/* ========================================
   三江源动物性格测试 - 现代国潮/极光风格覆盖
   ======================================== */

/* 新的主题变量 */
:root {
    --aurora-1: #6a11cb;
    --aurora-2: #2575fc;
    --aurora-3: #ff0844;
    --aurora-4: #00d2ff;
    
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-bg-dark: rgba(255, 255, 255, 0.4);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
    
    --neon-blue: #00f2fe;
    --neon-purple: #9b51e0;
    
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a6a;
}

/* 动态极光背景 */
.aurora-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    background: #0f172a;
    overflow: hidden;
    pointer-events: none;
}

.aurora-1, .aurora-2, .aurora-3 {
    position: absolute;
    width: 150vw;
    height: 150vh;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: auroraFlow 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.aurora-1 {
    background: radial-gradient(circle, var(--aurora-1), transparent 60%);
    top: -20vh;
    left: -20vw;
    animation-duration: 25s;
}

.aurora-2 {
    background: radial-gradient(circle, var(--aurora-2), transparent 60%);
    bottom: -20vh;
    right: -20vw;
    animation-duration: 22s;
    animation-delay: -5s;
}

.aurora-3 {
    background: radial-gradient(circle, var(--neon-blue), transparent 60%);
    top: -25vh;
    left: -25vw;
    animation-duration: 28s;
    animation-delay: -10s;
    opacity: 0.5;
}

.stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #eee, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 40px 70px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 50px 160px, #ddd, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 90px 40px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 130px 80px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 160px 120px, #ddd, rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 200px 200px;
    opacity: 0.3;
    animation: twinkle 4s infinite alternate;
}

@keyframes auroraFlow {
    0% { transform: scale(1) translate(0, 0) rotate(0deg); }
    50% { transform: scale(1.2) translate(10%, 10%) rotate(180deg); }
    100% { transform: scale(1) translate(-10%, -10%) rotate(360deg); }
}

@keyframes twinkle {
    0% { opacity: 0.2; }
    100% { opacity: 0.5; }
}

/* 覆盖原始背景 */
body {
    background: transparent;
    color: var(--text-primary);
}
.hero-bg {
    display: none; /* 移除旧的静态背景 */
}

/* ========================================
   毛玻璃卡片样式 (Glassmorphism)
   ======================================== */

.feature, .question-card, .result-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.feature {
    border-radius: var(--radius-xl);
}

.question-card, .result-card {
    border-radius: 32px;
}

/* 首页文本亮色覆盖，以适应深色极光背景 */
.hero h1 {
    color: #ffffff;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-size: 48px;
    letter-spacing: -1px;
}
.logo-text {
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.tagline {
    color: #00f2fe;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    background: linear-gradient(90deg, #00f2fe, #4facfe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}
.description {
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* ========================================
   潮酷按钮 & 选项
   ======================================== */

.btn-primary {
    background: linear-gradient(135deg, var(--aurora-1) 0%, var(--aurora-2) 100%);
    box-shadow: 0 8px 24px rgba(106, 17, 203, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    position: relative;
    z-index: 10;
}

.btn-primary:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 32px rgba(106, 17, 203, 0.6), inset 0 2px 4px rgba(255, 255, 255, 0.4);
}

.btn-primary:active, .btn-primary.touching {
    transform: translateY(2px);
    box-shadow: 0 4px 12px rgba(106, 17, 203, 0.4);
}

.btn-secondary {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.8);
    color: var(--aurora-2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.9);
    color: var(--aurora-1);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* 选项样式强化 */
.option {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.option:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37, 117, 252, 0.15);
}

.option.selected {
    background: linear-gradient(135deg, rgba(238, 242, 255, 0.9) 0%, rgba(255, 255, 255, 0.95) 100%);
    border-color: var(--neon-blue);
    box-shadow: 0 0 0 2px var(--neon-blue), 0 8px 24px rgba(0, 242, 254, 0.2);
    transform: translateY(-2px) scale(1.01);
}

.option::before {
    background: linear-gradient(to bottom, var(--neon-blue), var(--aurora-2));
    width: 6px;
    border-radius: 6px 0 0 6px;
}

/* 进度条 (30格分段) */
.progress-bar {
    background: transparent;
    border: none;
    box-shadow: none;
    display: flex;
    gap: 3px;
    height: 6px;
    overflow: visible;
}

.progress-segment {
    flex: 1;
    height: 100%;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 5px;
    transition: background-color 0.3s, box-shadow 0.3s;
}

.progress-segment.completed {
    background: #00e676; /* 答完的是绿色 */
    box-shadow: 0 0 8px rgba(0, 230, 118, 0.6);
}

.progress-segment.current {
    background: var(--neon-blue);
    box-shadow: 0 0 8px rgba(0, 242, 254, 0.6);
}

/* 进度条容器背景增强 */
.progress-container {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 16px;
    padding: 8px 16px !important;
    margin-top: 10px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 答题页顶部紧凑 */
#test.page.active {
    padding-top: 8px;
}

.test-header {
    padding: 6px 0 !important;
}

/* ========================================
   SSR卡牌化结果页
   ======================================== */

/* 结果页居中修正 */
#result.page.active {
    align-items: center;
    padding-left: 2px;
    padding-right: 2px;
}

.result-container {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.result-card {
    position: relative;
    overflow: hidden;
    padding: 40px 16px;
}

/* 卡牌流光边框效果 */
.result-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        transparent, 
        rgba(255, 255, 255, 0.8), 
        transparent 30%
    );
    animation: rotateFlow 8s linear infinite;
    z-index: -1;
}

