/* ============================================
   人类癫值鉴定所 - 沙雕魔性风格 CSS
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Comic Neue', 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background-color: #FFDE00;
    color: #222;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* 动态背景装饰 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 64, 129, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(0, 188, 212, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(76, 175, 80, 0.05) 0%, transparent 50%);
    z-index: -1;
    pointer-events: none;
}

/* ============================================
   页面容器
   ============================================ */
.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ============================================
   页面通用样式
   ============================================ */
.page {
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100vh;
    padding-bottom: 40px;
}

.page.active {
    display: block;
    opacity: 1;
    position: relative;
}

/* ============================================
   首页样式
   ============================================ */
.logo {
    text-align: center;
    margin-bottom: 35px;
    animation: bounce 2s ease-in-out infinite;
}

.logo i {
    font-size: 4.5rem;
    color: #FF4081;
    margin-bottom: 15px;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(255, 64, 129, 0.3));
}

.logo h1 {
    font-family: 'Fredoka One', 'Microsoft YaHei', cursive;
    font-size: 2.5rem;
    color: #222;
    text-shadow: 3px 3px 0 #FF4081, 6px 6px 0 rgba(0, 0, 0, 0.08);
    line-height: 1.2;
    letter-spacing: 2px;
}

.slogan {
    text-align: center;
    margin-bottom: 35px;
    padding: 25px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    border: 5px solid #FF4081;
    transform: rotate(-1deg);
}

.slogan-text {
    font-size: 1.8rem;
    font-weight: 900;
    color: #222;
    margin-bottom: 8px;
}

.slogan-sub {
    font-size: 1rem;
    color: #666;
    font-weight: 700;
}

.character {
    text-align: center;
    margin-bottom: 35px;
    animation: float 3s ease-in-out infinite;
}

.character-icon {
    font-size: 3.5rem;
    color: #00BCD4;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 8px rgba(0, 188, 212, 0.3));
}

.character-desc {
    font-size: 1.2rem;
    font-weight: 900;
    color: #222;
    text-shadow: 2px 2px 0 rgba(0, 188, 212, 0.3);
}

/* ============================================
   按钮样式
   ============================================ */
.btn-primary, .btn-secondary {
    display: block;
    width: 100%;
    padding: 18px 30px;
    font-size: 1.4rem;
    font-weight: 900;
    font-family: inherit;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 15px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, #FF4081, #FF9800);
    color: white;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background: linear-gradient(135deg, #00BCD4, #4CAF50);
    color: white;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.15);
}

.btn-primary:active, .btn-secondary:active {
    transform: scale(0.95);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary i, .btn-secondary i {
    margin-right: 8px;
}

.instructions {
    text-align: center;
    margin-top: 25px;
    font-size: 0.85rem;
    color: #888;
    font-weight: 700;
}

.instructions p {
    margin-bottom: 8px;
}

.instructions i {
    color: #FF4081;
    margin-right: 6px;
}

/* ============================================
   答题页样式
   ============================================ */
.quiz-header {
    margin-bottom: 25px;
}

.progress-container {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 50px;
    height: 32px;
    margin-bottom: 12px;
    border: 3px solid #222;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #FF4081, #FF9800, #FFDE00);
    width: 0%;
    transition: width 0.4s ease;
    border-radius: 50px;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 900;
    color: #222;
    font-size: 0.85rem;
    text-shadow: 0 0 4px white, 0 0 8px white;
    white-space: nowrap;
}

.question-counter {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 900;
    color: #222;
    text-shadow: 2px 2px 0 rgba(255, 64, 129, 0.3);
}

.question-counter span:first-child {
    color: #FF4081;
    font-size: 1.4rem;
}

.question-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 20px;
    margin-bottom: 25px;
    border: 4px solid #00BCD4;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.question-container h2 {
    font-size: 1.35rem;
    color: #222;
    font-weight: 900;
    line-height: 1.5;
}

.options-container {
    margin-bottom: 20px;
}

