/* ============================================================
   Concertina: Embodying Manipulation and Cognition
   Native eVLM Project Page Stylesheet
   Design System: Two-Tone Editorial Showcase (Lab Grade)
   ============================================================ */

:root {
  /* ============================================================
     Morandi Slate-Cyan Foundation Palette (Low Saturation & Soft Dark)
     ============================================================ */
  --bg: #F2F5F5;             /* Morandi pale mist cyan-grey */
  --bg-subtle: #E8EEF0;      /* Slightly deeper mist */
  --card: #FCFDFD;           /* Clean crisp Morandi chalk-white */
  --ink: #1B2A30;            /* Soft deep slate-cyan (no harsh pitch-black) */
  --ink-2: #283940;          /* Secondary dark slate body */
  --raised: #22343C;
  --muted: #566870;          /* Morandi dusty slate */
  --dim: #7C8F96;            /* Morandi light slate */
  --line: #DCE3E5;          /* Delicate slate-cyan border */
  --line-strong: #C4D0D4;

  /* Primary Accent: Morandi Slate Teal / Cyan */
  --teal: #366A75;           /* Refined Morandi slate teal */
  --teal-soft: #E6EFF0;      /* Low-sat soft cyan tint */
  --teal-border: #B7CED2;
  --teal-ink: #20454D;
  --teal-hi: #8DB9BE;        /* Muted ice celadon */

  /* Morandi Contrasting Palette (撞色体系) */
  /* 1. Dusty Terracotta / Clay (陶土灰粉/暖砖红，与青色的经典互补撞色) */
  --morandi-clay: #B66D5B;
  --morandi-clay-soft: #F7EDE9;
  --morandi-clay-border: #E8C8C0;
  --morandi-clay-ink: #7A3C2D;
  --morandi-clay-hi: #DE9B8B;

  /* 2. Warm Mustard / Ochre (灰赭/芥末黄，温暖低彩度提神色) */
  --morandi-ochre: #B08846;
  --morandi-ochre-soft: #F7F1E5;
  --morandi-ochre-border: #E5D5B8;
  --morandi-ochre-ink: #6E511E;
  --morandi-ochre-hi: #D6B272;

  /* 3. Sage Olive Green (鼠尾草灰绿，自然清新认证色) */
  --morandi-sage: #537C6D;
  --morandi-sage-soft: #EAF2EE;
  --morandi-sage-border: #BFD7CC;
  --morandi-sage-ink: #2C4F42;
  --morandi-sage-hi: #82AFA0;

  /* 4. Slate Lavender / Dusty Blue (灰紫粉/岩蓝，优雅科技冷撞色) */
  --morandi-slate: #5C748C;
  --morandi-slate-soft: #EDF2F7;
  --morandi-slate-border: #C8D5E3;
  --morandi-slate-ink: #2F445A;
  --morandi-slate-hi: #93A7BD;

  /* Backward Compatibility Aliases */
  --rose: var(--morandi-clay);
  --rose-soft: var(--morandi-clay-soft);
  --amber: var(--morandi-ochre);
  --amber-soft: var(--morandi-ochre-soft);
  --amber-border: var(--morandi-ochre-border);
  --amber-ink: var(--morandi-ochre-ink);
  --amber-hi: var(--teal-hi);
  --amber-hover: #A0CAD0;

  /* Hero & Dark Elements (Morandi Deep Slate Cyan, NOT pure pitch black) */
  --hero-bg: #1B2B32;        /* Soft dark slate cyan */
  --hero-bg-deep: #16242A;   /* Deeper slate cyan */
  --hero-text: #F0F4F5;
  --hero-muted: #8EACB4;
  --hero-line: rgba(220, 235, 240, 0.14);
  --hero-hi: var(--teal-hi);

  --code-bg: #16242A;
  --code-ink: #E2ECEE;
  --code-dim: #8EACB4;

  /* Typography & Layout Scale (Compact lab-grade) */
  --maxw: 1100px;
  --f-display: "Outfit", "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --f-hero-brand: "Plus Jakarta Sans", "Outfit", -apple-system, sans-serif;
  --f-body: "IBM Plex Sans", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --f-ui: "Plus Jakarta Sans", "IBM Plex Sans", "Noto Sans SC", sans-serif;
  --f-mono: "Fira Code", ui-monospace, monospace;

  --r: 8px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; }
html { scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.65;
  overflow-x: clip;
}

button, input, select, .navbar, table, figcaption, h3, h4, .eyebrow, .btns, .stats, .tab-bar, .pills, .badge, .chip, .small-note, .arch-step-head, .sbs-col-head, .anim-header, .gif-card-head {
  font-family: var(--f-ui);
}
code, pre, .mono, .math-box, .score-pill, .stat-val { font-family: var(--f-mono); }

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; color: var(--ink); line-height: 1.15; letter-spacing: -0.015em; }
h1 { font-family: var(--f-display); font-size: clamp(38px, 4.4vw, 56px); font-weight: 400; color: var(--hero-text); }
h1 em { font-style: italic; color: var(--amber-hi); }
h2 { font-family: var(--f-display); font-size: clamp(28px, 3.2vw, 40px); font-weight: 400; margin-bottom: 12px; }
h3 { font-size: 19px; font-weight: 600; margin-bottom: 8px; }
h4 { font-size: 15px; font-weight: 600; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 64px 0;
  border-top: 1px solid var(--line);
}
section:nth-of-type(even) { background: #FFFFFF; }
section:nth-of-type(odd) { background: var(--bg); }

/* Language Switcher Logic */
html[data-lang="zh"] [lang="en"] { display: none !important; }
html:not([data-lang="zh"]) [lang="zh"] { display: none !important; }
html[data-lang="zh"] h1, html[data-lang="zh"] h2, html[data-lang="zh"] h3 { letter-spacing: 0; }
html[data-lang="zh"] h1 em { font-style: normal; }

/* Sticky Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(27, 43, 50, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hero-line);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--hero-text);
  text-decoration: none;
  flex: none;
}
.brand:hover { text-decoration: none; }
.brand-logo { height: 32px; width: auto; display: block; }
.brand-name {
  font-family: var(--f-display);
  font-size: 26px;
  line-height: 1;
  color: var(--hero-text);
  letter-spacing: 0.01em;
}
.brand-tag {
  font-family: var(--f-mono);
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.42);
  color: var(--amber-hover);
  letter-spacing: 0.04em;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  display: block;
  color: var(--hero-muted);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  padding: 6px 11px;
  border-radius: 6px;
  transition: color 0.18s, background 0.18s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--hero-text);
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}
.lang-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--hero-line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--hero-muted);
  font: 600 12px var(--f-ui);
  cursor: pointer;
  transition: all 0.18s;
}
.lang-btn:hover { color: var(--hero-text); border-color: rgba(255, 255, 255, 0.4); }
html[data-lang="en"] .opt-en, html:not([data-lang="zh"]) .opt-en { color: var(--amber-hi); font-weight: 700; }
html[data-lang="zh"] .opt-zh { color: var(--amber-hi); font-weight: 700; }

/* Hero Section */
.hero {
  position: relative;
  background: var(--ink);
  color: var(--hero-text);
  padding: 56px 0 48px;
  overflow: hidden;
  border-bottom: 1px solid var(--hero-line);
}
.hero-bg {
  position: absolute;
  top: 0;
  right: 0;
  width: 64%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.28;
  mask-image: radial-gradient(ellipse at 70% 50%, black 20%, transparent 80%), linear-gradient(to right, transparent, black 40%);
  -webkit-mask-image: radial-gradient(ellipse at 70% 50%, black 20%, transparent 80%), linear-gradient(to right, transparent, black 40%);
}
.hero-bg video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.hero-video-ctrl {
  position: absolute;
  top: 18px;
  right: 24px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--hero-line);
  background: rgba(22, 36, 42, 0.75);
  backdrop-filter: blur(8px);
  color: var(--hero-muted);
  padding: 5px 12px;
  border-radius: 20px;
  font: 500 12px var(--f-ui);
  cursor: pointer;
  transition: all 0.2s;
}
.hero-video-ctrl:hover { color: var(--hero-text); border-color: rgba(255, 255, 255, 0.4); }
.hero-video-ctrl .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--morandi-sage);
  transition: background 0.2s;
}
.hero-video-ctrl.paused .dot { background: var(--amber-hi); }

