/* ==========================================================================
   栈迹 · STACK TRACE
   视觉方向：暖纸色 + 深墨绿 + 朱砂橙；编辑部式排版与实验室仪表盘结合。
   所有字体使用系统字体，避免联网加载；所有动画在 reduced-motion 下关闭。
   ========================================================================== */

:root {
  --paper: #f2ece0;
  --paper-deep: #e9e1d2;
  --surface: #fbf8f0;
  --surface-strong: #fffdf8;
  --ink: #17211d;
  --ink-soft: #344139;
  --muted: #70786f;
  --muted-light: #92998f;
  --line: #cec5b4;
  --line-strong: #a99f8c;
  --accent: #df5f36;
  --accent-deep: #b94321;
  --accent-soft: #f2c5b2;
  --green: #276b58;
  --green-deep: #194b3d;
  --green-soft: #cbe1d5;
  --amber: #b17a2b;
  --amber-soft: #f1dba9;
  --danger: #b64031;
  --danger-soft: #f3d0c9;
  --white: #fffdf8;
  --shadow-soft: 0 14px 45px rgba(42, 47, 39, 0.08);
  --shadow-card: 0 24px 70px rgba(32, 38, 31, 0.12);
  --mono: "SFMono-Regular", "Cascadia Code", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --sans: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", Georgia, serif;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 7% 2%, rgba(223, 95, 54, 0.11), transparent 30rem),
    radial-gradient(circle at 96% 16%, rgba(39, 107, 88, 0.11), transparent 34rem),
    var(--paper);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(23, 33, 29, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 33, 29, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

::selection {
  color: var(--white);
  background: var(--accent);
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
  width: 1em;
  height: 1em;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.025em;
}

code,
kbd {
  font-family: var(--mono);
}

kbd {
  display: inline-block;
  min-width: 18px;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface-strong);
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}

/* --------------------------------------------------------------------------
   通用排版与按钮
   -------------------------------------------------------------------------- */

.site-shell {
  overflow: clip;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow-line {
  display: block;
  width: 48px;
  height: 1px;
  background: var(--line-strong);
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.text-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 999px;
  font-weight: 650;
  line-height: 1.2;
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease;
}

.primary-btn {
  padding: 14px 21px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--white);
  box-shadow: 0 4px 0 rgba(23, 33, 29, 0.16);
  font-size: 14px;
}

.primary-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 6px 0 rgba(185, 67, 33, 0.18);
}

.primary-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 0 rgba(23, 33, 29, 0.15);
}

.primary-btn svg,
.secondary-btn svg,
.ghost-btn svg,
.text-btn svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.secondary-btn {
  padding: 13px 20px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}

.secondary-btn:hover {
  border-color: var(--ink);
  background: var(--surface-strong);
}

.ghost-btn {
  padding: 10px 15px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--ink-soft);
  font-size: 12px;
}

.ghost-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.text-btn {
  padding: 8px 4px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
}

.text-btn:hover {
  color: var(--accent-deep);
}

.small-text {
  font-size: 12px;
}

.wide-btn {
  width: 100%;
}

.small-btn {
  padding: 11px 16px;
  font-size: 12px;
}

