/* ==========================================================================
   CFOP LAB — visual system
   ========================================================================== */

:root {
  --bg: #07090d;
  --bg-soft: #0b0e15;
  --panel: rgba(16, 20, 29, 0.76);
  --panel-solid: #10141d;
  --panel-deep: #0a0d13;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f4f6fb;
  --muted: #9299a8;
  --muted-2: #606878;
  --accent: #d8ff3e;
  --accent-soft: rgba(216, 255, 62, 0.12);
  --accent-line: rgba(216, 255, 62, 0.32);
  --blue: #7894ff;
  --orange: #ff8e4d;
  --red: #ff5b5b;
  --green: #3ee08a;
  --sans: "SF Pro Display", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Roboto Mono", "Cascadia Code", Consolas, monospace;
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --max: 1560px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(1100px 620px at 84% -8%, rgba(58, 88, 220, 0.16), transparent 62%),
    radial-gradient(1000px 700px at 8% 24%, rgba(118, 151, 255, 0.07), transparent 60%),
    radial-gradient(820px 520px at 60% 100%, rgba(216, 255, 62, 0.035), transparent 65%),
    var(--bg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.023) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.023) 1px, transparent 1px);
  background-size: 82px 82px;
  mask-image: radial-gradient(ellipse 90% 72% at 50% 5%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 72% at 50% 5%, #000 20%, transparent 78%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(7, 9, 13, 0) 42%, rgba(7, 9, 13, 0.62) 100%);
}

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

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

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

::selection {
  color: #080b11;
  background: var(--accent);
}

.page-grain {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0.16;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

/* ==========================================================================
   Top bar
   ========================================================================== */

.topbar {
  position: relative;
  z-index: 10;
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 22px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

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

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: rgba(255, 255, 255, 0.84);
}

.brand-mark svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 11px rgba(216, 255, 62, 0.16));
}

.brand-mark.small {
  width: 28px;
  height: 28px;
}

.brand-copy {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--mono);
  letter-spacing: 0.055em;
}

.brand-copy b {
  font-size: 15px;
  font-weight: 700;
}

.brand-copy span {
  font-size: 9px;
  color: var(--accent);
  letter-spacing: 0.18em;
}

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

.topnav a {
  position: relative;
  font-size: 13px;
  color: var(--muted);
  transition: color 0.2s ease;
}

.topnav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -7px;
  height: 1px;
  background: var(--accent);
  transition: right 0.3s var(--ease);
}

.topnav a:hover {
  color: var(--text);
}

.topnav a:hover::after {
  right: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.13em;
  white-space: nowrap;
}

.live-pill i,
.rail-card-foot .dot,
.hint-dot,
.panel-foot-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(216, 255, 62, 0.8);
}

.top-cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.top-cta span {
  color: var(--accent);
  font-size: 14px;
}

.top-cta:hover {
  background: rgba(216, 255, 62, 0.08);
  border-color: var(--accent-line);
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 68px 40px 50px;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(480px, 0.98fr);
  align-items: center;
  gap: 30px;
  min-height: 620px;
}

.hero::before {
  content: "";
  position: absolute;
  top: -220px;
  right: -80px;
  width: 760px;
  height: 760px;
  pointer-events: none;
  background: radial-gradient(circle, rgba(100, 129, 255, 0.13), transparent 68%);
  filter: blur(20px);
}

.hero-copy {
  position: relative;
  z-index: 2;
  padding: 18px 0;
}

.eyebrow,
.section-kicker,
.mini-label {
  margin: 0;
  font-family: var(--mono);
  letter-spacing: 0.16em;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 25px;
  color: rgba(255, 255, 255, 0.64);
}

.eyebrow-line {
  width: 34px;
  height: 1px;
  background: var(--accent);
  box-shadow: 0 0 9px rgba(216, 255, 62, 0.65);
}

.hero h1 {
  margin: 0;
  font-size: clamp(58px, 6.2vw, 96px);
  line-height: 0.96;
  letter-spacing: -0.065em;
  font-weight: 800;
}

