:root {
  color-scheme: light;
  --ink: #132f44;
  --ink-strong: #0b2234;
  --muted: #4b6980;
  --subtle: #7893a8;
  --link: #0774a6;
  --accent: #2db9f6;
  --accent-deep: #0b84bd;
  --accent-hover: #58cafb;
  --accent-soft: #e6f6ff;
  --line: #d4e6f4;
  --line-soft: #e6f1fa;
  --wash: #edf7ff;
  --canvas: #f5faff;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #ffffff;
  --gutter: clamp(1.15rem, 4.2vw, 3.8rem);
  --header-height: 4.5rem;
  --spring: cubic-bezier(0.22, 1, 0.36, 1);
  --spring-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --shadow-sm: 0 4px 16px rgba(15, 62, 96, 0.06);
  --shadow-md: 0 14px 36px rgba(15, 62, 96, 0.09);
  --shadow-lg: 0 24px 56px rgba(11, 56, 89, 0.13);
  font-family: "Segoe UI Variable Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  line-height: 1.65;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  scroll-padding-top: var(--header-height);
  background: var(--canvas);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

p, h1, h2, h3, figure { margin: 0; }
img { display: block; max-width: 100%; height: auto; }
button, input { font: inherit; }
a { color: var(--link); text-underline-offset: 0.22em; }
:where(a, button, summary, input, [tabindex]):focus-visible {
  outline: 2.5px solid var(--accent-deep);
  outline-offset: 3px;
  border-radius: 0.45rem;
}

/* Skip link */
.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 100;
  padding: 0.6rem 0.95rem;
  border-radius: 0.6rem;
  background: white;
  box-shadow: var(--shadow-md);
  transform: translateY(calc(-100% - 2rem));
  transition: transform 0.22s var(--spring);
}
.skip-link:focus { transform: translateY(0); }

/* Top scroll progress ribbon */
.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 60;
  pointer-events: none;
  background: transparent;
}
.scroll-progress-bar {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(90deg, #34bcfc, #0b84bd 60%, #4dd4ff);
  box-shadow: 0 0 12px rgba(45, 185, 246, 0.55);
  will-change: transform;
}

/* Container */
.wrap {
  width: min(74rem, calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px) saturate(165%);
  -webkit-backdrop-filter: blur(18px) saturate(165%);
  border-bottom: 1px solid rgba(206, 228, 244, 0.72);
  transition: background-color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.92);
  border-bottom-color: rgba(190, 219, 240, 0.95);
  box-shadow: 0 8px 28px rgba(15, 58, 90, 0.06);
}

.header-inner, .footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.header-inner { min-height: calc(var(--header-height) - 1px); }

.brand {
  flex-shrink: 0;
  display: inline-flex;
  gap: 0.6rem;
  align-items: center;
  color: var(--ink-strong);
  font-weight: 740;
  text-decoration: none;
  white-space: nowrap;
}
.brand > img {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  object-fit: contain;
}
.brand-icon-wrap {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  transition: transform 0.35s var(--spring-bounce);
}
.brand-icon-wrap img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  aspect-ratio: 1 / 1;
}
.brand:hover .brand-icon-wrap {
  transform: translateY(-1px) rotate(-4deg) scale(1.06);
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-text strong { font-size: 1.02rem; letter-spacing: -0.015em; }
.brand-text small { font-size: 0.68rem; font-weight: 600; color: var(--subtle); letter-spacing: 0.04em; }

.main-nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.nav-indicator {
  position: absolute;
  top: 50%;
  left: 0;
  height: 2.1rem;
  border-radius: 999px;
  background: #e6f5ff;
  border: 1px solid #c5e6fa;
  transform: translate3d(0, -50%, 0);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.36s var(--spring), width 0.36s var(--spring), opacity 0.24s ease;
  z-index: 0;
}
.main-nav a {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0.88rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 620;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}
.main-nav a:hover { color: var(--link); }
.main-nav a[aria-current] { color: var(--accent-deep); font-weight: 680; }
.main-nav .source-link {
  margin-left: 0.45rem;
  padding: 0.36rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(17, 74, 114, 0.05);
}
.main-nav .source-link:hover {
  border-color: #9ed4f2;
  background: #f0f9ff;
  color: var(--accent-deep);
}
.main-nav .source-link .ext-arrow {
  transition: transform 0.25s var(--spring);
}
.main-nav .source-link:hover .ext-arrow {
  transform: translate(2px, -2px);
}

/* ==================== HERO SECTION ==================== */
.hero {
  position: relative;
  display: grid;
  place-items: center;
  min-block-size: calc(100svh - var(--header-height));
  padding-block: clamp(2.6rem, 5.5vw, 4.6rem) clamp(2.2rem, 4.5vw, 3.6rem);
  overflow: hidden;
  isolation: isolate;
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background:
    radial-gradient(ellipse 68% 58% at 50% 34%, rgba(213, 241, 255, 0.82), transparent 72%),
    linear-gradient(180deg, #f3faff 0%, #f8fcff 65%, #ffffff 100%);
}

.aurora-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(56px);
  opacity: 0.72;
  will-change: transform;
}
.orb-1 {
  width: clamp(18rem, 36vw, 34rem);
  height: clamp(18rem, 36vw, 34rem);
  top: -12%;
  left: 12%;
  background: radial-gradient(circle, rgba(52, 188, 252, 0.34), rgba(52, 188, 252, 0));
}
.orb-2 {
  width: clamp(16rem, 32vw, 30rem);
  height: clamp(16rem, 32vw, 30rem);
  top: 18%;
  right: 8%;
  background: radial-gradient(circle, rgba(14, 148, 212, 0.22), rgba(14, 148, 212, 0));
}
.orb-3 {
  width: clamp(16rem, 30vw, 28rem);
  height: clamp(16rem, 30vw, 28rem);
  bottom: -14%;
  left: 42%;
  background: radial-gradient(circle, rgba(125, 218, 255, 0.32), rgba(125, 218, 255, 0));
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(16, 125, 180, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 125, 180, 0.055) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 62% 62% at 50% 42%, black 25%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 62% 62% at 50% 42%, black 25%, transparent 80%);
}

/* Floating interactive lexicon cards around Hero */
.hero-float-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  max-width: 84rem;
  margin-inline: auto;
}
.float-word {
  position: absolute;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  padding: 0.72rem 0.96rem 0.64rem;
  border: 1px solid rgba(196, 226, 245, 0.92);
  border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 28px rgba(17, 83, 128, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transform: translate3d(var(--px, 0px), var(--py, 0px), 0);
  transition: transform 0.25s ease-out, border-color 0.25s ease, box-shadow 0.28s ease, background-color 0.25s ease;
}
.float-word:hover {
  border-color: #6bc8f5;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 34px rgba(13, 126, 186, 0.18), 0 0 0 3px rgba(52, 188, 252, 0.14);
}
.float-word::after {
  content: "点击查词 →";
  margin-top: 0.28rem;
  font-size: 0.7rem;
  font-weight: 660;
  color: var(--accent-deep);
  opacity: 0.56;
  transform: translateX(0);
  transition: opacity 0.22s ease, transform 0.22s var(--spring);
}
.float-word:hover::after { opacity: 1; transform: translateX(3px); }
.fw-word { font-weight: 760; font-size: 1.02rem; color: var(--ink-strong); letter-spacing: -0.02em; }
.fw-ipa { font-size: 0.74rem; color: var(--subtle); font-family: "Segoe UI", system-ui, sans-serif; }
.fw-def { font-size: 0.78rem; color: var(--muted); }

.float-word-1 { top: 18%; left: 4.5%; }
.float-word-2 { top: 22%; right: 4.5%; }
.float-word-3 { bottom: 20%; left: 6.5%; }
.float-word-4 { bottom: 18%; right: 6.5%; }

.hero-stage {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.5rem, 3.6vh, 2.8rem);
  pointer-events: none;
}

.hero-copy,
.scroll-cue {
  pointer-events: auto;
}

.hero-copy {
  text-align: center;
  max-width: 44rem;
}

.version-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.34rem 0.85rem;
  margin-bottom: 1.25rem;
  border: 1px solid #c6e5f8;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 6px 18px rgba(14, 102, 152, 0.08);
  color: var(--link);
  font-size: 0.83rem;
  font-weight: 650;
  text-decoration: none;
  transition: transform 0.25s var(--spring), border-color 0.2s ease, box-shadow 0.25s ease;
}
.version-pill:hover {
  transform: translateY(-2px);
  border-color: #7ccbf6;
  box-shadow: 0 10px 24px rgba(14, 128, 190, 0.15);
}
.live-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #17b877;
  box-shadow: 0 0 0 4px rgba(23, 184, 119, 0.2);
}
.pill-sep { opacity: 0.45; }

/* 3D Interactive Emblem */
.hero-emblem {
  position: relative;
  width: clamp(6.6rem, 11vw, 8.2rem);
  height: clamp(6.6rem, 11vw, 8.2rem);
  margin: 0 auto 1.2rem;
  perspective: 700px;
}
.emblem-ring {
  display: none;
}
.hero-mark-shell {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.22s ease-out;
  will-change: transform;
}
.hero-emblem:hover .hero-mark-shell {
  box-shadow: none;
}
.hero-mark {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 14px 26px rgba(14, 91, 138, 0.16));
  transition: filter 0.3s ease;
}
.hero-emblem:hover .hero-mark {
  filter: drop-shadow(0 18px 34px rgba(14, 123, 186, 0.24));
}
.emblem-sheen {
  display: none;
}

.descriptor {
  color: var(--link);
  font-weight: 700;
  font-size: 0.96rem;
  letter-spacing: 0.08em;
}