/* --------------------------------------------------------------------------
   顶栏
   -------------------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 32px;
  max-width: 1480px;
  margin: 0 auto;
  padding: 18px 48px;
  border-bottom: 1px solid rgba(169, 159, 140, 0.42);
  background: rgba(242, 236, 224, 0.84);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--surface);
  box-shadow: 0 5px 12px rgba(23, 33, 29, 0.18);
}

.brand-mark svg {
  width: 25px;
  height: 25px;
}

.brand-mark.small {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 253, 248, 0.2);
  box-shadow: none;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1;
}

.brand-copy strong {
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: 0.02em;
}

.brand-copy small {
  margin-top: 5px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 18px;
}

.topnav a {
  position: relative;
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: color 160ms ease, background-color 160ms ease;
}

.topnav a:hover,
.topnav a.is-active {
  color: var(--ink);
  background: rgba(255, 253, 248, 0.72);
}

.topnav a.is-active::after {
  content: "";
  position: absolute;
  bottom: 1px;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(-50%);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
}

.local-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid rgba(39, 107, 88, 0.28);
  border-radius: 999px;
  color: var(--green-deep);
  background: rgba(203, 225, 213, 0.4);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.local-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(39, 107, 88, 0.12);
}

.project-label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
  gap: 52px;
  align-items: center;
  max-width: 1360px;
  margin: 0 auto;
  padding: 86px 48px 78px;
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.hero h1 {
  max-width: 760px;
  margin-bottom: 27px;
  font-size: clamp(48px, 5.5vw, 78px);
  line-height: 1.05;
  letter-spacing: -0.055em;
}

.hero-accent {
  position: relative;
  color: var(--accent-deep);
  font-style: italic;
  white-space: nowrap;
}

.hero-accent::after {
  content: "";
  position: absolute;
  right: 0.02em;
  bottom: 0.02em;
  left: 0.02em;
  height: 0.12em;
  border-radius: 999px;
  background: var(--accent);
  opacity: 0.28;
  transform: rotate(-1.2deg);
}

.hero-underline {
  position: relative;
  white-space: nowrap;
}

.hero-underline::after {
  content: "";
  position: absolute;
  right: -0.06em;
  bottom: -0.03em;
  left: 0;
  height: 7px;
  background:
    linear-gradient(172deg, transparent 45%, var(--accent) 46%, var(--accent) 58%, transparent 59%);
  opacity: 0.75;
}

.lede {
  max-width: 620px;
  margin-bottom: 30px;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.85;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  margin-bottom: 34px;
}

.hero-actions .primary-btn {
  padding: 15px 24px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-tags span {
  padding: 5px 10px;
  border: 1px solid rgba(169, 159, 140, 0.58);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.42);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.hero-art {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 540px;
  isolation: isolate;
}

.hero-grid-line {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: -1;
  width: 470px;
  height: 470px;
  border: 1px solid rgba(169, 159, 140, 0.38);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.hero-grid-line::before,
.hero-grid-line::after {
  content: "";
  position: absolute;
  background: rgba(169, 159, 140, 0.38);
}

.hero-grid-line::before {
  top: 50%;
  left: -48px;
  width: calc(100% + 96px);
  height: 1px;
}

.hero-grid-line::after {
  top: -48px;
  left: 50%;
  width: 1px;
  height: calc(100% + 96px);
}

.specimen {
  position: relative;
  width: min(100%, 368px);
  padding: 17px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.06), transparent 42%),
    var(--ink);
  color: var(--surface);
  box-shadow:
    0 32px 70px rgba(23, 33, 29, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: rotate(-2.5deg);
  animation: specimen-float 7s ease-in-out infinite;
}

.specimen::after {
  content: "";
  position: absolute;
  inset: 8px;
  z-index: -1;
  border: 1px solid rgba(255, 253, 248, 0.08);
  border-radius: 18px;
}

.specimen-top,
.specimen-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(255, 253, 248, 0.58);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.specimen-expression {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 17px 0;
  padding: 13px 12px;
  border: 1px solid rgba(255, 253, 248, 0.1);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.04);
  font-family: var(--mono);
  font-size: 12px;
}

.specimen-expression span {
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(255, 253, 248, 0.06);
}

.specimen-expression .op {
  color: var(--amber-soft);
}

.specimen-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 14px;
}

.specimen-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px;
  border: 1px solid rgba(255, 253, 248, 0.08);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.13);
}

.specimen-cell {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  min-height: 54px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 253, 248, 0.11);
  border-radius: 9px;
  background: rgba(255, 253, 248, 0.055);
}

.specimen-cell small {
  color: rgba(255, 253, 248, 0.44);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.specimen-cell b {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 500;
}

.specimen-cell span {
  color: rgba(255, 253, 248, 0.32);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.specimen-cell.is-hot {
  border-color: rgba(241, 219, 169, 0.6);
  background: var(--amber-soft);
  color: var(--ink);
  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.18);
}

.specimen-cell.is-hot small,
.specimen-cell.is-hot span {
  color: rgba(23, 33, 29, 0.58);
}

.specimen-aside {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px 0;
}

.aside-label {
  color: rgba(255, 253, 248, 0.44);
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.7;
}

.aside-arrow {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 26px;
  line-height: 1;
}

.aside-note {
  color: rgba(255, 253, 248, 0.42);
  font-size: 8px;
  line-height: 1.7;
}

.specimen-foot {
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid rgba(255, 253, 248, 0.1);
}

.specimen-foot span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--green-soft);
}

.specimen-foot i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green-soft);
  box-shadow: 0 0 0 3px rgba(203, 225, 213, 0.12);
}

.hero-stamp {
  position: absolute;
  top: 6%;
  right: 2%;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 92px;
  height: 92px;
  padding: 12px;
  border: 1px solid rgba(185, 67, 33, 0.5);
  border-radius: 50%;
  color: var(--accent-deep);
  background: rgba(242, 236, 224, 0.7);
  transform: rotate(9deg);
  animation: stamp-float 8s ease-in-out infinite;
}

.hero-stamp span {
  font-family: var(--serif);
  font-size: 34px;
  line-height: 1;
}

.hero-stamp small {
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.6;
}

.floating-note {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: var(--shadow-soft);
  font-family: var(--mono);
  animation: note-float 6s ease-in-out infinite;
}

.floating-note b {
  color: var(--accent-deep);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.floating-note span {
  color: var(--muted);
  font-size: 8px;
}

.note-a {
  top: 18%;
  left: 0;
  transform: rotate(-4deg);
}

.note-b {
  right: 0;
  bottom: 16%;
  transform: rotate(3deg);
  animation-delay: -2.4s;
}

/* --------------------------------------------------------------------------
   流程条
   -------------------------------------------------------------------------- */

.route-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 17px 30px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.route-step {
  display: flex;
  align-items: center;
  gap: 11px;
}

.route-step > span {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
}

.route-step div {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.route-step strong {
  font-size: 12px;
}

.route-step small {
  color: var(--muted);
  font-size: 10px;
}

.route-arrow {
  color: var(--line-strong);
  font-family: var(--mono);
  font-style: normal;
  font-size: 15px;
}

/* --------------------------------------------------------------------------
   实验台
   -------------------------------------------------------------------------- */

.workbench-section {
  max-width: 1440px;
  margin: 0 auto;
  padding: 76px 48px 50px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 24px;
}

.section-heading .eyebrow {
  margin-bottom: 10px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(36px, 3.6vw, 52px);
  letter-spacing: -0.045em;
}

.section-heading > p {
  max-width: 310px;
  margin: 0 0 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: right;
  text-transform: uppercase;
}

.workbench-grid {
  display: grid;
  grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.control-panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(251, 248, 240, 0.88);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}

.panel-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 22px;
}

.panel-number {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
}

.panel-title h3 {
  margin: -2px 0 2px;
  font-size: 21px;
}

.panel-title p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 17px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-deep);
}

.mode-tab {
  padding: 8px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.mode-tab.is-active {
  background: var(--surface-strong);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(42, 47, 39, 0.09);
}

.expression-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.expression-shell:focus-within {
  border-color: var(--ink-soft);
  box-shadow:
    0 0 0 3px rgba(39, 107, 88, 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.expression-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px 0;
}

.expression-label-row label {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.expression-label-row span {
  color: var(--muted-light);
  font-size: 9px;
}

.expression-editor {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 6px;
  padding: 9px 13px 4px;
}

.expression-prompt {
  display: grid;
  place-items: center;
  align-self: start;
  width: 27px;
  height: 27px;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent-deep);
  background: rgba(242, 197, 178, 0.22);
  font-family: var(--serif);
  font-size: 13px;
  font-style: italic;
}

#expression {
  width: 100%;
  min-height: 104px;
  padding: 3px 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 21px;
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: -0.02em;
  resize: vertical;
}

#expression::placeholder {
  color: var(--muted-light);
}

.expression-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  border-top: 1px solid rgba(206, 197, 180, 0.55);
  color: var(--muted);
  font-size: 9px;
}

.expression-status > span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.expression-status b {
  color: var(--muted-light);
  font-weight: 500;
}

.example-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 11px;
}

.example-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(233, 225, 210, 0.58);
  text-align: left;
  transition: border-color 150ms ease, background-color 150ms ease, transform 150ms ease;
}