.hero h1 .accent {
  display: inline-block;
  letter-spacing: -0.072em;
  background: linear-gradient(105deg, #f3ffb3 0%, #d8ff3e 45%, #a7ffbc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 26px rgba(216, 255, 62, 0.12));
}

.hero-lede {
  max-width: 510px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.85;
  letter-spacing: 0.015em;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 35px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 0;
  border-radius: 999px;
  padding: 15px 21px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  color: #080b11;
  background: var(--accent);
  box-shadow: 0 12px 42px rgba(216, 255, 62, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.btn-primary:hover {
  box-shadow: 0 16px 50px rgba(216, 255, 62, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.btn-icon {
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1;
}

.btn-ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.075);
  border-color: var(--line-strong);
}

.play-glyph {
  position: relative;
  width: 15px;
  height: 15px;
  display: inline-block;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
}

.play-glyph::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 4px;
  border-left: 4px solid var(--accent);
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
}

.hero-stats {
  display: flex;
  gap: 0;
  margin-top: 55px;
}

.hero-stats div {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 0 27px;
  border-left: 1px solid var(--line);
}

.hero-stats div:first-child {
  padding-left: 0;
  border-left: 0;
}

.hero-stats strong {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.05em;
}

.hero-stats span {
  font-size: 10px;
  color: var(--muted-2);
  letter-spacing: 0.08em;
}

.hero-visual {
  position: relative;
  height: 585px;
  isolation: isolate;
}

.hero-canvas-wrap {
  position: absolute;
  inset: 0;
  z-index: 1;
  touch-action: none;
}

.hero-canvas-wrap::before {
  content: "";
  position: absolute;
  left: 20%;
  top: 19%;
  width: 64%;
  height: 62%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(88, 114, 255, 0.22), transparent 68%);
  filter: blur(35px);
  z-index: -1;
}

.hero-canvas-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.hero-orbit {
  position: absolute;
  z-index: 0;
  border: 1px solid rgba(161, 178, 255, 0.1);
  border-radius: 50%;
  pointer-events: none;
}

.orbit-a {
  inset: 8% 4% 10% 8%;
  transform: rotate(-22deg);
  background: radial-gradient(ellipse at center, transparent 52%, rgba(98, 128, 255, 0.03) 53%, transparent 55%);
}

.orbit-b {
  inset: 20% -2% 20% 2%;
  border-style: dashed;
  border-color: rgba(216, 255, 62, 0.09);
  transform: rotate(38deg);
  animation: orbitSpin 40s linear infinite;
}

@keyframes orbitSpin {
  to { transform: rotate(398deg); }
}

.float-tag {
  position: absolute;
  z-index: 3;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 9px;
  padding: 10px 13px 10px 10px;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(13, 17, 25, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: floaty 7s ease-in-out infinite;
}

.float-tag span {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 7px;
  color: var(--accent);
  background: rgba(216, 255, 62, 0.08);
  border: 1px solid rgba(216, 255, 62, 0.18);
  font-family: var(--mono);
  font-size: 10px;
}

.float-tag b {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  align-self: end;
}

.float-tag em {
  font-style: normal;
  color: var(--muted);
  font-size: 10px;
  margin-top: 1px;
}

.tag-cross {
  top: 54px;
  left: 4px;
}

.tag-f2l {
  right: 2px;
  top: 184px;
  animation-delay: -2.2s;
}

.tag-pll {
  left: 58px;
  bottom: 92px;
  animation-delay: -4.4s;
}

@keyframes floaty {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -9px, 0); }
}

.hero-caption {
  position: absolute;
  z-index: 3;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 11, 17, 0.68);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  white-space: nowrap;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.16em;
}

.hero-caption i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 7px rgba(62, 224, 138, 0.8);
}

/* ==========================================================================
   Workbench
   ========================================================================== */

.lab {
  position: relative;
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 34px 40px 90px;
  scroll-margin-top: 22px;
}

.lab::before {
  content: "";
  position: absolute;
  top: 0;
  left: 40px;
  right: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12) 18%, rgba(255, 255, 255, 0.12) 82%, transparent);
}

.lab-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 25px;
}

.section-kicker {
  color: var(--muted-2);
  margin-bottom: 9px;
}

.section-kicker span {
  color: var(--accent);
}

.lab-heading h2,
.method-heading h2 {
  margin: 0;
  font-size: clamp(32px, 3.2vw, 45px);
  font-weight: 750;
  letter-spacing: -0.055em;
}

.lab-hint {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.lab-grid {
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr) 362px;
  gap: 18px;
  align-items: start;
}

/* ---- step rail ---------------------------------------------------------- */

.step-rail {
  position: sticky;
  top: 20px;
  min-width: 0;
}

.rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rail-progress {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted-2);
}

.rail-progress b {
  color: var(--accent);
  font-weight: 500;
}

.rail-line {
  display: none;
}

.step-item {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 16px;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 14px 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--text);
  text-align: left;
  background: linear-gradient(145deg, rgba(23, 28, 40, 0.55), rgba(12, 15, 22, 0.42));
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.28s ease, background 0.28s ease, transform 0.28s var(--ease), box-shadow 0.28s ease;
}