h1 {
  margin-block: 0.42rem 0.95rem;
  font-size: clamp(3.15rem, 6.5vw, 5.7rem);
  font-weight: 820;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.title-gradient {
  background: linear-gradient(135deg, #0b263b 0%, #0e4a70 50%, #0882ba 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.summary {
  max-width: 36rem;
  margin-inline: auto;
  color: var(--muted);
  font-size: clamp(1.04rem, 1.75vw, 1.22rem);
  line-height: 1.7;
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-block: 1.65rem 1.25rem;
}

/* Magnetic glossy buttons */
.button {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.95rem;
  padding: 0.56rem 1.28rem;
  border: 1px solid transparent;
  border-radius: 0.82rem;
  text-align: center;
  text-decoration: none;
  font-weight: 670;
  font-size: 0.95rem;
  cursor: pointer;
  overflow: hidden;
  transform: translate3d(var(--tx, 0px), var(--ty, 0px), 0);
  transition: transform 0.25s var(--spring), background-color 0.22s ease, border-color 0.22s ease, box-shadow 0.25s ease, color 0.22s ease;
}
.button .btn-icon {
  transition: transform 0.28s var(--spring);
}
.button:hover .btn-icon {
  transform: translateY(1.5px);
}
.button.ghost:hover .btn-icon,
.quark .button:hover .btn-icon {
  transform: translateX(3px);
}

.primary {
  background: linear-gradient(135deg, #2ab8f9 0%, #0c84c6 100%);
  color: #ffffff;
  box-shadow: 0 10px 26px rgba(13, 134, 200, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}
.primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 28%, rgba(255, 255, 255, 0.36) 50%, transparent 72%);
  transform: translateX(-130%);
  transition: transform 0.65s var(--spring);
}
.primary:hover {
  background: linear-gradient(135deg, #3dc2ff 0%, #1193da 100%);
  color: #ffffff;
  box-shadow: 0 14px 32px rgba(13, 134, 200, 0.40), inset 0 1px 0 rgba(255, 255, 255, 0.42);
}
.primary:hover::before { transform: translateX(130%); }

.secondary {
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  border-color: #c4dff1;
  box-shadow: 0 4px 12px rgba(15, 65, 102, 0.06);
}
.secondary:hover {
  border-color: #82c4e8;
  background: #f0f9ff;
  color: var(--accent-deep);
  box-shadow: 0 10px 22px rgba(15, 92, 140, 0.11);
}

.ghost {
  background: rgba(235, 247, 255, 0.72);
  color: var(--link);
  border-color: rgba(186, 222, 245, 0.8);
}
.ghost:hover {
  background: #dff3ff;
  border-color: #95d2f4;
}

.hero-highlights {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem 0.85rem;
  padding: 0.48rem 1.05rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(206, 229, 245, 0.85);
  font-size: 0.84rem;
  color: var(--muted);
  margin-bottom: 0.72rem;
}
.hero-highlights strong { color: var(--ink-strong); font-weight: 740; }
.hl-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #9ec5df;
}

.compatibility, .package-platform, .preview-label {
  color: var(--muted);
  font-size: 0.86rem;
}

/* Scroll cue */
.scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 0.52rem;
  color: var(--subtle);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease, transform 0.25s var(--spring);
}
.scroll-cue:hover { color: var(--link); transform: translateY(2px); }
.scroll-mouse {
  width: 1.15rem;
  height: 1.75rem;
  border: 1.7px solid currentColor;
  border-radius: 999px;
  display: flex;
  justify-content: center;
  padding-top: 0.3rem;
}
.scroll-wheel {
  width: 3px;
  height: 6px;
  border-radius: 99px;
  background: currentColor;
}

/* ==================== SECTION HEADERS ==================== */
.section-eyebrow {
  color: var(--accent-deep);
  font-size: 0.75rem;
  font-weight: 760;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.28rem;
}
h2 {
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
  font-weight: 780;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--ink-strong);
}
h3 { font-size: 1.16rem; line-height: 1.38; color: var(--ink-strong); }

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
}
.section-lead {
  max-width: 32rem;
  color: var(--muted);
  font-size: 0.96rem;
}

/* ==================== FEATURE SHOWCASE ==================== */
.feature-section {
  position: relative;
  display: grid;
  align-content: center;
  padding-block: clamp(3rem, 5.8vw, 5rem);
  background:
    radial-gradient(ellipse 60% 45% at 88% 12%, rgba(224, 244, 255, 0.72), transparent 72%),
    #ffffff;
  border-block: 1px solid var(--line);
}

.feature-showcase {
  display: grid;
  gap: clamp(0.85rem, 2.2vw, 1.55rem);
  margin-top: 1.65rem;
}

.feature-tabs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 0.35rem;
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  background: linear-gradient(180deg, #f5faff 0%, #eef7ff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.tab-active-pill {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 0.82rem;
  background: #ffffff;
  border: 1px solid #bde0f5;
  box-shadow: 0 8px 20px rgba(17, 94, 142, 0.1), 0 1px 3px rgba(17, 94, 142, 0.06);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: transform 0.38s var(--spring), width 0.38s var(--spring), height 0.38s var(--spring), opacity 0.2s ease;
  will-change: transform, width, height;
}

.feature-tabs button {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.72rem;
  min-width: 0;
  padding: 0.56rem 0.72rem;
  border: 1px solid transparent;
  border-radius: 0.82rem;
  background: transparent;
  color: var(--ink);
  text-align: start;
  cursor: pointer;
  transition: color 0.22s ease, background-color 0.2s ease, transform 0.2s var(--spring);
}
.feature-tabs button:hover:not([aria-selected="true"]) {
  background: rgba(255, 255, 255, 0.55);
}
.feature-tabs button[aria-selected="true"] {
  color: var(--accent-deep);
}
.tab-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}
.tab-copy strong {
  font-size: 0.93rem;
  font-weight: 690;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tab-copy small {
  font-size: 0.74rem;
  color: var(--subtle);
  font-weight: 500;
  margin-top: 0.12rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.feature-tabs button[aria-selected="true"] .tab-copy small {
  color: #3a8bb3;
}

.feature-icon {
  display: grid;
  place-items: center;
  flex: none;
  inline-size: 2.35rem;
  block-size: 2.35rem;
  border-radius: 0.68rem;
  background: #e3f3fe;
  color: #0e78aa;
  transition: background-color 0.28s ease, color 0.28s ease, transform 0.32s var(--spring-bounce), box-shadow 0.28s ease;
}
.feature-tabs button:hover .feature-icon {
  transform: scale(1.06);
}
.feature-tabs button[aria-selected="true"] .feature-icon {
  background: linear-gradient(135deg, #32bbf8, #0f88c4);
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(15, 136, 196, 0.28);
  transform: scale(1.04);
}

.feature-glyph { font-weight: 760; font-size: 0.98rem; }
.feature-icon i, .feature-search { display: block; position: relative; }
.feature-search { inline-size: 0.85rem; block-size: 0.85rem; border: 1.75px solid currentColor; border-radius: 50%; }
.feature-search::after {
  content: "";
  position: absolute;
  inline-size: 0.4rem;
  block-size: 1.75px;
  top: 0.62rem;
  left: 0.57rem;
  background: currentColor;
  transform: rotate(45deg);
}
.feature-note, .feature-book { width: 0.9rem; height: 1.08rem; border: 1.6px solid; border-radius: 3px; }
.feature-note::after, .feature-book::after {
  content: "";
  position: absolute;
  width: 0.44rem;
  height: 1.4px;
  top: 0.31rem;
  left: 0.14rem;
  background: currentColor;
  box-shadow: 0 0.25rem 0 currentColor;
}
.feature-book { border-left-width: 3px; }
.feature-cursor {
  width: 1.05rem;
  height: 1.24rem;
  background: currentColor;
  clip-path: polygon(15% 4%, 90% 64%, 56% 66%, 70% 91%, 52% 98%, 38% 72%, 15% 89%);
}
.feature-repeat { width: 1.1rem; height: 1.1rem; border: 1.7px solid; border-right-color: transparent; border-radius: 50%; }
.feature-repeat::after {
  content: "";
  position: absolute;
  top: -0.08rem;
  right: -0.05rem;
  width: 0.38rem;
  height: 0.45rem;
  background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  transform: rotate(42deg);
}

/* Spotlight surface helper */
.spotlight-surface {
  position: relative;
  overflow: hidden;
}
.spotlight-surface::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), rgba(52, 188, 252, 0.17), transparent 65%);
  transition: opacity 0.3s ease;
  z-index: 0;
}
.spotlight-surface:hover::before { opacity: 1; }