.example-chip:hover {
  border-color: var(--line-strong);
  background: var(--surface-strong);
  transform: translateY(-1px);
}

.example-chip code {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.example-chip span {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 5px;
  margin-top: 9px;
}

.keypad button {
  display: grid;
  place-items: center;
  min-width: 0;
  height: 31px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

.keypad button:hover {
  border-color: var(--ink-soft);
  background: var(--ink);
  color: var(--surface);
}

.keypad-functions {
  grid-template-columns: repeat(6, 1fr);
  margin-top: 5px;
}

.keypad-functions button {
  font-family: var(--sans);
  font-size: 10px;
}

#batch-pane {
  margin-bottom: 4px;
}

.batch-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

#batch-input {
  width: 100%;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  outline: none;
  background: var(--surface-strong);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.75;
  resize: vertical;
}

#batch-input:focus {
  border-color: var(--ink-soft);
  box-shadow: 0 0 0 3px rgba(39, 107, 88, 0.11);
}

.batch-file-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 8px;
}

#batch-file-name {
  overflow: hidden;
  flex: 1;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-file-row .small-text {
  margin-left: auto;
  white-space: nowrap;
}

.options-block {
  margin-top: 18px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.option-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.option-hint {
  color: var(--muted-light);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.algorithm-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-bottom: 13px;
}

.algorithm-option {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-strong);
  text-align: left;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

.algorithm-option:hover {
  border-color: var(--line-strong);
}

.algorithm-option.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface);
}

.algorithm-index {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.algorithm-option.is-active .algorithm-index {
  color: var(--accent-soft);
}

.algorithm-option strong {
  font-size: 12px;
  font-weight: 650;
}

.algorithm-option small {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.algorithm-option.is-active small {
  color: rgba(255, 253, 248, 0.56);
}

.toggle-row,
.select-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-top: 1px solid rgba(206, 197, 180, 0.55);
}

.toggle-row {
  cursor: pointer;
}

.toggle-copy,
.select-row > span {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.toggle-copy strong,
.select-row strong {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
}

.toggle-copy small,
.select-row small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.switch {
  position: relative;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-track {
  display: block;
  width: 42px;
  height: 24px;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--paper-deep);
  transition: background-color 180ms ease, border-color 180ms ease;
}

.switch-track i {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface-strong);
  box-shadow: 0 1px 3px rgba(23, 33, 29, 0.2);
  transition: transform 180ms ease;
}

.switch input:checked + .switch-track {
  border-color: var(--green);
  background: var(--green);
}

.switch input:checked + .switch-track i {
  transform: translateX(18px);
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.select-row select {
  max-width: 148px;
  padding: 7px 24px 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: var(--surface-strong);
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
}

.select-row select:focus {
  border-color: var(--ink-soft);
}

.action-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 17px;
}

.action-stack .primary-btn {
  padding: 14px 20px;
}

.import-line {
  display: flex;
  justify-content: center;
}

.import-line .text-btn {
  color: var(--muted);
  font-size: 10px;
}

.panel-note {
  margin: 15px 0 0;
  padding-top: 13px;
  border-top: 1px dashed var(--line);
  color: var(--muted-light);
  font-size: 9px;
  line-height: 1.6;
  text-align: center;
}

/* --------------------------------------------------------------------------
   舞台外框
   -------------------------------------------------------------------------- */

.stage-panel {
  position: relative;
  min-height: 760px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  outline: none;
  background:
    radial-gradient(circle at 100% 0%, rgba(241, 219, 169, 0.22), transparent 25rem),
    var(--surface);
  box-shadow: var(--shadow-card);
  transition: box-shadow 200ms ease;
}

.stage-panel:focus-visible {
  box-shadow:
    0 0 0 4px rgba(223, 95, 54, 0.2),
    var(--shadow-card);
}

.stage-loading {
  display: grid;
  place-items: center;
  min-height: 640px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

/* 空态 */

.stage-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 700px;
  padding: 40px 24px;
  text-align: center;
}

.empty-illustration {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 218px;
  margin-bottom: 32px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: rgba(255, 253, 248, 0.65);
  box-shadow: var(--shadow-soft);
  transform: rotate(-2deg);
}

.empty-stack-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.empty-stack-row span,
.empty-stack-row i {
  color: var(--muted-light);
  font-family: var(--mono);
  font-size: 8px;
  font-style: normal;
  letter-spacing: 0.08em;
}

.empty-stack-row b {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
}

.empty-stack-row:first-child {
  border-color: var(--accent);
  background: rgba(242, 197, 178, 0.35);
}

.empty-stack-row:first-child b {
  color: var(--accent-deep);
}

.empty-cursor {
  position: absolute;
  right: -22px;
  top: 30px;
  width: 13px;
  height: 13px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
  animation: cursor-nudge 2.2s ease-in-out infinite;
}

.stage-empty h2 {
  margin-bottom: 14px;
  font-size: clamp(32px, 3.4vw, 46px);
  letter-spacing: -0.045em;
}

.empty-description {
  max-width: 460px;
  margin-bottom: 25px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.empty-tips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
}

.empty-tips span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.55);
  font-size: 10px;
}

.empty-tips b {
  color: var(--accent-deep);
  font-family: var(--mono);
  font-size: 8px;
}

/* 舞台头部 */

.stage-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 19px;
}

.stage-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.live-dot,
.instant-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(39, 107, 88, 0.12);
}

.live-dot {
  animation: soft-pulse 1.8s ease-in-out infinite;
}

.instant-dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(223, 95, 54, 0.12);
}

.stage-head h2 {
  margin: 0;
  font-size: clamp(27px, 2.8vw, 37px);
  letter-spacing: -0.045em;
}

.stage-result-pill {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex: 0 0 auto;
  min-width: 135px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-strong);
  box-shadow: 0 5px 14px rgba(42, 47, 39, 0.05);
}

.stage-result-pill span {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.06em;
}