.step-item + .step-item {
  margin-top: 8px;
}

.step-item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: var(--accent);
  opacity: 0;
  transform: scaleY(0.2);
  transition: opacity 0.28s ease, transform 0.3s var(--ease);
}

.step-item:hover {
  transform: translateX(3px);
  border-color: var(--line-strong);
  background: linear-gradient(145deg, rgba(29, 35, 50, 0.72), rgba(12, 15, 22, 0.5));
}

.step-item.is-active {
  border-color: var(--accent-line);
  background:
    radial-gradient(160px 100px at 0% 50%, rgba(216, 255, 62, 0.12), transparent 80%),
    linear-gradient(145deg, rgba(31, 38, 42, 0.9), rgba(12, 15, 22, 0.62));
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.step-item.is-active::before {
  opacity: 1;
  transform: scaleY(1);
}

.step-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted-2);
  letter-spacing: -0.02em;
}

.step-item.is-active .step-num {
  color: var(--accent);
}

.step-main {
  min-width: 0;
}

.step-en {
  display: block;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.18em;
  margin-bottom: 3px;
}

.step-zh {
  display: block;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.step-count {
  display: block;
  color: var(--muted-2);
  font-size: 10px;
  margin-top: 4px;
}

.step-arrow {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 14px;
  opacity: 0.45;
  transition: color 0.2s ease, transform 0.25s var(--ease);
}

.step-item.is-active .step-arrow {
  color: var(--accent);
  transform: translateX(2px);
  opacity: 0.9;
}

.rail-card {
  margin-top: 18px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.035), transparent 65%),
    rgba(12, 15, 22, 0.48);
}

.rail-card-kicker {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.18em;
}

.rail-card p {
  margin: 10px 0 14px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.72;
}

.rail-card-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.09em;
}

/* ---- stage -------------------------------------------------------------- */

.stage-column {
  min-width: 0;
}

.stage-card {
  position: relative;
  transition: box-shadow 0.4s ease;
  height: clamp(540px, 44vw, 690px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(680px 420px at 50% 30%, rgba(45, 67, 152, 0.21), transparent 68%),
    radial-gradient(320px 260px at 78% 83%, rgba(216, 255, 62, 0.035), transparent 74%),
    linear-gradient(160deg, #0e131e 0%, #090c13 61%, #07090e 100%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.055);
  isolation: isolate;
}

.stage-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.024) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: radial-gradient(ellipse 75% 62% at 50% 47%, #000 10%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 75% 62% at 50% 47%, #000 10%, transparent 78%);
  opacity: 0.65;
}

.stage-card::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 46%;
  width: 58%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  z-index: 0;
  border-radius: 50%;
  border: 1px solid rgba(151, 174, 255, 0.07);
  box-shadow: 0 0 0 38px rgba(151, 174, 255, 0.022), 0 0 0 82px rgba(151, 174, 255, 0.012);
  pointer-events: none;
}

#cubeCanvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}

#cubeCanvas.is-dragging {
  cursor: grabbing;
}

.stage-top {
  position: absolute;
  z-index: 3;
  top: 22px;
  left: 25px;
  right: 72px;
  pointer-events: none;
}

.stage-step {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
}

.stage-step span:first-child {
  color: var(--accent);
}

.stage-title-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 9px;
}

.stage-title-wrap h3 {
  margin: 0;
  font-size: clamp(22px, 2.1vw, 30px);
  font-weight: 700;
  letter-spacing: -0.045em;
}

.stage-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border: 1px solid rgba(216, 255, 62, 0.18);
  border-radius: 999px;
  background: rgba(216, 255, 62, 0.07);
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.stage-subtitle {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
}

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

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.meta-chip.accent {
  color: var(--accent);
  border-color: rgba(216, 255, 62, 0.18);
  background: rgba(216, 255, 62, 0.05);
}

.stage-hint {
  position: absolute;
  z-index: 3;
  left: 26px;
  bottom: 92px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  pointer-events: none;
}

.mouse-glyph {
  position: relative;
  width: 12px;
  height: 17px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 7px;
}

.mouse-glyph::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 3px;
  width: 1px;
  height: 4px;
  background: var(--accent);
  transform: translateX(-50%);
}

.stage-expand {
  position: absolute;
  z-index: 4;
  top: 21px;
  right: 21px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(14, 18, 27, 0.6);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.stage-expand:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
}

.stage-expand svg {
  width: 16px;
  height: 16px;
}