.option {
    background: rgba(255, 255, 255, 0.95);
    padding: 18px;
    border-radius: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 3px solid #222;
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.option:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.option:active {
    transform: scale(0.98);
}

.option.selected {
    background: linear-gradient(135deg, #FF4081, #FF9800);
    color: white;
    border-color: #FF4081;
    transform: scale(0.98);
    box-shadow: 0 4px 15px rgba(255, 64, 129, 0.4);
}

.option-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    background: #222;
    color: white;
    border-radius: 50%;
    font-weight: 900;
    margin-right: 14px;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.option.selected .option-label {
    background: white;
    color: #FF4081;
}

.option-text {
    flex: 1;
    line-height: 1.4;
}

.quiz-footer {
    text-align: center;
    margin-top: 15px;
}

.quiz-note {
    font-size: 0.85rem;
    color: #888;
    font-weight: 700;
}

.quiz-note i {
    color: #FF9800;
    margin-right: 6px;
}

/* ============================================
   加载页样式
   ============================================ */
.loading-content {
    text-align: center;
}

.loading-icon {
    font-size: 4.5rem;
    color: #FF4081;
    margin-bottom: 30px;
    filter: drop-shadow(0 4px 12px rgba(255, 64, 129, 0.3));
}

.loading-icon i {
    animation: spin 1.2s linear infinite;
}

#loading-text {
    font-size: 1.6rem;
    color: #222;
    font-weight: 900;
    margin-bottom: 25px;
    text-shadow: 2px 2px 0 rgba(0, 188, 212, 0.3);
    transition: opacity 0.2s ease;
    min-height: 2.4em;
}

.loading-bar {
    width: 100%;
    height: 28px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 50px;
    margin-bottom: 20px;
    border: 3px solid #222;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.loading-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, #00BCD4, #4CAF50);
    width: 0%;
    border-radius: 50px;
    transition: width 0.1s linear;
}

.loading-sub {
    font-size: 0.95rem;
    color: #888;
    font-weight: 700;
}

/* ============================================
   结果页背景模式（纯色背景）
   ============================================ */
body.result-mode {
    background: #FFDE00; /* 纯黄色背景 */
}

body.result-mode::before {
    /* 移除渐变特效 */
    display: none;
}

/* ============================================
   结果页样式 - 疯癫风格
   ============================================ */
.result-header {
    text-align: center;
    margin-bottom: 25px;
}

.result-header h1 {
    font-size: 2.2rem;
    color: #FFF;
    font-weight: 900;
    text-shadow: 3px 3px 0 #FF4081, 5px 5px 0 rgba(0,0,0,0.2);
    margin-bottom: 6px;
    letter-spacing: 3px;
    -webkit-text-stroke: 1px #222;
}

.result-sub {
    font-size: 0.95rem;
    color: #FFE;
    font-weight: 700;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
}

.score-container {
    background: linear-gradient(135deg, rgba(255,64,129,0.15), rgba(255,152,0,0.15));
    padding: 35px 20px;
    border-radius: 24px;
    margin-bottom: 25px;
    text-align: center;
    border: 5px dashed #FF4081;
    box-shadow: 0 0 30px rgba(255, 64, 129, 0.3), inset 0 0 30px rgba(255, 64, 129, 0.05);
    position: relative;
    overflow: hidden;
}

/* 分数容器背景装饰 */
.score-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,0,255,0.05) 0%, transparent 70%);
    animation: spin 20s linear infinite;
    pointer-events: none;
}

.score-circle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 170px;
    height: 170px;
    background: linear-gradient(135deg, #FF4081, #FF00FF, #FF9800);
    border-radius: 50%;
    text-align: center;
    margin-bottom: 20px;
    border: 7px solid white;
    box-shadow: 0 0 0 7px #FF4081, 0 0 40px rgba(255,0,255,0.5), 0 0 80px rgba(255,64,129,0.2);
    animation: pulse 2s ease-in-out infinite, glow 3s ease-in-out infinite alternate;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

@keyframes glow {
    0% { box-shadow: 0 0 0 7px #FF4081, 0 0 40px rgba(255,0,255,0.4), 0 0 80px rgba(255,64,129,0.15); }
    100% { box-shadow: 0 0 0 7px #FF00FF, 0 0 60px rgba(255,0,255,0.6), 0 0 100px rgba(255,64,129,0.3); }
}

.score-number {
    font-size: 4rem;
    font-weight: 900;
    color: white;
    text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3), 0 0 20px rgba(255,255,255,0.5);
    line-height: 1;
}

.score-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 700;
    margin-top: 3px;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
}

.level-container {
    margin-top: 15px;
    position: relative;
    z-index: 1;
}

#level-title {
    font-size: 2.2rem;
    color: #FF00FF;
    font-weight: 900;
    text-shadow: 3px 3px 0 rgba(0,0,0,0.2), 0 0 20px rgba(255,0,255,0.4);
    margin-bottom: 8px;
    -webkit-text-stroke: 1px #222;
    letter-spacing: 2px;
}

#level-desc {
    font-size: 1.15rem;
    color: #FFE;
    font-weight: 700;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
}

.radar-container {
    background: linear-gradient(135deg, rgba(0,188,212,0.1), rgba(255,255,255,0.85));
    padding: 25px 20px;
    border-radius: 20px;
    margin-bottom: 25px;
    text-align: center;
    border: 4px solid #00BCD4;
    box-shadow: 0 0 25px rgba(0, 188, 212, 0.2);
}

.radar-container h3 {
    font-size: 1.4rem;
    color: #FF4081;
    font-weight: 900;
    margin-bottom: 15px;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.1);
    -webkit-text-stroke: 0.5px #222;
}

#radar-chart {
    display: block;
    margin: 0 auto;
    max-width: 300px;
    width: 100%;
}

.dimension-labels {
    display: none;
}

.prescription-container {
    background: linear-gradient(135deg, rgba(76,175,80,0.1), rgba(255,255,255,0.85));
    padding: 25px 20px;
    border-radius: 20px;
    margin-bottom: 25px;
    border: 4px dashed #FF9800;
    box-shadow: 0 0 25px rgba(255, 152, 0, 0.15);
}