.feature-preview {
  display: grid;
  min-width: 0;
  padding: clamp(0.75rem, 1.8vw, 1.25rem);
  border: 1px solid #c5e2f5;
  border-radius: 1.35rem;
  background:
    radial-gradient(ellipse at 92% 8%, rgba(188, 232, 255, 0.85), transparent 64%),
    linear-gradient(145deg, #f2faff 0%, #e4f2fc 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 18px 44px rgba(17, 81, 124, 0.08);
}

.app-window {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  min-width: 0;
  border: 1px solid rgba(196, 223, 241, 0.95);
  border-radius: 0.95rem;
  background: white;
  box-shadow: 0 14px 36px rgba(16, 67, 104, 0.12);
  isolation: isolate;
}

.app-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.62rem 0.95rem;
  border-bottom: 1px solid #e1edf6;
  background: linear-gradient(180deg, #ffffff 0%, #f8fcff 100%);
}
.app-bar-left {
  display: flex;
  align-items: center;
  gap: 0.72rem;
}
.window-dots {
  display: inline-flex;
  gap: 0.34rem;
}
.window-dots i {
  width: 0.56rem;
  height: 0.56rem;
  border-radius: 50%;
  background: #d7e7f4;
}
.window-dots i:nth-child(1) { background: #ff8c82; }
.window-dots i:nth-child(2) { background: #ffd166; }
.window-dots i:nth-child(3) { background: #5cd69a; }

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  font-size: 0.86rem;
  font-weight: 720;
  color: var(--ink-strong);
}
.app-brand img {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.preview-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: #eaf7ff;
  border: 1px solid #cce9fa;
  color: var(--accent-deep);
  font-size: 0.75rem;
  font-weight: 660;
}
.badge-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1ea8e8;
}

/* Panels */
.demo-panel {
  display: grid;
  grid-template-rows: 1fr auto;
  min-width: 0;
}
.demo-panel:focus-visible { outline: 2.5px solid var(--accent-deep); outline-offset: -3px; }
.demo-panel:not([hidden]) ~ .demo-panel:not([hidden]) { border-top: 1px solid var(--line); }
.with-tabs .demo-panel { grid-area: 2 / 1; background: #fff; }
.with-tabs .demo-panel[hidden] { display: grid !important; visibility: hidden; pointer-events: none; }

.demo-view, .demo-main {
  min-width: 0;
  padding: clamp(1rem, 2.4vw, 1.75rem);
}
.demo-view { min-block-size: 21.8rem; }
.demo-view h3 { font-size: clamp(1.22rem, 2.1vw, 1.56rem); font-weight: 740; }
.demo-view .demo-word {
  font-size: clamp(2.05rem, 3.8vw, 2.95rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
  color: var(--ink-strong);
}

.word-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.word-title-group { display: flex; flex-direction: column; gap: 0.38rem; }
.phonetic-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.phonetic-text {
  color: var(--subtle);
  font-size: 0.92rem;
  font-family: "Segoe UI", system-ui, sans-serif;
}

/* Sound wave button */
.speak-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.2rem 0.58rem;
  border: 1px solid #cde8f9;
  border-radius: 999px;
  background: #eff9ff;
  color: var(--accent-deep);
  font-size: 0.76rem;
  font-weight: 650;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s var(--spring);
}
.speak-pill:hover { background: #ddf2ff; border-color: #93d2f5; }
.speak-pill:active { transform: scale(0.95); }
.wave-bars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 12px;
}
.wave-bars i {
  display: block;
  width: 2px;
  height: 5px;
  border-radius: 99px;
  background: currentColor;
  transition: height 0.2s ease;
}
.wave-bars i:nth-child(2) { height: 10px; }
.wave-bars i:nth-child(3) { height: 7px; }
.wave-bars i:nth-child(4) { height: 4px; }
.speak-pill.is-speaking {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  color: white;
}

.exam-tags {
  display: inline-flex;
  gap: 0.28rem;
}
.exam-tags span {
  padding: 0.12rem 0.44rem;
  border-radius: 0.35rem;
  background: #f1f7fc;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 640;
}

.preview-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.34rem 0.74rem;
  border: 1px solid #bfe3f8;
  border-radius: 0.62rem;
  background: var(--wash);
  color: var(--accent-deep);
  font-size: 0.84rem;
  font-weight: 670;
}
.subtle-chip {
  border-color: #ddebf6;
  background: #f7fbff;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
}
.action-chip {
  cursor: pointer;
  background: linear-gradient(135deg, #34bcfc, #1597d8);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(17, 146, 212, 0.25);
  transition: transform 0.24s var(--spring-bounce), box-shadow 0.24s ease, background 0.24s ease;
}
.action-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(17, 146, 212, 0.34);
}
.action-chip[data-saved="true"] {
  background: linear-gradient(135deg, #22c58b, #149e6d);
  box-shadow: 0 6px 16px rgba(20, 158, 109, 0.26);
}

/* Lookup panel */
.lookup-view {
  display: grid;
  grid-template-columns: minmax(9.5rem, 0.37fr) minmax(0, 1fr);
  padding: 0;
}
.demo-sidebar {
  display: flex;
  flex-direction: column;
  padding: 0.95rem 0.8rem;
  border-right: 1px solid #e2eef7;
  background: #f8fcff;
}
.preview-query {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.38rem;
  margin-block: 0.38rem 0.85rem;
  padding: 0.38rem 0.56rem;
  border: 1.5px solid #a7d5ef;
  border-radius: 0.55rem;
  background: white;
  box-shadow: 0 3px 10px rgba(15, 118, 178, 0.08);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.preview-query:focus-within {
  border-color: var(--accent-deep);
  box-shadow: 0 0 0 3px rgba(52, 188, 252, 0.2);
}
.preview-query input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink-strong);
  font-size: 0.92rem;
  font-weight: 600;
}
.preview-query .feature-search { color: var(--link); flex: none; margin-right: 0.16rem; }
.list-label { margin-bottom: 0.34rem; }

.suggestion-list {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}
.preview-current, .preview-row {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0.38rem 0.52rem;
  border-radius: 0.48rem;
  text-align: left;
  font-size: 0.88rem;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s var(--spring);
}
.preview-row:hover {
  background: #ebf6ff;
  color: var(--ink);
  transform: translateX(2px);
}
.preview-current {
  background: #ddf2ff;
  color: var(--accent-deep);
  font-weight: 700;
}

.definition-block {
  margin-top: 0.95rem;
  padding-top: 0.82rem;
  border-top: 1px solid #e4eef7;
}
.glosses {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 0.6rem;
  row-gap: 0.28rem;
  margin: 0.42rem 0 0;
  font-size: 0.98rem;
}
.glosses dt {
  color: var(--accent-deep);
  font-weight: 700;
  font-style: italic;
}
.glosses dd { margin: 0; color: var(--ink); }

.related-interactive { margin-top: 1.05rem; }
.preview-related {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}
.related-pill {
  padding: 0.28rem 0.65rem;
  border: 1px solid #d5e9f7;
  border-radius: 999px;
  background: #f5fbff;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 640;
  cursor: pointer;
  transition: all 0.22s var(--spring);
}
.related-pill:hover { border-color: #93d0f2; color: var(--link); }
.related-pill.is-active {
  background: #dff3ff;
  border-color: #7cc9f3;
  color: var(--accent-deep);
}
.related-drawer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.62rem;
  padding: 0.62rem 0.72rem;
  border-radius: 0.65rem;
  background: #f6fbff;
  border: 1px solid #e2eff8;
}
.rel-item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.22rem 0.52rem;
  border-radius: 0.45rem;
  background: white;
  border: 1px solid #deecf7;
  font-size: 0.84rem;
  font-weight: 660;
  color: var(--link);
}
.rel-item small { color: var(--muted); font-weight: 450; font-size: 0.77rem; }

/* Segmented pills */
.segmented-pills {
  display: inline-flex;
  gap: 0.22rem;
  padding: 0.22rem;
  border-radius: 0.68rem;
  background: #edf6fd;
  border: 1px solid #d7e9f6;
}
.seg-pill {
  padding: 0.26rem 0.65rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 640;
  cursor: pointer;
  transition: all 0.22s var(--spring);
}
.seg-pill:hover { color: var(--link); }
.seg-pill.is-active {
  background: white;
  color: var(--accent-deep);
  box-shadow: 0 2px 8px rgba(15, 78, 122, 0.11);
}

/* Notes & Morpheme Builder */
.sample-block {
  margin-top: 0.85rem;
  padding: 0.78rem 0.92rem;
  border-radius: 0.78rem;
  border: 1px solid #deedf8;
  background: #f4faff;
  color: #214a63;
}
.sample-block p + p { margin-top: 0.25rem; }
.block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}
.hint-tag {
  padding: 0.12rem 0.48rem;
  border-radius: 999px;
  background: #ddf2ff;
  color: var(--accent-deep);
  font-size: 0.72rem;
  font-weight: 680;
}