.stage-bottom {
  position: absolute;
  z-index: 4;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 17px;
  background: rgba(9, 12, 18, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.playback {
  display: flex;
  align-items: center;
  gap: 7px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.icon-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
}

.icon-btn:disabled {
  opacity: 0.28;
  cursor: default;
  pointer-events: none;
}

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

.icon-btn.loop-btn.is-active {
  color: var(--accent);
  background: rgba(216, 255, 62, 0.07);
  border-color: rgba(216, 255, 62, 0.17);
}

.play-btn {
  display: grid;
  place-items: center;
  width: 47px;
  height: 47px;
  margin: 0 2px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #080b11;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2) inset, 0 0 26px rgba(216, 255, 62, 0.18);
  transition: transform 0.2s var(--ease), box-shadow 0.2s ease;
}

.play-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25) inset, 0 0 36px rgba(216, 255, 62, 0.28);
}

.play-btn:active {
  transform: scale(0.97);
}

.play-icon {
  width: 0;
  height: 0;
  margin-left: 3px;
  border-left: 13px solid currentColor;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
}

.play-btn.is-playing .play-icon {
  width: 11px;
  height: 14px;
  margin-left: 0;
  border: 0;
  border-left: 4px solid currentColor;
  border-right: 4px solid currentColor;
}

.control-divider {
  width: 1px;
  height: 19px;
  margin: 0 2px;
  background: var(--line);
}

.speed-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.speed-control > span {
  color: var(--muted-2);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.speed-btns {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
}

.speed-btns button {
  padding: 5px 7px;
  border: 0;
  border-radius: 6px;
  color: var(--muted-2);
  background: transparent;
  font-family: var(--mono);
  font-size: 8px;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease;
}

.speed-btns button:hover {
  color: var(--text);
}

.speed-btns button.is-active {
  color: #0a0d13;
  background: var(--accent);
}

/* ---- algorithm card ----------------------------------------------------- */

.algo-card {
  margin-top: 16px;
  padding: 19px 20px 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.035), transparent 48%),
    rgba(13, 17, 25, 0.76);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.algo-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}

.mini-label {
  color: var(--muted-2);
  font-size: 8px;
  letter-spacing: 0.15em;
}

.algo-head h4 {
  margin: 5px 0 0;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.algo-head h4 span {
  margin-left: 6px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.03em;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 9px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.copy-btn svg {
  width: 13px;
  height: 13px;
}

.copy-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
}

.algo-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-top: 17px;
}

.move-chip {
  position: relative;
  min-width: 36px;
  padding: 10px 11px 9px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 9px;
  color: rgba(255, 255, 255, 0.84);
  background: rgba(255, 255, 255, 0.04);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0.015em;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, transform 0.18s var(--ease), box-shadow 0.18s ease;
}

.move-chip::after {
  content: attr(data-step);
  position: absolute;
  top: -5px;
  right: -4px;
  display: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  color: #080b11;
  background: var(--accent);
  font-family: var(--mono);
  font-size: 7px;
  line-height: 13px;
  text-align: center;
}

.move-chip:hover {
  color: var(--text);
  border-color: rgba(216, 255, 62, 0.3);
  background: rgba(216, 255, 62, 0.055);
}

.move-chip.is-done {
  color: rgba(255, 255, 255, 0.42);
  border-color: rgba(216, 255, 62, 0.1);
  background: rgba(216, 255, 62, 0.035);
}

.move-chip.is-active {
  color: #080b11;
  border-color: var(--accent);
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(216, 255, 62, 0.28);
}

.move-chip.is-active::after {
  display: block;
}

.timeline-wrap {
  margin-top: 14px;
}

.timeline-track {
  position: relative;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
}

.timeline-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(216, 255, 62, 0.5), var(--accent));
  box-shadow: 0 0 12px rgba(216, 255, 62, 0.42);
  transition: width 0.28s var(--ease);
}

.timeline-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.06em;
}

.segments {
  margin-top: 17px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.segments-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.segments-note {
  color: var(--muted-2);
  font-size: 9px;
}

.segment-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.segment-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.024);
  font-size: 9px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.segment-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.045);
}

.segment-btn.is-active {
  color: var(--accent);
  border-color: var(--accent-line);
  background: rgba(216, 255, 62, 0.06);
}

.segment-btn span {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
}

.segment-btn.is-active span {
  color: rgba(216, 255, 62, 0.62);
}

/* ---- insight cards ------------------------------------------------------ */

.insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
  scroll-margin-top: 28px;
}

.insight-card {
  min-width: 0;
  min-height: 218px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.035), transparent 50%),
    rgba(13, 17, 25, 0.66);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.insight-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 13px;
}

.insight-head h4 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.insight-en {
  margin-left: auto;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.14em;
}

