/* ==========================================================
   物理可视化学习站 · 设计系统
   纯静态，无外部依赖，系统字体优先
   ========================================================== */

:root {
  --bg: #ffffff;
  --bg-soft: #f7f9fc;
  --bg-deep: #eef2f8;
  --ink: #101828;
  --ink-2: #475467;
  --ink-3: #8a94a6;
  --line: #e4e9f0;
  --line-2: #d3dae5;

  --brand: #1c4ed8;
  --brand-2: #3b6ef5;
  --brand-soft: #eaf0ff;
  --accent: #f59e0b;
  --accent-soft: #fff5e2;
  --teal: #0d9488;
  --teal-soft: #e6f7f4;
  --rose: #e11d48;

  --radius-s: 8px;
  --radius: 14px;
  --radius-l: 22px;

  --shadow-s: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 6px 20px -8px rgba(16, 24, 40, .16);
  --shadow-l: 0 18px 48px -20px rgba(16, 24, 40, .28);

  --maxw: 1120px;
  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.72;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img, svg, canvas { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; font-weight: 600; }

p { margin: 0; }

button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

::selection { background: var(--brand); color: #fff; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- 导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-in {
  display: flex; align-items: center; gap: 28px;
  height: 66px;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.02em; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--brand);
  display: grid; place-items: center;
  box-shadow: 0 4px 12px -4px rgba(28, 78, 216, .6);
}
.logo-mark svg { width: 18px; height: 18px; }
.logo b { font-size: 16px; }
.logo span { font-size: 12px; color: var(--ink-3); font-weight: 400; margin-left: -2px; }

.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a {
  padding: 7px 14px; border-radius: 999px; font-size: 14.5px;
  color: var(--ink-2); transition: background .18s, color .18s;
}
.nav-links a:hover { background: var(--bg-deep); color: var(--ink); }
.nav-links a.on { background: var(--brand-soft); color: var(--brand); font-weight: 500; }

/* ---------- 通用 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: 999px;
  font-size: 15px; font-weight: 500;
  background: var(--brand); color: #fff;
  box-shadow: 0 8px 20px -10px rgba(28, 78, 216, .8);
  transition: transform .16s, box-shadow .16s, background .16s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 26px -10px rgba(28, 78, 216, .9); background: #1843c0; }
.btn.ghost {
  background: #fff; color: var(--ink); border: 1px solid var(--line-2); box-shadow: var(--shadow-s);
}
.btn.ghost:hover { border-color: var(--ink-3); background: var(--bg-soft); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 500; letter-spacing: .04em;
  color: var(--brand); text-transform: uppercase;
}
.eyebrow::before {
  content: ""; width: 16px; height: 2px; border-radius: 2px; background: var(--brand);
}

.sec { padding: 76px 0; }
.sec.soft { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sec-head { display: flex; align-items: flex-end; gap: 20px; margin-bottom: 34px; flex-wrap: wrap; }
.sec-head h2 { font-size: clamp(24px, 3.4vw, 33px); letter-spacing: -.025em; }
.sec-head p { color: var(--ink-2); font-size: 15.5px; max-width: 560px; margin-top: 8px; }
.sec-head .more { margin-left: auto; font-size: 14.5px; color: var(--brand); font-weight: 500; white-space: nowrap; }
.sec-head .more:hover { text-decoration: underline; text-underline-offset: 4px; }

.tag {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500; letter-spacing: .01em;
  background: var(--bg-deep); color: var(--ink-2);
}
.tag.brand { background: var(--brand-soft); color: var(--brand); }
.tag.accent { background: var(--accent-soft); color: #a15c00; }
.tag.teal { background: var(--teal-soft); color: var(--teal); }

/* ---------- 首页 Hero ---------- */
.hero { padding: 68px 0 24px; position: relative; overflow: hidden; }
.hero-grid {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center;
}

/* 防止 SVG / canvas 的固有宽度把网格列撑开 */
.hero-grid > *, .anim-grid > *, .video-row > *, .post-grid > *,
.lab-layout > *, .player-wrap > * { min-width: 0; }
.hero h1 {
  font-size: clamp(32px, 4.3vw, 48px);
  line-height: 1.18; letter-spacing: -.035em; font-weight: 600;
  margin: 18px 0 20px;
}
.hero h1 em {
  font-style: normal; color: var(--brand);
  background: linear-gradient(180deg, transparent 62%, var(--brand-soft) 62%);
}
.hero-lead { font-size: 17.5px; color: var(--ink-2); max-width: 500px; }
.hero-cta { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }

.hero-stats {
  display: flex; gap: 34px; margin-top: 40px;
  padding-top: 24px; border-top: 1px solid var(--line);
}
.hero-stats div b { display: block; font-size: 24px; font-weight: 600; letter-spacing: -.03em; }
.hero-stats div span { font-size: 13px; color: var(--ink-3); }

.hero-art {
  position: relative;
  border-radius: var(--radius-l);
  background: linear-gradient(160deg, #f4f7ff 0%, #eef3ff 42%, #fff8ec 100%);
  border: 1px solid var(--line);
  padding: 26px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.hero-art svg { width: 100%; height: auto; }
.hero-badge {
  position: absolute; right: 18px; bottom: 18px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 13px; font-size: 12px; color: var(--ink-2); box-shadow: var(--shadow-s);
}

/* ---------- 动画卡片 ---------- */
.anim-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 22px; }
.anim-card {
  display: block; border-radius: var(--radius); overflow: hidden;
  background: #fff; border: 1px solid var(--line);
  transition: transform .2s cubic-bezier(.2, .7, .3, 1), box-shadow .2s, border-color .2s;
}
.anim-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-l); border-color: var(--line-2); }
.anim-thumb {
  position: relative; aspect-ratio: 16 / 10;
  background: linear-gradient(150deg, #f5f8ff, #eaf0ff);
  border-bottom: 1px solid var(--line);
  display: grid; place-items: center; overflow: hidden;
}
.anim-thumb svg { width: 100%; height: 100%; }
.anim-thumb .play {
  position: absolute; right: 12px; bottom: 12px;
  width: 34px; height: 34px; border-radius: 50%;
  background: #fff; border: 1px solid var(--line);
  display: grid; place-items: center; box-shadow: var(--shadow-s);
  transition: transform .2s;
}
.anim-card:hover .play { transform: scale(1.08); background: var(--brand); border-color: var(--brand); }
.anim-card:hover .play svg { stroke: #fff; }
.anim-body { padding: 16px 18px 18px; }
.anim-body h3 { font-size: 16.5px; margin-bottom: 6px; }
.anim-body p { font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }
.anim-meta { display: flex; gap: 8px; margin-top: 12px; }

.anim-card.soon { opacity: .62; pointer-events: none; }
.anim-card.soon .anim-thumb { background: repeating-linear-gradient(135deg, #f7f9fc 0 10px, #f1f4f9 10px 20px); }

/* ---------- 微课 ---------- */
.video-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.v-card {
  display: flex; gap: 14px; padding: 14px;
  border-radius: var(--radius); border: 1px solid var(--line); background: #fff;
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.v-card:hover { border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-2px); }
.v-poster {
  width: 108px; flex: 0 0 108px; aspect-ratio: 16 / 10;
  border-radius: 10px; background: linear-gradient(150deg, #eef6ff, #e4ecff);
  display: grid; place-items: center; position: relative; overflow: hidden;
}
.v-poster span { font-size: 17px; font-weight: 500; color: #5b7fd4; letter-spacing: .03em; }
.v-poster i {
  position: absolute; right: 6px; bottom: 6px;
  font-style: normal; font-size: 10.5px; padding: 1px 6px; border-radius: 4px;
  background: rgba(16, 24, 40, .72); color: #fff;
}
.v-card .t { font-size: 14.5px; font-weight: 500; line-height: 1.5; }
.v-card .s { font-size: 12.5px; color: var(--ink-3); margin-top: 5px; }

/* ---------- 知识应用 ---------- */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.post-card {
  display: block; border-radius: var(--radius); border: 1px solid var(--line);
  background: #fff; padding: 22px; transition: border-color .18s, box-shadow .18s, transform .18s;
}
.post-card:hover { border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-3px); }
.post-card h3 { font-size: 16.5px; margin: 12px 0 8px; }
.post-card p { font-size: 13.5px; color: var(--ink-2); }
.post-card .foot { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 12.5px; color: var(--ink-3); }

/* ---------- 页脚 ---------- */
.foot-site {
  border-top: 1px solid var(--line); background: var(--bg-soft);
  padding: 40px 0 34px; margin-top: 0;
}
.foot-in { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.foot-in .logo { margin-bottom: 8px; }
.foot-site p { font-size: 13px; color: var(--ink-3); max-width: 420px; }
.foot-nav { margin-left: auto; display: flex; gap: 36px; flex-wrap: wrap; }
.foot-nav h4 { font-size: 12.5px; color: var(--ink-3); font-weight: 500; margin-bottom: 8px; }
.foot-nav a { display: block; font-size: 13.5px; color: var(--ink-2); padding: 3px 0; }
.foot-nav a:hover { color: var(--brand); }
.copy { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-3); display: flex; gap: 16px; flex-wrap: wrap; }

/* ---------- 列表页头 ---------- */
.page-head { padding: 52px 0 30px; }
.page-head h1 { font-size: clamp(27px, 4vw, 38px); letter-spacing: -.03em; margin: 12px 0 12px; }
.page-head p { color: var(--ink-2); max-width: 620px; font-size: 16px; }

/* 筛选条 */
.filters { display: flex; gap: 8px; flex-wrap: wrap; padding: 16px 0 30px; }
.filters button {
  padding: 7px 15px; border-radius: 999px; font-size: 14px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  transition: all .16s;
}
.filters button:hover { border-color: var(--line-2); background: var(--bg-soft); }
.filters button.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- 动画详情 ---------- */
.lab { padding: 30px 0 60px; }
.lab-head { display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.lab-head h1 { font-size: clamp(24px, 3.4vw, 33px); letter-spacing: -.03em; }
.lab-head p { color: var(--ink-2); font-size: 15px; margin-top: 8px; max-width: 640px; }
.lab-layout { display: grid; grid-template-columns: minmax(0, 1fr) 314px; gap: 22px; align-items: start; }
.stage {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px; box-shadow: var(--shadow-s);
}
.stage canvas { width: 100%; height: auto; border-radius: 10px; background: #fdfdff; }
.stage-hint { display: none; font-size: 12.5px; color: var(--ink-3); margin: 0 0 8px 2px; }
.panel {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-s);
}
.panel h3 { font-size: 13px; color: var(--ink-3); font-weight: 500; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 14px; }
.ctrl { margin-bottom: 18px; }
.ctrl:last-child { margin-bottom: 0; }
.ctrl label { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 7px; color: var(--ink-2); }
.ctrl label b { color: var(--ink); font-weight: 500; font-family: var(--mono); font-size: 13px; }
input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 4px;
  background: var(--line-2); outline: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 2px solid var(--brand); box-shadow: var(--shadow-s); cursor: pointer;
}
input[type=range]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid var(--brand); cursor: pointer;
}
.seg { display: flex; background: var(--bg-deep); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { flex: 1; padding: 7px 0; border-radius: 8px; font-size: 13.5px; color: var(--ink-2); transition: all .16s; }
.seg button.on { background: #fff; color: var(--ink); font-weight: 500; box-shadow: var(--shadow-s); }

.readout { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.readout div { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.readout span { font-size: 11.5px; color: var(--ink-3); display: block; }
.readout b { font-family: var(--mono); font-size: 15px; font-weight: 600; letter-spacing: -.02em; }
.readout b.hl { color: var(--brand); }

.verdict {
  margin-top: 14px; padding: 12px 14px; border-radius: 10px;
  background: var(--brand-soft); border: 1px solid #d3e0ff;
  font-size: 13.5px; color: #1740a8; line-height: 1.6;
}
.verdict b { font-weight: 600; }

.note { margin-top: 22px; padding: 20px 22px; border-radius: var(--radius); background: var(--bg-soft); border: 1px solid var(--line); }
.note h3 { font-size: 15px; margin-bottom: 10px; }
.note ol, .note ul { margin: 0; padding-left: 20px; color: var(--ink-2); font-size: 14px; }
.note li { margin: 5px 0; }
.note code { font-family: var(--mono); font-size: 13px; background: #fff; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line); }

/* ---------- 视频播放页 ---------- */
.player-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 26px; align-items: start; }
.player {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  background: #0b1220; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line);
}
.player iframe { width: 100%; height: 100%; border: 0; }
.player .ph {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
  color: #c7d2e4; gap: 10px; padding: 24px;
}
.player .ph strong { font-size: 16px; color: #fff; font-weight: 500; }
.player .ph span { font-size: 13px; }
.v-title { font-size: clamp(20px, 2.8vw, 26px); margin: 20px 0 10px; letter-spacing: -.02em; }
.v-sub { color: var(--ink-3); font-size: 13.5px; display: flex; gap: 14px; flex-wrap: wrap; }
.side-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: #fff; }
.side-box h3 { font-size: 14px; margin-bottom: 12px; }
.side-list a { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; color: var(--ink-2); }
.side-list a:last-child { border-bottom: 0; }
.side-list a:hover { color: var(--brand); }
.side-list i { font-style: normal; color: var(--ink-3); font-family: var(--mono); font-size: 12px; }

/* ---------- 文章详情 ---------- */
.article { max-width: 720px; }
.article h1 { font-size: clamp(26px, 4vw, 36px); letter-spacing: -.03em; margin: 14px 0 16px; }
.article .meta { color: var(--ink-3); font-size: 13.5px; display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 28px; }
.article h2 { font-size: 21px; margin: 36px 0 12px; letter-spacing: -.02em; }
.article p { color: #26303f; margin: 12px 0; }
.article ul { color: #26303f; padding-left: 22px; }
.article li { margin: 6px 0; }
.article blockquote {
  margin: 20px 0; padding: 14px 18px; border-left: 3px solid var(--brand);
  background: var(--bg-soft); border-radius: 0 10px 10px 0; color: var(--ink-2); font-size: 14.5px;
}
.article .formula {
  font-family: var(--mono); background: #0f172a; color: #e6edf7;
  padding: 14px 18px; border-radius: 10px; font-size: 14px; overflow-x: auto; margin: 16px 0;
}
.article .answer {
  border: 1px solid var(--line); border-radius: 12px; padding: 0 18px; margin: 18px 0; background: #fff;
}
.article .answer summary { cursor: pointer; padding: 14px 0; font-weight: 500; font-size: 14.5px; color: var(--brand); }

/* ---------- 表格 ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 4px; }
.tbl th, .tbl td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.tbl th { font-size: 12px; color: var(--ink-3); font-weight: 500; letter-spacing: .03em; background: var(--bg-soft); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td:first-child { font-family: var(--mono); color: var(--brand); white-space: nowrap; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 60px 20px; color: var(--ink-3); font-size: 14.5px; }

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-art { order: 0; }
  .anim-grid, .video-row, .post-grid { grid-template-columns: repeat(2, 1fr); }
  .player-wrap { grid-template-columns: 1fr; }

  /* 窄屏：画布 → 控制面板 → 说明，滑块紧跟在图下面，不用滚过一屏表格 */
  .lab-layout { display: flex; flex-direction: column; gap: 18px; align-items: stretch; }
  .lab-layout > div { display: contents; }
  .lab-layout .stage-hint { order: 1; margin-bottom: -10px; }
  .lab-layout .stage { order: 2; }
  .lab-layout .panel { order: 3; }
  .lab-layout .note { order: 4; margin-top: 4px; }
}
@media (max-width: 640px) {
  body { overflow-x: hidden; }
  .wrap { padding: 0 18px; }
  .sec { padding: 52px 0; }
  .nav-in { height: 58px; gap: 8px; }
  .logo { gap: 8px; }
  .logo span { display: none; }
  .logo b { font-size: 14.5px; }
  .logo-mark { width: 27px; height: 27px; border-radius: 8px; }
  .nav-links { gap: 0; }
  .nav-links a { padding: 6px 8px; font-size: 12.5px; }
  .note { overflow-x: auto; }
  .tbl { font-size: 12.5px; min-width: 520px; }
  .tbl th, .tbl td { padding: 8px 9px; white-space: nowrap; }
  .stage { overflow-x: auto; }
  .stage canvas { min-width: 620px; }
  .stage-hint { display: block; }
  .hero { padding: 40px 0 10px; }
  .hero-stats { gap: 20px; }
  .hero-stats div b { font-size: 20px; }
  .anim-grid, .video-row, .post-grid { grid-template-columns: 1fr; }
  .sec-head .more { margin-left: 0; }
  .foot-nav { margin-left: 0; gap: 20px; }
  .readout { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 430px) {
  .logo b { display: none; }
  .nav-links a { padding: 6px 7px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