.morpheme-builder {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.morpheme-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0.42rem 0.72rem;
  border: 1.5px solid #c6e4f7;
  border-radius: 0.65rem;
  background: white;
  cursor: pointer;
  transition: transform 0.24s var(--spring-bounce), border-color 0.2s ease, box-shadow 0.24s ease, background-color 0.2s ease;
}
.morpheme-chip strong { font-size: 1rem; color: var(--accent-deep); }
.morpheme-chip span { font-size: 0.74rem; color: var(--muted); }
.morpheme-chip:hover, .morpheme-chip.is-lit {
  border-color: #46bef6;
  background: #f0faff;
  box-shadow: 0 6px 14px rgba(18, 134, 196, 0.14);
  transform: translateY(-2px);
}
.morpheme-op { font-weight: 760; color: #6ca9cc; font-size: 1rem; }
.morpheme-result {
  flex: 1 1 11rem;
  display: flex;
  flex-direction: column;
  padding: 0.45rem 0.78rem;
  border-radius: 0.65rem;
  background: linear-gradient(135deg, #e2f5ff, #eef9ff);
  border: 1px solid #bce2f8;
}
.morpheme-result strong { color: var(--ink-strong); font-size: 0.98rem; }
.morpheme-result span { font-size: 0.8rem; color: #1b5a7d; }

.exam-en { font-size: 1rem; color: var(--ink-strong); line-height: 1.6; }
.exam-zh { font-size: 0.92rem; color: var(--muted); }
mark {
  padding: 0.05em 0.24em;
  border-radius: 0.3em;
  background: #d2effe;
  color: #085680;
  font-weight: 640;
}

/* Hover Lookup Panel */
.reading-sample {
  position: relative;
  margin-top: 0.95rem;
  padding: 1.05rem 1.2rem 13.2rem;
  border: 1px solid #d5e7f5;
  border-radius: 0.85rem;
  background:
    radial-gradient(circle at 85% 15%, rgba(224, 244, 255, 0.65), transparent 60%),
    #f9fcff;
  min-block-size: 19.5rem;
}
.reading-meta {
  font-size: 0.7rem;
  font-weight: 720;
  letter-spacing: 0.1em;
  color: var(--subtle);
  margin-bottom: 0.55rem;
}
.reading-prose {
  font-size: 1.08rem;
  line-height: 1.9;
  color: #213e54;
}
.demo-hover-target {
  display: inline-block;
  padding: 0.04em 0.28em;
  margin-inline: 0.04em;
  border: 1px solid rgba(52, 188, 252, 0.35);
  border-radius: 0.35em;
  background: rgba(213, 239, 252, 0.72);
  color: #085d8a;
  font-weight: 660;
  cursor: pointer;
  transition: background-color 0.18s ease, transform 0.2s var(--spring), border-color 0.2s ease, box-shadow 0.2s ease;
}
.demo-hover-target:hover,
.demo-hover-target[aria-expanded="true"] {
  background: #bde9fe;
  border-color: #34bcfc;
  box-shadow: 0 4px 12px rgba(17, 134, 196, 0.18);
  transform: translateY(-1px);
}

.hover-card {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 4;
  min-width: 17.5rem;
  max-width: min(22rem, calc(100% - 1.5rem));
  padding: 0.78rem 0.92rem;
  border: 1px solid #9dd5f7;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 34px rgba(14, 72, 112, 0.17), 0 0 0 1px rgba(255, 255, 255, 0.85);
  transform: translate3d(var(--tip-x, 1.5rem), var(--tip-y, 5.2rem), 0);
  transition: transform 0.34s var(--spring), opacity 0.2s ease;
}
.hover-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
}
.hover-card strong { font-size: 1.12rem; color: var(--ink-strong); }
.hover-ipa { font-size: 0.78rem; color: var(--subtle); }
.hover-card > p { margin-top: 0.24rem; font-size: 0.88rem; color: var(--ink); }
.hover-mnemonic {
  display: flex;
  align-items: flex-start;
  gap: 0.42rem;
  margin-top: 0.5rem !important;
  padding: 0.42rem 0.58rem;
  border-radius: 0.52rem;
  background: #f1f9ff;
  border: 1px solid #d9eefb;
  color: #215473 !important;
  font-size: 0.78rem !important;
  line-height: 1.5;
}
.hover-mnemonic span {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.08rem;
  border-radius: 0.3rem;
  background: #d8f0fe;
  color: var(--accent-deep);
  font-size: 0.68rem;
  font-weight: 760;
}
.hover-card-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  margin-top: 0.58rem;
  padding-top: 0.5rem;
  border-top: 1px solid #e6f1fa;
}
.hover-star-btn,
.hover-open-btn {
  border: 1px solid #cbe5f7;
  border-radius: 0.46rem;
  background: white;
  color: var(--link);
  font-size: 0.76rem;
  font-weight: 660;
  padding: 0.22rem 0.58rem;
  cursor: pointer;
  transition: all 0.2s var(--spring);
}
.hover-star-btn:hover { background: #e8f7ff; border-color: #6bc8f5; }
.hover-star-btn.is-starred {
  background: #e5faf2;
  border-color: #7cdbb8;
  color: #0e7c55;
}
.hover-open-btn {
  background: linear-gradient(135deg, #34bcfc, #1597d8);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(17, 146, 212, 0.22);
}
.hover-open-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 16px rgba(17, 146, 212, 0.32);
}

/* OCR & Translation Panel */
.ocr-stage {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.7rem;
}
.translation-input {
  position: relative;
  overflow: hidden;
  margin-top: 0;
  background: #f6fbff;
}
.ocr-marquee {
  position: absolute;
  inset: 5px;
  border: 1.5px dashed rgba(24, 152, 218, 0.55);
  border-radius: 0.62rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.28s ease;
}
.ocr-stage.is-ocr .ocr-marquee { opacity: 1; }
.ocr-marquee .corner {
  position: absolute;
  width: 10px;
  height: 10px;
  border: 2.5px solid #1698db;
}
.ocr-marquee .tl { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-radius: 3px 0 0 0; }
.ocr-marquee .tr { top: -2px; right: -2px; border-left: 0; border-bottom: 0; border-radius: 0 3px 0 0; }
.ocr-marquee .bl { bottom: -2px; left: -2px; border-right: 0; border-top: 0; border-radius: 0 0 0 3px; }
.ocr-marquee .br { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-radius: 0 0 3px 0; }

.ocr-laser {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 34%, rgba(52, 188, 252, 0.28) 50%, rgba(14, 134, 198, 0.55) 52%, transparent 66%);
  transform: translateX(-110%);
}
.ocr-badge {
  position: absolute;
  right: 8px;
  bottom: 6px;
  padding: 0.1rem 0.45rem;
  border-radius: 0.32rem;
  background: rgba(14, 134, 198, 0.12);
  color: var(--accent-deep);
  font-size: 0.68rem;
  font-weight: 700;
}

.mini-action-btn {
  position: relative;
  z-index: 2;
  padding: 0.22rem 0.6rem;
  border: 1px solid #c6e4f7;
  border-radius: 0.48rem;
  background: white;
  color: var(--link);
  font-size: 0.76rem;
  font-weight: 660;
  cursor: pointer;
  transition: all 0.2s var(--spring);
}
.mini-action-btn:hover { background: #e8f7ff; border-color: #6bc8f5; transform: translateY(-1px); }
.mini-action-btn.primary-mini {
  background: linear-gradient(135deg, #34bcfc, #1394d6);
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 12px rgba(19, 148, 214, 0.24);
}
.mini-action-btn.primary-mini:hover {
  box-shadow: 0 8px 18px rgba(19, 148, 214, 0.34);
}

.trans-arrow-divider {
  display: flex;
  justify-content: center;
  margin-block: -0.1rem;
}
.trans-pulse-icon {
  display: grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  background: #e5f5ff;
  border: 1px solid #c4e4f7;
  color: var(--accent-deep);
  font-size: 0.82rem;
  font-weight: 760;
}
.translation-output {
  margin-top: 0;
  background: linear-gradient(135deg, #eff9ff, #ffffff);
  border-color: #c7e5f7;
}
#trans-out-text { font-size: 1.02rem; font-weight: 600; color: var(--ink-strong); }

/* Cloud Wordbook Panel */
.quick-add-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.36rem;
}
.quick-add-chip {
  padding: 0.24rem 0.62rem;
  border: 1px solid #bfe3f8;
  border-radius: 999px;
  background: #f0f9ff;
  color: var(--accent-deep);
  font-size: 0.79rem;
  font-weight: 660;
  cursor: pointer;
  transition: all 0.22s var(--spring-bounce);
}
.quick-add-chip:hover {
  background: #d8f1ff;
  border-color: #5bc3f7;
  transform: translateY(-2px);
}
.quick-add-chip.is-added {
  background: #e8faf3;
  border-color: #8adcb9;
  color: #0e7c55;
}

.wordbook-wrap {
  margin-top: 0.85rem;
  max-height: 13.5rem;
  overflow-y: auto;
  border: 1px solid #e2eef7;
  border-radius: 0.75rem;
}
.demo-wordbook {
  border-collapse: collapse;
  width: 100%;
  text-align: start;
}
.demo-wordbook th, .demo-wordbook td {
  padding: 0.56rem 0.74rem;
  border-bottom: 1px solid #eaf2f8;
  text-align: start;
  font-size: 0.9rem;
}
.demo-wordbook tr:last-child td { border-bottom: 0; }
.demo-wordbook th {
  background: #f7fbff;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 680;
}
.demo-wordbook td:first-child { color: var(--accent-deep); font-weight: 700; }
.col-action { text-align: right !important; }
.status-pill {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: #e8f8f2;
  color: #0f7e56;
  font-size: 0.72rem;
  font-weight: 660;
}

/* Today Study & Desktop-to-Phone Sync */
.study-demo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(11.4rem, 12.8rem);
  align-items: center;
  gap: clamp(1rem, 2.6vw, 1.9rem);
  position: relative;
}
.study-desktop { min-width: 0; }
.study-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.study-progress {
  height: 0.46rem;
  margin-block: 0.52rem 0.72rem;
  overflow: hidden;
  border-radius: 999px;
  background: #e1f0fb;
}
.study-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #34bcfc, #0d85c1);
  transition: width 0.55s var(--spring);
}
.study-table {
  border: 1px solid #e2eef7;
  border-radius: 0.65rem;
  overflow: hidden;
}
.sync-row-btn {
  padding: 0.18rem 0.52rem;
  border: 1px solid #c3e2f6;
  border-radius: 0.42rem;
  background: #f1faff;
  color: var(--accent-deep);
  font-size: 0.76rem;
  font-weight: 660;
  cursor: pointer;
  transition: all 0.2s var(--spring);
}
.sync-row-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #07263a;
  transform: translateX(2px);
}