.hero-content {
  position: relative;
  z-index: 5;
  max-width: var(--maxw);
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 600 12px var(--f-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber-hover);
  margin-bottom: 18px;
}
.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber-hi);
}
.hero-sub {
  font-size: 18px;
  line-height: 1.65;
  color: var(--hero-muted);
  max-width: 820px;
  margin: 18px 0 28px;
}
.hero-sub strong { color: var(--hero-text); font-weight: 600; }

.authors {
  font-family: var(--f-ui);
  font-size: 16px;
  color: var(--hero-text);
  line-height: 1.8;
  margin-bottom: 28px;
}
.authors strong { font-weight: 600; }
.affils {
  font-size: 13.5px;
  color: var(--hero-muted);
  margin-top: 6px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 48px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 6px;
  font: 600 14px var(--f-ui);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary {
  background: var(--teal);
  color: #FFFFFF;
  border: 1px solid var(--teal-border);
}
.btn-primary:hover { background: var(--teal-ink); text-decoration: none; color: #FFFFFF; }
.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--hero-text);
  border: 1px solid var(--hero-line);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
  text-decoration: none;
  color: var(--hero-text);
}

/* Stats Cards */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--hero-line);
  border-radius: var(--r);
  padding: 20px 22px;
}
.stat-val {
  font-size: 38px;
  font-weight: 700;
  line-height: 1;
  color: var(--amber-hi);
  margin-bottom: 8px;
}
.stat-val .unit { font-size: 20px; font-weight: 400; color: var(--hero-muted); }
.stat-label {
  font-family: var(--f-ui);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--hero-text);
  margin-bottom: 4px;
}
.stat-sub {
  font-family: var(--f-ui);
  font-size: 12px;
  color: var(--hero-muted);
  line-height: 1.4;
}

/* Section Header Typography */
.sec-head {
  margin-bottom: 36px;
}
.sec-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 600 12px var(--f-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 8px;
}
.sec-num {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--teal-soft);
  border: 1px solid var(--teal-border);
  color: var(--teal);
}
.sec-lead {
  font-size: 15px;
  color: var(--muted);
  max-width: 900px;
  line-height: 1.68;
  margin: 0;
}
.sec-lead strong { color: var(--ink); }

