/* ============ 全站样式（响应式：电脑 + 手机） ============ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --bg: #f4f6fb; --card: #ffffff; --ink: #1e293b; --muted: #64748b;
  --line: #e2e8f0; --brand: #3b82f6; --shadow: 0 4px 18px rgba(30, 41, 59, .08);
}
html { scroll-behavior: smooth; }
body { font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.65; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ---------- 顶部导航 ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 14px; }
.logo { font-weight: 800; font-size: 17px; white-space: nowrap; }
.logo b { color: var(--brand); }
.nav-links { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav-links a { padding: 7px 12px; border-radius: 8px; font-size: 14.5px; color: #334155; transition: .15s; }
.nav-links a:hover { background: #eef2ff; color: var(--brand); }
.nav-burger { display: none; margin-left: auto; font-size: 22px; background: none; border: none; cursor: pointer; }
#searchForm { display: flex; }
#searchForm input { border: 1.5px solid var(--line); border-radius: 8px 0 0 8px; padding: 6px 10px; font-size: 13px; width: 130px; outline: none; background: #fff; transition: .2s; }
#searchForm input:focus { width: 170px; border-color: var(--brand); }
#searchForm button { border: none; background: var(--brand); color: #fff; padding: 0 12px; border-radius: 0 8px 8px 0; cursor: pointer; font-size: 13px; }

#app { max-width: 1180px; margin: 0 auto; padding: 18px 16px 60px; min-height: 70vh; }
.muted { color: var(--muted); }
.note { background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 10px 14px; font-size: 13px; color: #92400e; margin: 14px 0; }

/* ---------- 首页 ---------- */
.hero { text-align: center; padding: 46px 12px 34px; background: linear-gradient(135deg, #eef4ff 0%, #f0fdf4 50%, #fdf4ff 100%); border-radius: 18px; margin-bottom: 26px; }
.hero h1 { font-size: clamp(22px, 4vw, 34px); letter-spacing: 1px; }
.hero p { max-width: 720px; margin: 14px auto 0; color: #475569; font-size: 15px; }
.hero b { color: #1d4ed8; }
.hero-badges { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.hero-badges span { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px; font-size: 13px; color: #334155; box-shadow: var(--shadow); }
.sec-title { font-size: 20px; margin: 26px 0 14px; }
.subj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.subj-card { background: var(--card); border-radius: 14px; padding: 20px; box-shadow: var(--shadow); border-top: 4px solid var(--c); transition: transform .18s, box-shadow .18s; position: relative; }
.subj-card:hover { transform: translateY(-4px); box-shadow: 0 10px 26px rgba(30,41,59,.14); }
.subj-icon { font-size: 34px; }
.subj-name { font-size: 19px; font-weight: 800; margin-top: 6px; color: var(--c); }
.subj-name span { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 8px; }
.subj-meta { font-size: 13px; color: var(--muted); margin: 6px 0 10px; }
.subj-prog { height: 6px; background: #eef2f7; border-radius: 4px; overflow: hidden; }
.subj-prog i { display: block; height: 100%; background: var(--c); border-radius: 4px; transition: .3s; }
.subj-done { font-size: 12px; color: var(--muted); margin-top: 6px; }
.info-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-top: 26px; }
.info-card { background: var(--card); border-radius: 14px; padding: 20px; box-shadow: var(--shadow); }
.info-card h3 { font-size: 16px; margin-bottom: 10px; }
.info-card ul li { font-size: 14px; color: #475569; padding: 5px 0 5px 2px; border-bottom: 1px dashed var(--line); }
.more { display: inline-block; margin-top: 12px; color: #1d4ed8; font-size: 14px; font-weight: 600; }

/* ---------- 科目页 ---------- */
.subj-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: 6px 0 16px; }
.subj-big { font-size: 26px; font-weight: 800; color: var(--c); }
.subj-big span { font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 8px; }
.subj-progress { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.subj-progress .bar { width: 160px; height: 8px; background: #e2e8f0; border-radius: 5px; overflow: hidden; }
.subj-progress .bar i { display: block; height: 100%; background: #10b981; transition: .3s; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tab { border: 1.5px solid var(--line); background: #fff; padding: 7px 16px; border-radius: 999px; font-size: 13.5px; cursor: pointer; transition: .15s; color: #475569; }
.tab:hover { border-color: #93c5fd; color: #1d4ed8; }
.tab.on { background: #1e293b; color: #fff; border-color: #1e293b; }
.chapter { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden; }
.chapter summary { padding: 14px 18px; cursor: pointer; font-weight: 700; font-size: 15.5px; display: flex; justify-content: space-between; align-items: center; list-style: none; }
.chapter summary::-webkit-details-marker { display: none; }
.chapter summary::before { content: '▸'; color: #94a3b8; margin-right: 8px; transition: .15s; display: inline-block; }
.chapter[open] summary::before { transform: rotate(90deg); }
.chapter .cnt { font-size: 12px; color: var(--muted); font-weight: 400; background: #f1f5f9; padding: 2px 10px; border-radius: 999px; }
.pt-list { padding: 0 12px 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.pt-card { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; transition: .15s; background: #fff; }
.pt-card:hover { border-color: #93c5fd; box-shadow: 0 4px 14px rgba(59,130,246,.12); transform: translateY(-2px); }
.pt-card.done { background: #f0fdf4; border-color: #bbf7d0; }
.pt-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pt-title { font-weight: 700; font-size: 14.5px; }
.pt-anim { font-size: 11px; background: #ede9fe; color: #6d28d9; border-radius: 999px; padding: 2px 8px; }
.pt-demo { font-size: 11px; background: #fef3c7; color: #92400e; border-radius: 999px; padding: 2px 8px; }
.pt-desc { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.pt-exam { font-size: 12px; color: #1d4ed8; margin-top: 6px; }
.badge { font-size: 11px; background: #f1f5f9; color: #475569; border-radius: 999px; padding: 2px 8px; }

/* ---------- 考情页 ---------- */
.exam-page h1, .search-page h1 { font-size: 24px; margin: 8px 0 14px; }
.exam-page h2 { font-size: 17px; margin: 18px 0 10px; }
.exam-page h3 { font-size: 15px; margin: 18px 0 8px; }
.tbl { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); font-size: 14px; }
.tbl th, .tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl th { background: #f1f5f9; font-size: 13px; }
.tbl tr:last-child td { border-bottom: none; }
.plan li { background: #fff; border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; box-shadow: var(--shadow); font-size: 14px; }
.plan li::before { content: '✓ '; color: #10b981; font-weight: 800; }
.school { background: #fff; border-radius: 14px; padding: 18px; box-shadow: var(--shadow); margin-bottom: 12px; }
.s-name { font-size: 17px; font-weight: 800; }
.s-name span { font-size: 12px; color: #b45309; background: #fef3c7; border-radius: 999px; padding: 2px 10px; margin-left: 10px; vertical-align: middle; }
.s-est { font-size: 12.5px; color: var(--muted); margin: 4px 0 8px; }
.school p { font-size: 14px; color: #475569; }

/* ---------- 弹窗 ---------- */
#modal { position: fixed; inset: 0; z-index: 100; display: none; }
#modal.show { display: block; }
.m-mask { position: absolute; inset: 0; background: rgba(15,23,42,.55); }
.m-body { position: relative; max-width: 780px; margin: 4vh auto; background: #fff; border-radius: 18px; padding: 26px 28px 30px; max-height: 92vh; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; border-top: 5px solid var(--c); animation: pop .22s ease; }
@keyframes pop { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.m-close { position: sticky; top: 0; float: right; border: none; background: #f1f5f9; width: 34px; height: 34px; border-radius: 50%; font-size: 15px; cursor: pointer; color: #475569; z-index: 5; }
.m-close:hover { background: #e2e8f0; }
.m-crumb { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.m-title { font-size: 22px; color: #0f172a; margin-bottom: 14px; }
.m-sec { margin-bottom: 16px; }
.m-sec h4 { font-size: 14.5px; color: #334155; margin-bottom: 6px; }
.m-sec p { font-size: 14.5px; color: #475569; }
.fml li { font-family: Consolas, "Microsoft YaHei", monospace; font-size: 14px; background: #f8fafc; border-left: 3px solid var(--c, #3b82f6); border-radius: 8px; padding: 8px 12px; margin-bottom: 6px; }
.exam-line { background: #eff6ff; border-radius: 10px; padding: 10px 14px; color: #1e40af !important; }
.m-sec.warn p { background: #fffbeb; border-radius: 10px; padding: 10px 14px; color: #92400e; }
.m-sec.demo .q { background: #f0fdf4; border-radius: 10px 10px 0 0; padding: 12px 14px; font-size: 14.5px; font-weight: 600; border: 1px dashed #86efac; border-bottom: none; }
.m-sec.demo details { border: 1px dashed #86efac; border-top: none; border-radius: 0 0 10px 10px; }
.m-sec.demo summary { padding: 9px 14px; cursor: pointer; font-size: 13px; color: #16a34a; font-weight: 700; }
.m-sec.demo details p { padding: 10px 14px; font-size: 14px; color: #475569; border-top: 1px dashed #bbf7d0; }
.m-master { width: 100%; padding: 12px; border: none; border-radius: 12px; background: #1e293b; color: #fff; font-size: 15px; cursor: pointer; font-weight: 700; margin-top: 6px; }
.m-master.on { background: #10b981; }

/* ---------- 动画组件 ---------- */
.anim-wrap { background: #0d1526; border-radius: 14px; padding: 12px; }
.anim-ctrls { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-bottom: 10px; }
.a-ctrl { display: flex; align-items: center; gap: 8px; color: #cbd5e1; font-size: 12.5px; }
.a-ctrl input[type=range] { width: 110px; accent-color: #60a5fa; }
.a-ctrl b { color: #fde68a; min-width: 44px; font-size: 12px; }
.anim-canvas-box { height: 340px; border-radius: 10px; overflow: hidden; position: relative; }
.anim-canvas-box canvas { width: 100%; height: 100%; display: block; }
.anim-bar { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.anim-bar button { background: #1e293b; color: #e2e8f0; border: 1px solid #334155; border-radius: 8px; padding: 6px 14px; font-size: 13px; cursor: pointer; }
.anim-bar button:hover { background: #334155; }
.a-speed { display: flex; align-items: center; gap: 8px; color: #94a3b8; font-size: 12px; margin-left: auto; }
.a-speed input { width: 90px; accent-color: #f59e0b; }
.a-speed b { color: #fde68a; width: 34px; }
.anim-note { color: #94a3b8; font-size: 12.5px; margin-top: 10px; line-height: 1.6; }
.anim-missing { padding: 30px; text-align: center; color: #94a3b8; background: #0d1526; border-radius: 12px; }

/* ---------- 分步讲解栏 ---------- */
.anim-steps { display: flex; align-items: center; gap: 10px; margin-top: 10px; background: #131f38; border: 1px solid #2a3c5e; border-radius: 10px; padding: 8px 10px; }
.anim-steps button { background: #1e293b; color: #e2e8f0; border: 1px solid #334155; border-radius: 8px; padding: 6px 12px; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.anim-steps button:hover { background: #334155; }
.a-step-info { flex: 1; min-width: 0; }
.a-step-info b { display: block; color: #fde68a; font-size: 13.5px; }
.a-step-info span { display: block; color: #b6c4dd; font-size: 12px; line-height: 1.55; margin-top: 2px; }
.a-dots { display: flex; gap: 5px; margin-top: 5px; }
.a-dots i { width: 22px; height: 6px; border-radius: 4px; background: #2a3c5e; cursor: pointer; transition: .15s; }
.a-dots i.seen { background: #3b5a8f; }
.a-dots i.on { background: #f59e0b; }
.a-auto { display: flex; align-items: center; gap: 5px; color: #94a3b8; font-size: 12px; cursor: pointer; white-space: nowrap; }
.a-auto input { accent-color: #f59e0b; }
@media (max-width: 760px) {
  .anim-steps { flex-wrap: wrap; }
  .a-step-info { order: 3; width: 100%; }
}

/* ---------- 页脚 ---------- */
footer { border-top: 1px solid var(--line); background: #fff; padding: 22px 16px 30px; text-align: center; color: var(--muted); font-size: 12.5px; line-height: 2; }

/* ---------- 手机适配 ---------- */
@media (max-width: 760px) {
  /* 弹窗：m-body 自身作为滚动容器（修复手机端无法上下滑动） */
  .m-body { margin: 0; max-width: none; width: 100%; min-height: 0; height: 100vh; height: 100dvh; max-height: 100dvh; border-radius: 0; padding: 16px 16px calc(48px + env(safe-area-inset-bottom)); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .m-close { position: sticky; top: 0; right: 0; float: right; }
  .nav-burger { display: block; }
  .nav-links { display: none; position: absolute; top: 100%; right: 10px; left: 10px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 30px rgba(15,23,42,.15); padding: 10px; flex-direction: column; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 11px 14px; font-size: 15px; }
  #searchForm { margin-left: auto; }
  #searchForm input { width: 90px; } #searchForm input:focus { width: 120px; }
  .logo { font-size: 15px; }
  .pt-list { grid-template-columns: 1fr; }
  .anim-canvas-box { height: 250px; }
  .hero { padding: 30px 10px 24px; }
  .tbl { font-size: 13px; display: block; overflow-x: auto; }
  .subj-progress { width: 100%; }
  .subj-progress .bar { flex: 1; }
}
@media (max-width: 400px) {
  .a-ctrl input[type=range] { width: 84px; }
}