.study-phone {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  max-width: 12.6rem;
  min-block-size: 21.6rem;
  margin-inline: auto;
  padding: 0.65rem 0.85rem 0.58rem;
  border: 0.32rem solid #1a3346;
  border-radius: 2rem;
  text-align: center;
  background:
    radial-gradient(circle at 50% 18%, rgba(201, 237, 255, 0.72), transparent 62%),
    linear-gradient(180deg, #ffffff 0%, #eef8ff 64%, #e2f3fe 100%);
  box-shadow:
    0 18px 36px rgba(15, 62, 96, 0.2),
    0 2px 8px rgba(15, 62, 96, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transition: transform 0.35s var(--spring-bounce), box-shadow 0.35s ease;
}
.study-phone.is-receiving {
  box-shadow: 0 20px 40px rgba(24, 159, 224, 0.34), 0 0 0 4px rgba(52, 188, 252, 0.28);
}
.phone-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.66rem;
  font-weight: 700;
  color: #4b6c84;
  padding-inline: 0.25rem;
}
.phone-notch {
  display: block;
  width: 3.2rem;
  height: 0.42rem;
  border-radius: 999px;
  background: #1a3346;
}
.phone-signal {
  font-size: 0.62rem;
  letter-spacing: 0.02em;
}
.phone-screen-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding-block: 0.8rem;
}
.phone-app-pill {
  padding: 0.16rem 0.58rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid #cde6f7;
  color: var(--link);
  font-size: 0.7rem;
  font-weight: 680;
}
.phone-word-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}
.study-phone strong {
  color: var(--ink-strong);
  font-size: clamp(1.6rem, 2.6vw, 1.95rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
}
.phone-ipa { font-size: 0.8rem; color: var(--subtle); }
.phone-answer-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.44rem;
  min-height: 5.5rem;
  width: 100%;
}
.phone-reveal-btn {
  padding: 0.36rem 0.86rem;
  border: 1px solid #b9e2fa;
  border-radius: 999px;
  background: #dff3ff;
  color: #09567d;
  font-size: 0.78rem;
  font-weight: 680;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s var(--spring), border-color 0.2s ease;
}
.phone-reveal-btn:hover { background: #c5eafe; border-color: #79ccf5; transform: scale(1.03); }
.phone-def {
  width: 100%;
  padding: 0.38rem 0.54rem;
  border-radius: 0.62rem;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #d5eaf8;
  font-size: 0.79rem;
  color: var(--ink);
  font-weight: 620;
}
.phone-rate-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.32rem;
  width: 100%;
}
.rate-btn {
  padding: 0.3rem 0.2rem;
  border-radius: 0.52rem;
  border: 1px solid transparent;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s var(--spring), background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.rate-btn:hover { transform: translateY(-1.5px); }
.rate-know {
  background: #e5faf2;
  border-color: #9be5c7;
  color: #0e7c55;
}
.rate-know:hover { background: #d0f6e7; box-shadow: 0 4px 10px rgba(14, 124, 85, 0.16); }
.rate-vague {
  background: #fff6e5;
  border-color: #f6d08b;
  color: #b45309;
}
.rate-vague:hover { background: #ffecc8; box-shadow: 0 4px 10px rgba(180, 83, 9, 0.14); }
.rate-forget {
  background: #fff0f2;
  border-color: #f7b4be;
  color: #c82842;
}
.rate-forget:hover { background: #ffe0e5; box-shadow: 0 4px 10px rgba(200, 40, 66, 0.14); }
.phone-bottom-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.38rem;
  font-size: 0.68rem;
  color: #6b8ba2;
}
.phone-home-bar {
  display: block;
  width: 3.4rem;
  height: 0.24rem;
  border-radius: 999px;
  background: rgba(26, 51, 70, 0.24);
}

.study-transfer {
  display: none;
  position: absolute;
  z-index: 6;
  top: 46%;
  left: 44%;
  padding: 0.26rem 0.72rem;
  border: 1px solid #8bd2f7;
  border-radius: 999px;
  background: white;
  color: var(--accent-deep);
  font-weight: 740;
  font-size: 0.85rem;
  box-shadow: 0 10px 26px rgba(14, 128, 190, 0.28);
  pointer-events: none;
}
.study-transfer b { padding-inline-start: 0.25rem; }

/* 3D Flip Flashcard Deck */
.review-deck-view {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.85rem;
}
.deck-dots {
  display: inline-flex;
  gap: 0.36rem;
  align-items: center;
}
.deck-dots span {
  width: 0.52rem;
  height: 0.52rem;
  border-radius: 999px;
  background: #d5e7f5;
  transition: width 0.3s var(--spring), background-color 0.25s ease;
}
.deck-dots span.is-current {
  width: 1.5rem;
  background: var(--accent-deep);
}
.deck-dots span.is-done {
  background: #27c089;
}
.deck-dots span.is-vague {
  background: #f59e0b;
}
.deck-dots span.is-forget {
  background: #f43f5e;
}

.flashcard-stage {
  position: relative;
  height: 11.4rem;
  max-width: 28rem;
  width: 100%;
  margin-inline: auto;
  perspective: 1100px;
}
.card-stack-bg {
  position: absolute;
  inset: 0;
  border-radius: 1rem;
  border: 1px solid #d4e8f7;
  background: #f4faff;
  pointer-events: none;
  transition: transform 0.35s var(--spring);
}
.stack-1 { transform: translateY(8px) scale(0.955); opacity: 0.85; }
.stack-2 { transform: translateY(15px) scale(0.91); opacity: 0.55; }

.flashcard-3d {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  cursor: pointer;
  transition: transform 0.58s var(--spring);
}
.flashcard-3d.is-flipped {
  transform: rotateY(180deg);
}
.flashcard-3d.swipe-right {
  transform: translateX(130px) rotate(11deg) scale(0.92);
  opacity: 0;
  transition: transform 0.36s ease-in, opacity 0.28s ease-in;
}
.flashcard-3d.swipe-left {
  transform: translateX(-130px) rotate(-11deg) scale(0.92);
  opacity: 0;
  transition: transform 0.36s ease-in, opacity 0.28s ease-in;
}
.flashcard-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1.15rem 1.35rem;
  border-radius: 1rem;
  border: 1px solid #c3e2f6;
  background: linear-gradient(150deg, #ffffff 0%, #f0f9ff 100%);
  box-shadow: 0 12px 28px rgba(17, 79, 120, 0.1);
  text-align: center;
}
.flashcard-back {
  transform: rotateY(180deg);
  align-items: flex-start;
  text-align: left;
  background: linear-gradient(150deg, #eef9ff 0%, #ffffff 100%);
  border-color: #84ccf5;
}
.card-kicker {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent-deep);
  letter-spacing: 0.04em;
}
.review-word {
  font-size: clamp(1.85rem, 3.3vw, 2.35rem);
  font-weight: 780;
  color: var(--ink-strong);
  margin-top: 0.2rem;
  letter-spacing: -0.03em;
}
.fc-ipa { font-size: 0.9rem; color: var(--subtle); margin-top: 0.1rem; }
.flip-cue {
  margin-top: 0.7rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: #e5f5ff;
  color: var(--link);
  font-size: 0.76rem;
  font-weight: 660;
}
.fc-glosses { margin-top: 0.45rem; font-size: 0.94rem; }
.fc-note {
  margin-top: 0.58rem;
  padding: 0.34rem 0.58rem;
  border-radius: 0.5rem;
  background: #edf7ff;
  color: #215777;
  font-size: 0.8rem;
  width: 100%;
}

.flashcard-footer-slot {
  display: grid;
  place-items: center;
  min-height: 2.85rem;
  margin-top: 0.65rem;
}
.fc-pre-hint {
  font-size: 0.84rem;
  color: var(--subtle);
  padding: 0.42rem 0.9rem;
  border-radius: 999px;
  background: #f4faff;
  border: 1px dashed #c8e3f5;
}
.flashcard-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  max-width: 24rem;
  width: 100%;
  margin: 0 auto;
}
.flashcard-actions:not([hidden]) {
  animation: word-pop 0.3s var(--spring) both;
}
.fc-btn {
  padding: 0.52rem 0.95rem;
  border: 1px solid transparent;
  border-radius: 0.72rem;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.22s var(--spring), background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.22s ease;
}
.fc-btn:hover { transform: translateY(-2px); }
.fc-know {
  background: linear-gradient(135deg, #27c58d, #159e6d);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(21, 158, 109, 0.24);
}
.fc-know:hover { box-shadow: 0 10px 22px rgba(21, 158, 109, 0.34); }
.fc-vague {
  background: #fff6e5;
  border-color: #f4cb80;
  color: #b45309;
}
.fc-vague:hover {
  background: #ffecc8;
  border-color: #e9b251;
  box-shadow: 0 8px 18px rgba(180, 83, 9, 0.14);
}
.fc-forget {
  background: #fff0f2;
  border-color: #f5aeb8;
  color: #c82842;
}
.fc-forget:hover {
  background: #ffe0e5;
  border-color: #eb8796;
  box-shadow: 0 8px 18px rgba(200, 40, 66, 0.15);
}

.demo-caption {
  padding: 0.72rem clamp(1rem, 2.4vw, 1.75rem);
  border-top: 1px solid #e2eef7;
  background: #f7fbff;
  color: var(--muted);
  font-size: 0.88rem;
  text-wrap: pretty;
}

/* ==================== DOWNLOAD SECTION ==================== */
.download-screen, .history-screen { display: grid; }
.download-screen {
  background:
    radial-gradient(ellipse 55% 50% at 15% 20%, rgba(215, 242, 255, 0.68), transparent 70%),
    var(--canvas);
}
.download-section {
  align-self: center;
  padding-block: clamp(3rem, 6vh, 4.8rem);
}

.download-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem 1.4rem;
}
.download-heading .compatibility { margin-top: 0.42rem; }
.version-tag {
  display: inline-block;
  padding: 0.06rem 0.48rem;
  border-radius: 0.42rem;
  background: #e1f4ff;
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
}
.github-release-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.86rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: white;
  font-size: 0.88rem;
  font-weight: 650;
  text-decoration: none;
  transition: all 0.22s var(--spring);
}
.github-release-link:hover {
  border-color: #82c6eb;
  background: #eff9ff;
  transform: translateY(-1px);
}

.quark {
  margin-top: 1.55rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  padding: 1.35rem clamp(1.2rem, 2.8vw, 1.85rem);
  border: 1px solid #b5ddf6;
  border-radius: 1.25rem;
  background:
    radial-gradient(ellipse 46% 90% at 96% 10%, rgba(72, 198, 255, 0.20), transparent 72%),
    linear-gradient(135deg, #e7f6ff 0%, #f6fbff 55%, #ffffff 100%);
  box-shadow: 0 10px 28px rgba(15, 86, 134, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.92);
  transition: border-color 0.25s ease, box-shadow 0.3s ease, transform 0.28s var(--spring);
}
.quark:hover {
  border-color: #6bc4f3;
  box-shadow: 0 16px 38px rgba(13, 114, 174, 0.14);
  transform: translateY(-2px);
}
.quark-lead {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}
.quark-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 3.3rem;
  height: 3.3rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, #2cb9f9, #0c84c6);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(12, 132, 198, 0.26);
}
.quark-copy { position: relative; z-index: 1; min-width: 0; }
.quark-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.42rem;
  margin-bottom: 0.35rem;
}
.quark-badge {
  display: inline-block;
  padding: 0.14rem 0.58rem;
  border-radius: 999px;
  background: rgba(12, 132, 198, 0.13);
  color: var(--accent-deep);
  font-size: 0.74rem;
  font-weight: 720;
}
.quark-subbadge {
  display: inline-block;
  padding: 0.14rem 0.56rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid #cce6f6;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 600;
}
.quark p { color: var(--muted); margin-top: 0.24rem; font-size: 0.92rem; }
.quark .button { position: relative; z-index: 1; padding-inline: 1.45rem; }

