/* 河南高考志愿填报 · 家长端界面 */
:root {
  --bg: #f0f4f8;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #1d4ed8;
  --primary-dark: #1e3a8a;
  --accent: #d97706;
  --ok: #15803d;
  --warn: #b45309;
  --danger: #b91c1c;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
  font-size: 17px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(165deg, #eff6ff 0%, var(--bg) 45%, #f8fafc 100%);
  line-height: 1.65;
  min-height: 100vh;
}

.page {
  max-width: 920px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 55%, #2563eb 100%);
  color: #fff;
  border-radius: calc(var(--radius) + 4px);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hero .tagline {
  margin: 0 0 16px;
  opacity: 0.92;
  font-size: 1rem;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.trust-badge {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.85rem;
}

.meta-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 18px;
  font-size: 0.92rem;
  color: var(--muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.card h2 {
  margin: 0 0 6px;
  font-size: 1.15rem;
}

.card .subtitle {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.95rem;
}

.field input,
.field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  background: #fafafa;
}

.field input:focus,
.field select:focus {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  border-color: var(--primary);
  background: #fff;
}

.re-choice-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f8fafc;
  cursor: pointer;
  user-select: none;
  font-size: 0.92rem;
}

.chip input {
  width: auto;
  margin: 0;
}

.checkbox-row {
  margin-top: 14px;
  padding: 12px 14px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.checkbox-row label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 500;
  cursor: pointer;
}

.btn-primary {
  width: 100%;
  margin-top: 18px;
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, #2563eb 100%);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 0.92rem;
  cursor: pointer;
}

#result[hidden] {
  display: none !important;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

@media (max-width: 640px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }
}

.metric {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}

.metric .value {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.metric .label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 4px;
}

.metric.danger .value {
  color: var(--danger);
}

.metric.ok .value {
  color: var(--ok);
}

.tier-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tier-pill {
  flex: 1;
  min-width: 100px;
  text-align: center;
  padding: 12px;
  border-radius: 12px;
  font-weight: 600;
}

.tier-pill.chong {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.tier-pill.wen {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.tier-pill.bao {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.notice {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.92rem;
  margin-bottom: 14px;
}

.notice.warn {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.notice.info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}

table.vol-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

table.vol-table th,
table.vol-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

table.vol-table th {
  background: #f1f5f9;
  font-weight: 600;
  white-space: nowrap;
}

table.vol-table tr:last-child td {
  border-bottom: none;
}

.badge-tier {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-tier.chong {
  background: #ffedd5;
  color: #c2410c;
}

.badge-tier.wen {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-tier.bao {
  background: #dcfce7;
  color: #15803d;
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
}

.checklist li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.checklist li:last-child {
  border-bottom: none;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 7px;
  flex-shrink: 0;
}

.dot.green {
  background: var(--ok);
}

.dot.yellow {
  background: var(--warn);
}

.dot.red {
  background: var(--danger);
}

.export-box {
  margin-top: 14px;
}

.export-box pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 14px;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 0.8rem;
  line-height: 1.5;
  max-height: 220px;
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 24px;
}

.loading {
  text-align: center;
  padding: 24px;
  color: var(--muted);
}

.optional-block {
  margin: 16px 0;
  padding: 12px 14px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: #f8fafc;
}

.optional-block summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
}

.guide-steps {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide-steps li {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.guide-steps .num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 3px solid var(--primary);
  padding-left: 16px;
}

.timeline li {
  margin-bottom: 14px;
  position: relative;
}

.timeline li::before {
  content: "";
  width: 10px;
  height: 10px;
  background: var(--primary);
  border-radius: 50%;
  position: absolute;
  left: -21px;
  top: 6px;
}

.guide-panel + .guide-panel {
  margin-top: 16px;
}

.guide-table td:first-child {
  font-weight: 600;
  white-space: nowrap;
}

.batch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.batch-card {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #f8fafc;
}

.batch-card.in-scope {
  border-color: #93c5fd;
  background: #eff6ff;
}

.batch-card.out-scope {
  opacity: 0.85;
}

.batch-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
}

.plain-list {
  margin: 8px 0 0 18px;
  padding: 0;
}

.plain-list.mistakes li {
  color: #b45309;
}

.status-next {
  display: block;
  margin-top: 8px;
  color: var(--primary);
}

.export-gate {
  margin-top: 12px;
  padding: 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
}

.export-gate label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 8px 0;
  font-size: 0.92rem;
}

.export-gate input {
  margin-top: 3px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

@media print {
  .hero,
  #plan-form,
  .optional-block,
  .btn-row,
  .export-gate,
  .strategy-tabs,
  .cmp-check,
  #btn-compare,
  #advisor-section,
  .footer {
    display: none !important;
  }
  .page {
    max-width: none;
    padding: 0;
  }
  .card {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }
}

.strategy-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.strategy-tab {
  border: 1px solid var(--border);
  background: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
}

.strategy-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.rec-badge {
  font-size: 0.72rem;
  background: #fef3c7;
  color: #b45309;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 4px;
}

.strategy-tab.active .rec-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.compare-table th[scope="row"] {
  background: #f8fafc;
  width: 120px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.chip-btn {
  border: 1px solid var(--border);
  background: #f8fafc;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
}

.chip-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.advisor-answer {
  margin-top: 10px;
  min-height: 48px;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.status-card {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  font-size: 0.88rem;
}

.saved-list {
  list-style: none;
  padding: 0;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.saved-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.saved-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.saved-select {
  display: block;
  width: 100%;
  margin: 6px 0;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.offline-banner {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.expert-card {
  border-left: 4px solid var(--primary);
  background: linear-gradient(135deg, #eff6ff 0%, #fff 60%);
}

.expert-headline {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e3a8a;
  margin: 0 0 10px;
}

.expert-bullets {
  margin: 0;
  padding-left: 20px;
  line-height: 1.6;
}

.zhengji-card .status-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}

.status-pill.wait {
  background: #fef3c7;
  color: #b45309;
}

.status-pill.ok {
  background: #dcfce7;
  color: #15803d;
}

.compare-summary ul {
  margin: 8px 0 0 18px;
  padding: 0;
}

.compare-best {
  background: #ecfdf5;
  font-weight: 600;
}

.badge-tier.inline {
  font-size: 0.72rem;
  padding: 2px 6px;
  vertical-align: middle;
}

.zhengji-phases {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}

.zhengji-phase {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}

.zhengji-phase .phase-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
  background: #cbd5e1;
}

.zhengji-phase.active .phase-dot {
  background: var(--primary);
  box-shadow: 0 0 0 3px #dbeafe;
}

.zhengji-phase.done .phase-dot {
  background: #22c55e;
}

.zhengji-ann-list {
  margin: 8px 0 16px 18px;
  padding: 0;
}

.zhengji-preview {
  margin: 12px 0;
  padding: 12px;
  border: 1px dashed #94a3b8;
  border-radius: 10px;
  background: #f8fafc;
}

.zhengji-preview-table td.muted {
  color: #94a3b8;
  font-style: italic;
}

.zhengji-faq-block {
  margin: 12px 0;
}

.zhengji-faq {
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.zhengji-faq summary {
  cursor: pointer;
  font-weight: 600;
}

.profile-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9rem;
}

.profile-bar select {
  min-width: 180px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

body.large-text {
  font-size: 1.12rem;
}

body.large-text .hero h1 {
  font-size: 1.85rem;
}

body.large-text .vol-table,
body.large-text .compare-table {
  font-size: 0.95rem;
}

/* === AI 深度问答区 === */
.ai-section {
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.ai-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  vertical-align: middle;
  margin-left: 6px;
}

.ai-badge.on {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1e3a8a;
  border: 1px solid #93c5fd;
}

.ai-badge.off {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid var(--border);
}

.ai-chat-box {
  margin: 12px 0;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  max-height: 340px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.ai-chat-box .ai-empty {
  color: var(--muted);
  text-align: center;
  padding: 20px 8px;
  font-size: 0.9rem;
}

.ai-turn {
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 10px;
  font-size: 0.92rem;
  line-height: 1.7;
  animation: aiFadeIn 0.2s ease;
}

.ai-turn:last-child {
  margin-bottom: 0;
}

.ai-turn.user {
  background: #e0f2fe;
  border-left: 3px solid var(--primary);
}

.ai-turn.assistant {
  background: #fff;
  border: 1px solid var(--border);
}

@keyframes aiFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.ai-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-right: 6px;
  vertical-align: middle;
}

.ai-tag.live {
  background: #dcfce7;
  color: #15803d;
}

.ai-tag.degraded {
  background: #fef3c7;
  color: #b45309;
}

.ai-input-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-top: 8px;
}

.ai-input-row textarea {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  min-height: 44px;
  transition: border-color 0.15s;
}

.ai-input-row textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px #dbeafe;
}

.ai-input-row .btn-primary {
  white-space: nowrap;
  align-self: stretch;
}

@media (max-width: 640px) {
  .ai-input-row {
    flex-direction: column;
  }
  .ai-input-row textarea {
    min-height: 60px;
  }
}