/* Principles 3-Grid (Section 01) */
.principles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}
.principle-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--dim);
  border-radius: var(--r);
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
}
.principle-card.p-discrete { border-top-color: var(--rose); }
.principle-card.p-attached { border-top-color: var(--amber); }
.principle-card.p-evlm { border-top-color: var(--teal); background: #FCFDFD; }
.p-badge {
  font: 600 11px var(--f-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.principle-card h3 { font-size: 15px; margin-bottom: 10px; color: var(--ink); }
.principle-card p { font-size: 14.5px; color: var(--muted); line-height: 1.6; margin: 0 0 16px; flex-grow: 1; }
.p-metric {
  font: 600 13px var(--f-mono);
  padding: 6px 10px;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
  align-self: flex-start;
}
.p-evlm .p-metric { background: var(--teal-soft); border-color: var(--teal-border); color: var(--teal); }

/* Figures & Captions */
.fig-frame {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  margin-top: 24px;
}
.fig-img-wrap {
  background: #FFFFFF;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.fig-img-wrap img {
  max-width: 100%;
  height: auto;
  display: block;
}
.fig-caption {
  padding: 14px 20px;
  background: #FAFAFA;
  display: flex;
  gap: 14px;
  align-items: baseline;
}
.fig-tag {
  font: 700 11px var(--f-mono);
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--ink);
  color: #FFFFFF;
  flex: none;
}
.fig-text {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
}
.fig-text strong { color: var(--ink); }

.two-col-figs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 24px;
}

/* Data Tables */
.tbl-wrap {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  overflow: hidden;
}
.tbl-title-bar {
  padding: 12px 18px;
  background: #F8FAFC;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.tbl-title-bar h4 { margin: 0; font-size: 14px; color: var(--ink); }
.tbl-meta { font: 500 11.5px var(--f-mono); color: var(--muted); }
.tbl-scroll { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
}
.data-table th, .data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.data-table th {
  background: #F1F5F9;
  font-family: var(--f-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}
.data-table td.num, .data-table th.num { text-align: right; font-family: var(--f-mono); }
.data-table td.method-name { font-weight: 600; color: var(--ink); white-space: nowrap; }
.data-table tr.row-ours {
  background: var(--morandi-sage-soft);
}
.data-table tr.row-ours td {
  color: var(--morandi-sage-ink);
  font-weight: 600;
  border-bottom: 1.5px solid #86EFAC;
}
.score-pill {
  display: inline-block;
  font: 700 11.5px var(--f-mono);
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--teal-soft);
  border: 1px solid var(--teal-border);
  color: var(--teal);
}

/* Architecture Walkthrough (Section 02) */
.arch-walk {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-top: 28px;
  margin-bottom: 28px;
}
.arch-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.arch-step {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  overflow: hidden;
  transition: all 0.2s;
  cursor: pointer;
}
.arch-step-head {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #FFFFFF;
}
.arch-step-num {
  font: 700 12px var(--f-mono);
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--muted);
}
.arch-step-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.arch-step-body {
  display: none;
  padding: 16px 18px 18px;
  border-top: 1px solid var(--line);
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.6;
}
.arch-step.active {
  border-color: var(--teal);
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.08);
}
.arch-step.active .arch-step-num {
  background: var(--teal-soft);
  border-color: var(--teal-border);
  color: var(--teal);
}
.arch-step.active .arch-step-body {
  display: block;
}
.math-box {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 13px;
  color: var(--ink);
  overflow-x: auto;
}

.arch-visual-panel {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  overflow: hidden;
}
.anim-header {
  padding: 12px 16px;
  background: var(--hero-bg-deep);
  color: #FFFFFF;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.anim-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 600 13px var(--f-ui);
  color: var(--hero-text);
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--morandi-sage);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}
.anim-body {
  background: var(--hero-bg-deep);
  padding: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.anim-body img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
}

/* GIF Summary Banners (Top of Section 03) */
.gif-banner-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}
.gif-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  overflow: hidden;
}
.gif-card-head {
  padding: 12px 16px;
  background: var(--hero-bg-deep);
  color: #FFFFFF;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.gif-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 600 12.5px var(--f-ui);
  color: var(--hero-text);
}
.gif-card img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--hero-bg-deep);
}
.gif-card-foot {
  padding: 12px 16px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
  background: #FFFFFF;
  border-top: 1px solid var(--line);
}
.gif-card-foot strong { color: var(--ink); }

/* Tabbed Demos & Results (Section 03 & 04) */
.tab-bar {
  display: flex;
  gap: 6px;
  border-bottom: 2px solid var(--line-strong);
  margin-bottom: 24px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab-btn {
  border: 0;
  background: none;
  padding: 12px 18px;
  font: 600 14px var(--f-ui);
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
}

.demo-panel, .res-panel {
  display: none;
}
.demo-panel.active, .res-panel.active {
  display: block;
}

/* Playlist + Player Stage */
.demo-stage {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  align-items: start;
}
.playlist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 600px;
  overflow-y: auto;
  padding-right: 4px;
}
.play-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card);
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.18s;
}
.play-item:hover { border-color: var(--dim); }
.play-item.active {
  border-color: var(--teal);
  background: var(--teal-soft);
}
.play-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.play-seq { font: 700 12.5px var(--f-mono); color: var(--ink); }
.play-badge {
  font: 700 10.5px var(--f-mono);
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--morandi-sage-soft);
  color: var(--morandi-sage-ink);
}
.play-desc {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.4;
}

