/* ====== 系统分析师在线习题 - 共享样式 ====== */
*{margin:0;padding:0;box-sizing:border-box}
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans SC",sans-serif;background:#f0f2f5;min-height:100vh;color:#333}

/* 通用容器 */
.container{max-width:800px;margin:0 auto;padding:12px}

/* 试卷头部 */
.header{background:linear-gradient(135deg,#1a237e,#283593);color:#fff;padding:20px 16px;border-radius:12px;margin-bottom:12px;text-align:center}
.header h1{font-size:1.3rem;font-weight:600;line-height:1.4}
.header .sub{font-size:0.85rem;opacity:0.85;margin-top:4px}

/* 进度条 */
.progress-bar{background:#fff;border-radius:10px;padding:10px 14px;margin-bottom:12px;box-shadow:0 1px 3px rgba(0,0,0,.08)}
.progress-info{display:flex;justify-content:space-between;font-size:0.85rem;margin-bottom:6px;color:#666}
.progress-track{height:8px;background:#e0e0e0;border-radius:4px;overflow:hidden}
.progress-fill{height:100%;background:linear-gradient(90deg,#43a047,#66bb6a);border-radius:4px;transition:width .3s}

/* 返回按钮 */
.back-link{display:inline-flex;align-items:center;gap:4px;color:#fff;text-decoration:none;font-size:0.85rem;margin-bottom:10px;opacity:0.85}
.back-link:hover{opacity:1}

/* 题目卡片 */
.card{background:#fff;border-radius:12px;padding:20px 16px;margin-bottom:12px;box-shadow:0 1px 3px rgba(0,0,0,.08)}
.card .q-meta{display:flex;align-items:center;gap:8px;margin-bottom:12px}
.card .q-num{background:#1a237e;color:#fff;min-width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:0.9rem;flex-shrink:0;padding:0 6px}
.card .q-tags{display:flex;flex-wrap:wrap;gap:4px}
.card .q-tag{font-size:0.7rem;background:#e3f2fd;color:#1565c0;padding:2px 8px;border-radius:10px}
.card .q-text{font-size:1rem;line-height:1.7;margin-bottom:16px}

/* 选项 */
.options{display:flex;flex-direction:column;gap:10px}
.option{display:flex;align-items:flex-start;gap:10px;padding:12px 14px;border:2px solid #e0e0e0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:0.95rem;line-height:1.5}
.option:hover{border-color:#90caf9;background:#f5f9ff}
.option.selected{border-color:#1a237e;background:#e8eaf6}
.option.correct{border-color:#43a047;background:#e8f5e9}
.option.wrong{border-color:#e53935;background:#ffebee}
.option.disabled{pointer-events:none;opacity:0.85}
.option .radio{width:20px;height:20px;border-radius:50%;border:2px solid #bdbdbd;flex-shrink:0;display:flex;align-items:center;justify-content:center;margin-top:1px}
.option.selected .radio{border-color:#1a237e;background:#1a237e}
.option.selected .radio::after{content:'';width:8px;height:8px;background:#fff;border-radius:50%}
.option.correct .radio{border-color:#43a047;background:#43a047}
.option.correct .radio::after{content:'✓';color:#fff;font-size:12px;font-weight:bold}
.option.wrong .radio{border-color:#e53935;background:#e53935}
.option.wrong .radio::after{content:'✗';color:#fff;font-size:12px;font-weight:bold}

/* 按钮 */
.btn-row{display:flex;gap:10px;margin-top:16px}
.btn{flex:1;padding:12px;border:none;border-radius:8px;font-size:1rem;font-weight:600;cursor:pointer;transition:all .2s;text-align:center}
.btn-primary{background:#1a237e;color:#fff}
.btn-primary:hover{background:#283593}
.btn-primary:disabled{background:#9e9e9e;cursor:not-allowed}
.btn-outline{background:transparent;border:2px solid #1a237e;color:#1a237e}
.btn-outline:hover{background:#e8eaf6}

/* 解析区 - 显示答案解析全文 */
.analysis{display:none;margin-top:14px;padding:16px;background:#fafafa;border-radius:10px;border-left:4px solid #1a237e}
.analysis.show{display:block}
.analysis .result{font-weight:700;font-size:1rem;margin-bottom:8px;padding-bottom:8px;border-bottom:1px solid #e0e0e0}
.analysis .result.correct{color:#2e7d32}
.analysis .result.wrong{color:#c62828}
.analysis .result-icon{font-size:1.2rem}
.analysis .explanation{font-size:0.9rem;line-height:1.8;color:#444;white-space:pre-wrap}
.analysis .explanation:empty::after{content:'（暂无解析）';color:#999;font-style:italic}

/* 底部导航 */
.nav-row{display:flex;gap:10px;margin-top:8px;margin-bottom:20px}
.nav-btn{flex:1;padding:12px;background:#fff;border:1px solid #ddd;border-radius:8px;font-size:0.95rem;cursor:pointer;text-align:center;transition:all .2s}
.nav-btn:hover{background:#f5f5f5}
.nav-btn:disabled{opacity:0.4;cursor:not-allowed}
.nav-btn.primary-nav{background:#1a237e;color:#fff;border-color:#1a237e}
#navInfo{flex:1;text-align:center;line-height:44px;font-size:0.85rem;color:#888}

/* 得分面板 */
.score-panel{display:none;background:#fff;border-radius:12px;padding:24px;text-align:center;box-shadow:0 2px 8px rgba(0,0,0,.1);margin-top:12px}
.score-panel.show{display:block}
.score-panel .score-num{font-size:3rem;font-weight:800;color:#1a237e}
.score-panel .score-total{font-size:1.2rem;color:#888}
.score-panel .score-detail{margin:12px 0;font-size:0.9rem;color:#666}
.score-panel .score-bar{height:10px;border-radius:5px;background:#e0e0e0;overflow:hidden;margin:12px 0}
.score-panel .score-bar-fill{height:100%;border-radius:5px;transition:width .5s}

/* 首页样式 */
.home-header{background:linear-gradient(135deg,#1a237e,#283593);color:#fff;padding:30px 20px;border-radius:14px;margin-bottom:16px;text-align:center}
.home-header h1{font-size:1.5rem;margin-bottom:6px;font-weight:700}
.home-header p{font-size:0.9rem;opacity:0.85;line-height:1.5}
.filter-bar{display:flex;gap:8px;margin-bottom:16px;flex-wrap:wrap}
.filter-btn{padding:6px 16px;border-radius:20px;border:1.5px solid #1a237e;background:#fff;color:#1a237e;font-size:0.85rem;cursor:pointer;transition:all .2s;font-weight:500}
.filter-btn.active{background:#1a237e;color:#fff}
.filter-btn:hover:not(.active){background:#e8eaf6}
.exam-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:12px}
.exam-card{background:#fff;border-radius:12px;padding:18px 16px;box-shadow:0 1px 3px rgba(0,0,0,.06);text-decoration:none;color:inherit;transition:all .25s;display:block;position:relative;overflow:hidden}
.exam-card::before{content:'';position:absolute;left:0;top:0;bottom:0;width:4px;background:#1a237e;border-radius:4px 0 0 4px;transition:width .2s}
.exam-card:hover{box-shadow:0 4px 16px rgba(0,0,0,.1);transform:translateY(-2px)}
.exam-card:hover::before{width:6px}
.exam-card .ec-year{font-size:1.4rem;font-weight:700;color:#1a237e}
.exam-card .ec-title{font-size:0.85rem;color:#666;margin-top:4px;line-height:1.4}
.exam-card .ec-info{font-size:0.8rem;color:#999;margin-top:8px;display:flex;align-items:center;gap:6px}
.exam-card .ec-badge{display:inline-block;font-size:0.7rem;padding:3px 10px;border-radius:12px;font-weight:500}
.badge-real{background:#e8f5e9;color:#2e7d32}
.badge-mock{background:#fff3e0;color:#e65100}
.badge-2025{background:#e3f2fd;color:#1565c0}
.badge-thesis{background:#f3e5f5;color:#7b1fa2}

/* 统计条 */
.stats-bar{background:#fff;border-radius:10px;padding:12px 16px;margin-bottom:16px;display:flex;justify-content:space-around;text-align:center;box-shadow:0 1px 3px rgba(0,0,0,.06)}
.stats-bar .stat-val{font-size:1.5rem;font-weight:700;color:#1a237e}
.stats-bar .stat-label{font-size:0.75rem;color:#999;margin-top:2px}

/* 来源标注 */
.source-note{font-size:0.75rem;color:#aaa;text-align:center;padding:10px;margin-top:8px}

/* 移动端 */
@media(max-width:480px){
  .header h1{font-size:1.1rem}
  .header{padding:14px 12px}
  .card{padding:14px 12px}
  .exam-grid{grid-template-columns:1fr}
  .home-header{padding:20px 14px}
  .home-header h1{font-size:1.3rem}
}

/* ====== 问答题区 ====== */
.essay-section{margin-top:20px}
.essay-section h3{font-size:1.1rem;color:#1a237e;margin-bottom:12px;padding-bottom:8px;border-bottom:2px solid #e3f2fd}
.essay-block{background:#fff;border-radius:10px;padding:16px;margin-bottom:10px;box-shadow:0 1px 3px rgba(0,0,0,.05)}
.essay-header{font-weight:700;font-size:1rem;color:#1a237e;cursor:pointer;padding:4px 0}
.essay-header:hover{color:#283593}
.essay-desc{font-size:0.85rem;color:#666;margin:8px 0;display:none;line-height:1.6}
.essay-block.expanded .essay-desc{display:block}
.essay-q{margin-top:12px;font-size:0.9rem;line-height:1.6}
.essay-a{background:#f5f5f5;padding:12px;border-radius:6px;font-size:0.9rem;line-height:1.7;margin-top:6px;white-space:pre-wrap}

/* ====== 图片弹窗 ====== */
.q-image{margin:12px 0;border:1px solid #e0e0e0;border-radius:8px;overflow:hidden;cursor:pointer;position:relative;max-height:300px}
.q-image img{width:100%;display:block;object-fit:contain;max-height:300px}
.q-image:hover img{opacity:0.9}
.q-image-hint{position:absolute;bottom:6px;right:8px;background:rgba(0,0,0,.6);color:#fff;padding:2px 8px;border-radius:4px;font-size:0.7rem}
.lightbox{display:none;position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.9);z-index:9999;align-items:center;justify-content:center}
.lightbox.show{display:flex}
.lightbox-close{position:absolute;top:16px;right:24px;color:#fff;font-size:2rem;cursor:pointer;z-index:1}
.lightbox-img{max-width:95vw;max-height:95vh;object-fit:contain;border-radius:4px}

/* ====== 题型标签 ====== */
.essay-qtype{display:inline-block;font-size:0.7rem;padding:1px 8px;border-radius:8px;margin-right:6px;font-weight:500;vertical-align:middle}
.essay-qtype-选择{background:#e3f2fd;color:#1565c0}
.essay-qtype-填空{background:#fff3e0;color:#e65100}
.essay-qtype-简答{background:#e8f5e9;color:#2e7d32}
.essay-a-choice{border-left:3px solid #1565c0}
.essay-a-fill{border-left:3px solid #e65100}

/* ====== PDF 页面浏览器 ====== */
.pdf-section{margin-top:24px}
.pdf-section h3{font-size:1.1rem;color:#1a237e;margin-bottom:12px;padding-bottom:8px;border-bottom:2px solid #e3f2fd}
.pdf-nav{display:flex;gap:10px;align-items:center;margin-bottom:12px}
.pdf-nav span{flex:1;text-align:center;font-size:0.9rem;color:#666}
.pdf-viewer{border:1px solid #e0e0e0;border-radius:8px;overflow:hidden;cursor:pointer;margin-bottom:12px}
.pdf-viewer img{width:100%;display:block}
.pdf-viewer:hover{box-shadow:0 2px 8px rgba(0,0,0,.1)}
.pdf-thumbnails{display:grid;grid-template-columns:repeat(auto-fill,minmax(80px,1fr));gap:4px}
.pdf-thumb{width:100%;aspect-ratio:0.707;object-fit:cover;border:1px solid #e0e0e0;border-radius:4px;cursor:pointer;transition:all .2s}
.pdf-thumb:hover{border-color:#1a237e;opacity:0.8}
.pdf-thumb.active{border-color:#1a237e;box-shadow:0 0 0 2px #1a237e}

/* ====== 查看原卷按钮 ====== */
.view-pdf-btn{display:inline-flex;align-items:center;gap:6px;padding:8px 16px;background:#fff;color:#1a237e;border:1.5px solid #1a237e;border-radius:8px;font-size:0.85rem;cursor:pointer;margin-bottom:8px;text-decoration:none}
.view-pdf-btn:hover{background:#e8eaf6}
