:root {
    --primary-color: #ff5f8f;
    --secondary-color: #ff82ad;
    --accent-color: #ffdbf2;
    --bg-gradient: linear-gradient(180deg, #fff6fb 0%, #fefefe 60%, #ffffff 100%);
    --card-bg: rgba(255, 255, 255, 0.9);
    --text-primary: #1a1a1a;
    --text-secondary: #6b6b6b;
    --border-color: rgba(255, 255, 255, 0.4);
    --shadow-soft: 0 20px 45px rgba(255, 95, 143, 0.18);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "HarmonyOS Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
}

/* 全局防止图片显示选中框 */
img {
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

button img,
.floating-btn img,
.hero-btn img {
    outline: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    pointer-events: none;
}

body.home-page {
    min-height: 100vh;
    background: var(--bg-gradient);
    color: var(--text-primary);
    padding: 32px min(5vw, 48px) 120px;
    position: relative;
    overflow-x: hidden;
}

.dream-glow {
    position: fixed;
    inset: -20% auto auto 50%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(255, 176, 220, 0.25), transparent 60%);
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 0;
}

.home-hero {
    position: relative;
    z-index: 1;
    padding: 20px 24px 16px;
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.65);
    box-shadow: 0 30px 60px rgba(255, 118, 165, 0.15);
    backdrop-filter: blur(16px);
}

.hero-collapsed-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.hero-collapsed-text {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    color: var(--text-secondary);
    min-width: 0;
}