.stage-result-pill strong {
  max-width: 220px;
  overflow: hidden;
  color: var(--green-deep);
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-result-pill small {
  max-width: 200px;
  overflow: hidden;
  color: var(--muted-light);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 方案切换与对比 */

.run-switch {
  display: flex;
  align-items: stretch;
  gap: 5px;
  margin-bottom: 10px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper-deep);
}

.run-switch-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.run-switch-btn:hover {
  color: var(--ink);
}

.run-switch-btn.is-active {
  background: var(--surface-strong);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(42, 47, 39, 0.08);
}

.run-switch-index {
  color: var(--muted-light);
  font-family: var(--mono);
  font-size: 8px;
}

.run-switch-btn.is-active .run-switch-index {
  color: var(--accent-deep);
}

.run-switch-btn span:last-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.run-switch-btn strong {
  font-size: 11px;
}

.run-switch-btn small {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.run-switch-status {
  display: inline-flex;
  align-items: center;
  align-self: center;
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  white-space: nowrap;
}

.run-switch-status.is-ok {
  color: var(--green-deep);
  background: var(--green-soft);
}

.run-switch-status.is-bad {
  color: var(--danger);
  background: var(--danger-soft);
}

.comparison-strip {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 14px;
  padding: 10px 13px;
  border: 1px solid;
  border-radius: 12px;
}

.comparison-strip.is-ok {
  border-color: rgba(39, 107, 88, 0.3);
  background: rgba(203, 225, 213, 0.35);
}

.comparison-strip.is-bad {
  border-color: rgba(182, 64, 49, 0.38);
  background: rgba(243, 208, 201, 0.4);
}

.comparison-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.7);
  color: var(--green-deep);
}

.comparison-strip.is-bad .comparison-icon {
  color: var(--danger);
}

.comparison-icon svg {
  width: 16px;
  height: 16px;
}

.comparison-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.comparison-copy strong {
  color: var(--green-deep);
  font-size: 11px;
  font-weight: 650;
}

.comparison-strip.is-bad .comparison-copy strong {
  color: var(--danger);
}

.comparison-copy span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}

/* 阶段标签 */

.phase-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 13px;
}

.phase-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  text-align: left;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.phase-tab:hover {
  border-color: var(--line-strong);
  background: rgba(255, 253, 248, 0.6);
}

.phase-tab.is-active {
  border-color: var(--ink-soft);
  background: var(--surface-strong);
  box-shadow: 0 2px 7px rgba(42, 47, 39, 0.06);
}

.phase-index {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 700;
}

.phase-tab.is-active .phase-index {
  border-color: var(--accent);
  color: var(--accent-deep);
}

.phase-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.phase-copy strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phase-copy small {
  color: var(--muted);
  font-size: 8px;
}

/* 扫描轨道 */

.scan-panel {
  margin-bottom: 13px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 253, 248, 0.68);
}

.scan-head,
.scan-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 9px;
}

.scan-head {
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.scan-head > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.scan-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.scan-count {
  color: var(--muted-light);
  letter-spacing: 0.02em;
}

.token-rail {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 2px 0 5px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.token-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-strong);
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 10px;
  white-space: nowrap;
  transition: opacity 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

.token-chip i {
  color: var(--muted-light);
  font-size: 7px;
  font-style: normal;
}

.token-chip.is-done {
  opacity: 0.42;
}

.token-chip.is-future {
  opacity: 0.72;
}

.token-chip.is-active {
  border-color: var(--accent);
  background: rgba(242, 197, 178, 0.38);
  color: var(--accent-deep);
  box-shadow: 0 0 0 2px rgba(223, 95, 54, 0.1);
  opacity: 1;
}

.scan-foot {
  margin-top: 4px;
  font-size: 8px;
}

.scan-foot span:last-child {
  overflow: hidden;
  max-width: 48%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.token-rail-empty {
  color: var(--muted-light);
  font-size: 10px;
}

/* --------------------------------------------------------------------------
   栈可视化
   -------------------------------------------------------------------------- */

.arena {
  display: grid;
  gap: 10px;
  margin-bottom: 13px;
}

.arena.is-single {
  grid-template-columns: minmax(0, 1fr);
}

.arena.is-pair {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.arena.is-triple {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stack-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 315px;
  padding: 15px;
  border: 1px solid rgba(255, 253, 248, 0.09);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.05), transparent 45%),
    var(--ink);
  color: var(--surface);
  box-shadow: 0 12px 28px rgba(23, 33, 29, 0.16);
  transition: box-shadow 200ms ease, border-color 200ms ease;
}

.stack-card.is-active {
  border-color: rgba(241, 219, 169, 0.45);
  box-shadow:
    0 0 0 2px rgba(223, 95, 54, 0.1),
    0 14px 32px rgba(23, 33, 29, 0.2);
}

.stack-green.is-active {
  border-color: rgba(203, 225, 213, 0.55);
}

.stack-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}

.stack-kicker {
  display: block;
  margin-bottom: 4px;
  color: rgba(255, 253, 248, 0.42);
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.stack-head h3,
.output-head h3,
.context-head h3 {
  margin: 0;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0;
}

.stack-amber .stack-head h3 {
  color: var(--amber-soft);
}

.stack-green .stack-head h3 {
  color: var(--green-soft);
}

.stack-count {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  color: var(--surface);
  font-family: var(--mono);
  font-size: 17px;
  line-height: 1;
}

.stack-count small {
  color: rgba(255, 253, 248, 0.4);
  font-size: 8px;
}

.stack-well {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 5px;
  max-height: 266px;
  min-height: 190px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid rgba(255, 253, 248, 0.08);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.14);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 253, 248, 0.24) transparent;
}

.stack-cell {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 43px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 253, 248, 0.1);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.045);
  animation: cell-enter 260ms ease both;
  animation-delay: calc(var(--i) * 18ms);
}

.stack-cell.is-top {
  border-color: rgba(255, 253, 248, 0.26);
  background: rgba(255, 253, 248, 0.09);
}

.stack-amber .stack-cell.is-top {
  border-color: rgba(241, 219, 169, 0.55);
  background: rgba(241, 219, 169, 0.14);
}

.stack-green .stack-cell.is-top {
  border-color: rgba(203, 225, 213, 0.55);
  background: rgba(203, 225, 213, 0.13);
}

.stack-cell.is-fresh {
  animation:
    cell-enter 260ms ease both,
    cell-pop 420ms ease 80ms;
}

.cell-level {
  color: rgba(255, 253, 248, 0.34);
  font-family: var(--mono);
  font-size: 8px;
}