.player-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
}
.player-video-box {
  background: var(--hero-bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
}
.player-video-box video {
  width: 100%;
  height: 100%;
  max-height: 520px;
  object-fit: contain;
  display: block;
}
.player-meta {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.pm-kicker {
  font: 600 11.5px var(--f-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 6px;
}
.pm-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  margin-bottom: 12px;
}
.task-chain-list {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.task-chain-list li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 13.5px;
  color: var(--ink);
}
.tc-step {
  font: 700 11px var(--f-mono);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--teal-soft);
  border: 1px solid var(--teal-border);
  color: var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.pm-footer {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* Side-by-Side Synchronized Player (Tab 3) */
.sbs-stage {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  padding: 20px;
}
.sbs-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.sbs-pill {
  border: 1px solid var(--line-strong);
  background: var(--bg);
  padding: 8px 14px;
  border-radius: 6px;
  font: 600 13px var(--f-ui);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}
.sbs-pill:hover { color: var(--ink); border-color: var(--ink); }
.sbs-pill.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #FFFFFF;
}

.sbs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.sbs-col {
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--hero-bg-deep);
}
.sbs-col-head {
  padding: 10px 14px;
  background: var(--hero-bg);
  color: #FFFFFF;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.sbs-col-title { font-size: 13px; font-weight: 600; }
.sbs-col video {
  width: 100%;
  height: auto;
  display: block;
}
.sbs-caption-bar {
  margin-top: 16px;
  padding: 14px 16px;
  background: #F8FAFC;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--muted);
}
.sbs-caption-bar strong { color: var(--ink); }
.sync-btn {
  border: 1px solid var(--line-strong);
  background: #FFFFFF;
  color: var(--ink);
  padding: 6px 14px;
  border-radius: 4px;
  font: 600 12px var(--f-ui);
  cursor: pointer;
  transition: all 0.18s;
  flex: none;
}
.sync-btn:hover { background: var(--bg); border-color: var(--ink); }

/* Results Section Charts (Section 04) */
.res-overview {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}
.res-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  padding: 24px;
}
.res-card h4 { font-size: 16px; margin-bottom: 6px; }
.res-card-sub { font-size: 13px; color: var(--muted); margin: 0 0 16px; }

/* Audit 3 Pillars (Section 05) */
.audit-pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}
.pillar-card {
  border: 1px solid var(--line);
  border-top: 3px solid var(--teal);
  border-radius: var(--r);
  background: var(--card);
  padding: 24px;
}
.pillar-tag {
  font: 700 11px var(--f-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 12px;
}
.pillar-big {
  font: 700 36px var(--f-mono);
  color: var(--ink);
  margin: 10px 0 14px;
  line-height: 1;
}
.pillar-card h3 { font-size: 16px; margin-bottom: 8px; }
.pillar-card p { font-size: 14px; color: var(--muted); line-height: 1.6; margin: 0; }

/* Code & Citation Cards (Section 06) */
.code-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--code-bg);
  overflow: hidden;
}
.code-card-head {
  padding: 10px 16px;
  background: var(--hero-bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--hero-muted);
  font: 500 12px var(--f-mono);
}
.copy-btn {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: #FFFFFF;
  padding: 3px 10px;
  border-radius: 4px;
  font: 600 11.5px var(--f-ui);
  cursor: pointer;
  transition: all 0.18s;
}
.copy-btn:hover { background: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.4); }
.code-card pre {
  margin: 0;
  padding: 16px 20px;
  font: 13px/1.65 var(--f-mono);
  color: var(--code-ink);
  overflow-x: auto;
}

/* Footer */
footer {
  background: var(--ink);
  color: var(--hero-muted);
  padding: 48px 0;
  border-top: 1px solid var(--hero-line);
  font-size: 14px;
}
footer a { color: var(--hero-text); text-decoration: underline; text-decoration-color: var(--amber-hi); }