.hero-collapsed-desc {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-toggle {
    border: none;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 999px;
    padding: 8px 14px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    color: var(--primary-color);
    box-shadow: 0 8px 24px rgba(255, 95, 143, 0.25);
}

.hero-toggle .material-icons {
    transition: transform 0.25s ease;
}

.home-hero:not(.collapsed) .hero-toggle .material-icons {
    transform: rotate(180deg);
}

.hero-content {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.home-hero.collapsed .hero-content {
    display: none;
}

.hero-meta {
    flex: 1 1 320px;
}

.hero-eyebrow {
    font-size: 14px;
    color: var(--secondary-color);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.home-hero h1 {
    font-size: clamp(28px, 4vw, 38px);
    margin-bottom: 12px;
    color: #ff3c64;
}

.hero-desc {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: center;
    align-items: flex-start;
}

.hero-btn {
    border: none;
    border-radius: 999px;
    padding: 14px 28px;
    font-size: 15px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.hero-btn.primary {
    background: linear-gradient(120deg, #ff5f8f, #ff82ad);
    color: #fff;
    box-shadow: var(--shadow-soft);
}

.hero-btn.ghost {
    background: rgba(255, 255, 255, 0.3);
    color: var(--primary-color);
    border: 1px solid rgba(255, 95, 143, 0.4);
}

.hero-btn .material-icons {
    font-size: 18px;
    vertical-align: middle;
    margin-right: 4px;
}

.hero-btn-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 6px;
}

.hero-btn:hover {
    transform: translateY(-2px);
}

.gallery-section {
    position: relative;
    z-index: 1;
    margin-top: 36px;
    min-height: 400px;
}

/* 浮球容器 */
.floating-balls-container {
    position: relative;
    width: 100%;
    min-height: 500px;
    margin-bottom: 40px;
    overflow: hidden;
    border-radius: 24px;
    background: linear-gradient(135deg, 
        rgba(255, 240, 250, 0.3) 0%, 
        rgba(255, 228, 240, 0.2) 50%,
        rgba(255, 240, 250, 0.3) 100%);
    backdrop-filter: blur(10px);
    box-shadow: inset 0 2px 20px rgba(255, 182, 193, 0.1);
}

.floating-balls-container:empty {
    display: none;
}

/* 浮球样式 */
.floating-ball {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    cursor: pointer;
    transition: opacity 0.15s ease;
    z-index: 2;
    box-shadow: 0 8px 24px rgba(255, 95, 143, 0.3),
                0 0 40px rgba(255, 182, 193, 0.2),
                inset 0 2px 8px rgba(255, 255, 255, 0.4);
    overflow: hidden;
    will-change: transform, left, top;
}

/* 无规则运动由JavaScript控制，不再使用CSS动画 */

.floating-ball::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: linear-gradient(135deg, 
        rgba(255, 182, 193, 0.6) 0%, 
        rgba(255, 107, 157, 0.7) 50%,
        rgba(255, 182, 193, 0.6) 100%);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
    z-index: -1;
    opacity: 0.8;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.floating-ball img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    transition: transform 0.3s ease;
}

.floating-ball:hover {
    transform: scale(1.2) !important;
    box-shadow: 0 12px 32px rgba(255, 95, 143, 0.4),
                0 0 60px rgba(255, 182, 193, 0.3),
                inset 0 2px 10px rgba(255, 255, 255, 0.5);
    z-index: 10;
}

.floating-ball:hover img {
    transform: scale(1.1);
}

.floating-ball.capturing {
    pointer-events: none;
    z-index: 100;
}

/* 精灵球摇晃动画 */
.floating-ball.pokeball-shake {
    animation: pokeballShake 0.3s ease-in-out;
}

@keyframes pokeballShake {
    0%, 100% {
        transform: translateX(0) rotate(0deg);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-10px) rotate(-5deg);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(10px) rotate(5deg);
    }
}

/* 捕获成功动画 */
.floating-ball.capture-success {
    animation: captureSuccess 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes captureSuccess {
    0% {
        transform: scale(1);
        opacity: 1;
        filter: brightness(1);
    }
    30% {
        transform: scale(1.3);
        filter: brightness(1.5) drop-shadow(0 0 20px rgba(76, 175, 80, 0.8));
    }
    60% {
        transform: scale(1.5) translateY(-30px);
        filter: brightness(2) drop-shadow(0 0 40px rgba(76, 175, 80, 1));
    }
    100% {
        transform: scale(0) translateY(-100px);
        opacity: 0;
        filter: brightness(0);
    }
}

/* 捕获失败动画 */
.floating-ball.capture-failed {
    animation: captureFailed 0.8s ease-in-out forwards;
}

@keyframes captureFailed {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    25% {
        transform: scale(1.1) rotate(-10deg);
        filter: brightness(0.8);
    }
    50% {
        transform: scale(1.1) rotate(10deg);
        filter: brightness(0.6);
    }
    75% {
        transform: scale(1) rotate(-5deg);
        filter: brightness(0.8);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
        filter: brightness(1);
    }
}

/* 闪现动画 */
.floating-ball.teleporting {
    z-index: 200;
}

/* 闪光AI样式 */
.floating-ball.shiny {
    box-shadow: 0 8px 24px rgba(255, 215, 0, 0.5),
                0 0 60px rgba(255, 215, 0, 0.4),
                inset 0 2px 8px rgba(255, 255, 255, 0.6);
    animation: shinyGlow 2s ease-in-out infinite;
}

@keyframes shinyGlow {
    0%, 100% {
        filter: brightness(1) drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
    }
    50% {
        filter: brightness(1.3) drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
    }
}

.floating-ball.shiny::before {
    background: linear-gradient(135deg, 
        rgba(255, 215, 0, 0.8) 0%, 
        rgba(255, 193, 7, 0.9) 50%,
        rgba(255, 215, 0, 0.8) 100%);
    animation: shinyGradient 2s ease-in-out infinite;
}

@keyframes shinyGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.shiny-badge {
    color: #FFD700;
    font-size: 14px;
    margin-left: 4px;
    animation: sparkle 1s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.2) rotate(180deg); }
}

/* 挣扎效果 */
.floating-ball.struggling {
    filter: brightness(1.2) drop-shadow(0 0 15px rgba(255, 87, 34, 0.6));
    animation: struggleFlash 0.2s ease-in-out;
}

@keyframes struggleFlash {
    0%, 100% { 
        filter: brightness(1) drop-shadow(0 0 10px rgba(255, 87, 34, 0.4));
    }
    50% { 
        filter: brightness(1.4) drop-shadow(0 0 20px rgba(255, 87, 34, 0.8));
    }
}

/* 捕获闪光效果 */
.capture-flash {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, transparent 70%);
    animation: flashPulse 0.5s ease-out;
    pointer-events: none;
    z-index: 10;
}

@keyframes flashPulse {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
    100% {
        opacity: 0;
        transform: scale(1.5);
    }
}

/* 粒子特效 */
.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1000;
    animation: particleFly 1s ease-out forwards;
}

.particle-success {
    box-shadow: 0 0 10px currentColor;
}

.particle-failed {
    box-shadow: 0 0 10px currentColor;
}

@keyframes particleFly {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--vx, 0), var(--vy, 0)) scale(0);
    }
}

/* 浮球名称提示 */
.floating-ball-name {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 12px;
    color: var(--primary-color);
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    text-shadow: 0 2px 8px rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 12px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(255, 95, 143, 0.2);
}

.floating-ball:hover .floating-ball-name {
    opacity: 1;
}

/* 捕获提示 */
.capture-hint {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, 
        rgba(255, 240, 250, 0.98) 0%, 
        rgba(255, 228, 240, 0.98) 100%);
    padding: 24px 32px;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(255, 95, 143, 0.4),
                0 0 80px rgba(255, 182, 193, 0.3);
    z-index: 1000;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 182, 193, 0.4);
}

