/* ibphysics-base.css — IB Physics 备考站共享样式（暗色主题） */
:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --panel-2: #172033;
  --line: #334155;
  --text: #e2e8f0;
  --dim: #94a3b8;
  --accent: #38bdf8;
  --ok: #22c55e;
  --bad: #ef4444;
  --warn: #f59e0b;
  --purple: #a78bfa;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}
.container { max-width: 940px; margin: 0 auto; padding: 20px 20px 80px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; margin: 6px 0 2px; color: #f1f5f9; }
h2 { font-size: 18px; color: var(--accent); margin: 28px 0 10px; }
h3 { font-size: 16px; margin: 18px 0 8px; }
p { margin: 8px 0; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: #0f172aee; backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.topbar .inner {
  max-width: 940px; margin: 0 auto; padding: 10px 20px;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.topbar .brand { font-weight: 700; color: #f1f5f9; text-decoration: none; }
.topbar .brand:hover { color: #fff; }
/* 中英切换：只在讲义两页出现（IBP.topbar({lang:true})），靠右贴着品牌链接的对侧 */
.topbar .lang { margin-left: auto; display: flex; gap: 4px; }
.topbar .langbtn {
  font: inherit; font-size: 12px; line-height: 1; cursor: pointer;
  background: var(--panel-2); color: var(--dim); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 11px;
}
.topbar .langbtn:hover { color: var(--accent); border-color: var(--accent); }
.topbar .langbtn.on { background: var(--accent); border-color: var(--accent); color: #04121f; font-weight: 700; }

.card {
  background: var(--panel); border-radius: 12px; padding: 18px 20px;
  margin-bottom: 16px; border-left: 4px solid var(--line);
}
.grid { display: grid; gap: 14px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.badge {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 9px;
  border-radius: 999px; background: #334155; color: #cbd5e1; margin-right: 6px;
  vertical-align: middle;
}
.badge.oos { background: #7c2d12; color: #fed7aa; }
.badge.partial { background: #78350f; color: #fde68a; }
.badge.unofficial { background: #4c1d95; color: #ddd6fe; }
.badge.marks { background: #0c4a6e; color: #bae6fd; }
.badge.kp { background: #14532d; color: #bbf7d0; cursor: pointer; }
.badge.kp:hover { background: #16a34a; color: #fff; }

.q-card { background: var(--panel); border-radius: 12px; padding: 18px 22px; margin-bottom: 18px; border-left: 4px solid var(--line); }
.q-card:target { border-left-color: var(--warn); box-shadow: 0 0 0 2px rgba(245, 158, 11, .25); }
.q-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.q-num { background: #0ea5e9; color: #fff; font-weight: 700; font-size: 13px; padding: 2px 10px; border-radius: 6px; }
.q-text { font-size: 16.5px; line-height: 1.85; color: #f1f5f9; }
.q-stem { font-size: 15px; color: #cbd5e1; background: var(--panel-2); border-left: 3px solid var(--line); padding: 8px 12px; border-radius: 0 8px 8px 0; margin-bottom: 12px; }
.part { border-top: 1px dashed var(--line); padding-top: 12px; margin-top: 12px; }
.part:first-of-type { border-top: none; }
.part-label { font-weight: 700; color: var(--warn); margin-right: 8px; }

.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; margin: 12px 0; }
.opts.one { grid-template-columns: 1fr; }
.opt {
  display: flex; gap: 8px; align-items: flex-start; padding: 8px 12px;
  background: var(--panel-2); border: 1px solid transparent; border-radius: 8px; cursor: pointer;
}
.opt:hover { border-color: var(--accent); }
.opt .key { font-weight: 700; color: var(--accent); min-width: 18px; }
.opt.picked { border-color: var(--accent); background: #0c2f45; }
.opt.correct { border-color: var(--ok); background: #052e16; }
.opt.wrong { border-color: var(--bad); background: #3f1216; }
.opt img { max-width: 260px; }

figure { margin: 12px 0; text-align: center; }
figure img { max-width: 100%; height: auto; background: #fff; border-radius: 8px; padding: 6px; }
figure figcaption { font-size: 12px; color: var(--dim); margin-top: 4px; }

table.data { border-collapse: collapse; margin: 12px 0; font-size: 14px; width: auto; }
table.data th, table.data td { border: 1px solid var(--line); padding: 6px 12px; text-align: left; }
table.data th { background: #0b2b3f; color: #bae6fd; }

details.panel { margin: 12px 0; border-radius: 8px; background: var(--panel-2); padding: 2px 0; }
details.panel > summary {
  cursor: pointer; color: var(--accent); font-size: 13px; font-weight: 600;
  padding: 8px 14px; list-style: none;
}
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::before { content: "▸ "; }
details.panel[open] > summary::before { content: "▾ "; }
details.panel .body { padding: 4px 16px 14px; font-size: 15px; }
details.ms { border-left: 3px solid var(--purple); }
details.sol { border-left: 3px solid var(--ok); }

.mp { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; padding-bottom: 8px; border-bottom: 1px dashed #263449; }
.mp:last-child { border-bottom: none; }
.mp .mk { color: var(--purple); font-weight: 700; font-size: 12px; white-space: nowrap; padding-top: 2px; }
.mp .tags { color: var(--dim); font-size: 12px; }
.alt { margin: 8px 0; padding: 8px 12px; background: #1a1440; border-radius: 8px; font-size: 14px; }
.alt .alt-h { color: var(--purple); font-weight: 700; font-size: 12px; }
ol.steps { margin: 8px 0; padding-left: 22px; }
ol.steps li { margin-bottom: 8px; }
.ans-line { font-size: 16px; font-weight: 600; color: #86efac; background: #052e16; padding: 8px 14px; border-radius: 8px; margin: 8px 0; }
.note { font-size: 13px; color: #fcd34d; background: #3a2a06; padding: 6px 12px; border-radius: 6px; margin: 8px 0; }

.meter { display: flex; gap: 6px; align-items: center; margin: 10px 0; flex-wrap: wrap; }
.meter button, .btn {
  background: #0ea5e9; color: #fff; border: none; border-radius: 8px;
  padding: 6px 14px; font-size: 14px; cursor: pointer; font-family: inherit;
}
.meter button.ghost, .btn.ghost { background: var(--panel); color: var(--dim); border: 1px solid var(--line); }
.meter button.on { background: var(--ok); color: #fff; }
.meter button:hover, .btn:hover { filter: brightness(1.12); }
.verdict { font-size: 13px; font-weight: 700; }
.verdict.ok { color: var(--ok); }
.verdict.bad { color: var(--bad); }

.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 10px 12px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.list li:hover { background: var(--panel-2); }
.stat { font-size: 12px; color: var(--dim); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 14px 0; }
input[type=search], input[type=number], select {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 10px; font-size: 14px; font-family: inherit;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); cursor: pointer; }
.chip.on { background: #16a34a; border-color: #16a34a; color: #fff; }
/* 知识点图谱「卷面」：双列对齐，左侧题位、右侧分值 */
.kp-refs { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 30px; margin: 4px 0; }
.kp-refs a { display: flex; justify-content: space-between; gap: 10px; padding: 2px 4px; text-decoration: none; }
.kp-refs a:hover { background: var(--panel-2); }
.kp-refs .pm { color: var(--dim); white-space: nowrap; }

/* 满宽排版：知识点图谱与讲义页把左右空白换成内容（body 上挂 wide-page） */
body.wide-page .container, body.wide-page .topbar .inner {
  max-width: none; padding-left: clamp(16px, 2vw, 40px); padding-right: clamp(16px, 2vw, 40px);
}
body.wide-page .kp-refs { grid-template-columns: repeat(auto-fill, minmax(min(400px, 100%), 1fr)); }
body.wide-page section.mod, body.wide-page .lec-head { max-width: none; }

.empty { color: var(--dim); font-style: italic; padding: 20px 0; }
.foot { margin-top: 40px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--dim); }
@media (max-width: 640px) { .opts, .kp-refs { grid-template-columns: 1fr; } }