.cell-value {
  overflow: hidden;
  font-family: var(--mono);
  font-size: clamp(15px, 1.8vw, 21px);
  font-weight: 500;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stack-amber .cell-value {
  color: var(--amber-soft);
}

.stack-green .cell-value {
  color: var(--green-soft);
}

.cell-top {
  color: rgba(255, 253, 248, 0.46);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.stack-empty {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 165px;
  border: 1px dashed rgba(255, 253, 248, 0.13);
  border-radius: 8px;
  color: rgba(255, 253, 248, 0.27);
}

.stack-empty span {
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.08em;
}

.stack-empty small {
  font-size: 8px;
}

.stack-base,
.output-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  color: rgba(255, 253, 248, 0.33);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.stack-base-line {
  flex: 1;
  height: 1px;
  background: rgba(255, 253, 248, 0.12);
}

.stack-base span:last-child {
  color: rgba(203, 225, 213, 0.55);
}

/* 后缀输出 / 固定后缀 */

.output-card,
.context-card {
  display: flex;
  flex-direction: column;
  min-height: 315px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(241, 219, 169, 0.27);
}

.output-head,
.context-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 11px;
}

.output-card .stack-kicker,
.context-card .stack-kicker {
  color: var(--amber);
}

.output-head h3,
.context-head h3 {
  color: var(--ink);
}

.output-status {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
}

.output-well {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 5px;
  min-height: 190px;
  padding: 10px;
  border: 1px solid rgba(169, 159, 140, 0.42);
  border-radius: 11px;
  background: rgba(255, 253, 248, 0.52);
}

.output-token {
  display: inline-flex;
  align-items: center;
  height: 27px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-strong);
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 11px;
}

.output-token.is-fresh {
  border-color: var(--accent);
  background: rgba(242, 197, 178, 0.42);
  color: var(--accent-deep);
  animation: token-pop 340ms ease;
}

.output-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 168px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
  text-align: center;
}

.output-foot {
  justify-content: space-between;
  color: var(--muted);
}

.context-card {
  background: rgba(203, 225, 213, 0.24);
}

.context-card .stack-kicker {
  color: var(--green);
}

.context-tokens {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 5px;
  padding: 10px;
  border: 1px solid rgba(39, 107, 88, 0.22);
  border-radius: 11px;
  background: rgba(255, 253, 248, 0.45);
}

.context-token {
  display: inline-flex;
  align-items: center;
  height: 25px;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 10px;
}

.context-token.is-active {
  border-color: var(--accent);
  background: rgba(242, 197, 178, 0.5);
  color: var(--accent-deep);
}

.context-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.65;
}

/* --------------------------------------------------------------------------
   讲解 / 控制 / 底部
   -------------------------------------------------------------------------- */

.narration {
  position: relative;
  margin-bottom: 13px;
  padding: 14px 16px 14px 18px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0 13px 13px 0;
  background: var(--surface-strong);
}

.narration-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.action-badge {
  display: inline-flex;
  align-items: center;
  height: 19px;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--paper-deep);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.action-badge.action-push,
.action-badge.action-output {
  background: rgba(203, 225, 213, 0.7);
  color: var(--green-deep);
}

.action-badge.action-pop {
  background: rgba(243, 208, 201, 0.7);
  color: var(--danger);
}

.action-badge.action-calc {
  background: rgba(241, 219, 169, 0.75);
  color: #74501c;
}

.action-badge.action-done {
  background: var(--ink);
  color: var(--surface);
}

.narration-step {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.06em;
}

.narration-phase {
  color: var(--muted-light);
  font-size: 8px;
}

.narration h3 {
  margin: 0 0 4px;
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.narration p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.75;
}

.transport {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr);
  gap: 11px 16px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.65);
}

.transport-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

.icon-btn svg {
  width: 15px;
  height: 15px;
}

.icon-btn:hover:not(:disabled) {
  border-color: var(--line);
  background: var(--surface-strong);
  color: var(--ink);
}

.icon-btn:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.play-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 35px;
  padding: 0 12px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--surface);
  font-size: 10px;
  font-weight: 650;
  transition: background-color 160ms ease, transform 160ms ease;
}

.play-btn:hover {
  transform: translateY(-1px);
  background: var(--accent);
  border-color: var(--accent);
}

.play-btn svg {
  width: 15px;
  height: 15px;
}

.play-btn.is-playing {
  background: var(--accent);
  border-color: var(--accent);
}

.transport-tools {
  display: flex;
  justify-content: flex-end;
}

.speed-control {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 8px;
}

.speed-control select {
  padding: 4px 18px 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  background: var(--surface-strong);
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 9px;
}

.progress-block {
  grid-column: 1 / -1;
}

.step-range {
  width: 100%;
  height: 4px;
  margin: 0;
  border-radius: 999px;
  outline: none;
  appearance: none;
  background: linear-gradient(
    90deg,
    var(--accent) 0 var(--progress),
    var(--paper-deep) var(--progress) 100%
  );
  cursor: pointer;
}

.step-range::-webkit-slider-thumb {
  width: 13px;
  height: 13px;
  border: 2px solid var(--surface-strong);
  border-radius: 50%;
  appearance: none;
  background: var(--accent);
  box-shadow: 0 1px 4px rgba(23, 33, 29, 0.25);
}

.step-range::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border: 2px solid var(--surface-strong);
  border-radius: 50%;
  background: var(--accent);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  color: var(--muted-light);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.04em;
}

.stage-foot {
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.standard-output {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
}

.standard-line {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 7px 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: rgba(233, 225, 210, 0.34);
}

.standard-line span {
  flex: 0 0 auto;
  padding-top: 2px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.standard-line code {
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.65;
}

.standard-line strong {
  color: var(--green-deep);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.postfix-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 9px;
  padding: 8px 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: rgba(233, 225, 210, 0.34);
}

.postfix-line span {
  flex: 0 0 auto;
  padding-top: 2px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.06em;
}

.postfix-line code {
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.65;
}

.postfix-line.is-muted code {
  color: var(--muted-light);
  font-family: var(--sans);
}

.stage-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.stage-meta span,
.instant-foot span {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.5);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.03em;
}

.stage-note {
  margin: 9px 0 0;
  color: var(--muted-light);
  font-size: 9px;
  line-height: 1.6;
}

.stage-note code {
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   即时结果
   -------------------------------------------------------------------------- */

.instant-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 13px;
}

.instant-grid.is-dual {
  grid-template-columns: 1fr 1fr;
}

.instant-card {
  display: flex;
  flex-direction: column;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface-strong);
}