.insight-icon {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border: 1px solid rgba(216, 255, 62, 0.14);
  border-radius: 7px;
  color: var(--accent);
  background: rgba(216, 255, 62, 0.055);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1;
}

.icon-eye::before { content: "◉"; }
.icon-scissors::before { content: "⌗"; }
.icon-bolt::before { content: "✦"; }

.recognition-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.recognition-list li {
  position: relative;
  padding-left: 12px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.62;
}

.recognition-list li + li {
  margin-top: 3px;
}

.recognition-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.66em;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.7;
}

.recognition-visual {
  margin-top: 13px;
}

.edge-status {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.edge-status div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 7px 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.edge-status b {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
}

.edge-status span {
  color: var(--muted-2);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.edge-status .is-ok {
  border-color: rgba(216, 255, 62, 0.15);
}

.edge-status .is-ok b {
  color: var(--accent);
}

.edge-status .is-out b {
  color: var(--orange);
}

.piece-status {
  display: grid;
  gap: 5px;
}

.piece-status div {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 9px;
}

.piece-status b {
  font-weight: 600;
}

.piece-status em {
  margin-left: auto;
  color: var(--muted);
  font-style: normal;
  font-family: var(--mono);
  font-size: 8px;
}

.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted-2);
}

.status-dot.ok {
  background: var(--accent);
  box-shadow: 0 0 7px rgba(216, 255, 62, 0.6);
}

.status-dot.out {
  background: var(--orange);
}

.oll-map-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.oll-map {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  width: 88px;
  height: 88px;
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #07090e;
  transform: rotateX(0deg) rotateZ(-4deg);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
}

.oll-map i {
  display: block;
  border-radius: 4px;
  background: var(--cell);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.oll-map i.is-yellow {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 0 9px rgba(255, 216, 77, 0.22);
}

.oll-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted-2);
  font-size: 8px;
  line-height: 1.3;
}

.oll-legend b {
  display: block;
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
}

.pll-rings {
  display: flex;
  gap: 16px;
}

.pll-ring {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), rgba(255, 255, 255, 0.075) 0);
  box-shadow: 0 0 16px rgba(216, 255, 62, 0.07);
}

.ring::before {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: #0c1017;
}

.ring b,
.ring span {
  position: relative;
  z-index: 1;
}

.ring b {
  margin-top: -3px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
}

.ring span {
  color: var(--muted-2);
  font-size: 7px;
  letter-spacing: 0.06em;
}

.breakdown-list {
  display: grid;
  gap: 6px;
}

.breakdown-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.02);
}

.breakdown-row b {
  color: var(--text);
  font-size: 9px;
  font-weight: 600;
}

.breakdown-row em {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breakdown-row span {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7px;
  white-space: nowrap;
}

.insight-note {
  margin: 11px 0 0;
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.55;
}

.coach-card {
  background:
    radial-gradient(180px 140px at 100% 0%, rgba(216, 255, 62, 0.08), transparent 72%),
    linear-gradient(155deg, rgba(255, 255, 255, 0.035), transparent 50%),
    rgba(13, 17, 25, 0.68);
}

.coach-tip {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 10.5px;
  line-height: 1.72;
}

.coach-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 13px;
}

.coach-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 7px;
  border: 1px solid rgba(216, 255, 62, 0.15);
  border-radius: 6px;
  color: var(--accent);
  background: rgba(216, 255, 62, 0.055);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.03em;
}

.coach-chip.subtle {
  color: var(--muted);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.02);
}

/* ---- case panel --------------------------------------------------------- */

.case-panel {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: calc(100vh - 40px);
  min-height: 680px;
  max-height: 920px;
  padding: 20px 15px 13px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.035), transparent 44%),
    rgba(12, 16, 23, 0.79);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  scroll-margin-top: 22px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 0 5px;
}

.panel-head h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.035em;
}

.panel-head .section-kicker {
  margin-bottom: 6px;
}

.count-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 25px;
  padding: 0 8px;
  border: 1px solid rgba(216, 255, 62, 0.18);
  border-radius: 7px;
  color: var(--accent);
  background: rgba(216, 255, 62, 0.05);
  font-family: var(--mono);
  font-size: 10px;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  margin: 17px 5px 0;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted-2);
  cursor: text;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.search-wrap:focus-within {
  border-color: rgba(216, 255, 62, 0.3);
  background: rgba(216, 255, 62, 0.03);
}

.search-wrap svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
}

.search-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 11px;
}

.search-wrap input::placeholder {
  color: var(--muted-2);
}