.result-card::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: var(--glass-bg);
    border-radius: 30px;
    z-index: -1;
    backdrop-filter: blur(20px);
}

@keyframes rotateFlow {
    100% { transform: rotate(1turn); }
}

.result-header h2 {
    color: #fff;
    text-shadow: 0 2px 10px rgba(255,255,255,0.3);
}
.result-header h2::after {
    background: linear-gradient(90deg, transparent, #00f2fe, transparent);
}

.animal-avatar {
    background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.4));
    border: 2px solid rgba(255,255,255,0.8);
    box-shadow: 0 16px 40px rgba(0,0,0,0.1), inset 0 4px 10px rgba(255,255,255,0.5);
    width: 180px;
    height: 180px;
    font-size: 90px;
    margin-top: 20px;
}

.animal-name {
    background: linear-gradient(135deg, var(--aurora-1), var(--aurora-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 42px;
    text-shadow: 0 4px 12px rgba(37, 117, 252, 0.2);
}

.animal-tagline {
    background: #1a1a2e;
    color: #fff;
    display: inline-block;
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 16px;
    margin-bottom: 40px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.trait-tag {
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    border: 1px solid rgba(255,255,255,0.8);
    color: var(--aurora-2);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    font-weight: 600;
}

/* 保护提示优化 */
.wildlife-notice {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
}
.wildlife-notice p {
    color: rgba(255,255,255,0.9);
}
.wildlife-notice p:first-child {
    color: #00f2fe;
}

/* ========================================
   结果页排版优化
   ======================================== */

/* 雷达图标签单行显示 */
/* 雷达图标签单行显示 */
.radar-labels {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow: visible !important; /* 取消滚动，允许文字溢出显示，防止被截断 */
    justify-content: space-between !important;
    width: 110% !important; /* 放宽 10% 给 12px 字体留足空间 */
    margin: 0 0 0 -5% !important; /* 向左偏移 5% 保持绝对居中 */
    padding: 0 !important;
}
.radar-labels span {
    flex: 0 0 auto;
    text-align: center;
    font-size: 12px !important; /* 和图表上的字一样大 */
    padding: 0 !important;
    white-space: nowrap;
    background: transparent !important;
}

/* 动物类型标签 (如 ENTJ) 金色背景 */
#animalType {
    display: inline-block;
    background: linear-gradient(135deg, #d4af37 0%, #ffdf73 50%, #d4af37 100%);
    color: #fff;
    font-weight: bold;
    border-radius: 50px;
    padding: 6px 16px;
    font-size: 16px;
    margin-top: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
    letter-spacing: 1px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* 解读区域精美圆角方框 */
.description-container,
.strategy-container,
.background-container,
.match-container,
.tips-container {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
    text-align: left;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.8), 0 8px 24px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.description-container:hover,
.strategy-container:hover,
.background-container:hover,
.match-container:hover,
.tips-container:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.9), 0 12px 32px rgba(0, 0, 0, 0.08);
}

.description-container h4,
.strategy-container h4,
.background-container h4,
.match-container h4,
.tips-container h4 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 18px;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 12px;
    position: relative;
    display: inline-block;
}

.description-container h4::after,
.strategy-container h4::after,
.background-container h4::after,
.match-container h4::after,
.tips-container h4::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 30px;
    height: 3px;
    background: linear-gradient(90deg, var(--aurora-1), var(--neon-blue));
    border-radius: 3px;
}