.instant-card.accent-amber {
  border-top: 3px solid var(--amber);
}

.instant-card.accent-green {
  border-top: 3px solid var(--green);
}

.instant-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
}

.instant-index {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
}

.instant-card-head h3 {
  margin: 0 0 3px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
}

.instant-card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.instant-result {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.instant-result span {
  color: var(--muted);
  font-size: 9px;
}

.instant-result strong {
  overflow-wrap: anywhere;
  color: var(--green-deep);
  font-family: var(--mono);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 500;
  line-height: 1.2;
}

.accent-amber .instant-result strong {
  color: var(--accent-deep);
}

.instant-postfix {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}

.instant-postfix span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.06em;
}

.instant-postfix code {
  overflow-wrap: anywhere;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.6;
}

.instant-postfix.is-muted code {
  color: var(--muted-light);
  font-family: var(--sans);
}

.instant-card-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: auto;
  color: var(--muted-light);
  font-family: var(--mono);
  font-size: 7px;
}

.visualizer-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 13px;
  padding: 13px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 13px;
  background: rgba(233, 225, 210, 0.38);
}

.visualizer-callout > div {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.callout-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--green);
}

.callout-icon svg {
  width: 16px;
  height: 16px;
}

.visualizer-callout strong {
  display: block;
  margin-bottom: 1px;
  font-size: 11px;
}

.visualizer-callout p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}

.instant-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* --------------------------------------------------------------------------
   错误态
   -------------------------------------------------------------------------- */

.error-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 700px;
  max-width: 740px;
  margin: 0 auto;
  padding: 30px 20px;
}

.error-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
  border: 1px solid rgba(182, 64, 49, 0.3);
  border-radius: 12px;
  background: var(--danger-soft);
  color: var(--danger);
}

.error-icon svg {
  width: 22px;
  height: 22px;
}

.error-stage .eyebrow {
  color: var(--danger);
  margin-bottom: 12px;
}

.error-type {
  margin-bottom: 10px;
  padding: 4px 8px;
  border: 1px solid rgba(182, 64, 49, 0.28);
  border-radius: 4px;
  color: var(--danger);
  background: rgba(243, 208, 201, 0.45);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.error-stage h2 {
  margin-bottom: 7px;
  font-size: clamp(30px, 3.4vw, 42px);
}

.error-message {
  margin-bottom: 18px;
  color: var(--ink-soft);
  font-size: 15px;
}

.code-frame {
  display: flex;
  align-items: stretch;
  width: 100%;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--ink);
  color: var(--surface);
  overflow: hidden;
}

.code-line {
  flex: 0 0 auto;
  padding: 13px 10px;
  border-right: 1px solid rgba(255, 253, 248, 0.1);
  color: rgba(255, 253, 248, 0.28);
  font-family: var(--mono);
  font-size: 10px;
}

.code-frame code {
  overflow-x: auto;
  padding: 13px;
  color: var(--green-soft);
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.code-frame mark {
  padding: 1px 2px;
  border-radius: 3px;
  background: var(--accent);
  color: var(--white);
}

.error-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  width: 100%;
  margin-bottom: 15px;
}

.error-facts div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.55);
}

.error-facts span {
  display: block;
  margin-bottom: 2px;
  color: var(--muted-light);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.05em;
}

.error-facts strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.5;
}

.error-hint {
  width: 100%;
  margin: 0 0 17px;
  padding: 10px 12px;
  border-left: 2px solid var(--amber);
  background: rgba(241, 219, 169, 0.3);
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.7;
}

.error-hint b {
  color: #74501c;
}

.error-retry {
  align-self: flex-start;
}

/* --------------------------------------------------------------------------
   批量结果
   -------------------------------------------------------------------------- */

.batch-empty {
  min-height: 680px;
}

.batch-empty-icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-strong);
  color: var(--green);
  box-shadow: var(--shadow-soft);
}

.batch-empty-icon svg {
  width: 30px;
  height: 30px;
}

.batch-head {
  align-items: center;
}

.batch-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-bottom: 11px;
}

.batch-stats div {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-strong);
}

.batch-stats span {
  display: block;
  color: var(--muted);
  font-size: 8px;
}

.batch-stats strong {
  display: block;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.3;
}

.batch-stats .is-ok strong {
  color: var(--green-deep);
}

.batch-stats .is-bad strong {
  color: var(--danger);
}

.batch-summary-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.batch-summary-line span {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
}

.batch-summary-line .warn-text {
  border-color: rgba(182, 64, 49, 0.3);
  color: var(--danger);
}

.batch-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
}

.batch-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.batch-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-deep);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
}

.batch-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(206, 197, 180, 0.5);
  vertical-align: top;
}

.batch-table tr:last-child td {
  border-bottom: 0;
}

.batch-table tbody tr:hover {
  background: rgba(233, 225, 210, 0.28);
}

.batch-table tr.row-error {
  background: rgba(243, 208, 201, 0.18);
}

.row-line {
  width: 36px;
  color: var(--muted-light);
  font-family: var(--mono);
  font-size: 8px;
}

.row-expression {
  max-width: 280px;
}

.row-expression code {
  display: block;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-size: 10px;
}

.row-error-detail {
  display: block;
  margin-top: 3px;
  color: var(--danger);
  font-size: 8px;
  line-height: 1.5;
}

.row-result code {
  color: var(--green-deep);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  height: 19px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 8px;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge.is-ok {
  background: var(--green-soft);
  color: var(--green-deep);
}

.status-badge.is-bad {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-badge.is-warn {
  background: var(--amber-soft);
  color: #74501c;
}

.table-action {
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 8px;
  white-space: nowrap;
}

.table-action:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.table-more,
.batch-note {
  padding: 8px 10px;
  font-size: 9px;
}

/* --------------------------------------------------------------------------
   方法 / 关于 / 页脚
   -------------------------------------------------------------------------- */

.methods-section {
  max-width: 1440px;
  margin: 0 auto;
  padding: 58px 48px 68px;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.method-card {
  position: relative;
  min-height: 270px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(251, 248, 240, 0.78);
  box-shadow: 0 10px 30px rgba(42, 47, 39, 0.04);
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.method-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-soft);
}

.method-index {
  position: absolute;
  top: 18px;
  right: 20px;
  color: var(--muted-light);
  font-family: var(--mono);
  font-size: 9px;
}

.method-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-strong);
  color: var(--green);
}