.search-wrap kbd {
  flex: 0 0 auto;
  padding: 2px 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted-2);
  background: rgba(255, 255, 255, 0.025);
  font-family: var(--mono);
  font-size: 7px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 12px 5px 10px;
}

.filter-btn {
  padding: 5px 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted-2);
  background: transparent;
  font-size: 8.5px;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.filter-btn span {
  margin-left: 3px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7px;
}

.filter-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.filter-btn.is-active {
  color: var(--accent);
  border-color: rgba(216, 255, 62, 0.16);
  background: rgba(216, 255, 62, 0.055);
}

.filter-btn.is-active span {
  color: rgba(216, 255, 62, 0.55);
}

.case-scroll {
  flex: 1;
  min-height: 0;
  margin: 0 -5px;
  padding: 3px 5px 8px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.case-scroll::-webkit-scrollbar {
  width: 5px;
}

.case-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.case-scroll::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.case-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 94px;
  padding: 10px 10px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  text-align: left;
  background: rgba(255, 255, 255, 0.018);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s var(--ease);
}

.case-tile:hover {
  z-index: 1;
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
}

.case-tile.is-active {
  border-color: rgba(216, 255, 62, 0.4);
  background:
    radial-gradient(100px 80px at 0% 0%, rgba(216, 255, 62, 0.11), transparent 72%),
    rgba(216, 255, 62, 0.045);
  box-shadow: inset 0 0 0 1px rgba(216, 255, 62, 0.04), 0 8px 24px rgba(0, 0, 0, 0.18);
}

.case-tile::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 8px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--line-strong);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.case-tile.is-active::after {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(216, 255, 62, 0.8);
}

.tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding-right: 9px;
}

.tile-num {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
}

.case-tile:not(.is-active) .tile-num {
  color: rgba(216, 255, 62, 0.68);
}

.tile-group {
  max-width: 72%;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.38);
  font-size: 8.5px;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-name {
  margin-top: 9px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.86);
  font-size: 11.5px;
  font-weight: 550;
  letter-spacing: 0.005em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-alg {
  margin-top: 5px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.42);
  font-family: var(--mono);
  font-size: 8.5px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-tile.is-active .tile-name {
  color: #fff;
}

.case-tile.is-active .tile-alg {
  color: rgba(216, 255, 62, 0.54);
}

.empty-state {
  padding: 35px 15px;
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.7;
  text-align: center;
}

.panel-foot {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 10px 5px 0;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 8px;
  line-height: 1.5;
}

.panel-foot-dot {
  flex: 0 0 auto;
  margin-top: 4px;
  opacity: 0.7;
}

/* ==========================================================================
   Method / footer
   ========================================================================== */

.method {
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 10px 40px 100px;
}

.method-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 26px;
}

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

.method-note {
  max-width: 305px;
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.75;
  text-align: right;
}

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

.method-card {
  position: relative;
  min-height: 250px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.04), transparent 55%),
    rgba(12, 16, 23, 0.6);
  transition: border-color 0.25s ease, transform 0.35s var(--ease), background 0.25s ease;
}

.method-card:hover {
  transform: translateY(-4px);
  border-color: rgba(216, 255, 62, 0.18);
  background:
    radial-gradient(200px 150px at 100% 0%, rgba(216, 255, 62, 0.07), transparent 70%),
    linear-gradient(155deg, rgba(255, 255, 255, 0.05), transparent 55%),
    rgba(12, 16, 23, 0.7);
}