/* Responsive Rules */
@media (max-width: 1024px) {
  .principles-grid, .audit-pillars, .arch-walk, .res-overview, .gif-banner-grid, .two-col-figs {
    grid-template-columns: 1fr;
  }
  .demo-stage { grid-template-columns: 1fr; }
  .player-card { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .hero-bg { width: 100%; opacity: 0.2; }
}

@media (max-width: 640px) {
  .sbs-grid { grid-template-columns: 1fr; }
  .brand-tag { display: none; }
  section { padding: 60px 0; }
  .stats { grid-template-columns: 1fr; }
  .nav-links a { padding: 5px 8px; font-size: 12.5px; }
  h1 { font-size: 32px; }
}


/* ============================================================
   Hero Section Morandi Contrasting Colors (首屏莫兰迪撞色定制)
   ============================================================ */
/* Primary CTA button: Refined Slate Teal */
.btn-primary {
  background: var(--teal);
  color: #FFFFFF;
  border: 1px solid var(--teal-border);
}
.btn-primary:hover {
  background: var(--teal-ink);
  color: #FFFFFF;
}

/* GitHub Ghost Button: Muted Ochre warm subtle border */
.btn-github {
  background: rgba(176, 136, 70, 0.1);
  color: #F5E8D0;
  border: 1px solid rgba(176, 136, 70, 0.35);
}
.btn-github:hover {
  background: rgba(176, 136, 70, 0.2);
  border-color: rgba(176, 136, 70, 0.6);
  color: #FFFFFF;
}

/* HF Checkpoint Button: Dusty Terracotta subtle warmth */
.btn-hf {
  background: rgba(182, 109, 91, 0.12);
  color: #F8DFD9;
  border: 1px solid rgba(182, 109, 91, 0.38);
}
.btn-hf:hover {
  background: rgba(182, 109, 91, 0.24);
  border-color: rgba(182, 109, 91, 0.65);
  color: #FFFFFF;
}

/* Interactive Rollout Button: Slate Lavender cool contrast */
.btn-gallery {
  background: rgba(92, 116, 140, 0.15);
  color: #DEE7F0;
  border: 1px solid rgba(92, 116, 140, 0.4);
}
.btn-gallery:hover {
  background: rgba(92, 116, 140, 0.28);
  border-color: rgba(92, 116, 140, 0.7);
  color: #FFFFFF;
}

/* Four Stat Cards: Distinct Morandi Contrasting Accents */
.stat-card {
  position: relative;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--hero-line);
  border-radius: var(--r);
  padding: 16px 18px;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}
.stat-card:hover {
  transform: translateY(-2px);
}

