:root {
  color-scheme: dark;
  --bg: #0f1412;
  --bg-soft: #171e1b;
  --ink: #e8efe9;
  --muted: #9aada0;
  --line: rgba(232, 239, 233, 0.12);
  --accent: #5fd0a5;
  --accent-dim: rgba(95, 208, 165, 0.16);
  --warn: #c4a574;
  --radius: 14px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --max: 920px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.9em;
  color: var(--accent);
}

::selection {
  background: rgba(95, 208, 165, 0.32);
  color: var(--ink);
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

section[id] {
  scroll-margin-top: 5rem;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 15% -10%, rgba(95, 208, 165, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(90, 140, 180, 0.12), transparent 50%),
    linear-gradient(180deg, #121916 0%, var(--bg) 45%, #0c100e 100%);
  animation: drift 26s ease-in-out infinite alternate;
}

/* opacity 是合成器层动画；原来对整屏 fixed 元素做 hue-rotate
   属于绘制级滤镜，在 180 个播放器的长页面上会持续触发重绘。*/
@keyframes drift {
  from { opacity: 0.78; }
  to { opacity: 1; }
}

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(4.5rem, 12vh, 7rem) 1.5rem 3rem;
  animation: rise 0.9s ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.eyebrow {
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

/* logo 与 h1 是兄弟节点 —— app.js 用 textContent 覆写标题，
   放进 h1 内部会被清掉。*/
.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0 0 1rem;
}

.hero .brand h1 {
  margin: 0;
}

.brand-logo {
  flex: none;
  height: clamp(2.4rem, 6vw, 3.6rem);   /* 与 h1 的 font-size 同一条 clamp */
  width: auto;
}

.lede {
  margin: 0;
  max-width: 38rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.hint {
  margin: 1.1rem 0 0;
  max-width: 38rem;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--accent);
  background: rgba(95, 208, 165, 0.13);
  border-radius: 0 8px 8px 0;
  color: var(--accent);
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.5;
}

.overview {
  margin: 1.5rem 0 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #ffffff;
}

.overview + .overview {
  margin-top: 1.25rem;
}

.overview-hero {
  margin-top: 0;
}

.overview-narrow {
  width: 80%;
  margin-inline: auto;
}

.overview img {
  display: block;
  width: 100%;
  height: auto;
}

.overview figcaption {
  padding: 0.7rem 1rem 0.8rem;
  color: #191f1c;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 650;
  text-align: center;
  letter-spacing: 0.01em;
}

.jumpbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(15, 20, 18, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.55rem 1.5rem 0.85rem;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-block;
  padding: 0.6rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.btn:hover {
  border-color: var(--muted);
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-1px);
}

.ico {
  margin-right: 0.45rem;
  font-size: 1rem;
  line-height: 1;
  vertical-align: -0.05em;
}

.cta-note {
  margin: 0.85rem 0 0;
  max-width: 38rem;
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.5;
}

.guide {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.75rem 1.5rem 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.jump a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.55rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent-dim);
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.jump a:hover {
  border-color: var(--accent);
  background: rgba(95, 208, 165, 0.3);
  transform: translateY(-1px);
}

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
}

.section {
  padding-top: 2.5rem;
  margin-top: 1rem;
  border-top: 1px solid var(--line);
  animation: rise 0.8s ease both;
  animation-delay: 0.15s;
}

.section-head {
  margin-bottom: 1.5rem;
}

.section-head h2 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 650;
}

/* 小节标题里的图标要跟着标题字号缩放，覆盖 .ico 的固定 1rem */
.section-head h2 .ico {
  margin-right: 0.4rem;
  font-size: 0.85em;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  max-width: none;
}

/* section 内的提示条（与页头 .hint 同一套视觉语言）。
   选择器要压过 .section-head p，否则 margin/color 会被覆盖。 */
.section-head p.callout {
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--accent);
  background: rgba(95, 208, 165, 0.13);
  border-radius: 0 8px 8px 0;
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.55;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.example {
  position: relative;
  padding: 1.15rem 1.2rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.04), transparent 55%);
  transition: border-color 0.25s, transform 0.25s;
}

.example::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 1rem;
  bottom: 1rem;
  width: 2px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.25s;
}

.example:hover::before {
  opacity: 1;
}

.example:hover {
  border-color: rgba(95, 208, 165, 0.35);
}

.example h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.example .note {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.clips {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 640px) {
  .clips {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

.clip {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.clip-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.clip audio {
  width: 100%;
  height: 40px;
  border-radius: 8px;
}

.missing {
  padding: 0.75rem 0.85rem;
  border: 1px dashed rgba(196, 165, 116, 0.45);
  border-radius: 8px;
  color: var(--warn);
  font-size: 0.85rem;
  background: rgba(196, 165, 116, 0.06);
}

.image-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 700px) {
  .image-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
  transition: border-color 0.25s, transform 0.25s;
}

.figure:hover {
  border-color: rgba(95, 208, 165, 0.35);
  transform: translateY(-2px);
}

.figure img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
  background: #0a0e0c;
}

.figure figcaption {
  padding: 0.85rem 1rem 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.empty {
  padding: 1.5rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.demo-group + .demo-group {
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--line);
}

.demo-group > h3 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 650;
}

.demo-group > h3::before {
  content: "";
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 2px;
  background: var(--accent);
}

.demo-group > .note {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* 卡片里带标签的说明行（Text / Instruction / Style / Spatial …） */
.example .detail {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.detail-label {
  display: inline-block;
  margin-right: 0.5rem;
  padding: 0.05rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: 0.1em;
}

/* ---------- 理解任务结果表（任务作行，clip 作列） ---------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.04), transparent 55%);
}

.demo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.demo-table th,
.demo-table td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.demo-table tbody tr:last-child > * {
  border-bottom: none;
}

.ux-table .clip-head {
  min-width: 11rem;
}

.ux-table .clip-id {
  display: block;
  color: var(--ink);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.ux-table .row-label,
.ux-table .task-name {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 650;
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
}

.ux-table .task-name {
  width: 8rem;
  vertical-align: top;
  padding-top: 0.8rem;
}

.ux-table .gp-label {
  width: 6.5rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ux-table .val-cell {
  color: var(--ink);
}

.ux-table .val {
  font-weight: 600;
}

.ux-table .num {
  margin-left: 0.5rem;
  color: var(--muted);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.78rem;
  white-space: nowrap;
}

.ux-table .pred-row .val-cell.mismatch .val {
  color: var(--warn);
}

.ux-table .audio-cell audio {
  display: block;
  width: 100%;
  height: 34px;
}

.ux-table .asr-cell {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

/* 每个任务块之间加一条分隔线 */
.ux-table tr.gt-row > * {
  border-top: 1px solid var(--line);
}

.foot {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.foot p {
  margin: 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

/* 只有第一行带顶部分隔线，后续行紧接其上 */
.foot p + p {
  margin-top: 0.65rem;
  padding-top: 0;
  border-top: none;
}

.foot-title {
  color: var(--ink);
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
