/* ==========================================================================
   1. 核心全局样式与动态变色皮肤变量
   ========================================================================== */
:root {
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    --panel-bg: #ffffff;
    --text-main: #2d3748;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --primary: #4a5568;
    --accent-glow: rgba(74, 85, 104, 0.15);
    --banner-gradient: linear-gradient(90deg, #718096, #4a5568, #2d3748);
}

.theme-sanmin {
    --primary: #1a365d;
    --accent-glow: rgba(26, 54, 93, 0.2);
    --banner-gradient: linear-gradient(90deg, #002395 0%, #0053a0 50%, #2b6cb0 100%);
}
.theme-jianzhi {
    --primary: #7f1d1d;
    --accent-glow: rgba(127, 29, 29, 0.2);
    --banner-gradient: linear-gradient(90deg, #7f1d1d 0%, #991b1b 50%, #b45309 100%);
}
.theme-liberal {
    --primary: #005a5b;
    --accent-glow: rgba(0, 90, 91, 0.2);
    --banner-gradient: linear-gradient(90deg, #1A202C 0%, #234e52 50%, #4a5568 100%);
}
.theme-socialdem {
    --primary: #9b2c2c;
    --accent-glow: rgba(155, 44, 44, 0.2);
    --banner-gradient: linear-gradient(90deg, #9b2c2c 0%, #741d1d 50%, #2D3748 100%);
}
.theme-wangdao {
    --primary: #1c3d27;
    --accent-glow: rgba(28, 61, 39, 0.2);
    --banner-gradient: linear-gradient(90deg, #14321a 0%, #1c3d27 50%, #b7791f 100%);
}
.theme-technocrat {
    --primary: #2B6CB0;
    --accent-glow: rgba(43, 108, 176, 0.2);
    --banner-gradient: linear-gradient(90deg, #2B6CB0 0%, #2D3748 50%, #00A3C4 100%);
}
.theme-newleft {
    --primary: #5c0612;
    --accent-glow: rgba(92, 6, 18, 0.2);
    --banner-gradient: linear-gradient(90deg, #2D3748 0%, #5c0612 50%, #9B2C2C 100%);
}
.theme-federalist {
    --primary: #44337A;
    --accent-glow: rgba(68, 51, 122, 0.2);
    --banner-gradient: linear-gradient(90deg, #44337A 0%, #3182CE 50%, #805AD5 100%);
}

/* ==========================================================================
   2. 视觉重置（消除高亮蓝块与聚焦框）
   ========================================================================== */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-focus-ring-color: transparent !important;
}
button:focus, input:focus, .option-btn:focus { outline: none !important; }

body { background: var(--bg-gradient); min-height: 100vh; display: flex; flex-direction: column; justify-content: space-between; align-items: center; color: var(--text-main); }

.global-header { width: 100%; max-width: 780px; display: flex; justify-content: space-between; align-items: center; padding: 20px 10px; margin-top: 10px; }
.logo-area { display: flex; align-items: center; gap: 10px; }
.site-logo { width: 34px; height: 34px; }
.logo-text { font-size: 19px; font-weight: 700; color: #4a5568; letter-spacing: 0.5px; }

.lang-switcher { display: flex; background: #e2e8f0; padding: 3px; border-radius: 20px; }
.lang-btn { background: transparent; border: none; padding: 6px 14px; font-size: 12.5px; font-weight: 600; color: #4a5568; border-radius: 15px; cursor: pointer; transition: all 0.2s; }
.lang-btn.active { background: white; color: #1a202c; box-shadow: 0 2px 4px rgba(0,0,0,0.08); }

.container { background: var(--panel-bg); width: 100%; max-width: 780px; border-radius: 16px; box-shadow: 0 15px 35px rgba(0,0,0,0.06); padding: 40px; margin-bottom: 40px; position: relative; overflow: hidden; border: 1px solid rgba(226, 232, 240, 0.8); }
.view-section { display: none; opacity: 0; transform: translateY(6px); transition: opacity 0.35s ease, transform 0.35s ease; }
.view-section.active { display: block; opacity: 1; transform: translateY(0); }

h1 { font-size: 25px; text-align: center; margin-bottom: 12px; color: var(--primary); font-weight: 700; }
.subtitle { text-align: center; color: var(--text-muted); margin-bottom: 30px; font-size: 14px; line-height: 1.6; max-width: 600px; margin-left: auto; margin-right: auto; }

.btn { display: inline-flex; align-items: center; justify-content: center; background: var(--primary); color: white; border: none; padding: 13px 28px; font-size: 15px; font-weight: 600; border-radius: 8px; cursor: pointer; transition: all 0.15s ease; text-decoration: none; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 5px 12px var(--accent-glow); opacity: 0.95; }

.intro-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 30px; }
.intro-card { background: #f8fafc; border: 1px solid var(--border-color); padding: 18px; border-radius: 10px; }
.intro-card h3 { font-size: 14.5px; margin-bottom: 5px; color: var(--primary); }
.intro-card p { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.privacy-tip { text-align: center; background: #edf2f7; padding: 12px; border-radius: 8px; font-size: 12.5px; color: #4a5568; margin-bottom: 30px; line-height: 1.5; }
.center-wrapper { display: flex; justify-content: center; }

/* ==========================================================================
   3. 测验导航与渐变淡化动画引擎 (Fade Cross-Dissolve)
   ========================================================================== */
.quiz-nav-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.back-btn { background: transparent; border: none; color: var(--text-muted); display: flex; align-items: center; gap: 5px; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: color 0.2s; padding: 4px 0; visibility: hidden; }
.back-btn.visible { visibility: visible; }
.back-btn:hover { color: var(--primary); }
.progress-text { font-size: 13.5px; font-weight: 700; color: var(--text-muted); }

.progress-container { width: 100%; height: 5px; background: #e2e8f0; border-radius: 3px; margin-bottom: 35px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--primary); width: 0%; transition: width 0.3s ease; }
.question-card { background: #f8fafc; border-left: 5px solid var(--primary); padding: 25px; border-radius: 0 10px 10px 0; margin-bottom: 30px; }
.question-text { font-size: 16.5px; line-height: 1.6; font-weight: 600; color: #1a202c; text-align: justify; }

/* 切换动效核心控制类 */
.transition-fade { opacity: 1; transform: scale(1); transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1); }
.transition-fade.fade-out { opacity: 0; transform: scale(0.99); }

/* ==========================================================================
   4. 选项卡片常驻边框与独立柔和发光矩阵
   ========================================================================== */
.options-container { display: flex; flex-direction: column; gap: 11px; }
.option-btn { width: 100%; padding: 14px 20px; border: 2px solid var(--border-color); background: #ffffff; border-radius: 8px; font-size: 14.5px; font-weight: 600; cursor: pointer; text-align: left; transition: background 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), color 0.2s, border-color 0.2s, box-shadow 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); position: relative; }

/* 七级梯度边框色彩常驻配置 */
.option-btn.opt-vagree { border-color: #276749; color: #276749; }
.option-btn.opt-agree { border-color: #38a169; color: #38a169; }
.option-btn.opt-sagree { border-color: #68d391; color: #2f855a; }
.option-btn.opt-neutral { border-color: #718096; color: #4a5568; }
.option-btn.opt-sdisagree { border-color: #fc8181; color: #c53030; }
.option-btn.opt-disagree { border-color: #e53e3e; color: #9b2c2c; }
.option-btn.opt-vdisagree { border-color: #9b2c2c; color: #742a2a; }

/* 悬停与选中状态下的平滑填充映射 */
.option-btn.opt-vagree:hover, .option-btn.opt-vagree.selected { background: #e6fffa; color: #1c4530; }
.option-btn.opt-agree:hover, .option-btn.opt-agree.selected { background: #f0fff4; color: #22543d; }
.option-btn.opt-sagree:hover, .option-btn.opt-sagree.selected { background: #f0fff4; color: #22543d; }
.option-btn.opt-neutral:hover, .option-btn.opt-neutral.selected { background: #f7fafc; color: #2d3748; }
.option-btn.opt-sdisagree:hover, .option-btn.opt-sdisagree.selected { background: #fff5f5; color: #742a2a; }
.option-btn.opt-disagree:hover, .option-btn.opt-disagree.selected { background: #fff5f5; color: #742a2a; }
.option-btn.opt-vdisagree:hover, .option-btn.opt-vdisagree.selected { background: #fff5f5; color: #611f1f; }

/* 选择激活状态下的边缘高度柔和向外扩散发光特效 */
.option-btn.opt-vagree.selected { box-shadow: 0 0 14px rgba(39, 103, 73, 0.45); }
.option-btn.opt-agree.selected { box-shadow: 0 0 14px rgba(56, 161, 105, 0.45); }
.option-btn.opt-sagree.selected { box-shadow: 0 0 14px rgba(104, 211, 145, 0.45); }
.option-btn.opt-neutral.selected { box-shadow: 0 0 14px rgba(113, 128, 150, 0.45); }
.option-btn.opt-sdisagree.selected { box-shadow: 0 0 14px rgba(252, 129, 129, 0.45); }
.option-btn.opt-disagree.selected { box-shadow: 0 0 14px rgba(229, 62, 62, 0.45); }
.option-btn.opt-vdisagree.selected { box-shadow: 0 0 14px rgba(155, 44, 44, 0.45); }

/* ==========================================================================
   5. 结果显示面板样式
   ========================================================================== */
.results-gradient-banner { width: calc(100% + 80px); height: 14px; background: var(--banner-gradient); margin: -40px -40px 30px -40px; transition: background 0.8s ease; }
.result-title-container { text-align: center; margin-bottom: 30px; border-bottom: 2px dashed var(--border-color); padding-bottom: 25px; }
.faction-badge { display: inline-block; padding: 7px 22px; background: var(--primary); color: white; border-radius: 20px; font-size: 19px; font-weight: 700; margin-bottom: 15px; }
.faction-desc { font-size: 14.5px; line-height: 1.7; color: var(--text-main); text-align: justify; background: #f8fafc; padding: 20px; border-radius: 10px; border: 1px solid var(--border-color); }

.axis-wrapper { margin-bottom: 30px; }
.axis-item { margin-bottom: 22px; }
.axis-info { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 600; margin-bottom: 5px; }
.axis-labels { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }
.axis-bar-bg { width: 100%; height: 14px; background: #edf2f7; border-radius: 7px; overflow: hidden; }
.axis-bar-fill { height: 100%; width: 50%; transition: width 1.2s cubic-bezier(0.1, 1, 0.1, 1); border-radius: 7px; background: var(--primary); }

.share-box { margin-top: 35px; border-top: 1px solid var(--border-color); padding-top: 25px; text-align: center; }
.share-title { font-size: 13.5px; font-weight: 600; color: var(--text-muted); margin-bottom: 12px; }
.share-input-group { display: flex; gap: 10px; margin-bottom: 25px; }
.share-url { flex: 1; padding: 12px; border: 1px solid var(--border-color); background: #f7fafc; border-radius: 6px; font-size: 12.5px; color: #4a5568; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.btn-sm { padding: 10px 18px; font-size: 13.5px; }
.btn-outline { background: white; border: 1px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: #f7fafc; }
.bottom-actions { display: flex; justify-content: center; gap: 15px; }

.global-footer { width: 100%; max-width: 780px; text-align: center; padding: 20px 10px; margin-bottom: 10px; border-top: 1px solid rgba(226, 232, 240, 0.5); font-size: 13px; color: #718096; line-height: 1.8; }
.footer-link { color: #4a5568; font-weight: 600; text-decoration: none; border-bottom: 1px solid #718096; padding-bottom: 1px; transition: color 0.2s; }
.footer-link:hover { color: #1a202c; }
.copyright-text { font-size: 11px; color: #a0aec0; margin-top: 4px; letter-spacing: 0.3px; }

@media(max-width: 640px) {
    .intro-grid { grid-template-columns: 1fr; gap: 12px; }
    .container { padding: 25px 18px; }
    h1 { font-size: 21px; }
    .share-input-group { flex-direction: column; }
}