/* ============================================
   深圳中考志愿填报系统 — 自定义主题
   基于 Ant Design v4（antd.css 官方版）
   ============================================ */

/* ===== CSS 变量（系统唯一权威定义） ===== */
:root {
  --primary: #1a56db;
  --primary-hover: #3b82f6;
  --primary-dark: #1e40af;
  --primary-bg: #eff6ff;
  --primary-border: #91caff;
  --primary-light: #3b82f6;
  --accent: #f59e0b;
  --accent-bg: #fffbeb;
  --success: #10b981;
  --success-bg: #f0fdf4;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --warning: #d97706;
  --info: #6366f1;
  --info-bg: #eef2ff;
  --text: #1e293b;
  --text-light: #64748b;
  --text-secondary: #64748b;
  --text-tertiary: #94a3b8;
  --border: #e2e8f0;
  --bg: #f0f4f8;
  --card: #ffffff;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 30px rgba(0,0,0,0.12);
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.02);
  --radius: 16px;
  --radius-sm: 12px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --max-w: 100%;
  --side-pad: 16px;
  --top-h: 56px;
  --bottom-h: 60px;
}

/* ===== 基础重置 ===== */
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif; color: var(--text); background: #f5f7fa; }
a { color: var(--primary); text-decoration: none; }

/* ===== 布局 ===== */
.app-layout { min-height: 100vh; display: flex; flex-direction: column; }
.app-content { flex: 1; padding: 0; }
.page-wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ===== Header ===== */
.app-header { position: sticky; top: 0; z-index: 100; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.app-header-inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; height: 56px; display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.logo-icon { font-size: 22px; }
.header-nav { display: flex; gap: 4px; }
.header-nav a { color: rgba(255,255,255,0.75); padding: 6px 14px; border-radius: var(--radius); font-size: 14px; transition: all 0.2s; }
.header-nav a:hover { color: #fff; background: rgba(255,255,255,0.1); }
.header-nav a.active { color: #fff; background: rgba(255,255,255,0.15); font-weight: 600; }

/* ===== Footer ===== */
.app-footer { text-align: center; padding: 16px 24px; font-size: 12px; color: var(--text-tertiary); border-top: 1px solid var(--border); }

/* ===== Hero ===== */
.hero-section {
  text-align: center;
  padding: 48px 24px 40px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
  margin: 0 0 32px;
  border-radius: 0;
}
.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  pointer-events: none;
}
.hero-section h1 { font-size: 32px; font-weight: 800; margin: 0 0 12px; color: #fff; position: relative; z-index: 1; }
.hero-section p { font-size: 16px; color: rgba(255,255,255,0.9); margin: 0 0 20px; position: relative; z-index: 1; }
.hero-badges { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-bottom: 0; position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(4px);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
}

/* ===== 功能卡片 ===== */
.feature-card { background: #fff; border-radius: var(--radius-xl); padding: 28px 24px; text-align: center; border: 1px solid var(--border); transition: all 0.3s; box-shadow: var(--shadow); display: flex; flex-direction: column; height: 100%; }
.feature-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.08); transform: translateY(-2px); border-color: var(--primary-border); }
.feature-icon { font-size: 36px; margin-bottom: 12px; }
.feature-card h3 { font-size: 16px; font-weight: 700; margin: 0 0 8px; }
.feature-card p { font-size: 13px; color: var(--text-secondary); margin: 0; line-height: 1.6; }

/* ===== 统计卡片 ===== */
.stat-card-custom { background: #fff; border-radius: var(--radius-lg); padding: 24px 16px 20px; text-align: center; border: 1px solid var(--border); transition: all 0.2s; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; min-height: 140px; }
.stat-card-custom:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); transform: translateY(-3px); }
.stat-icon { font-size: 28px; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--primary); line-height: 1; }
.stat-label-custom { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.stat-card-custom.stat-blue { border-color: var(--primary-border); background: var(--primary-bg); }
.stat-card-custom.stat-blue .stat-value { color: var(--primary); }
.stat-card-custom.stat-green { border-color: #b7eb8f; background: #f6ffed; }
.stat-card-custom.stat-green .stat-value { color: var(--success); }
.stat-card-custom.stat-orange { border-color: #ffe58f; background: #fffbe6; }
.stat-card-custom.stat-orange .stat-value { color: var(--warning); }
.stat-card-custom.stat-red { border-color: #ffa39e; background: #fff2f0; }
.stat-card-custom.stat-red .stat-value { color: var(--danger); }

/* ===== 步骤导航 ===== */
.step-nav-custom { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 24px; }
.step-nav-custom button { border: 1px solid var(--border); background: #fff; padding: 8px 16px; border-radius: var(--radius); font-size: 13px; cursor: pointer; transition: all 0.2s; color: var(--text-secondary); }
.step-nav-custom button:hover { border-color: var(--primary); color: var(--primary); }
.step-nav-custom button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.step-content-custom { display: none; }
.step-content-custom.active { display: block; }
.back-home { display: inline-block; margin-bottom: 12px; font-size: 13px; color: var(--text-secondary); }
.back-home:hover { color: var(--primary); }

/* ===== 分数展示 ===== */
.score-display { text-align: center; padding: 28px; margin: 16px 0; background: linear-gradient(135deg, var(--primary-bg), #fff); border: 1px solid var(--primary-border); border-radius: var(--radius-xl); }
.score-big { font-size: 52px; font-weight: 800; color: var(--primary); line-height: 1; letter-spacing: -2px; }
.score-big .score-unit { font-size: 18px; font-weight: 600; letter-spacing: 0; }
.score-label { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }
.score-position { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; padding: 4px 16px; border-radius: 20px; font-size: 13px; font-weight: 600; }

/* ===== 学校卡片 ===== */
.school-item { background: white; border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 10px; box-shadow: 0 1px 6px rgba(0,0,0,0.04); transition: all 0.25s; border: 2px solid transparent; display: flex; flex-direction: column; gap: 8px; }
.school-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); border-color: var(--primary-bg); }
.school-item.selected { border-color: var(--primary-border); background: #fafaff; }
.school-item-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.school-name { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.school-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-secondary); }
.school-meta span { display: inline-flex; align-items: center; gap: 3px; }
.school-score { font-size: 22px; font-weight: 700; color: var(--primary); text-align: right; }
.school-score .score-unit { font-size: 12px; font-weight: 400; color: var(--text-secondary); }
.school-diff { font-size: 12px; font-weight: 600; }
.school-diff.positive { color: var(--success); }
.school-diff.negative { color: var(--danger); }
.school-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.school-actions button { padding: 4px 12px; border-radius: 8px; border: 1px solid var(--border); background: white; font-size: 12px; cursor: pointer; transition: all 0.2s; }
.school-actions button:hover { border-color: var(--primary); color: var(--primary); }
.school-actions button.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ===== 结果汇总卡片 ===== */
.result-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 16px 0; }
.result-card { padding: 16px; border-radius: var(--radius); text-align: center; border: 1px solid; }
.result-card .value { font-size: 28px; font-weight: 800; }
.result-card .label { font-size: 13px; margin-top: 2px; }
.result-card.blue { border-color: var(--primary-border); background: var(--primary-bg); color: var(--primary); }
.result-card.green { border-color: #b7eb8f; background: #f6ffed; color: var(--success); }
.result-card.orange { border-color: #ffe58f; background: #fffbe6; color: var(--warning); }
.result-card.red { border-color: #ffa39e; background: #fff2f0; color: var(--danger); }

/* ===== 建议框 ===== */
.advice-box { padding: 14px 18px; border-radius: var(--radius); border: 1px solid; margin: 12px 0; font-size: 13px; line-height: 1.7; }
.advice-title { font-weight: 600; margin-bottom: 4px; font-size: 14px; }
.advice-box.tip { border-color: var(--primary-border); background: var(--primary-bg); }
.advice-box.tip .advice-title { color: var(--primary); }
.advice-box.warn { border-color: #ffa39e; background: #fff2f0; }
.advice-box.warn .advice-title { color: var(--danger); }
.advice-box.success { border-color: #b7eb8f; background: #f6ffed; }
.advice-box.success .advice-title { color: var(--success); }

/* ===== 对比表格 ===== */
.compare-modal-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.compare-modal-table th { background: var(--primary-bg); padding: 10px 12px; text-align: center; font-weight: 600; color: var(--primary); border-bottom: 2px solid var(--primary); position: sticky; top: 0; }
.compare-modal-table td { padding: 10px 12px; text-align: center; border-bottom: 1px solid var(--border); }
.compare-modal-table tr:last-child td { border-bottom: none; }
.compare-modal-table tr:hover td { background: var(--primary-bg); }
.compare-modal-table .school-col { text-align: left; font-weight: 500; min-width: 80px; }
.compare-modal-table .best-val { color: var(--success); font-weight: 700; }

/* ===== 志愿槽 ===== */
.volunteer-slot { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 2px solid var(--border); border-radius: 12px; margin-bottom: 8px; background: white; }
.slot-num { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.slot-num.batch-1 { background: #dbeafe; color: var(--primary); }
.slot-num.batch-2 { background: #fef3c7; color: #d97706; }
.slot-num.batch-3 { background: #dcfce7; color: #16a34a; }
.batch-section { margin-bottom: 20px; }
.batch-section h3 { font-size: 15px; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.nav-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }
.section-divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ===== 标签 ===== */
.tag { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.tag-red { background: #fff2f0; color: var(--danger); }
.tag-green { background: #f0fdf4; color: var(--success); }
.tag-blue { background: var(--primary-bg); color: var(--primary); }
.tag-orange { background: #fff7e6; color: #d97706; }
.tag-gray { background: #f3f4f6; color: var(--text-tertiary); }

/* ===== 趋势图SVG ===== */
.trend-svg-wrap { width: 100%; margin-top: 6px; overflow-x: auto; }
.trend-svg { max-width: 200px; height: auto; vertical-align: middle; }
.trend-line { fill: none; stroke-width: 2; stroke-linecap: round; }
.trend-area { opacity: 0.15; }
.trend-dot { fill: var(--primary); r: 3.5; }
.trend-dot.up { fill: var(--success); }
.trend-dot.down { fill: var(--danger); }
.trend-label { font-size: 10px; fill: var(--text-secondary); text-anchor: middle; }
.trend-label-end { text-anchor: end; }

/* ===== 详情模态框 ===== */
.modal-overlay-fixed { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; }
.modal-overlay-fixed.active { display: flex; }
.modal-content-fixed { background: white; border-radius: 20px; width: 90%; max-width: 900px; max-height: 85vh; overflow-y: auto; padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.modal-header-fixed { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header-fixed h2 { font-size: 20px; }
.modal-close-fixed { width: 36px; height: 36px; border-radius: 50%; border: none; background: #f1f5f9; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.modal-close-fixed:hover { background: #e2e8f0; }

/* ===== 对比侧栏 ===== */
.compare-sidebar { position: fixed; right: 16px; top: 50%; transform: translateY(-50%); width: 200px; background: var(--card); border-radius: var(--radius-sm); box-shadow: 0 8px 30px rgba(0,0,0,0.12); z-index: 999; display: none; overflow: hidden; border: 1px solid var(--border); }
.compare-sidebar.show { display: block; }
.cs-header { padding: 12px 14px; font-size: 13px; font-weight: 600; background: var(--primary); color: white; }
.cs-list { padding: 8px 10px; max-height: 300px; overflow-y: auto; }
.selected-tag { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; margin-bottom: 4px; font-size: 12px; background: var(--primary-bg); border-radius: 8px; color: var(--primary); }
.selected-tag .remove { cursor: pointer; font-weight: 700; }
.cs-footer { padding: 10px 14px; border-top: 1px solid var(--border); }

/* ===== Toast ===== */
.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-100px); padding: 10px 20px; border-radius: 10px; background: #1f2937; color: white; font-size: 13px; font-weight: 500; z-index: 9999; transition: transform 0.35s; box-shadow: 0 4px 16px rgba(0,0,0,0.15); pointer-events: none; }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.toast-success { background: var(--success); }
.toast.toast-error { background: var(--danger); }
.toast.toast-warn { background: var(--warning); }

/* ===== 折叠区块 ===== */
.collapse-section { margin-bottom: 8px; }
.collapse-header { padding: 10px 14px; cursor: pointer; font-size: 13px; font-weight: 600; border-radius: 10px; background: var(--card); display: flex; justify-content: space-between; align-items: center; user-select: none; }
.collapse-header:hover { opacity: 0.8; }
.collapse-icon { font-size: 10px; transition: transform 0.3s; }
.collapse-body { overflow: hidden; transition: max-height 0.3s; max-height: 5000px; }
.collapse-body.collapsed { max-height: 0; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .hero-section h1 { font-size: 24px; }
  .hero-section p { font-size: 14px; }
  .hero-badges { gap: 8px; }
  .chat-bubble { max-width: 90%; }
  .compare-sidebar { display: none !important; }
}
@media (max-width: 576px) {
  .hero-section { padding: 32px 0 20px; }
  .hero-section h1 { font-size: 20px; }
  .header-nav a { padding: 4px 8px; font-size: 12px; }
}