.method-num {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.method-card h3 {
  margin: 22px 0 10px;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.035em;
}

.method-card p {
  max-width: 320px;
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.8;
}

.method-mock {
  position: absolute;
  right: 20px;
  bottom: 17px;
  left: 20px;
  height: 53px;
  opacity: 0.8;
}

.mock-moves {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mock-moves i {
  display: block;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(216, 255, 62, 0.18);
  border-radius: 6px;
  background: rgba(216, 255, 62, 0.05);
}

.mock-moves i:nth-child(3) {
  width: 30px;
  height: 30px;
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 18px rgba(216, 255, 62, 0.22);
}

.mock-segments {
  display: flex;
  gap: 7px;
  align-items: flex-end;
}

.mock-segments span {
  display: block;
  height: 24px;
  border: 1px solid rgba(216, 255, 62, 0.18);
  border-radius: 6px;
  background: rgba(216, 255, 62, 0.04);
}

.mock-segments span:nth-child(1) { width: 29%; }
.mock-segments span:nth-child(2) { width: 41%; border-color: rgba(216, 255, 62, 0.32); background: rgba(216, 255, 62, 0.08); }
.mock-segments span:nth-child(3) { width: 21%; }

.mock-cases {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 4px;
  align-content: end;
}

.mock-cases i {
  display: block;
  height: 17px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.03);
}

.mock-cases i:nth-child(4),
.mock-cases i:nth-child(8) {
  border-color: rgba(216, 255, 62, 0.25);
  background: rgba(216, 255, 62, 0.08);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 24px 40px 34px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 9px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.site-footer p {
  margin: 0;
  letter-spacing: 0.02em;
}

.site-footer a {
  color: var(--muted);
  transition: color 0.2s ease;
}

.site-footer a span {
  margin-left: 5px;
  color: var(--accent);
}

.site-footer a:hover {
  color: var(--text);
}

/* ==========================================================================
   Toast
   ========================================================================== */

.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 28px;
  padding: 10px 15px;
  border: 1px solid rgba(216, 255, 62, 0.22);
  border-radius: 999px;
  color: #0a0d13;
  background: var(--accent);
  font-size: 11px;
  font-weight: 600;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.3);
  transform: translate(-50%, 18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.3s var(--ease);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1360px) {
  .lab-grid {
    grid-template-columns: 220px minmax(0, 1fr) 330px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(430px, 0.92fr);
  }

  .hero-visual {
    height: 540px;
  }
}

@media (max-width: 1180px) {
  .topnav {
    display: none;
  }

  .lab-grid {
    grid-template-columns: minmax(0, 1fr) 338px;
  }

  .step-rail {
    position: static;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 2px;
  }

  .rail-head,
  .rail-line,
  .rail-card {
    display: none;
  }

  .step-rail #stepRail {
    display: contents;
  }

  .step-item {
    padding: 12px 12px;
  }

  .step-item + .step-item {
    margin-top: 0;
  }

  .step-item:hover {
    transform: translateY(-2px);
  }

  .stage-card {
    height: clamp(520px, 58vw, 650px);
  }

  .insight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .coach-card {
    grid-column: 1 / -1;
    min-height: 170px;
  }
}