.packages {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.95rem, 2.2vw, 1.45rem);
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}
.package-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 1.4rem;
  border: 1px solid #d4e6f4;
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 24px rgba(15, 62, 96, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transition: transform 0.3s var(--spring), border-color 0.25s ease, box-shadow 0.3s ease;
}
.package-card > * { position: relative; z-index: 1; }
.package-card:hover {
  transform: translateY(-5px);
  border-color: #7cc9f3;
  box-shadow: 0 18px 40px rgba(15, 76, 120, 0.12);
}
.package-card.is-recommended {
  border-color: #5fc0f3;
  background:
    radial-gradient(ellipse 80% 45% at 50% 0%, rgba(190, 234, 255, 0.45), transparent 70%),
    linear-gradient(180deg, #ffffff 0%, #f3faff 100%);
  box-shadow: 0 14px 36px rgba(14, 120, 182, 0.14), inset 0 2px 0 #35bcf9;
}
.package-card.is-recommended .button {
  background: linear-gradient(135deg, #2ab8f9 0%, #0c84c6 100%);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(12, 132, 198, 0.28);
}
.package-card.is-recommended .button:hover {
  background: linear-gradient(135deg, #3dc2ff 0%, #1193da 100%);
  color: #ffffff;
  box-shadow: 0 12px 26px rgba(12, 132, 198, 0.36);
}
.package-card.is-recommended .ext-pill {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}
.package-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  width: 100%;
  margin-bottom: 0.45rem;
}
.os-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.85rem;
  background: linear-gradient(145deg, #eef8ff, #dcf2ff);
  border: 1px solid #c3e4f8;
  color: var(--accent-deep);
  transition: transform 0.28s var(--spring-bounce), background-color 0.25s ease;
}
.package-card:hover .os-icon {
  transform: scale(1.06) rotate(-2deg);
}
.package-card.is-recommended .os-icon {
  background: linear-gradient(135deg, #2cb9f9, #0c84c6);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(12, 132, 198, 0.26);
}
.package-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}
.os-badge {
  padding: 0.18rem 0.58rem;
  border-radius: 999px;
  background: #edf7ff;
  border: 1px solid #d1e9f9;
  color: var(--accent-deep);
  font-size: 0.74rem;
  font-weight: 700;
}
.rec-badge {
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #2ab8f9, #0c84c6);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(12, 132, 198, 0.24);
}
.package-card h3 { font-size: 1.2rem; font-weight: 760; letter-spacing: -0.015em; }
.package-card .package-platform { font-size: 0.82rem; color: var(--subtle); font-weight: 600; }
.package-card .package-desc { color: var(--muted); font-size: 0.9rem; line-height: 1.6; margin-top: 0.15rem; }
.pkg-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  margin-top: 0.35rem;
  margin-bottom: 0.85rem;
}
.pkg-highlights span {
  padding: 0.14rem 0.54rem;
  border-radius: 0.45rem;
  background: #f4faff;
  border: 1px solid #deeffa;
  color: #3d637d;
  font-size: 0.74rem;
  font-weight: 600;
}
.package-card .button { margin-top: auto; width: 100%; justify-content: space-between; min-height: 2.85rem; }
.ext-pill {
  padding: 0.12rem 0.48rem;
  border-radius: 0.42rem;
  background: #e9f5fe;
  color: var(--accent-deep);
  font-size: 0.75rem;
  font-weight: 740;
  letter-spacing: 0.03em;
}

.install-help {
  margin-top: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem 1.2rem;
  padding: 0.9rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
}
.install-help details {
  flex: 1 1 20rem;
  padding: 0;
  border: 0;
  background: transparent;
}
.install-help details p { margin-top: 0.45rem; font-size: 0.9rem; }
.help-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0;
  font-size: 0.86rem;
}
.help-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.34rem 0.76rem;
  border-radius: 999px;
  border: 1px solid #cfe4f5;
  background: #f4faff;
  color: var(--accent-deep);
  font-weight: 640;
  text-decoration: none;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s var(--spring);
}
.help-pill:hover {
  border-color: #79c8f4;
  background: #e4f5ff;
  transform: translateY(-1px);
}
summary { cursor: pointer; color: var(--link); font-weight: 660; }

/* ==================== HISTORY SECTION ==================== */
.history-screen {
  grid-template-rows: 1fr auto;
  background:
    radial-gradient(ellipse 52% 42% at 88% 12%, rgba(223, 243, 255, 0.56), transparent 72%),
    #ffffff;
  border-top: 1px solid var(--line);
}
.history-section {
  align-self: center;
  padding-block: clamp(3rem, 6vh, 4.6rem);
}