.capture-hint.show {
    opacity: 1;
    pointer-events: auto;
}

.capture-hint.success {
    border-color: rgba(76, 175, 80, 0.6);
    background: linear-gradient(135deg, 
        rgba(200, 255, 200, 0.98) 0%, 
        rgba(180, 255, 180, 0.98) 100%);
}

.capture-hint.failed {
    border-color: rgba(244, 67, 54, 0.6);
    background: linear-gradient(135deg, 
        rgba(255, 235, 235, 0.98) 0%, 
        rgba(255, 220, 220, 0.98) 100%);
}

.capture-hint-icon {
    font-size: 48px;
    margin-bottom: 12px;
    animation: bounce 0.6s ease infinite;
}

.capture-hint-icon.success-icon {
    animation: successBounce 0.8s ease infinite;
}

@keyframes successBounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-10px) scale(1.1);
    }
}

.capture-hint-icon.failed-icon {
    animation: failedShake 0.5s ease infinite;
}

@keyframes failedShake {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-10deg);
    }
    75% {
        transform: rotate(10deg);
    }
}

/* 捕获统计 */
.capture-stats {
    display: flex;
    justify-content: space-around;
    margin: 16px 0;
    padding: 12px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    gap: 16px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    text-shadow: 0 2px 4px rgba(255, 95, 143, 0.2);
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.capture-hint-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.capture-hint-message {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.capture-hint-btn {
    background: linear-gradient(120deg, #ff5f8f, #ff82ad);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 10px 24px;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.capture-hint-btn:hover {
    transform: translateY(-2px);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 20px;
}

.section-label {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 12px;
    color: var(--secondary-color);
    margin-bottom: 6px;
}

.section-header h2 {
    font-size: 24px;
}

.section-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 999px;
    padding: 10px 16px;
    color: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(255, 95, 143, 0.15);
}

.grid-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.gallery-item {
    position: relative;
    border-radius: 28px;
    overflow: hidden;
    background: var(--card-bg);
    box-shadow: 0 20px 50px rgba(28, 22, 43, 0.15);
    min-height: 320px;
    display: flex;
    flex-direction: column;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 24px 60px rgba(255, 95, 143, 0.25);
}

.image-container {
    position: relative;
    flex: 1;
    overflow: hidden;
}

.image-container::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 45%;
    background: linear-gradient(180deg, transparent, rgba(7, 6, 20, 0.7));
}

.character-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-item:hover .character-image {
    transform: scale(1.08);
}

.card-info {
    position: absolute;
    bottom: 16px;
    left: 16px;
    right: 16px;
    color: #fff;
    z-index: 2;
}

.character-name {
    font-size: 18px;
    font-weight: 600;
}

.character-desc {
    margin-top: 6px;
    font-size: 13px;
    opacity: 0.85;
}

.role-status {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    backdrop-filter: blur(6px);
}

.gallery-item.completed .role-status {
    background: rgba(61, 212, 149, 0.5);
}

.gallery-item.traveling .role-status {
    background: rgba(255, 152, 72, 0.55);
}

.card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.85);
}

.card-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.card-cta {
    border: none;
    background: var(--primary-color);
    color: #fff;
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
}

.delete-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(18, 18, 18, 0.55);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
}

.delete-btn .material-icons {
    color: #fff;
}

.gallery-empty {
    margin-top: 24px;
    padding: 32px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.8);
    text-align: center;
    color: var(--text-secondary);
    border: 1px dashed rgba(255, 95, 143, 0.35);
}

.floating-nav {
    position: fixed;
    bottom: 28px;
    right: 32px;
    display: flex;
    gap: 12px;
    z-index: 10;
}

.floating-btn {
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    padding: 0;
    background: rgba(255, 255, 255, 0.85);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(27, 19, 32, 0.15);
    color: var(--primary-color);
    transition: all 0.3s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    overflow: hidden;
}

.floating-btn:focus,
.floating-btn:focus-visible,
.floating-btn:active {
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
}

.floating-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(27, 19, 32, 0.2);
    background: rgba(255, 255, 255, 0.95);
}

.material-icons {
    font-size: 18px;
    color: var(--primary-color);
}

.floating-btn-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    outline: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    pointer-events: none;
}

@media (max-width: 720px) {
    body.home-page {
        padding: 24px 18px 120px;
    }
    .home-hero {
        padding: 16px 18px;
    }
    .hero-actions {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .floating-nav {
        left: 50%;
        transform: translateX(-50%);
        right: auto;
        gap: 10px;
    }
    .floating-btn {
        width: 44px;
        height: 44px;
    }
    .floating-btn-icon {
        width: 100%;
        height: 100%;
    }
}