/* Card 1: LIBERO 98.15% - Morandi Celadon / Teal (主色冰青) */
.stat-card.stat-teal {
  border-top: 3px solid var(--teal-hi);
  background: linear-gradient(180deg, rgba(141, 185, 190, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
}
.stat-card.stat-teal .stat-val {
  color: var(--teal-hi);
}

/* Card 2: Robustness 85.9% - Morandi Warm Ochre (温暖芥末灰黄撞色) */
.stat-card.stat-ochre {
  border-top: 3px solid var(--morandi-ochre-hi);
  background: linear-gradient(180deg, rgba(214, 178, 114, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
}
.stat-card.stat-ochre .stat-val {
  color: var(--morandi-ochre-hi);
}

/* Card 3: CALVIN 4.142 - Morandi Dusty Terracotta / Clay (陶土灰粉撞色) */
.stat-card.stat-clay {
  border-top: 3px solid var(--morandi-clay-hi);
  background: linear-gradient(180deg, rgba(222, 155, 139, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
}
.stat-card.stat-clay .stat-val {
  color: var(--morandi-clay-hi);
}

/* Card 4: ASCR 0.21% - Morandi Sage Olive Green (鼠尾草青绿撞色) */
.stat-card.stat-sage {
  border-top: 3px solid var(--morandi-sage-hi);
  background: linear-gradient(180deg, rgba(130, 175, 160, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
}
.stat-card.stat-sage .stat-val {
  color: var(--morandi-sage-hi);
}

/* Stat card values */
.stat-val {
  font-family: var(--f-display);
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}
.stat-val .unit {
  font-size: 16px;
  font-weight: 500;
  opacity: 0.7;
}
.stat-label {
  font-family: var(--f-ui);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--hero-text);
  margin-bottom: 3px;
}
.stat-sub {
  font-family: var(--f-ui);
  font-size: 11.5px;
  color: var(--hero-muted);
  line-height: 1.35;
}

/* Section 1 Principle cards Morandi colors */
.principle-card.p-discrete {
  border-top-color: var(--morandi-clay);
  background: #FCF8F6;
}
.principle-card.p-discrete .p-badge { color: var(--morandi-clay-ink); }
.principle-card.p-discrete .p-metric {
  background: var(--morandi-clay-soft);
  border-color: var(--morandi-clay-border);
  color: var(--morandi-clay-ink);
}

.principle-card.p-attached {
  border-top-color: var(--morandi-ochre);
  background: #FCF9F4;
}
.principle-card.p-attached .p-badge { color: var(--morandi-ochre-ink); }
.principle-card.p-attached .p-metric {
  background: var(--morandi-ochre-soft);
  border-color: var(--morandi-ochre-border);
  color: var(--morandi-ochre-ink);
}

.principle-card.p-evlm {
  border-top-color: var(--teal);
  background: #FAFDFD;
}
.principle-card.p-evlm .p-badge { color: var(--teal-ink); }
.principle-card.p-evlm .p-metric {
  background: var(--teal-soft);
  border-color: var(--teal-border);
  color: var(--teal-ink);
}

/* Section 5 Audit Pillars Morandi Contrast */
.pillar-card:nth-child(1) {
  border-top: 3px solid var(--teal);
}
.pillar-card:nth-child(1) .pillar-tag {
  color: var(--teal);
}
.pillar-card:nth-child(1) .pillar-big {
  color: var(--teal-ink);
}

.pillar-card:nth-child(2) {
  border-top: 3px solid var(--morandi-ochre);
}
.pillar-card:nth-child(2) .pillar-tag {
  color: var(--morandi-ochre-ink);
}
.pillar-card:nth-child(2) .pillar-big {
  color: var(--morandi-ochre-ink);
}

.pillar-card:nth-child(3) {
  border-top: 3px solid var(--morandi-clay);
}
.pillar-card:nth-child(3) .pillar-tag {
  color: var(--morandi-clay-ink);
}
.pillar-card:nth-child(3) .pillar-big {
  color: var(--morandi-clay-ink);
}

/* Score Pills Morandi coloring */
.score-pill.top {
  background: var(--morandi-sage-soft);
  color: var(--morandi-sage-ink);
  border: 1px solid var(--morandi-sage-border);
}
.score-pill.sub {
  background: var(--morandi-ochre-soft);
  color: var(--morandi-ochre-ink);
  border: 1px solid var(--morandi-ochre-border);
}

/* Table ours row */
table.data-table tr.highlight-row, table.data-table tr.row-ours {
  background: var(--teal-soft) !important;
  font-weight: 600;
}
table.data-table tr.highlight-row td, table.data-table tr.row-ours td {
  color: var(--teal-ink);
  border-top: 1px solid var(--teal-border);
  border-bottom: 1px solid var(--teal-border);
}


/* ============================================================
   Section 03: Video Showcase & Card Morandi Refinement
   ============================================================ */

/* Top GIF Summary Cards */
.gif-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(27, 42, 48, 0.04);
  transition: transform 0.2s, box-shadow 0.2s;
}
.gif-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(27, 42, 48, 0.08);
}
.gif-card-head {
  padding: 12px 18px;
  background: linear-gradient(135deg, #1B2B32 0%, #223740 100%);
  color: #FFFFFF;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(220, 235, 240, 0.12);
}
.gif-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 600 13px var(--f-ui);
  color: var(--hero-text);
}
.gif-card-head .score-pill {
  background: rgba(141, 185, 190, 0.18);
  color: #A4D3D8;
  border: 1px solid rgba(141, 185, 190, 0.35);
  font-size: 11px;
}
.gif-card img {
  display: block;
  width: 100%;
  height: auto;
  background: #142026;
}
.gif-card-foot {
  padding: 13px 18px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  background: #F9FCFC;
  border-top: 1px solid var(--line);
}
.gif-card-foot strong {
  color: var(--ink);
}

/* Playlist Items (Left column of Tab 1 & Tab 2) */
.play-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #FCFDFD;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}
.play-item:hover {
  border-color: var(--teal-border);
  background: #F3F7F8;
  transform: translateX(2px);
}
.play-item.active {
  border-color: var(--teal-border);
  border-left: 3px solid var(--teal);
  background: linear-gradient(90deg, var(--teal-soft) 0%, #F5F9FA 100%);
}
.play-seq {
  font: 700 12px var(--f-mono);
  color: var(--ink);
}
.play-badge {
  font: 700 10.5px var(--f-mono);
  padding: 2px 7px;
  border-radius: 3px;
  background: var(--morandi-sage-soft);
  color: var(--morandi-sage-ink);
  border: 1px solid var(--morandi-sage-border);
}
.play-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  margin-top: 3px;
}

/* Player Stage (Right column of Tab 1 & Tab 2) */
.player-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #FCFDFD;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(27, 42, 48, 0.05);
}
.player-video-box {
  background: #142026;
  border-right: 1px solid var(--line);
}
.player-meta {
  padding: 24px;
  background: #FAFDFD;
}
.pm-kicker {
  font: 700 11px var(--f-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 6px;
}
.pm-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  margin-bottom: 12px;
}
.tc-step {
  background: var(--teal-soft);
  border: 1px solid var(--teal-border);
  color: var(--teal);
}
.pm-footer {
  border-top: 1px solid var(--line);
  background: #F3F7F8;
  margin: 20px -24px -24px;
  padding: 12px 24px;
}

/* Side-by-Side (Tab 3) Stage */
.sbs-stage {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #FAFDFD;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(27, 42, 48, 0.04);
}
.sbs-pill {
  border: 1px solid var(--line-strong);
  background: #FFFFFF;
  color: var(--muted);
  font-weight: 600;
}
.sbs-pill:hover {
  border-color: var(--teal);
  color: var(--ink);
}
.sbs-pill.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(54, 106, 117, 0.25);
}

/* SBS Video Cards: Ours (Teal) vs Baseline (Warm Clay) */
.sbs-col.ours {
  border: 1px solid var(--teal-border);
  border-radius: 6px;
  overflow: hidden;
  background: #142026;
  box-shadow: 0 2px 8px rgba(54, 106, 117, 0.1);
}
.sbs-col.ours .sbs-col-head {
  background: linear-gradient(135deg, #1B2B32 0%, #203A42 100%);
  border-bottom: 1px solid rgba(141, 185, 190, 0.2);
}
.sbs-col.ours .sbs-col-title {
  color: #D6ECF0;
  font-weight: 700;
}
.sbs-col.ours .score-pill {
  background: var(--morandi-sage-soft);
  color: var(--morandi-sage-ink);
  border: 1px solid var(--morandi-sage-border);
}

.sbs-col.baseline {
  border: 1px solid var(--morandi-clay-border);
  border-radius: 6px;
  overflow: hidden;
  background: #142026;
  box-shadow: 0 2px 8px rgba(182, 109, 91, 0.1);
}
.sbs-col.baseline .sbs-col-head {
  background: linear-gradient(135deg, #2A1F20 0%, #352526 100%);
  border-bottom: 1px solid rgba(222, 155, 139, 0.2);
}
.sbs-col.baseline .sbs-col-title {
  color: #F8DFD9;
  font-weight: 700;
}
.sbs-col.baseline .score-pill {
  background: var(--morandi-clay-soft);
  color: var(--morandi-clay-ink);
  border: 1px solid var(--morandi-clay-border);
}

.sbs-caption-bar {
  background: #F3F7F8;
  border: 1px solid var(--line);
  color: var(--muted);
}
.sync-btn {
  background: #FFFFFF;
  border: 1px solid var(--line-strong);
  color: var(--teal);
  font-weight: 600;
}
.sync-btn:hover {
  background: var(--teal-soft);
  border-color: var(--teal);
}