.prescription-container h3 {
    font-size: 1.4rem;
    color: #FF9800;
    font-weight: 900;
    margin-bottom: 15px;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.1);
    -webkit-text-stroke: 0.5px #222;
}

.prescription-container h3 i {
    color: #FF9800;
    margin-right: 8px;
}

.prescription-card {
    background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
    padding: 22px;
    border-radius: 16px;
    margin-bottom: 20px;
    border: 3px solid #FF9800;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#prescription-text {
    font-size: 1.25rem;
    color: #222;
    font-weight: 900;
    text-align: center;
    line-height: 1.5;
}

.result-footer {
    text-align: center;
    padding-bottom: 20px;
}

.result-note {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    font-weight: 700;
    margin-top: 15px;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
}

/* ============================================
   分享全屏遮罩（参考NBTI风格）
   ============================================ */
.share-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
}

.share-overlay.active {
    display: flex;
}

/* 顶部黄色提示条 */
.share-overlay-top {
    width: 100%;
    background: #FFDE00;
    border-bottom: 4px solid #222;
    padding: 16px 20px;
    text-align: center;
    flex-shrink: 0;
}

.share-overlay-title {
    font-size: 1.3rem;
    font-weight: 900;
    color: #222;
    margin-bottom: 4px;
}

.share-overlay-hint {
    font-size: 0.95rem;
    font-weight: 900;
    color: #FF4081;
    animation: pulse 1.5s ease-in-out infinite;
}

/* 关闭按钮 */
.close-share-btn {
    position: absolute;
    top: 80px;
    right: 12px;
    z-index: 10;
    width: 44px;
    height: 44px;
    background: #222;
    color: white;
    border: 3px solid white;
    border-radius: 0;
    font-size: 1.4rem;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.close-share-btn:active {
    transform: scale(0.9);
}

/* 图片预览 */
.share-overlay-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    min-height: 0;
}

.share-image-full {
    display: block;
    max-width: 100%;
    max-height: 70vh;
    border: 4px solid #222;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    -webkit-touch-callout: default;
}

/* 底部提示 */
.share-overlay-bottom {
    width: 100%;
    background: #FF4081;
    border-top: 4px solid #222;
    padding: 14px 20px;
    text-align: center;
    flex-shrink: 0;
}

.share-overlay-bottom p {
    color: white;
    font-size: 0.9rem;
    font-weight: 700;
}

/* ============================================
   音效开关按钮
   ============================================ */
.sound-toggle {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 999;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid #222;
    background: rgba(255, 255, 255, 0.95);
    color: #222;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transition: all 0.2s ease;
    line-height: 1;
}

.sound-toggle:active {
    transform: scale(0.9);
}

.sound-toggle.active {
    background: linear-gradient(135deg, #FF4081, #FF9800);
    color: white;
    border-color: #FF4081;
}

/* ============================================
   分享图片与提示
   ============================================ */
.share-image {
    display: block;
    margin: 0 auto 15px;
    max-width: 100%;
    border: 4px solid #222;
    border-radius: 12px;
}

.share-tip {
    font-size: 0.85rem;
    color: #999;
    font-weight: 700;
    margin-bottom: 15px;
    text-align: center;
}

/* ============================================
   动画效果
   ============================================ */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   响应式设计
   ============================================ */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .logo i {
        font-size: 3.5rem;
    }
    
    .slogan-text {
        font-size: 1.5rem;
    }
    
    .btn-primary, .btn-secondary {
        padding: 16px 25px;
        font-size: 1.2rem;
    }
    
    .score-circle {
        width: 140px;
        height: 140px;
    }
    
    .score-number {
        font-size: 3.2rem;
    }
    
    #level-title {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 12px;
    }
    
    .logo h1 {
        font-size: 1.7rem;
    }
    
    .logo i {
        font-size: 3rem;
    }
    
    .slogan {
        padding: 18px;
    }
    
    .slogan-text {
        font-size: 1.3rem;
    }
    
    .question-container {
        padding: 18px;
    }
    
    .question-container h2 {
        font-size: 1.2rem;
    }
    
    .option {
        padding: 14px;
        font-size: 0.95rem;
    }
    
    .option-label {
        min-width: 32px;
        height: 32px;
        font-size: 0.95rem;
        margin-right: 10px;
    }
    
    .score-circle {
        width: 120px;
        height: 120px;
    }
    
    .score-number {
        font-size: 2.6rem;
    }
    
    #level-title {
        font-size: 1.5rem;
    }
    
    #prescription-text {
        font-size: 1.05rem;
    }
    
    .share-actions {
        flex-direction: column;
    }
    
    #loading-text {
        font-size: 1.3rem;
    }
}

/* 防止移动端点击延迟 */
@media (hover: none) and (pointer: coarse) {
    .option:hover {
        transform: none;
    }
    
    .btn-primary:active, .btn-secondary:active {
        transform: scale(0.95);
    }
}

/* 安全区域适配（刘海屏等） */
@supports (padding: env(safe-area-inset-bottom)) {
    .container {
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
    
    .result-footer {
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
}