/* =========================================
   GT深度心理类型测评 - 样式文件 v3.0
   支持深色/浅色主题切换
   ========================================= */

/* ==================== 深色主题（默认） ==================== */
:root {
    --bg: #0b1220;
    --bg-gradient: radial-gradient(1000px 600px at 20% 10%, rgba(74,144,226,0.15), rgba(0,0,0,0)),
                   radial-gradient(1000px 600px at 80% 0%, rgba(80,227,194,0.10), rgba(0,0,0,0)),
                   #0b1220;
    --text: #ffffff;
    --text-sec: rgba(255,255,255,0.85);
    --text-mute: rgba(255,255,255,0.60);
    --line: rgba(255,255,255,0.15);
    --line-dark: rgba(255,255,255,0.25);
    --primary: #4A90E2;
    --secondary: #50E3C2;
    --accent: #FF6B6B;
    --card-bg: linear-gradient(180deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.8));
    --card-solid: #151b26;
    --card-shadow: 0 10px 30px rgba(0,0,0,0.3);
    --info-bg: rgba(255,255,255,0.05);
    --guide-bg: rgba(80, 227, 194, 0.08);
    --option-bg: rgba(255,255,255,0.03);
    --option-hover: rgba(255,255,255,0.08);
    --axis-circle-bg: #151b26;
    --trace-bg: rgba(0,0,0,0.2);
    --modal-bg: rgba(0,0,0,0.95);
    --radius: 16px;
}

/* ==================== 浅色主题 ==================== */
[data-theme="light"] {
    --bg: #FAF8F5;
    --bg-gradient: radial-gradient(800px 400px at 20% 10%, rgba(49,130,206,0.06), transparent),
                   radial-gradient(600px 400px at 80% 5%, rgba(49,151,149,0.05), transparent),
                   #FAF8F5;
    --text: #2D3748;
    --text-sec: #4A5568;
    --text-mute: #A0AEC0;
    --line: rgba(0,0,0,0.08);
    --line-dark: rgba(0,0,0,0.15);
    --primary: #3182CE;
    --secondary: #319795;
    --accent: #E53E3E;
    --card-bg: #FFFFFF;
    --card-solid: #FFFFFF;
    --card-shadow: 0 4px 20px rgba(0,0,0,0.08);
    --info-bg: #F5F2ED;
    --guide-bg: rgba(49,151,149,0.08);
    --option-bg: #F5F2ED;
    --option-hover: #FFFFFF;
    --axis-circle-bg: #FFFFFF;
    --trace-bg: #F5F2ED;
    --modal-bg: rgba(255,255,255,0.98);
}

/* ==================== 基础样式 ==================== */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; outline: none; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", Helvetica, Arial, sans-serif;
    background: var(--bg-gradient);
    color: var(--text);
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    transition: background 0.3s ease, color 0.3s ease;
}

/* ==================== 布局 ==================== */
.app-container { width: min(700px, 100%); margin-top: 1vh; padding-bottom: 60px; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.brand h1 { font-size: 1.1em; margin: 0; letter-spacing: 0.5px; font-weight: 700; color: var(--text); line-height: 1.2; }
.brand .sub { font-size: 0.75em; color: var(--text-mute); margin-top: 2px; text-transform: uppercase; letter-spacing: 1px; }

.topbar-right { display: flex; align-items: center; gap: 10px; }

.theme-toggle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--line-dark);
    background: var(--card-solid);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1em;
    line-height: 1;
    transition: 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 0;
}
.theme-toggle:hover { transform: scale(1.08); }
.theme-toggle span { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }

.pill { border: 1px solid var(--line); background: var(--info-bg); padding: 4px 10px; border-radius: 999px; font-size: 0.75em; color: var(--text-sec); display: inline-flex; align-items: center; white-space: nowrap; }