@media (max-width: 960px) {
  .topbar {
    padding: 18px 24px;
  }

  .live-pill {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 48px 24px 34px;
    gap: 0;
  }

  .hero-copy {
    padding-bottom: 0;
  }

  .hero h1 {
    font-size: clamp(58px, 11vw, 84px);
  }

  .hero-lede {
    max-width: 600px;
  }

  .hero-stats {
    margin-top: 36px;
  }

  .hero-visual {
    height: 470px;
    margin-top: -5px;
  }

  .tag-cross { left: 8%; }
  .tag-f2l { right: 7%; top: 130px; }
  .tag-pll { left: 15%; bottom: 43px; }

  .lab {
    padding: 28px 24px 70px;
  }

  .lab::before {
    left: 24px;
    right: 24px;
  }

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

  .step-rail {
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .case-panel {
    position: static;
    height: 620px;
    min-height: 0;
    max-height: none;
  }

  .stage-card {
    height: clamp(500px, 78vw, 660px);
  }

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

  .coach-card {
    grid-column: auto;
  }

  .method {
    padding: 10px 24px 70px;
  }

  .method-heading {
    display: block;
  }

  .method-heading h2 {
    margin-top: 4px;
  }

  .method-note {
    margin-top: 16px;
    text-align: left;
  }

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

  .method-card {
    min-height: 200px;
  }

  .site-footer {
    padding: 22px 24px 30px;
    flex-wrap: wrap;
  }

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

@media (max-width: 760px) {
  .topbar-right {
    gap: 8px;
  }

  .top-cta {
    padding: 8px 11px;
    font-size: 10px;
  }

  .hero {
    padding-top: 35px;
  }

  .hero h1 {
    font-size: clamp(48px, 14vw, 68px);
    letter-spacing: -0.07em;
  }

  .hero-lede {
    font-size: 13px;
    margin-top: 22px;
  }

  .hero-actions {
    margin-top: 27px;
  }

  .hero-stats div {
    padding: 0 17px;
  }

  .hero-stats strong {
    font-size: 18px;
  }

  .hero-visual {
    height: 390px;
  }

  .hero-caption {
    display: none;
  }

  .float-tag {
    padding: 8px 10px;
  }

  .float-tag span {
    width: 23px;
    height: 23px;
    font-size: 8px;
  }

  .float-tag b,
  .float-tag em {
    font-size: 8px;
  }

  .tag-cross { top: 32px; left: 1%; }
  .tag-f2l { right: 0; top: 103px; }
  .tag-pll { left: 6%; bottom: 25px; }

  .lab {
    padding-left: 16px;
    padding-right: 16px;
  }

  .lab::before {
    left: 16px;
    right: 16px;
  }

  .lab-heading {
    display: block;
  }

  .lab-hint {
    margin-top: 10px;
  }

  .step-rail {
    gap: 6px;
  }

  .step-item {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 11px 10px;
  }

  .step-num,
  .step-arrow {
    display: none;
  }

  .step-en {
    font-size: 7px;
  }

  .step-zh {
    font-size: 11px;
    white-space: nowrap;
  }

  .step-count {
    display: none;
  }

  .stage-card {
    height: auto;
    border-radius: 20px;
  }

  .stage-card::after {
    display: none;
  }

  .stage-top {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    padding: 19px 18px 0;
  }

  #cubeCanvas {
    position: relative;
    inset: auto;
    width: 100%;
    height: clamp(350px, 58vw, 440px);
  }

  .stage-title-wrap h3 {
    font-size: 21px;
  }

  .stage-subtitle {
    font-size: 10px;
  }

  .stage-meta {
    margin-top: 10px;
  }

  .stage-hint {
    display: none;
  }

  .stage-expand {
    top: 17px;
    right: 16px;
  }

  .stage-bottom {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    margin: 0 10px 10px;
    padding: 8px;
    gap: 7px;
    flex-wrap: wrap;
  }

  .playback {
    gap: 3px;
  }

  .icon-btn {
    width: 30px;
    height: 30px;
  }

  .play-btn {
    width: 43px;
    height: 43px;
  }

  .speed-control {
    margin-left: auto;
  }

  .speed-control > span {
    display: none;
  }

  .speed-btns button {
    padding: 5px 6px;
  }

  .control-divider,
  .loop-btn {
    display: none;
  }

  .algo-card {
    padding: 15px;
    border-radius: 16px;
  }

  .algo-strip {
    gap: 5px;
  }

  .move-chip {
    padding: 6px 7px;
    font-size: 11px;
  }

  .segments-note {
    display: none;
  }

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

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

  .case-panel {
    height: 580px;
    border-radius: 20px;
  }

  .case-grid {
    gap: 6px;
  }

  .case-tile {
    min-height: 82px;
    padding: 8px;
  }

  .tile-name {
    font-size: 10px;
  }

  .method {
    padding-left: 16px;
    padding-right: 16px;
  }

  .method-card {
    padding: 18px;
  }

  .method-card h3 {
    font-size: 18px;
  }

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

  .site-footer p {
    display: none;
  }
}

@media (max-width: 430px) {
  .hero h1 {
    font-size: 45px;
  }

  .hero-stats {
    gap: 0;
  }

  .hero-stats div {
    padding: 0 11px;
  }

  .hero-stats span {
    font-size: 8px;
  }

  .hero-visual {
    height: 335px;
  }

  .float-tag {
    display: none;
  }

  .stage-card {
    height: auto;
  }

  .stage-bottom {
    justify-content: center;
  }

  .speed-control {
    width: 100%;
    justify-content: center;
  }

  .stage-step {
    font-size: 8px;
  }
}

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


/* case selection pulse */
.stage-card.case-enter #cubeCanvas {
  animation: casePulse 0.52s var(--ease);
}

@keyframes casePulse {
  0% { opacity: 0.55; transform: scale(0.985); }
  100% { opacity: 1; transform: scale(1); }
}

.stage-card:fullscreen {
  width: 100vw;
  height: 100vh;
  border: 0;
  border-radius: 0;
  background: #07090e;
}

.stage-card:fullscreen .stage-top {
  top: 34px;
  left: 38px;
}

.stage-card:fullscreen .stage-bottom {
  left: 30px;
  right: 30px;
  bottom: 24px;
}

.stage-card:fullscreen .stage-hint {
  left: 38px;
  bottom: 105px;
}


/* notation legend */
.notation-note {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 8px;
  line-height: 1.6;
  letter-spacing: 0.015em;
}

.notation-note span {
  display: inline-block;
  margin-right: 7px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.12em;
}

.notation-note b {
  color: rgba(255, 255, 255, 0.58);
  font-family: var(--mono);
  font-weight: 500;
}


.stage-card:fullscreen #cubeCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.stage-card:fullscreen .stage-top {
  position: absolute;
}

.stage-card:fullscreen .stage-bottom {
  position: absolute;
}

/* 课程中台整合：返回「其他教学内容」 */
.top-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.top-back-arrow { color: var(--accent); font-size: 13px; }
.top-back:hover { color: var(--text); border-color: var(--accent-line); background: rgba(216, 255, 62, .06); }
.footer-links { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
@media (max-width: 960px) {
  .top-back-text { display: none; }
  .top-back { padding: 7px 10px; }
}
