/* ============================================================
   智行江畔 V6.6 —— 全局样式
   配色：江财红 #9E1B32 / 深蓝 #1B2A4A / 金色 #C9A227 / 米白 #FAF7F2
   移动端断点：768px
   ============================================================ */
:root {
  --red: #9E1B32; --red-dark: #7A1428; --red-light: #F5E3E7;
  --blue: #1B2A4A; --blue-light: #2C3E6B;
  --gold: #C9A227; --gold-light: #F3E8C8;
  --bg: #FAF7F2; --card: #FFFFFF;
  --text: #2B2B33; --muted: #7C7C88;
  --radius: 14px; --shadow: 0 6px 20px rgba(27, 42, 74, 0.08);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.7;
}
.container { max-width: 980px; margin: 0 auto; padding: 0 16px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.btn { display: inline-block; border: none; border-radius: 999px; padding: 11px 26px; font-size: 15px; font-weight: 600; cursor: pointer; transition: all .2s; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.chip { display: inline-block; border: 1px solid #E5DFD5; background: #fff; border-radius: 999px; padding: 5px 14px; font-size: 13px; color: var(--blue); cursor: pointer; margin: 0 6px 8px 0; }
.chip:hover { border-color: var(--red); color: var(--red); }
.empty-tip { color: var(--muted); font-size: 14px; }
.cross-tag { color: var(--gold); font-weight: 700; margin-right: 4px; cursor: help; }
.card-x { position: absolute; top: 8px; right: 10px; border: none; background: none; font-size: 15px; color: var(--muted); cursor: pointer; }

/* ---------- 顶部 ---------- */
.slogan-bar { background: var(--blue); color: var(--gold); text-align: center; font-size: 13.5px; letter-spacing: 2px; padding: 8px 12px; font-weight: 600; }
.navbar { position: sticky; top: 0; z-index: 300; background: var(--card); box-shadow: 0 2px 10px rgba(27,42,74,.06); }
.nav-inner { max-width: 980px; margin: 0 auto; padding: 0 16px; height: 60px; display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark { width: 36px; height: 36px; background: var(--red); color: #fff; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 700; }
.logo-text { font-size: 18px; font-weight: 700; color: var(--blue); line-height: 1.2; }
.logo-text small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.nav-links { display: flex; list-style: none; gap: 4px; }
.nav-links a { display: block; padding: 8px 20px; border-radius: 999px; cursor: pointer; color: var(--text); font-size: 15px; }
.nav-links a:hover { color: var(--red); background: var(--red-light); }
.nav-links a.active { background: var(--red); color: #fff; }
.nav-toggle { display: none; border: none; background: none; font-size: 24px; color: var(--blue); cursor: pointer; }

/* ---------- 视图 ---------- */
.view { display: none; }
.view.active { display: block; animation: fadeUp .3s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- 搜索视图 ---------- */
.search-hero { text-align: center; padding: 40px 0 20px; position: relative; }
.search-hero h1 { font-size: 40px; color: var(--red); letter-spacing: 3px; }
.search-sub { color: var(--muted); margin: 6px 0 22px; }
.search-bar { display: flex; gap: 10px; max-width: 640px; margin: 0 auto; }
.search-bar input { flex: 1; border: 2px solid #E5DFD5; border-radius: 999px; padding: 12px 22px; font-size: 15.5px; outline: none; background: #fff; }
.search-bar input:focus { border-color: var(--red); }
.suggest-box { position: absolute; left: 50%; transform: translateX(-50%); top: 100%; margin-top: -12px; width: min(640px, 92vw); background: #fff; border-radius: 12px; box-shadow: 0 14px 36px rgba(27,42,74,.16); z-index: 120; overflow: hidden; }
.suggest-item { padding: 10px 18px; cursor: pointer; font-size: 14.5px; display: flex; justify-content: space-between; align-items: center; }
.suggest-item:hover { background: var(--bg); }
.suggest-cat { font-size: 12px; color: var(--muted); }

.result-list { margin: 14px 0; }
.result-item { padding: 16px 20px; margin-bottom: 12px; }
.result-item h4 { font-size: 16px; color: var(--blue); margin-bottom: 6px; }
.result-summary { font-size: 14px; color: var(--muted); }
.result-foot { margin-top: 8px; display: flex; justify-content: space-between; align-items: center; }
.cat-badge { background: var(--gold-light); color: var(--gold); font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 12px; }
.result-count { font-size: 13px; color: var(--red); font-weight: 600; }
.result-detail { border-top: 1px dashed #E5DFD5; margin-top: 10px; padding-top: 10px; }
.detail-answer { font-size: 14.5px; }
.detail-spots { margin-top: 10px; font-size: 13.5px; color: var(--muted); }

.block-card { padding: 18px 20px; margin-bottom: 16px; }
.block-card h3 { font-size: 17px; color: var(--blue); margin-bottom: 12px; }
.chip-row { line-height: 2; }
.hist-clear { color: var(--red); }

.hot-item { display: flex; align-items: center; gap: 8px; padding: 8px 4px; border-bottom: 1px dashed #EFE9DF; cursor: pointer; font-size: 14.5px; }
.hot-item:last-child { border-bottom: none; }
.hot-rank { width: 22px; height: 22px; border-radius: 6px; background: #EFE9DF; color: var(--muted); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hot-rank.r1 { background: var(--red); color: #fff; }
.hot-rank.r2 { background: var(--gold); color: #fff; }
.hot-rank.r3 { background: var(--blue-light); color: #fff; }
.hot-q { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hot-c { color: var(--red); font-size: 13px; font-weight: 600; }

/* ---------- 问卷折叠面板 ---------- */
.survey-panel { margin-bottom: 16px; overflow: hidden; }
.survey-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; cursor: pointer; font-weight: 700; color: var(--blue); font-size: 15.5px; user-select: none; }
.survey-arrow { color: var(--gold); font-size: 16px; }
.survey-body { max-height: 0; overflow-y: auto; transition: max-height .3s ease; padding: 0 20px; }
.survey-panel.open .survey-body { max-height: 520px; }
.survey-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding-top: 4px; }
.survey-item h4 { font-size: 13.5px; color: var(--text); margin-bottom: 4px; }
.survey-chart { width: 100%; height: 190px; }
.survey-import { margin: 14px 0 16px; }
.survey-tip { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.survey-import textarea { width: 100%; border: 2px solid #E5DFD5; border-radius: 10px; padding: 8px 12px; font-size: 12.5px; font-family: monospace; resize: vertical; outline: none; }
.survey-actions { margin-top: 8px; display: flex; gap: 12px; align-items: center; }
.survey-actions .btn { padding: 8px 22px; font-size: 14px; }
.survey-msg { font-size: 13px; color: var(--red); }

/* ---------- 力导向图谱 ---------- */
.graph-tip { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.graph-wrap { position: relative; }
#graphSvg { background: #FDFCFA; border-radius: 10px; border: 1px solid #EFE9DF; }
#miniMap { position: absolute; right: 8px; bottom: 8px; background: rgba(255,255,255,.92); border: 1px solid #E5DFD5; border-radius: 8px; z-index: 5; }
#graphCard { position: absolute; width: 250px; background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(27,42,74,.2); padding: 14px 16px; z-index: 10; font-size: 13px; }
#graphCard h5 { font-size: 14px; color: var(--red); margin-bottom: 6px; padding-right: 16px; }
#graphCard p { color: var(--muted); font-size: 12.5px; margin-bottom: 8px; }
.graph-list-item { padding: 9px 6px; border-bottom: 1px dashed #EFE9DF; cursor: pointer; font-size: 14px; }
.graph-list-item:hover { background: var(--bg); }
.graph-note { font-size: 13px; color: var(--muted); margin-bottom: 8px; }

/* ---------- 地图视图 ---------- */
.map-wrap { position: relative; height: calc(100vh - 130px); min-height: 520px; }
#mapBox { width: 100%; height: 100%; background: #E8E4DC; }
.map-placeholder { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 30px; color: var(--muted); }
.map-placeholder h3 { color: var(--red); }
.map-layers { position: absolute; top: 14px; left: 14px; padding: 10px 16px; z-index: 20; display: flex; gap: 16px; font-size: 14px; }
.map-layers label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.map-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); cursor: pointer; }
.route-num { width: 26px; height: 26px; border-radius: 50%; background: var(--gold); border: 2px solid #fff; color: var(--blue); font-weight: 800; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.route-panel { position: absolute; top: 14px; right: 14px; width: 320px; max-height: calc(100% - 28px); overflow-y: auto; padding: 18px 20px; z-index: 25; }
.route-panel h4 { font-size: 16px; color: var(--red); margin-bottom: 6px; padding-right: 20px; }
.route-total { font-size: 13.5px; color: var(--muted); margin-bottom: 10px; }
.route-total b { color: var(--red); font-size: 18px; }
.route-steps { list-style: none; }
.route-steps li { position: relative; padding: 0 0 12px 18px; font-size: 13.5px; border-left: 2px solid var(--gold-light); margin-left: 4px; }
.route-steps li b { color: var(--blue); }
.spot-drawer { position: absolute; left: 0; right: 0; bottom: 0; height: 180px; background: #fff; border-radius: 16px 16px 0 0; box-shadow: 0 -6px 24px rgba(27,42,74,.18); z-index: 30; display: flex; flex-direction: column; transition: height .25s ease; }
.drawer-handle { text-align: center; padding: 8px 0 6px; font-size: 13px; color: var(--muted); cursor: pointer; font-weight: 600; border-bottom: 1px solid #F3EFE7; flex-shrink: 0; }
.drawer-list { overflow-y: auto; padding: 8px 16px 16px; }
.drawer-group h5 { font-size: 13px; color: var(--gold); margin: 8px 0 4px; }
.drawer-item { display: flex; align-items: center; gap: 8px; padding: 7px 4px; font-size: 14px; cursor: pointer; border-bottom: 1px dashed #F3EFE7; }
.drawer-item .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.drawer-votes { margin-left: auto; font-size: 12.5px; color: var(--red); }

/* Popup */
.pop-title { font-size: 15px; font-weight: 700; color: var(--blue); }
.pop-meta { font-size: 12.5px; color: var(--muted); margin: 3px 0; }
.pop-tags { margin-bottom: 6px; }
.pop-tag { display: inline-block; background: var(--red-light); color: var(--red); font-size: 11px; border-radius: 999px; padding: 1px 8px; margin-right: 4px; }
.pop-vote { border: none; border-radius: 999px; background: var(--red); color: #fff; padding: 6px 16px; font-size: 13px; cursor: pointer; }
.pop-vote.voted { background: #C9C9CF; }

/* ---------- 指南视图 ---------- */
.section-head { text-align: center; padding: 36px 0 20px; }
.section-head h2 { font-size: 28px; color: var(--blue); }
.section-head h2::after { content: ""; display: block; width: 46px; height: 4px; background: var(--gold); border-radius: 2px; margin: 10px auto 0; }
.section-head p { color: var(--muted); margin-top: 10px; }
.tab-bar { display: flex; justify-content: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.tab { border: 2px solid #E5DFD5; background: #fff; border-radius: 999px; padding: 9px 26px; font-size: 14.5px; cursor: pointer; color: var(--text); }
.tab.active { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp .25s ease; }

.flow-card { padding: 20px 24px; margin-bottom: 16px; }
.flow-card h3 { font-size: 17.5px; color: var(--red); margin-bottom: 6px; }
.flow-total { font-size: 13.5px; color: var(--muted); margin-bottom: 12px; }
.flow-total b { color: var(--red); }
.flow-steps { list-style: none; }
.flow-steps li { position: relative; padding: 0 0 14px 44px; font-size: 14px; }
.flow-steps li::before { content: ""; position: absolute; left: 11px; top: 26px; bottom: 0; width: 2px; background: var(--gold-light); }
.flow-steps li:last-child::before { display: none; }
.step-no { position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--gold); color: var(--blue); font-weight: 800; font-size: 12.5px; display: flex; align-items: center; justify-content: center; }
.step-min { float: right; font-size: 12px; color: var(--muted); background: var(--bg); border-radius: 999px; padding: 1px 10px; }
.flow-map-btn { margin-top: 6px; padding: 9px 24px; font-size: 14px; }

#guideCalendar { padding: 22px 26px; margin-bottom: 40px; }
.cal-title { font-size: 18px; color: var(--red); margin-bottom: 16px; }
.cal-timeline { position: relative; padding-left: 22px; }
.cal-timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--red), var(--gold)); border-radius: 2px; }
.cal-node { position: relative; margin-bottom: 16px; }
.cal-node::before { content: ""; position: absolute; left: -21px; top: 6px; width: 12px; height: 12px; background: #fff; border: 3px solid var(--red); border-radius: 50%; }
.cal-date { font-size: 12.5px; color: var(--gold); font-weight: 700; letter-spacing: .5px; }
.cal-body b { color: var(--blue); font-size: 15px; }
.cal-body p { font-size: 13px; color: var(--muted); }

.med-card { padding: 18px 22px; margin-bottom: 14px; }
.med-card h4 { font-size: 15.5px; color: var(--red); margin-bottom: 8px; }
.med-card p { font-size: 14px; }
#tab-medical { margin-bottom: 40px; }

/* ---------- 我的视图 ---------- */
#view-mine .container { padding-top: 28px; padding-bottom: 40px; }
.guide-entry { display: flex; align-items: center; gap: 16px; padding: 20px 24px; margin-bottom: 16px; cursor: pointer; }
.guide-entry:hover { transform: translateY(-2px); }
.ge-icon { font-size: 34px; }
.guide-entry h3 { font-size: 18px; color: var(--blue); }
.guide-entry p { font-size: 13px; color: var(--muted); }
.ge-arrow { margin-left: auto; color: var(--gold); font-size: 22px; font-weight: 700; }
.mine-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed #EFE9DF; font-size: 14.5px; }
.mine-row b { color: var(--blue); }
.mine-row span { color: var(--red); font-weight: 600; }
.mine-intro { font-size: 14.5px; }
.mine-ver { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* ---------- 移动端底部导航 ---------- */
.mobile-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: #fff; box-shadow: 0 -2px 12px rgba(27,42,74,.12); z-index: 400; }
.mobile-nav a { flex: 1; text-align: center; padding: 8px 0 7px; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; cursor: pointer; }
.mobile-nav a span { font-size: 20px; }
.mobile-nav a.active { color: var(--red); font-weight: 700; }

/* ---------- 页脚 ---------- */
.footer { background: var(--blue); color: rgba(255,255,255,.85); text-align: center; padding: 26px 16px; font-size: 13.5px; }
.footer-sub { font-size: 12px; color: rgba(255,255,255,.5); margin-top: 5px; }

/* ================= 移动端适配（375px 逐一验证） ================= */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .mobile-nav { display: flex; }
  main { padding-bottom: 70px; }
  .footer { padding-bottom: 90px; }
  .container { padding: 0 12px; }
  .card, .survey-panel, .block-card, .flow-card, .med-card { width: 100%; }
  .search-hero h1 { font-size: 30px; }
  .search-bar { flex-direction: row; }
  .search-bar .btn { padding: 11px 18px; font-size: 14px; }
  .survey-grid { grid-template-columns: 1fr; }
  .survey-panel.open .survey-body { max-height: 62vh; }
  .graph-wrap, #graphSvg { width: 100% !important; }
  #miniMap { width: 110px; height: 88px; }
  /* 地图：抽屉默认半屏高度已内联 180px，占满底部 */
  .map-wrap { height: calc(100vh - 200px); min-height: 420px; }
  .route-panel { width: calc(100% - 28px); right: 14px; top: 60px; max-height: 55%; }
  .map-layers { top: 10px; left: 10px; padding: 8px 12px; font-size: 13px; }
}

/* ============================================================
   V6.6+AI 增量样式：AI 卡片 / 追问条 / 学习资源彩蛋 / Toast
   ============================================================ */

/* ---------- AI 回答卡片 ---------- */
.ai-card { padding: 16px 20px; margin-bottom: 12px; border-left: 5px solid var(--blue); }
.ai-head { font-weight: 700; color: var(--blue); margin-bottom: 8px; font-size: 15px; }
.ai-mid-tag { margin-left: 10px; font-size: 11px; font-weight: 600; color: var(--gold); background: var(--gold-light); border-radius: 999px; padding: 2px 10px; vertical-align: 2px; }
.ai-text { font-size: 14.5px; line-height: 1.8; }
.ai-loading { color: var(--muted); font-size: 14px; animation: aiBlink 1.2s infinite; }
@keyframes aiBlink { 50% { opacity: 0.4; } }
.ai-safe { background: var(--red-light); border-radius: 10px; padding: 10px 14px; }
.ai-fold { max-height: 84px; overflow: hidden; }
.ai-expand { border: none; background: none; color: var(--red); font-size: 13px; cursor: pointer; padding: 4px 0; font-weight: 600; }
.ai-spot-row { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 4px; white-space: nowrap; -webkit-overflow-scrolling: touch; }
.ai-spot-row .chip { flex-shrink: 0; margin: 0; }
.ai-note { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.ai-card code { background: var(--bg); border-radius: 4px; padding: 1px 6px; font-size: 13px; }

/* ---------- 继续追问条 ---------- */
.ai-context-bar { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 10px auto 0; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.ai-context-go { border: none; background: var(--blue); color: #fff; border-radius: 999px; padding: 5px 16px; font-size: 13px; cursor: pointer; }
.ai-context-clear { border: 1px solid #E5DFD5; background: #fff; color: var(--muted); border-radius: 999px; padding: 5px 14px; font-size: 12.5px; cursor: pointer; }
.ai-context-clear:hover { color: var(--red); border-color: var(--red); }

/* ---------- 学习资源彩蛋 ---------- */
.study-panel { margin-top: 16px; overflow: hidden; }
.study-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; cursor: pointer; font-weight: 700; color: var(--blue); font-size: 15.5px; user-select: none; }
.study-arrow { color: var(--gold); font-size: 16px; }
.study-body { max-height: 0; overflow-y: auto; transition: max-height .3s ease; padding: 0 20px; }
.study-panel.open .study-body { max-height: 420px; }
.study-group h5 { font-size: 13px; color: var(--gold); margin: 10px 0 6px; }
.study-item { display: block; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--text); margin-bottom: 4px; }
.study-item:hover { background: var(--bg); }
.study-item b { display: block; font-size: 14px; color: var(--blue); }
.study-item span { font-size: 12.5px; color: var(--muted); }

/* ---------- Toast ---------- */
.app-toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: rgba(27,42,74,.92); color: #fff; border-radius: 999px; padding: 10px 24px; font-size: 14px; z-index: 500; box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: 86vw; text-align: center; }

/* ---------- 毕业生停保专区标题 ---------- */
.med-stop-title { font-size: 17px; color: var(--gold); margin: 22px 0 12px; padding-top: 14px; border-top: 2px dashed #EFE9DF; }

/* ---------- AI 移动端适配 ---------- */
@media (max-width: 768px) {
  .ai-card { width: 100%; padding: 14px 16px; }
  .ai-spot-row { padding-bottom: 8px; }
}