.history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.7rem 1rem;
  margin-top: 1.45rem;
  padding: 0.62rem 0.78rem;
  border: 1px solid #d7e9f6;
  border-radius: 1rem;
  background: rgba(246, 251, 255, 0.92);
  box-shadow: 0 6px 20px rgba(15, 68, 108, 0.04);
}
.history-search-box {
  flex: 1 1 18rem;
  display: flex;
  align-items: center;
  gap: 0.52rem;
  padding: 0.44rem 0.78rem;
  border: 1px solid #cce3f4;
  border-radius: 0.72rem;
  background: #ffffff;
  color: var(--subtle);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.history-search-box:focus-within {
  border-color: var(--accent-deep);
  box-shadow: 0 0 0 3px rgba(52, 188, 252, 0.18);
  color: var(--accent-deep);
}
.history-search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink-strong);
  font-size: 0.9rem;
}
.history-search-box input::placeholder { color: #89a2b6; }
.history-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.history-tool-btn {
  padding: 0.42rem 0.82rem;
  border: 1px solid #cbe4f5;
  border-radius: 0.68rem;
  background: #ffffff;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 640;
  cursor: pointer;
  transition: all 0.2s var(--spring);
}
.history-tool-btn:hover {
  border-color: #7cc9f3;
  background: #eff9ff;
  color: var(--accent-deep);
}
.history-tool-btn[aria-pressed="true"] {
  background: #dff3ff;
  border-color: #6bc4f3;
  color: var(--accent-deep);
}
.history-count-pill {
  padding: 0.32rem 0.68rem;
  border-radius: 999px;
  background: #eaf6ff;
  color: var(--link);
  font-size: 0.8rem;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.history-list {
  position: relative;
  list-style: none;
  padding: 0.25rem 0 0.25rem 1.85rem;
  margin: 1.25rem 0 0;
  display: grid;
  gap: 0.88rem;
}
.history-list::before {
  content: "";
  position: absolute;
  top: 1.2rem;
  bottom: 1.2rem;
  left: 0.56rem;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, #32bbf8 0%, #c6e2f5 32%, #e0eef8 100%);
}

.history-row {
  position: relative;
  border: 1px solid #dcebf6;
  border-radius: 1.05rem;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 4px 16px rgba(15, 62, 96, 0.04);
  transition: border-color 0.24s ease, box-shadow 0.28s ease, transform 0.26s var(--spring), background-color 0.24s ease;
  overflow: visible;
}
.history-row::before { border-radius: 1.05rem; }
.history-row:hover {
  border-color: #9ed4f4;
  box-shadow: 0 12px 28px rgba(15, 74, 118, 0.09);
  transform: translateY(-2px);
}

.timeline-node {
  position: absolute;
  left: -1.63rem;
  top: 1.38rem;
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 50%;
  background: #ffffff;
  border: 2.5px solid #6cc3ee;
  box-shadow: 0 0 0 4px #ffffff;
  transition: transform 0.28s var(--spring-bounce), border-color 0.24s ease, background-color 0.24s ease, box-shadow 0.24s ease;
}
.history-row:first-child .timeline-node {
  background: #1ea8e8;
  border-color: #0e82bc;
  box-shadow: 0 0 0 4px rgba(45, 185, 246, 0.22);
}
.history-row:hover .timeline-node {
  transform: scale(1.24);
  border-color: #0d82bc;
  background: #34bcfc;
}

.history-card-body {
  position: relative;
  z-index: 1;
  padding: 1rem 1.2rem 0.92rem;
}
.history-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1.2rem;
}
.history-title-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  flex: 1 1 22rem;
  gap: 0.5rem 0.65rem;
  min-width: 0;
}
.history-ver-pill {
  flex: none;
  padding: 0.2rem 0.68rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #e5f6ff, #d5effe);
  border: 1px solid #bce2f7;
  color: var(--accent-deep);
  font-size: 0.94rem;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.history-badge {
  flex: none;
  padding: 0.14rem 0.52rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #32bbf8, #128cc8);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
}
.history-preview {
  flex: 1 1 14rem;
  min-width: 0;
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.history-dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  padding: 0.36rem 0.68rem;
  border: 1px solid #cfe3f2;
  border-radius: 0.62rem;
  background: #ffffff;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 650;
  text-decoration: none;
  transition: transform 0.22s var(--spring), border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.22s ease, color 0.2s ease;
}
.history-dl-btn em {
  font-style: normal;
  padding: 0.06rem 0.36rem;
  border-radius: 0.34rem;
  background: #edf7ff;
  color: var(--accent-deep);
  font-size: 0.7rem;
  font-weight: 740;
}
.history-dl-btn:hover {
  border-color: #7cc8f2;
  background: #eef9ff;
  color: var(--accent-deep);
  transform: translateY(-1.5px);
  box-shadow: 0 5px 14px rgba(14, 108, 162, 0.12);
}
.history-dl-btn.is-os-match {
  border-color: #9ed5f5;
  background: #f2faff;
}
.history-dl-btn.is-os-match em {
  background: #d5effe;
}

.history-notes {
  margin-top: 0.7rem;
  padding-top: 0.62rem;
  border-top: 1px dashed #e1eef7;
}
.history-notes summary {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  list-style: none;
  font-size: 0.84rem;
  font-weight: 660;
  color: var(--link);
  padding: 0.16rem 0.5rem 0.16rem 0.1rem;
  border-radius: 0.45rem;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.history-notes summary::-webkit-details-marker { display: none; }
.history-notes summary:hover {
  color: var(--accent-deep);
  background: #eef8ff;
}
.history-notes summary .chev {
  transition: transform 0.26s var(--spring);
}
.history-notes[open] summary .chev {
  transform: rotate(180deg);
}
.history-notes-body {
  margin-top: 0.52rem;
  padding: 0.68rem 0.88rem;
  border-radius: 0.72rem;
  background: #f5faff;
  border: 1px solid #e1eff9;
}
.history-changes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.36rem;
  color: #274a63;
  font-size: 0.89rem;
}
.history-changes li {
  position: relative;
  padding-left: 0.95rem;
}
.history-changes li::before {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 0.56em;
  width: 0.36rem;
  height: 0.36rem;
  border-radius: 50%;
  background: #36b9ed;
}
.history-release-link {
  margin-top: 0.56rem;
  padding-top: 0.45rem;
  border-top: 1px solid #e1eef8;
  font-size: 0.82rem;
}
.history-release-link a {
  text-decoration: none;
  font-weight: 640;
}
.history-release-link a:hover { text-decoration: underline; }
.history-fallback { margin: 0; font-size: 0.88rem; }

.history-empty {
  margin-top: 1rem;
  padding: 1.4rem;
  border: 1px dashed #c8e0f0;
  border-radius: 0.95rem;
  background: #f8fcff;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.history-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem 0.85rem;
  margin-top: 1.25rem;
  padding-left: 1.85rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Footer */
.site-footer {
  padding-block: 1.65rem 1.85rem;
  border-top: 1px solid var(--line);
  background: #f9fcff;
}
.footer-inner { flex-wrap: wrap; }
.footer-brand p { margin-top: 0.3rem; color: var(--muted); font-size: 0.88rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; }
.site-footer nav a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 620;
  text-decoration: none;
  transition: color 0.2s ease;
}
.site-footer nav a:hover { color: var(--accent-deep); text-decoration: underline; }

.redirect-body {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
  background:
    radial-gradient(ellipse 65% 55% at 50% 24%, rgba(206, 239, 255, 0.85), transparent 72%),
    linear-gradient(180deg, #f3faff 0%, #f9fcff 100%);
}
.redirect-card {
  width: min(30rem, 100%);
  padding: 2.2rem 2rem;
  border: 1px solid #cce4f5;
  border-radius: 1.45rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 22px 54px rgba(15, 76, 120, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  text-align: center;
}
.redirect-logo {
  margin: 0 auto 1rem;
  width: 52px;
  height: 52px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.redirect-card h1 {
  margin: 0.6rem 0 0.55rem;
  font-size: clamp(1.5rem, 4vw, 1.95rem);
  font-weight: 800;
  color: var(--ink-strong);
}
.redirect-sub {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.65;
}
.redirect-spinner {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  border: 2.5px solid #cde8fa;
  border-top-color: #0e89cb;
  animation: spin-slow 0.85s linear infinite;
}
.redirect-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.1rem;
  padding: 0.42rem 0.9rem;
  border-radius: 999px;
  background: #edf7ff;
  color: var(--accent-deep);
  font-size: 0.84rem;
  font-weight: 640;
}
.redirect-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
  margin-top: 1.45rem;
}
.redirect-actions .button { min-width: 9.5rem; }

/* ==================== ADVANCED MOTION & KEYFRAMES ==================== */
@media (prefers-reduced-motion: no-preference) {
  /* Hero entry choreography */
  .hero-copy > * {
    animation: hero-rise 0.75s var(--spring) both;
  }
  .hero-copy > *:nth-child(1) { animation-delay: 0.04s; }
  .hero-copy > *:nth-child(2) { animation-delay: 0.1s; }
  .hero-copy > *:nth-child(3) { animation-delay: 0.16s; }
  .hero-copy > *:nth-child(4) { animation-delay: 0.22s; }
  .hero-copy > *:nth-child(5) { animation-delay: 0.28s; }
  .hero-copy > *:nth-child(6) { animation-delay: 0.34s; }
  .hero-copy > *:nth-child(7) { animation-delay: 0.4s; }
  .hero-copy > *:nth-child(8) { animation-delay: 0.45s; }

  .orb-1 { animation: drift-1 16s ease-in-out infinite alternate; }
  .orb-2 { animation: drift-2 19s ease-in-out infinite alternate; }
  .orb-3 { animation: drift-3 14s ease-in-out infinite alternate; }

  .ring-outer { animation: spin-slow 26s linear infinite; }
  .ring-inner { animation: pulse-ring 3.8s ease-in-out infinite; }
  .live-dot { animation: live-pulse 2.2s ease-in-out infinite; }
  .badge-pulse { animation: live-pulse 2s ease-in-out infinite; }
  .scroll-wheel { animation: scroll-wheel-bob 1.8s ease-in-out infinite; }

  .float-word-1 { animation: float-bob-a 5.8s ease-in-out infinite; }
  .float-word-2 { animation: float-bob-b 6.6s ease-in-out infinite; }
  .float-word-3 { animation: float-bob-b 6.1s ease-in-out infinite; }
  .float-word-4 { animation: float-bob-a 7.1s ease-in-out infinite; }
  .float-word:hover { animation-play-state: paused; }

  /* Scroll-triggered reveal */
  .js-ready [data-reveal] {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.68s var(--spring), transform 0.68s var(--spring);
  }
  .js-ready [data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
  }

  /* Screen transitions */
  .screen[data-enter-from="below"] { --enter-offset: 16px; }
  .screen[data-enter-from="above"] { --enter-offset: -16px; }
  .screen[data-enter-from] > :is(.hero-stage, .wrap) {
    animation: enter-screen 0.56s var(--spring) both;
  }

  /* Tab scene crossfade & slide */
  .with-tabs .scene-entering {
    z-index: 2;
    animation: scene-enter 0.44s var(--spring) both;
  }
  .with-tabs .scene-leaving {
    visibility: visible !important;
    pointer-events: none;
    animation: scene-leave 0.34s ease both;
  }

  /* Micro content animations */
  .is-animating-word {
    animation: word-pop 0.38s var(--spring) both;
  }
  .speak-pill.is-speaking .wave-bars i {
    animation: eq-bounce 0.52s ease-in-out infinite alternate;
  }
  .speak-pill.is-speaking .wave-bars i:nth-child(2) { animation-delay: 0.12s; }
  .speak-pill.is-speaking .wave-bars i:nth-child(3) { animation-delay: 0.24s; }
  .speak-pill.is-speaking .wave-bars i:nth-child(4) { animation-delay: 0.08s; }

  .ocr-stage.is-scanning .ocr-laser {
    animation: ocr-sweep 0.95s cubic-bezier(0.28, 0.72, 0.25, 1) forwards;
  }
  .translation-output.is-revealing {
    animation: word-pop 0.42s var(--spring) both;
  }

  .row-fly-in {
    animation: save-word-row 0.65s var(--spring) both;
  }

  .study-transfer.is-flying {
    display: block;
    animation: transfer-arc 0.92s cubic-bezier(0.28, 0.68, 0.25, 1) both;
  }
  .study-phone.is-receiving {
    animation: phone-pop 0.48s var(--spring-bounce) both;
  }

  .history-row.is-appended {
    animation: hero-rise 0.48s var(--spring) both;
  }

  details[open] > :is(p, ul, dl, .history-notes-body) {
    animation: word-pop 0.28s var(--spring) both;
  }

  .button:active, .feature-tabs button:active, .fc-btn:active {
    transform: scale(0.97) !important;
  }

  @keyframes hero-rise {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
  }
  @keyframes drift-1 {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to { transform: translate3d(42px, 28px, 0) scale(1.1); }
  }
  @keyframes drift-2 {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to { transform: translate3d(-38px, 34px, 0) scale(1.08); }
  }
  @keyframes drift-3 {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to { transform: translate3d(26px, -28px, 0) scale(1.12); }
  }
  @keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
  }
  @keyframes pulse-ring {
    0%, 100% { opacity: 0.45; transform: scale(1); }
    50% { opacity: 0.95; transform: scale(1.04); }
  }
  @keyframes live-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(23, 184, 119, 0.35); }
    50% { box-shadow: 0 0 0 6px rgba(23, 184, 119, 0); }
  }
  @keyframes scroll-wheel-bob {
    0%, 100% { transform: translateY(0); opacity: 1; }
    65% { transform: translateY(7px); opacity: 0.2; }
  }
  @keyframes float-bob-a {
    0%, 100% { margin-top: 0; }
    50% { margin-top: -10px; }
  }
  @keyframes float-bob-b {
    0%, 100% { margin-top: 0; }
    50% { margin-top: 10px; }
  }
  @keyframes enter-screen {
    from { opacity: 0.65; transform: translateY(var(--enter-offset)); }
    to { opacity: 1; transform: translateY(0); }
  }
  @keyframes scene-enter {
    from { opacity: 0; transform: translateX(calc(2rem * var(--scene-direction, 1))) scale(0.99); }
    to { opacity: 1; transform: translateX(0) scale(1); }
  }
  @keyframes scene-leave {
    to { opacity: 0; transform: translateX(calc(-1.5rem * var(--scene-direction, 1))) scale(0.99); }
  }
  @keyframes word-pop {
    from { opacity: 0.2; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }
  @keyframes eq-bounce {
    from { height: 3px; }
    to { height: 12px; }
  }
  @keyframes ocr-sweep {
    from { transform: translateX(-110%); }
    to { transform: translateX(115%); }
  }
  @keyframes save-word-row {
    0% { opacity: 0; transform: translateY(-10px) scale(0.98); background: #b4e6fc; }
    55% { opacity: 1; background: #ddf3ff; }
    100% { opacity: 1; transform: translateY(0) scale(1); background: #eff9ff; }
  }
  @keyframes transfer-arc {
    0% { opacity: 0; transform: translate(-5.5rem, 2.2rem) scale(0.84); }
    20% { opacity: 1; transform: translate(-1.5rem, -1.6rem) scale(1.04); }
    68% { opacity: 1; transform: translate(3.5rem, -1.1rem) scale(1); }
    100% { opacity: 0; transform: translate(7.2rem, 0.35rem) scale(0.76); }
  }
  @keyframes phone-pop {
    0% { transform: scale(1); }
    45% { transform: scale(1.045) translateY(-3px); }
    100% { transform: scale(1); }
  }
}

/* ==================== DESKTOP FULL-SCREEN RHYTHM ==================== */
html { scroll-snap-type: y proximity; }
.screen { scroll-snap-align: start; }

@media (min-width: 55rem) and (min-height: 44rem) and (pointer: fine) and (hover: hover) and (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; scroll-snap-type: y mandatory; }
  html.section-moving { scroll-snap-type: none; }
  .screen { min-block-size: calc(100svh - var(--header-height)); scroll-snap-stop: always; }
}

@media (min-width: 50rem) and (pointer: fine) {
  .feature-showcase.with-tabs {
    grid-template-columns: minmax(14.5rem, 0.31fr) minmax(0, 1fr);
    align-items: start;
  }
  .feature-tabs { grid-template-columns: 1fr; }
}

/* Hide periphery float cards before they collide with center copy */
@media (max-width: 72rem) {
  .hero-float-layer { display: none; }
}

/* ==================== RESPONSIVE / MOBILE ==================== */
@media (max-width: 49.99rem), (pointer: coarse) {
  :root { --header-height: 3.85rem; --gutter: clamp(1rem, 4.5vw, 1.8rem); }
  html { overflow-anchor: none; scroll-snap-type: none; }
  .header-inner, .footer-inner, .feature-section > .wrap, .download-section, .history-section {
    max-width: 42rem;
  }
  .header-inner { gap: 0.45rem; }
  .brand { gap: 0.42rem; }
  .brand-text strong { font-size: 0.94rem; }
  .brand-text small { display: none; }
  .brand-icon-wrap { width: 34px; height: 34px; padding: 3px; }
  .main-nav { gap: 0.08rem; }
  .main-nav a { padding: 0.34rem 0.44rem; font-size: 0.82rem; }
  .main-nav .source-link { margin-left: 0.14rem; padding: 0.28rem 0.52rem; font-size: 0.8rem; }

  .hero {
    min-block-size: auto;
    padding-block: 2.6rem 2.4rem;
  }
  .hero-emblem { width: 5.6rem; height: 5.6rem; margin-bottom: 0.9rem; }
  h1 { font-size: clamp(2.55rem, 10vw, 3.8rem); }
  .summary { font-size: 0.98rem; }
  .hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: min(100%, 24rem);
    margin-inline: auto;
  }
  .hero-actions .ghost { grid-column: 1 / -1; }
  .hero-highlights {
    border-radius: 1rem;
    padding: 0.52rem 0.85rem;
    gap: 0.35rem 0.8rem;
  }
  .hl-dot { display: none; }
  .scroll-cue { display: none; }

  .feature-section { padding-block: 2.5rem; }
  .feature-tabs { gap: 0.28rem; padding: 0.36rem; }
  .feature-tabs button { gap: 0.48rem; padding: 0.46rem 0.52rem; }
  .tab-copy small { display: none; }
  .feature-tabs .feature-icon { inline-size: 1.9rem; block-size: 1.9rem; }
  .feature-preview { padding: 0.52rem; border-radius: 1rem; }
  .demo-view { min-block-size: 16rem; }

  .study-demo { grid-template-columns: minmax(0, 1fr); gap: 0.8rem; }
  .study-phone {
    max-width: 100%;
    min-block-size: auto;
    padding: 0.85rem 1rem;
    border-width: 0.2rem;
    border-radius: 1.15rem;
  }
  .phone-status, .phone-bottom-hint { display: none; }
  .phone-screen-body { padding-block: 0.2rem; gap: 0.45rem; }
  .phone-answer-zone { min-height: auto; }
  .study-transfer { left: 42%; top: auto; bottom: 4.5rem; }

  .packages { grid-template-columns: 1fr; }
  .quark .button { width: 100%; }
  .history-list { padding-left: 1.25rem; }
  .history-list::before { left: 0.32rem; }
  .timeline-node { left: -1.25rem; width: 0.64rem; height: 0.64rem; }
  .history-card-body { padding: 0.88rem 0.92rem; }
  .history-preview { flex-basis: 100%; white-space: normal; }
  .history-downloads { width: 100%; }
  .history-dl-btn { flex: 1 1 auto; justify-content: center; }
  .history-controls { padding-left: 0; }
}

@media (max-width: 36rem) {
  .lookup-view { grid-template-columns: minmax(0, 1fr); }
  .demo-sidebar {
    border-right: 0;
    border-bottom: 1px solid #e2eef7;
  }
  .suggestion-list {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .preview-current, .preview-row { width: auto; }
  .reading-sample { padding-bottom: 13.8rem; }
}

@media (max-width: 22rem) {
  .main-nav a { padding: 0.3rem 0.4rem; font-size: 0.8rem; }
  .feature-tabs button { font-size: 0.82rem; }
}

/* ==================== PACKAGE SIZE & SHA-256 CHECKSUMS ==================== */
.pkg-size-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.16rem 0.52rem;
  border-radius: 999px;
  background: rgba(14, 134, 198, 0.09);
  border: 1px solid rgba(14, 134, 198, 0.22);
  color: var(--accent-deep);
  font-size: 0.72rem;
  font-weight: 660;
  font-variant-numeric: tabular-nums;
}
.checksum-panel {
  margin-top: 1.05rem;
  border: 1px solid #d7e8f6;
  border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(8px);
  overflow: hidden;
}
.checksum-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.78rem 1.05rem;
  cursor: pointer;
  list-style: none;
  font-size: 0.86rem;
  font-weight: 640;
  color: var(--ink-strong);
}
.checksum-panel summary::-webkit-details-marker { display: none; }
.checksum-panel summary .chev {
  color: var(--muted);
  transition: transform 0.22s var(--spring);
}
.checksum-panel[open] summary .chev { transform: rotate(180deg); }
.checksum-list {
  list-style: none;
  margin: 0;
  padding: 0 1.05rem 0.95rem;
  display: grid;
  gap: 0.6rem;
  border-top: 1px solid #e7f1f8;
  padding-top: 0.8rem;
}
.checksum-row {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  padding: 0.62rem 0.78rem;
  border-radius: 0.68rem;
  background: #f6fbff;
  border: 1px solid #e1eef8;
}
.checksum-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.checksum-label {
  font-size: 0.82rem;
  font-weight: 680;
  color: var(--ink-strong);
}
.checksum-label em {
  font-style: normal;
  font-size: 0.7rem;
  padding: 0.08rem 0.42rem;
  border-radius: 999px;
  background: #e4f4ff;
  color: var(--accent-deep);
  margin-left: 0.3rem;
}
.checksum-file {
  font-size: 0.75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.checksum-code-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.checksum-hash {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.74rem;
  color: var(--accent-deep);
  word-break: break-all;
  line-height: 1.45;
}
.checksum-copy-btn {
  flex: none;
  padding: 0.24rem 0.66rem;
  border-radius: 0.48rem;
  border: 1px solid #c5e3f6;
  background: white;
  color: var(--accent-deep);
  font-size: 0.74rem;
  font-weight: 650;
  cursor: pointer;
  transition: all 0.18s ease;
}
.checksum-copy-btn:hover {
  background: #eaf7ff;
  border-color: #6bc8f5;
}
.checksum-copy-btn.is-copied {
  background: #e8faf3;
  border-color: #8adcb9;
  color: #0e7c55;
}