.method-icon svg {
  width: 21px;
  height: 21px;
}

.method-card h3 {
  margin-bottom: 9px;
  font-size: 23px;
}

.method-card p {
  max-width: 350px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}

.method-card > small {
  display: block;
  margin-top: 18px;
  color: var(--muted-light);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.05em;
}

.mini-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.mini-flow span {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 8px;
}

.mini-flow i {
  color: var(--line-strong);
  font-family: var(--mono);
  font-size: 9px;
  font-style: normal;
}

.method-card-accent {
  border-color: transparent;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.04), transparent 45%),
    var(--ink);
  color: var(--surface);
}

.method-card-accent .method-icon {
  border-color: rgba(255, 253, 248, 0.16);
  background: rgba(255, 253, 248, 0.06);
  color: var(--amber-soft);
}

.method-card-accent p {
  color: rgba(255, 253, 248, 0.62);
}

.method-card-accent > small {
  color: rgba(255, 253, 248, 0.36);
}

.feature-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.feature-pills span {
  padding: 4px 8px;
  border: 1px solid rgba(255, 253, 248, 0.16);
  border-radius: 999px;
  color: var(--green-soft);
  font-size: 8px;
}

.about-section {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 60px;
  align-items: center;
  max-width: 1344px;
  margin: 0 auto 66px;
  padding: 52px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 90% 10%, rgba(223, 95, 54, 0.18), transparent 24rem),
    var(--ink);
  color: var(--surface);
}

.about-copy .eyebrow {
  color: rgba(255, 253, 248, 0.4);
}

.about-copy h2 {
  margin-bottom: 19px;
  font-size: clamp(34px, 4vw, 52px);
  letter-spacing: -0.045em;
}

.about-copy > p {
  max-width: 620px;
  margin-bottom: 23px;
  color: rgba(255, 253, 248, 0.62);
  font-size: 13px;
  line-height: 1.85;
}

.about-points {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.about-points span {
  padding: 6px 9px;
  border: 1px solid rgba(255, 253, 248, 0.14);
  border-radius: 5px;
  color: rgba(255, 253, 248, 0.62);
  font-size: 9px;
}

.about-points b {
  margin-right: 4px;
  color: var(--amber-soft);
  font-family: var(--mono);
  font-size: 7px;
}

.about-note {
  position: relative;
  padding: 26px 24px 23px;
  border: 1px solid rgba(255, 253, 248, 0.13);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.045);
}

.note-mark {
  position: absolute;
  top: 4px;
  left: 16px;
  color: var(--accent);
  font-family: var(--serif);
  font-size: 60px;
  line-height: 1;
  opacity: 0.65;
}

.about-note p {
  position: relative;
  margin: 19px 0 22px;
  color: var(--green-soft);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.85;
}