/* ==================== 测试页顶栏 ==================== */
.quiz-topbar { display: flex; justify-content: center; align-items: center; margin-bottom: 15px; position: relative; }
.quiz-topbar-right { position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
.phase-indicator { display: flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: var(--info-bg); border: 1px solid var(--line); }
.phase-dot { width: 5px; height: 5px; border-radius: 50%; }
.phase-dot.part1 { background: var(--primary); box-shadow: 0 0 5px var(--primary); }
.phase-dot.part2 { background: var(--secondary); box-shadow: 0 0 5px var(--secondary); }
#phase-text { font-size: 0.7em; font-weight: 600; color: var(--text-sec); letter-spacing: 0.5px; }

/* 浅色主题下phase-dot不需要发光 */
[data-theme="light"] .phase-dot.part1,
[data-theme="light"] .phase-dot.part2 { box-shadow: none; }

/* ==================== 进度条 ==================== */
.progress-wrap { width: 100%; height: 4px; background: var(--line); border-radius: 999px; overflow: hidden; margin-bottom: 8px; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--primary), var(--secondary)); transition: width 0.3s ease; box-shadow: 0 0 8px rgba(80, 227, 194, 0.4); }
[data-theme="light"] .progress-fill { box-shadow: none; }

/* ==================== 卡片 ==================== */
.card { 
    background: var(--card-bg); 
    border: 1px solid var(--line); 
    border-radius: var(--radius); 
    box-shadow: var(--card-shadow); 
    padding: 24px; 
    position: relative; 
    backdrop-filter: blur(12px); 
    -webkit-backdrop-filter: blur(12px); 
    animation: fadeIn 0.4s ease-out;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}
[data-theme="light"] .card { backdrop-filter: none; -webkit-backdrop-filter: none; }