.description-text,
.strategy-text,
.background-text,
.match-text,
.tips-text {
    margin-bottom: 0 !important;
}

/* 翻页按钮样式优化 */
.navigation {
    display: flex !important;
    flex-direction: row !important; /* 强制在一行显示，覆盖 styles.css 中移动端的 column 设置 */
    justify-content: center !important;
    gap: 20px !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
    margin-bottom: 30px !important; /* 增加底部外边距强制向上推 30px (~8mm) */
}

/* 按钮居中优化 */
.btn-primary, .btn-secondary {
    justify-content: center !important;
}

.navigation .btn-secondary {
    background: #ffffff !important; 
    border: 1.5px solid #a4bcdf !important;
    color: #86a0c5 !important;
    border-radius: 50px !important;
    padding: 12px 32px !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    box-shadow: none !important;
    transition: all 0.3s ease !important;
    min-width: 140px !important;
    width: auto !important; /* 强制覆盖全局 100% 宽度 */
    flex: 0 0 auto !important; /* 强制不撑满 flex 容器 */
    margin: 0 !important;
}

.navigation .btn-secondary:hover:not(:disabled) {
    background: #f4f7fb;
    color: #5c7fa8;
    border-color: #5c7fa8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(106, 141, 182, 0.15);
}

.navigation .btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: transparent;
    border-color: #cbd5e1;
    color: #94a3b8;
}

/* ========================================
   首页全屏适配 & 特性方块等宽并排
   ======================================== */

/* 首页不需要额外 padding，全部留给 hero 自身居中 */
#home.page.active {
    padding: 0;
    overflow: hidden; /* 禁止首页滚动 */
}

/* hero 紧凑居中，避免溢出 */
.hero {
    padding: 16px 20px;
    justify-content: center;
    height: 100vh;
    box-sizing: border-box;
    overflow: hidden;
}

.hero-content {
    justify-content: center;
    gap: 0; /* 用各元素自身 margin 控制间距 */
    max-height: 100%;
}

/* 缩小 logo 上方的视觉空间 */
.logo {
    margin-bottom: 20px;
}

.hero h1 {
    margin-top: 0;
    margin-bottom: 10px;
}

.tagline {
    margin-bottom: 16px;
}

.description {
    margin-bottom: 24px;
}

/* 三个特性方块：始终并排 + 等宽 */
.features {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 16px !important;
    margin-bottom: 28px !important;
    width: 100%;
    justify-content: center !important;
}

.feature {
    flex: 1 1 0 !important;   /* 等宽分配 */
    min-width: 0 !important;  /* 允许缩小 */
    max-width: 180px;
    padding: 16px 12px !important;
}

.disclaimer {
    margin-top: 16px;
}

/* 小屏幕进一步压缩 */
@media (max-width: 480px) {
    .hero {
        padding: 12px 12px;
    }

    .logo {
        margin-bottom: 12px;
    }

    .logo-icon {
        font-size: 32px !important;
    }

    .logo-text {
        font-size: 20px !important;
    }

    .hero h1 {
        font-size: 24px !important;
        margin-bottom: 6px;
    }

    .tagline {
        font-size: 14px !important;
        margin-bottom: 10px;
    }

    .description {
        font-size: 13px !important;
        margin-bottom: 16px;
        line-height: 1.5;
    }

    .features {
        gap: 8px !important;
        margin-bottom: 18px !important;
    }

    .feature {
        padding: 10px 8px !important;
        border-radius: 16px !important;
    }

    .feature-icon {
        font-size: 22px !important;
    }

    .feature span:last-child {
        font-size: 11px !important;
    }

    .btn-primary {
        padding: 14px 28px !important;
        font-size: 15px !important;
        margin-bottom: 8px;
    }

    .disclaimer {
        font-size: 10px !important;
        margin-top: 8px;
    }
}