.note-sign {
  color: rgba(255, 253, 248, 0.32);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.site-footer {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 25px 48px 34px;
  border-top: 1px solid var(--line);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-brand > div {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.footer-brand strong {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.footer-brand small {
  color: var(--muted);
  font-size: 8px;
}

.site-footer p {
  margin: 0 auto 0 0;
  color: var(--muted);
  font-size: 9px;
}

.footer-year {
  color: var(--muted-light);
  font-family: var(--mono);
  font-size: 8px;
}

/* Toast */

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  max-width: min(360px, calc(100vw - 48px));
  padding: 11px 15px;
  border: 1px solid rgba(255, 253, 248, 0.12);
  border-radius: 10px;
  background: var(--ink);
  color: var(--surface);
  box-shadow: 0 12px 34px rgba(23, 33, 29, 0.25);
  font-size: 11px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   动画
   -------------------------------------------------------------------------- */

@keyframes specimen-float {
  0%,
  100% {
    transform: rotate(-2.5deg) translateY(0);
  }
  50% {
    transform: rotate(-1.2deg) translateY(-9px);
  }
}

@keyframes stamp-float {
  0%,
  100% {
    transform: rotate(9deg) translateY(0);
  }
  50% {
    transform: rotate(6deg) translateY(-6px);
  }
}

@keyframes note-float {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -5px;
  }
}

@keyframes cursor-nudge {
  0%,
  100% {
    transform: rotate(-45deg) translate(0, 0);
  }
  50% {
    transform: rotate(-45deg) translate(3px, 3px);
  }
}

@keyframes soft-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(39, 107, 88, 0.12);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(39, 107, 88, 0.05);
  }
}

@keyframes cell-enter {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cell-pop {
  0% {
    transform: scale(0.985);
  }
  45% {
    transform: scale(1.012);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes token-pop {
  0% {
    transform: translateY(3px) scale(0.96);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */

@media (max-width: 1240px) {
  .hero {
    gap: 30px;
    padding-right: 34px;
    padding-left: 34px;
  }

  .workbench-section,
  .methods-section {
    padding-right: 34px;
    padding-left: 34px;
  }

  .topbar {
    padding-right: 34px;
    padding-left: 34px;
  }

  .workbench-grid {
    grid-template-columns: minmax(340px, 390px) minmax(0, 1fr);
  }

  .icon-btn span {
    display: none;
  }

  .icon-btn {
    width: 32px;
    justify-content: center;
    padding: 0;
  }
}

@media (max-width: 1100px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(330px, 0.75fr);
  }

  .hero h1 {
    font-size: clamp(44px, 5.8vw, 64px);
  }

  .floating-note {
    display: none;
  }

  .workbench-grid {
    grid-template-columns: 1fr;
  }

  .control-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
    gap: 0 24px;
    align-items: start;
  }

  .control-panel > .panel-title,
  .control-panel > .mode-tabs,
  .control-panel > #single-pane,
  .control-panel > #batch-pane {
    grid-column: 1;
  }

  .control-panel > .options-block {
    grid-column: 2;
    grid-row: 1 / span 3;
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .control-panel > .action-stack {
    grid-column: 2;
    margin-top: 10px;
  }

  .control-panel > .panel-note {
    grid-column: 1 / -1;
  }

  .stage-panel {
    min-height: 720px;
  }
}

@media (max-width: 900px) {
  .topbar {
    gap: 16px;
    padding: 15px 22px;
  }

  .topnav,
  .project-label {
    display: none;
  }

  .topbar-right {
    gap: 9px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 60px 22px 48px;
  }

  .hero-art {
    min-height: 430px;
  }

  .hero-grid-line {
    width: 390px;
    height: 390px;
  }

  .specimen {
    width: min(100%, 390px);
  }

  .hero-stamp {
    top: 2%;
    right: 6%;
  }

  .route-strip {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 20px;
    padding: 15px 22px;
  }

  .route-arrow {
    display: none;
  }

  .workbench-section,
  .methods-section {
    padding-right: 22px;
    padding-left: 22px;
  }

  .section-heading {
    align-items: flex-start;
  }

  .section-heading > p {
    font-size: 8px;
    text-align: right;
  }

  .control-panel {
    display: block;
    padding: 20px;
  }

  .options-block {
    margin-top: 18px;
    padding-top: 17px;
    border-top: 1px solid var(--line);
  }

  .method-grid {
    grid-template-columns: 1fr;
  }

  .method-card {
    min-height: 0;
  }

  .about-section {
    grid-template-columns: 1fr;
    gap: 30px;
    margin-right: 22px;
    margin-left: 22px;
    padding: 34px 26px;
  }

  .site-footer {
    flex-wrap: wrap;
    padding-right: 22px;
    padding-left: 22px;
  }

  .site-footer p {
    order: 3;
    width: 100%;
    margin: 0;
  }
}

@media (max-width: 720px) {
  .hero-stamp {
    display: none;
  }

  .stage-panel {
    min-height: 0;
    padding: 20px;
    border-radius: 22px;
  }

  .stage-empty,
  .error-stage {
    min-height: 580px;
  }

  .stage-head {
    flex-direction: column;
    gap: 12px;
  }

  .stage-result-pill {
    align-items: flex-start;
    width: 100%;
    min-width: 0;
  }

  .stage-result-pill strong {
    max-width: 100%;
  }

  .arena.is-pair,
  .arena.is-triple,
  .instant-grid.is-dual {
    grid-template-columns: 1fr;
  }

  .stack-card,
  .output-card,
  .context-card {
    min-height: 245px;
  }

  .stack-well,
  .output-well {
    min-height: 150px;
    max-height: 240px;
  }

  .stack-empty {
    min-height: 130px;
  }

  .output-empty {
    min-height: 130px;
  }

  .transport {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .transport-buttons {
    justify-content: space-between;
    width: 100%;
  }

  .transport-tools {
    display: none;
  }

  .transport-buttons .play-btn {
    flex: 1;
    justify-content: center;
  }

  .icon-btn span {
    display: none;
  }

  .error-facts {
    grid-template-columns: 1fr;
  }

  .batch-stats {
    grid-template-columns: 1fr 1fr;
  }

  .batch-head {
    flex-direction: row;
    align-items: center;
  }

  .batch-head .primary-btn {
    width: auto;
  }

  .run-switch {
    flex-wrap: wrap;
  }

  .run-switch-btn {
    flex: 1 1 140px;
  }

  .run-switch-status {
    order: 3;
    margin: 0 5px 2px;
  }

  .phase-tabs {
    flex-direction: column;
  }

  .phase-tab {
    width: 100%;
  }

  .visualizer-callout {
    align-items: flex-start;
    flex-direction: column;
  }

  .about-note p {
    font-size: 16px;
  }
}

@media (max-width: 520px) {
  .topbar {
    padding: 13px 16px;
  }

  .brand-copy strong {
    font-size: 19px;
  }

  .local-pill {
    font-size: 8px;
  }

  .hero {
    padding: 48px 16px 38px;
  }

  .hero h1 {
    font-size: clamp(39px, 11.5vw, 52px);
  }

  .lede {
    font-size: 14px;
  }

  .hero-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-art {
    min-height: 370px;
  }

  .hero-grid-line {
    width: 320px;
    height: 320px;
  }

  .specimen {
    transform: none;
    animation: none;
  }

  .hero-stamp {
    width: 70px;
    height: 70px;
    top: 0;
    right: 0;
  }

  .hero-stamp span {
    font-size: 26px;
  }

  .hero-stamp small {
    font-size: 6px;
  }

  .route-strip {
    justify-content: flex-start;
    gap: 10px 16px;
    padding: 13px 16px;
  }

  .route-step > span {
    width: 23px;
    height: 23px;
  }

  .workbench-section,
  .methods-section {
    padding-right: 14px;
    padding-left: 14px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .section-heading > p {
    text-align: left;
  }

  .control-panel {
    padding: 15px;
    border-radius: 22px;
  }

  .example-list {
    grid-template-columns: 1fr;
  }

  #expression {
    font-size: 18px;
  }

  .keypad {
    grid-template-columns: repeat(6, 1fr);
  }

  .keypad-functions {
    grid-template-columns: repeat(4, 1fr);
  }

  .stage-panel {
    padding: 14px;
  }

  .stage-empty {
    padding: 25px 10px;
  }

  .stage-empty h2 {
    font-size: 32px;
  }

  .empty-tips {
    flex-direction: column;
    align-items: center;
  }

  .stage-head h2 {
    font-size: 28px;
  }

  .scan-panel {
    padding: 9px;
  }

  .token-chip {
    font-size: 9px;
  }

  .narration {
    padding: 12px 13px 12px 15px;
  }

  .narration h3 {
    font-size: 15px;
  }

  .stack-card,
  .output-card,
  .context-card {
    padding: 12px;
  }

  .cell-value {
    font-size: 17px;
  }

  .stack-cell {
    grid-template-columns: 24px minmax(0, 1fr) auto;
  }

  .postfix-line {
    flex-direction: column;
    gap: 2px;
  }

  .batch-table {
    min-width: 540px;
  }

  .about-section {
    margin-right: 14px;
    margin-left: 14px;
    padding: 28px 20px;
  }

  .site-footer {
    padding-right: 16px;
    padding-left: 16px;
  }

  .toast {
    right: 12px;
    bottom: 12px;
    max-width: calc(100vw - 24px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