/* ==================== 按钮 ==================== */
.btn-action { 
    display: block; 
    width: 100%; 
    padding: 14px; 
    border-radius: 12px; 
    border: none; 
    background: linear-gradient(135deg, var(--primary) 0%, #2f6fbf 100%); 
    color: white; 
    font-size: 1em; 
    font-weight: 600; 
    cursor: pointer; 
    transition: 0.2s; 
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.25); 
    text-align: center; 
    margin-top: 0; 
}
.btn-action:hover { transform: translateY(-2px); filter: brightness(1.1); }
[data-theme="light"] .btn-action { background: linear-gradient(135deg, var(--primary) 0%, #2b6cb0 100%); box-shadow: 0 4px 15px rgba(49,130,206,0.3); }

.btn-save-card { background: linear-gradient(135deg, #2D9A8C 0%, #237A6E 100%) !important; color: #fff !important; margin-top: 0; }
[data-theme="light"] .btn-save-card { background: linear-gradient(135deg, var(--secondary) 0%, #2C7A7B 100%) !important; }

.btn-secondary { background: transparent !important; border: 1px solid var(--line-dark) !important; color: var(--text-sec); box-shadow: none !important; margin-top: 12px; }
.btn-secondary:hover { background: var(--info-bg) !important; border-color: var(--text-sec) !important; }

#btn-container { display: flex; flex-direction: column; gap: 0; }
.btn-nav-row { display: flex; justify-content: space-between; gap: 15px; margin-top: 25px; }
.btn-prev { background: transparent; border: 1px solid var(--line); color: var(--text-mute); padding: 10px 20px; border-radius: 10px; cursor: pointer; font-size: 0.9em; transition: 0.2s; }
.btn-prev:hover { border-color: var(--text-sec); color: var(--text); background: var(--info-bg); }

/* ==================== Part 1 ==================== */
.guide-text { font-size: 0.8em; color: var(--secondary); background: var(--guide-bg); border-left: 3px solid var(--secondary); padding: 10px 12px; margin-bottom: 20px; line-height: 1.5; border-radius: 0 6px 6px 0; }
.question-text-p1 { font-size: 1.15em; font-weight: 600; margin-bottom: 20px; line-height: 1.5; color: var(--text); }
.question-desc-p1 { font-size: 0.85em; opacity: 0.7; display: block; margin-top: 8px; font-weight: 400; line-height: 1.5; }
.conflict-container { display: flex; flex-direction: column; gap: 12px; }
.conflict-option { background: var(--option-bg); border: 1px solid var(--line); padding: 16px; border-radius: 12px; cursor: pointer; transition: all 0.2s; display: flex; align-items: flex-start; gap: 14px; }
.conflict-option:hover { background: var(--option-hover); border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.conflict-option:active {
    transform: scale(0.97);
}

/* Part1 选中状态 */
.conflict-option.selected {
    transform: scale(0.98);
    border-color: var(--secondary);
    background: var(--option-hover);
    box-shadow: 0 0 0 3px rgba(80, 227, 194, 0.4);
}
[data-theme="light"] .conflict-option.selected {
    box-shadow: 0 0 0 3px rgba(49, 151, 149, 0.35);
}
.opt-content { flex: 1; font-size: 0.9em; color: var(--text-sec); line-height: 1.5; }
.opt-title { display: block; color: var(--text); font-weight: 600; font-size: 1em; margin-bottom: 4px; }
.opt-desc { display: block; font-size: 0.9em; opacity: 0.75; line-height: 1.5; }

/* ==================== Part 2 ==================== */
.guide-text-p2 { font-size: 0.8em; color: var(--secondary); background: var(--guide-bg); border-left: 3px solid var(--secondary); padding: 10px 12px; margin-bottom: 28px; line-height: 1.5; border-radius: 0 6px 6px 0; }
.question-text-p2 { font-size: 1.1em; font-weight: 600; margin-bottom: 35px; line-height: 1.55; color: var(--text); text-align: left; padding: 0 10px; display: inline-block; width: auto; max-width: 100%; }
.question-text-wrapper { text-align: center; }

.axis-container { display: flex; justify-content: space-between; align-items: flex-start; margin: 0 0 10px; position: relative; padding: 0 5px; }
.axis-line { position: absolute; top: 18px; left: 15px; right: 15px; height: 2px; background: var(--line); z-index: 0; }
.axis-item { z-index: 1; display: flex; flex-direction: column; align-items: center; cursor: pointer; width: 18%; transition: 0.2s; }
.axis-item:hover .axis-circle { border-color: var(--primary); transform: scale(1.1); }

/* 深色主题圆圈 - 还原原版设计 */
.axis-circle { width: 36px; height: 36px; border-radius: 50%; background-color: #151b26; border: 2px solid var(--line); margin-bottom: 15px; transition: 0.3s cubic-bezier(0.25, 1, 0.5, 1); box-shadow: 0 4px 10px rgba(0,0,0,0.2); position: relative; }
.axis-item:nth-child(1) .axis-circle { background-color: #151b26; border-color: rgba(255,255,255,0.15); }
.axis-item:nth-child(2) .axis-circle { background-image: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.15) 100%); border-color: rgba(255,255,255,0.3); }
.axis-item:nth-child(3) .axis-circle { background-image: linear-gradient(135deg, rgba(74,144,226,0.15) 0%, rgba(74,144,226,0.25) 100%); border-color: rgba(74,144,226,0.4); }
.axis-item:nth-child(4) .axis-circle { background-image: linear-gradient(135deg, rgba(74,144,226,0.4) 0%, rgba(74,144,226,0.6) 100%); border-color: rgba(74,144,226,0.7); }
.axis-item:nth-child(5) .axis-circle { background-image: linear-gradient(135deg, rgba(80,227,194,0.6) 0%, rgba(74,144,226,0.7) 100%); border-color: rgba(80,227,194,0.8); }
.axis-item:nth-child(6) .axis-circle { background-image: linear-gradient(135deg, #50E3C2 0%, #4A90E2 100%); border-color: rgba(80, 227, 194, 0.9); }

/* 浅色主题圆圈 - 从浅到深渐变，全部使用不透明背景遮挡横线 */
[data-theme="light"] .axis-circle { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
[data-theme="light"] .axis-item:nth-child(1) .axis-circle { background: #FAFAFA; border-color: #D0D0D0; }
[data-theme="light"] .axis-item:nth-child(2) .axis-circle { background: linear-gradient(135deg, #F5F5F5 0%, #EFEFEF 100%); border-color: #C0C0C0; }
[data-theme="light"] .axis-item:nth-child(3) .axis-circle { background: linear-gradient(135deg, #E8F4FD 0%, #D6EBFA 100%); border-color: rgba(49,130,206,0.45); }
[data-theme="light"] .axis-item:nth-child(4) .axis-circle { background: linear-gradient(135deg, #C3DEFA 0%, #A8D1F8 100%); border-color: rgba(49,130,206,0.6); }
[data-theme="light"] .axis-item:nth-child(5) .axis-circle { background: linear-gradient(135deg, #7BCCC8 0%, #6BB8D6 100%); border-color: rgba(49,151,149,0.8); }
[data-theme="light"] .axis-item:nth-child(6) .axis-circle { background: linear-gradient(135deg, #319795 0%, #3182CE 100%); border-color: #319795; }

.axis-label { font-size: 0.75em; color: var(--text-mute); text-align: center; line-height: 1.3; white-space: nowrap; }
.axis-item:hover .axis-label { color: var(--text); }

/* Part2 选中状态 */
.axis-item.selected .axis-circle {
    transform: scale(1.2);
    border-color: var(--secondary) !important;
    box-shadow: 0 0 0 4px rgba(80, 227, 194, 0.4), 0 0 15px rgba(80, 227, 194, 0.3);
}
.axis-item.selected .axis-label {
    color: var(--secondary);
    font-weight: 600;
}
[data-theme="light"] .axis-item.selected .axis-circle {
    border-color: var(--secondary) !important;
    box-shadow: 0 0 0 4px rgba(49, 151, 149, 0.3), 0 0 15px rgba(49, 151, 149, 0.2);
}

/* Part2 点击瞬间效果 */
.axis-item:active .axis-circle {
    transform: scale(1.1);
}

/* ==================== 结果卡片 ==================== */
.result-card-inner { background: var(--card-solid); border-radius: 16px; padding: 25px 20px; border: 1px solid var(--line); color: var(--text); }
.result-header { text-align: center; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.result-header h3 { margin: 0; font-size: 1.2em; color: var(--text); letter-spacing: 1px; }
.type-hero-main { background: linear-gradient(135deg, rgba(74,144,226,0.25) 0%, rgba(30,41,59,0.5) 100%); border: 1px solid rgba(74,144,226,0.3); border-radius: 12px; padding: 20px; text-align: center; margin-bottom: 20px; }
[data-theme="light"] .type-hero-main { background: linear-gradient(135deg, rgba(49,130,206,0.1) 0%, rgba(49,151,149,0.08) 100%); border: 1px solid rgba(49,130,206,0.2); }
.type-title-main { font-size: 3.2em; margin: 5px 0; font-weight: 800; letter-spacing: 3px; color: var(--text); text-shadow: 0 0 20px rgba(74,144,226,0.5); }
[data-theme="light"] .type-title-main { text-shadow: none; }
.type-sub-main { color: var(--primary); font-size: 0.8em; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.type-hero-sec { background: var(--info-bg); border: 1px dashed var(--line-dark); border-radius: 10px; padding: 10px 15px; text-align: center; margin-bottom: 25px; }
.type-sub-sec { font-size: 0.7em; color: var(--text-mute); display: block; margin-bottom: 2px; opacity: 0.8; }
.type-title-sec { font-size: 1.3em; font-weight: 700; color: var(--text-sec); margin: 0; line-height: 1.2; letter-spacing: 1px; }

/* ==================== 图表 ==================== */
.chart-container { margin-top: 10px; }
.chart-title { text-align: center; font-size: 0.95em; color: var(--text-sec); margin-bottom: 15px; font-weight: 600; }
.bar-row { display: flex; align-items: center; margin-bottom: 12px; height: 26px; }
.bar-row.highlight .bar-label { color: var(--secondary); }
.bar-label { width: 28px; font-weight: 700; color: var(--text); font-family: "SF Mono", "Roboto Mono", "Consolas", monospace; font-size: 0.85em; letter-spacing: -1px; }
.bar-track { flex: 1; background: var(--line); height: 10px; border-radius: 5px; margin: 0 8px; position: relative; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--primary), var(--secondary)); box-shadow: 0 0 8px rgba(80,227,194,0.3); }
[data-theme="light"] .bar-fill { box-shadow: none; }
.bar-val-box { width: 45px; text-align: right; line-height: 1; display: flex; flex-direction: column; justify-content: center; align-items: flex-end; }
.bar-val { font-size: 0.85em; color: var(--text); font-weight: 700; font-family: "Helvetica Neue", Arial, sans-serif; letter-spacing: -0.5px; }
.bar-raw { font-size: 0.6em; color: var(--text-mute); margin-top: 1px; font-family: "Helvetica Neue", Arial, sans-serif; letter-spacing: -0.3px; }

/* Trace区域 */
.trace-box { margin-top: 25px; padding: 15px; background: var(--trace-bg); border: 1px dashed var(--line-dark); border-radius: 8px; display: flex; flex-direction: column; align-items: center; }
.trace-row { font-family: "SF Mono", "Roboto Mono", "Consolas", monospace; font-size: 0.7em; color: var(--text-mute); text-align: center; line-height: 1.6; letter-spacing: 0.5px; margin-bottom: 4px; }
.trace-row:last-child { margin-bottom: 0; }

/* ==================== 版权 ==================== */
.copyright { text-align: center; margin-top: 25px; font-size: 0.65em; color: var(--text-mute); opacity: 0.7; font-family: sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.copyright-standalone { text-align: center; margin-top: 20px; font-size: 0.7em; color: var(--text-mute); opacity: 0.7; font-family: sans-serif; }

/* ==================== 报告页 ==================== */
#report-screen { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--bg); z-index: 200; overflow-y: auto; }
#report-screen.hidden { display: none; }
[data-theme="light"] #report-screen { background: var(--bg); }
.report-container { max-width: 800px; margin: 0 auto; padding: 20px 20px 100px; color: var(--text-sec); line-height: 1.8; font-size: 16px; }
.report-header { text-align: center; margin-bottom: 40px; }
.report-type-code { font-size: 4rem; font-weight: 800; margin: 0; line-height: 1.1; color: var(--text); text-shadow: 0 0 30px rgba(74, 144, 226, 0.6); letter-spacing: 2px; }
[data-theme="light"] .report-type-code { text-shadow: none; }
.report-title { font-size: 1.2rem; color: var(--secondary); margin-top: 8px; font-weight: 500; letter-spacing: 1px; }
.report-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; justify-content: flex-start; }
.report-tag { background: var(--info-bg); border: 1px solid var(--line); color: var(--text-mute); padding: 4px 12px; border-radius: 20px; font-size: 0.85rem; }
.section-title { font-size: 1.3rem; color: var(--text); margin: 50px 0 20px; display: flex; align-items: center; font-weight: 700; }
.section-title::before { content: ''; display: block; width: 4px; height: 22px; background: var(--secondary); margin-right: 12px; border-radius: 2px; box-shadow: 0 0 10px var(--secondary); }
[data-theme="light"] .section-title::before { box-shadow: none; }
.core-desc-box { margin-bottom: 30px; text-align: justify; color: var(--text-sec); }
.core-check-list { display: flex; flex-direction: column; gap: 12px; }
.core-check-list.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 30px; }
.core-item { display: flex; align-items: flex-start; gap: 10px; color: var(--text-sec); font-size: 0.95em; }
.core-item::before { content: '✓'; color: var(--secondary); font-weight: bold; flex-shrink: 0; margin-top: 1px; }
.function-box { border-left: 3px solid var(--primary); background: var(--info-bg); border-radius: 0 12px 12px 0; padding: 20px; }
.function-box-title { margin: 0 0 15px 0; color: var(--text); font-size: 1.1em; }
[data-theme="light"] .function-box-title { color: var(--primary); }
.text-block p { margin-bottom: 1.2em; }
.sw-container { display: grid; grid-template-columns: 1fr; gap: 25px; }
@media (min-width: 768px) { .sw-container { grid-template-columns: 1fr 1fr; } }
.sw-box { background: var(--info-bg); border-radius: 12px; padding: 20px 25px; border: 1px solid var(--line); }
.sw-header { font-size: 1.1rem; font-weight: 700; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }
.sw-list { list-style: none !important; padding: 0; margin: 0; }
.sw-item { list-style: none !important; margin-bottom: 18px; line-height: 1.6; padding-left: 16px; position: relative; }
.sw-item::before { content: ''; position: absolute; left: 0; top: 10px; width: 6px; height: 6px; border-radius: 50%; }
.sw-box-green { border-top: 3px solid var(--secondary); }
.sw-box-green .sw-header { color: var(--secondary); }
.sw-box-green .sw-item::before { background-color: var(--secondary); }
.sw-box-red { border-top: 3px solid var(--accent); }
.sw-box-red .sw-header { color: var(--accent); }
.sw-box-red .sw-item::before { background-color: var(--accent); }
.sw-item strong { color: var(--text); display: block; margin-bottom: 3px; font-weight: 600; }
.sw-item span { font-size: 0.95em; opacity: 0.85; }
.scene-box { background: var(--info-bg); border-left: 2px solid var(--line-dark); padding: 15px 20px; margin-bottom: 20px; border-radius: 0 8px 8px 0; }
.scene-title { font-size: 1.1rem; color: var(--text); margin-bottom: 10px; font-weight: 600; }
.famous-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.famous-tag { background: rgba(255,255,255,0.1); color: var(--text-mute); padding: 4px 12px; border-radius: 20px; font-size: 0.85rem; border: none; }
[data-theme="light"] .famous-tag { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.closing-quote { margin-top: 60px; margin-bottom: -60px; padding: 25px; text-align: left; background: var(--guide-bg); border-radius: 12px; font-style: italic; color: var(--secondary); font-size: 1.05rem; line-height: 1.8; }

/* 报告页顶部切换按钮 */
.report-theme-toggle { position: fixed; top: 20px; right: 20px; z-index: 210; }

/* ==================== 工具类 ==================== */
.hidden { display: none !important; }

/* ==================== 动画 ==================== */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ==================== 弹窗 ==================== */
#img-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--modal-bg); z-index: 9999; flex-direction: column; align-items: center; justify-content: center; }
.modal-hint { color: var(--text); margin-bottom: 15px; font-size: 0.9em; opacity: 0.8; }
[data-theme="light"] .modal-hint { color: #2D3748; }
#generated-img { max-width: 90%; max-height: 70vh; border-radius: 12px; box-shadow: 0 0 30px rgba(0,0,0,0.3); border: 1px solid var(--line); margin-bottom: 20px; }
.modal-btn-row { display: flex; gap: 15px; }
.modal-btn { background: transparent; border: 1px solid var(--line-dark); color: var(--text-sec); padding: 8px 20px; border-radius: 20px; cursor: pointer; transition: 0.2s; font-size: 0.9em; }
.modal-btn:hover { background: var(--info-bg); color: var(--text); }
.modal-btn-primary { background: var(--secondary); color: #fff; border: none; font-weight: 600; }
[data-theme="light"] .modal-btn-primary { color: #fff; }
.modal-btn-primary:hover { filter: brightness(1.1); }
@media (max-width: 768px) { #download-btn-action { display: none !important; } }

/* ==================== 手机端适配 ==================== */
@media (max-width: 480px) {
    .brand .sub { font-size: 0.6em; letter-spacing: 0.5px; }
    #quiz-screen { min-height: 480px; padding-bottom: 30px; }
    .guide-text { margin-bottom: 30px; }
    .guide-text-p2 { margin-bottom: 40px; }
    .question-text-p2 { margin-bottom: 50px; }
    .axis-container { margin-bottom: 30px; }
    .conflict-container { margin-bottom: 20px; }
    .btn-nav-row { margin-top: 50px; }
    .trace-row { font-size: 0.6em; letter-spacing: 0; }
    .theme-toggle { width: 30px; height: 30px; font-size: 0.9em; }
}

/* Part2 手机端文字两行显示 */
@media (max-width: 420px) {
    .axis-label {
        font-size: 0.7em;
        line-height: 1.3;
    }
    .axis-circle {
        width: 32px;
        height: 32px;
    }
}

/* ==================== 密钥认证层 ==================== */
#auth-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    background: linear-gradient(180deg, #F8FAFB 0%, #EDF5F7 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    color: #333;
    font-family: 'Noto Sans SC', sans-serif;
    transition: opacity 0.4s ease;
}

.auth-brand { text-align: center; margin-bottom: 40px; }
.auth-brand-name {
    font-family: 'Nunito', sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: #6AABB8;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    line-height: 1.2;
}
.auth-brand-sub {
    font-size: 16px;
    color: #666;
    font-weight: 500;
    letter-spacing: 1px;
    line-height: 1.5;
}

.auth-card {
    width: 100%;
    max-width: 320px;
    padding: 40px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #FFFFFF;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(106, 171, 184, 0.1);
}

.input-wrapper { width: 100%; margin-bottom: 24px; }

.auth-input {
    width: 100%;
    padding: 15px;
    background: #F4F7F8;
    border: 2px solid transparent;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    color: #333;
    box-sizing: border-box;
    font-family: inherit;
}
.auth-input:focus {
    outline: none;
    background: #FFFFFF;
    border-color: #6AABB8;
    box-shadow: 0 0 0 4px rgba(106, 171, 184, 0.08);
}

.btn-unlock {
    width: 140px;
    padding: 12px 0;
    font-size: 15px;
    font-weight: 700;
    border-radius: 50px;
    background: linear-gradient(135deg, #6AABB8 0%, #5B8FB9 100%);
    color: white;
    box-shadow: 0 6px 15px rgba(91, 143, 185, 0.25);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}
.btn-unlock:active { transform: scale(0.96); }

.no-key-box { margin-top: 20px; }
.no-key-link {
    font-size: 12px;
    color: #999;
    text-decoration: none;
    cursor: pointer;
    font-weight: 500;
}

.auth-copyright {
    margin-top: 30px;
    text-align: center;
    font-size: 11px;
    color: #CCC;
}

.auth-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 100000;
}
.auth-toast.show {
    opacity: 1;
    visibility: visible;
    bottom: 50px;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* ==================== 欢迎页样式 ==================== */
.welcome-header { text-align: center; padding: 0; margin-top: -5px; }
.welcome-title { font-size: 1.8em; margin-bottom: 6px; color: var(--secondary); }
.welcome-subtitle { color: var(--text-sec); font-size: 0.95em; margin: 0; }

.welcome-info-box {
    background: var(--info-bg);
    padding: 25px;
    border-radius: 12px;
    margin: 20px 0;
    font-size: 0.95em;
    line-height: 1.8;
    color: var(--text-sec);
    border: 1px solid var(--line);
}
.welcome-info-section { margin-bottom: 15px; }
.welcome-info-section:last-child { margin-bottom: 0; }
.welcome-info-title { font-weight: 700; color: var(--text); margin-bottom: 4px; }
.welcome-info-desc { padding-left: 0; opacity: 0.9; font-size: 0.95em; }
.welcome-info-footer {
    padding-top: 15px;
    border-top: 1px dashed var(--line);
    font-size: 0.9em;
    opacity: 0.8;
    color: var(--secondary);
    line-height: 1.8;
}

/* ==================== 状态指示器 ==================== */
.status-dot {
    width: 6px;
    height: 6px;
    background: var(--secondary);
    border-radius: 50%;
    margin-right: 6px;
}

/* ==================== 页码样式 ==================== */
.page-num {
    text-align: center;
    margin: 8px 0 20px;
    font-size: 0.75em;
    color: var(--text-mute);
    font-family: 'Helvetica Neue', Arial, sans-serif;
    letter-spacing: 1px;
}

/* ==================== 结果页样式 ==================== */
.result-actions { margin-top: 20px; }
.result-btn-row { display: flex; gap: 15px; }

.btn-report {
    background: linear-gradient(135deg, var(--accent) 0%, #d63031 100%) !important;
    margin-bottom: 15px;
}

.btn-transparent {
    background: transparent !important;
    border: 1px solid var(--line) !important;
    color: var(--text-sec) !important;
    margin-top: 0;
}

/* ==================== 图表标题 ==================== */
.chart-title-text {
    margin: 25px 0 15px 0;
    text-align: center;
    font-size: 0.95em;
    color: var(--text-sec);
    font-weight: 400;
}

/* ==================== 报告页顶栏 ==================== */
#report-topbar {
    position: sticky;
    top: 0;
    background: var(--card-solid);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 210;
}

.report-back-btn {
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 1em;
    cursor: pointer;
}

.report-topbar-right { display: flex; gap: 10px; align-items: center; }

.report-save-btn {
    background: var(--info-bg);
    border: 1px solid var(--line);
    padding: 5px 12px;
    border-radius: 6px;
    color: var(--secondary);
    cursor: pointer;
}

/* ==================== 结果页主题切换区域 ==================== */
.result-theme-toggle { display: flex; justify-content: flex-end; margin-bottom: 15px; }

/* ==================== 报告内容样式 ==================== */
.function-body-text { margin-bottom: 0; font-size: 0.95em; }
.sw-spacer { margin-top: 50px; }
.scene-content { font-size: 0.95rem; text-align: justify; line-height: 1.7; }

/* ==================== 加载提示 ==================== */
.loading-hint {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    color: var(--text-mute);
    font-size: 1rem;
}
.loading-hint::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid var(--line);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== Toast 提示组件 ==================== */
.app-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    max-width: 80%;
    text-align: center;
}
.app-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.app-toast-info {
    background: rgba(74, 144, 226, 0.95);
    color: #fff;
}
.app-toast-success {
    background: rgba(80, 227, 194, 0.95);
    color: #0b1220;
}
.app-toast-error {
    background: rgba(255, 107, 107, 0.95);
    color: #fff;
}
[data-theme="light"] .app-toast-info {
    background: rgba(49, 130, 206, 0.95);
}
[data-theme="light"] .app-toast-success {
    background: rgba(49, 151, 149, 0.95);
    color: #fff;
}
[data-theme="light"] .app-toast-error {
    background: rgba(229, 62, 62, 0.95);
}

/* ==================== 可访问性增强 ==================== */
/* Part1 选项保留焦点样式（键盘导航用） */
.conflict-option:focus-visible {
    outline: 2px solid var(--secondary);
    outline-offset: 3px;
}
/* Part2 选项移除焦点外框，改用透明度变化 */
.axis-item:focus {
    outline: none;
}
.axis-item:focus-visible {
    outline: none;
}
/* 跳过链接（屏幕阅读器） */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 淡入动画 */
.fade-in {
    animation: fadeIn 0.4s ease;
}
