:root {
  --bg: #f7f6f2;
  --bg-elevated: #ffffff;
  --bg-subtle: #efede6;
  --ink: #111318;
  --ink-muted: #545a68;
  --ink-faint: #7c8393;
  --border: rgba(17, 19, 24, 0.1);
  --border-strong: rgba(17, 19, 24, 0.18);
  --accent: #145ef2;
  --accent-deep: #0b3fb8;
  --accent-soft: rgba(20, 94, 242, 0.09);
  --seal: #c83728;
  --seal-soft: rgba(200, 55, 40, 0.1);
  --ok: #0d8a55;
  --ok-soft: rgba(13, 138, 85, 0.11);
  --shadow-sm: 0 2px 8px rgba(17, 19, 24, 0.05);
  --shadow-md: 0 14px 36px rgba(17, 19, 24, 0.08), 0 2px 8px rgba(17, 19, 24, 0.04);
  --shadow-lg: 0 28px 60px rgba(17, 19, 24, 0.12), 0 6px 18px rgba(17, 19, 24, 0.05);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --font-serif: "Songti SC", "Noto Serif SC", "STSong", "SimSun", Georgia, serif;
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "MiSans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Cascadia Mono", ui-monospace, Menlo, monospace;
}

[data-theme="dark"] {
  --bg: #0b0d12;
  --bg-elevated: #131720;
  --bg-subtle: #191f2b;
  --ink: #eef1f7;
  --ink-muted: #9aa3b5;
  --ink-faint: #6c7587;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.2);
  --accent: #3b82f6;
  --accent-deep: #2563eb;
  --accent-soft: rgba(59, 130, 246, 0.15);
  --seal: #ef6354;
  --seal-soft: rgba(239, 99, 84, 0.16);
  --ok: #34d399;
  --ok-soft: rgba(52, 211, 153, 0.14);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 30px 70px rgba(0, 0, 0, 0.6);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 12% 8%, var(--accent-soft), transparent 42%),
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 100% 100%, 48px 48px, 48px 48px;
  background-position: 0 0, -1px -1px, -1px -1px;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 220ms var(--ease-out), color 220ms var(--ease-out);
}

.page-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.025;
  background-image: repeating-radial-gradient(circle at 0 0, #000 0, #000 1px, transparent 1px, transparent 3px);
}

.container {
  position: relative;
  z-index: 1;
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-subtle);
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--border);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.brand-logo {
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.brand-sub {
  font-size: 11px;
  color: var(--ink-muted);
  font-family: var(--font-mono);
}

.version-pill {
  font-style: normal;
  color: var(--accent);
  font-weight: 600;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a {
  text-decoration: none;
  color: var(--ink-muted);
  font-size: 14px;
  font-weight: 500;
  transition: color 160ms var(--ease-out);
}

.nav-links a:hover {
  color: var(--ink);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--ink);
  cursor: pointer;
  font-size: 15px;
  transition: transform 140ms var(--ease-out), border-color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}

.icon-btn:active {
  transform: scale(0.95);
}

[data-theme="dark"] .theme-icon-light { display: none; }
:root:not([data-theme="dark"]) .theme-icon-dark { display: none; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    transform 140ms var(--ease-out),
    background-color 180ms var(--ease-out),
    border-color 180ms var(--ease-out),
    box-shadow 180ms var(--ease-out);
}

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

.btn-sm {
  padding: 7px 14px;
  font-size: 13px;
}

.btn-lg {
  padding: 13px 20px;
  font-size: 15px;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.btn-lg:not(.btn-primary) {
  flex-direction: row;
  align-items: center;
}

.btn-block {
  width: 100%;
  justify-content: space-between;
  padding: 11px 14px;
  font-size: 14px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(20, 94, 242, 0.25);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--ink);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.btn-outline {
  background: var(--bg-subtle);
  color: var(--ink);
  border-color: var(--border);
}

.btn-store {
  background: var(--ink);
  color: var(--bg);
}

.cta-main {
  font-size: 15px;
  line-height: 1.2;
}

.cta-sub {
  font-size: 11.5px;
  font-weight: 500;
  opacity: 0.85;
  font-family: var(--font-mono);
}

.btn-meta {
  font-size: 12px;
  font-family: var(--font-mono);
  opacity: 0.85;
  flex-shrink: 0;
}

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(20, 94, 242, 0.34);
  }
  .btn-secondary:hover,
  .btn-outline:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
  }
  .btn-store:hover {
    opacity: 0.92;
    transform: translateY(-1px);
  }
}

/* Hero */
.hero {
  padding: 52px 0 64px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  gap: 36px;
  align-items: center;
}

.eyebrow-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.seal-tag,
.meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.seal-tag {
  background: var(--seal-soft);
  color: var(--seal);
  border: 1px solid color-mix(in srgb, var(--seal) 28%, transparent);
}

.meta-tag {
  background: var(--bg-elevated);
  color: var(--ink-muted);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
}

.hero-title {
  margin: 0 0 16px;
  font-family: var(--font-serif);
  font-size: clamp(34px, 4.6vw, 54px);
  line-height: 1.14;
  letter-spacing: -0.025em;
  font-weight: 700;
}

.title-accent {
  color: var(--accent);
}

.hero-lead {
  margin: 0 0 26px;
  font-size: 16px;
  color: var(--ink-muted);
  max-width: 56ch;
}

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.hero-metrics {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.metric-item dt {
  font-size: 12px;
  color: var(--ink-faint);
  margin-bottom: 2px;
}

.metric-item dd {
  margin: 0;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
}

.metric-item dd small {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-muted);
}

/* Live IME Sandbox */
.sandbox-shell {
  min-width: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.sandbox-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}

.window-dots {
  display: flex;
  gap: 6px;
}

.window-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-strong);
}

.chrome-title {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 500;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chrome-controls {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.chip-btn {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--ink-muted);
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 11.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 140ms var(--ease-out), color 140ms var(--ease-out);
}

.chip-btn.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.sandbox-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.theme-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.theme-pill {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--ink-muted);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  transition: background-color 140ms var(--ease-out), border-color 140ms var(--ease-out), color 140ms var(--ease-out);
}

.theme-pill.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.hud-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: transform 120ms var(--ease-out);
}

.hud-badge:active {
  transform: scale(0.95);
}

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

.hud-badge.is-en .hud-dot {
  background: var(--seal);
}

.sandbox-editor {
  position: relative;
  padding: 18px 18px 20px;
  min-height: 230px;
  cursor: text;
}

.editor-output {
  font-size: 18px;
  line-height: 1.65;
  min-height: 58px;
  word-break: break-word;
}

.preedit-text {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  font-family: var(--font-mono);
  font-size: 16px;
}

.caret {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--accent);
  vertical-align: text-bottom;
  margin-left: 1px;
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.sandbox-hidden-input {
  width: 100%;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px dashed var(--border-strong);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
}

.sandbox-hidden-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-style: solid;
}

/* Candidate Panel Themes */
.candidate-panel {
  margin-top: 14px;
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md);
}

.candidate-panel.is-glass {
  background: color-mix(in srgb, var(--bg-elevated) 84%, transparent);
  backdrop-filter: blur(18px);
}

.candidate-panel.is-dark {
  background: #141824;
  color: #eef2ff;
  border-color: rgba(255, 255, 255, 0.14);
}

.candidate-panel.is-paper {
  background: #fbf7eb;
  color: #241f18;
  border-color: rgba(110, 82, 42, 0.22);
}

.candidate-panel.is-cobalt {
  background: #0d2149;
  color: #eff6ff;
  border-color: rgba(96, 165, 250, 0.3);
}

.cand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 7px;
  margin-bottom: 7px;
  border-bottom: 1px solid currentColor;
  border-bottom-color: color-mix(in srgb, currentColor 14%, transparent);
  font-size: 12px;
}

.cand-preedit {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent);
}

.candidate-panel.is-dark .cand-preedit,
.candidate-panel.is-cobalt .cand-preedit {
  color: #7cb3ff;
}

.cand-page-hint {
  opacity: 0.65;
  font-size: 11px;
}

.cand-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.candidate-panel.is-vertical .cand-list {
  flex-direction: column;
  gap: 4px;
}

.cand-item {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 7px;
  font-size: 15px;
  cursor: pointer;
  border: 1px solid transparent;
}

.cand-item.is-selected {
  background: var(--accent);
  color: #ffffff;
}

.cand-item:not(.is-selected):hover {
  background: color-mix(in srgb, currentColor 8%, transparent);
}

.cand-index {
  font-family: var(--font-mono);
  font-size: 11.5px;
  opacity: 0.72;
}

.cand-hint {
  font-size: 11px;
  opacity: 0.65;
  margin-left: 2px;
}

.sandbox-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 11px 16px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
}

.presets-label {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 600;
}

.preset-btn {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--ink);
  border-radius: 7px;
  padding: 4px 9px;
  font-size: 12px;
  cursor: pointer;
  transition: transform 120ms var(--ease-out), border-color 140ms var(--ease-out);
}

.preset-btn:active {
  transform: scale(0.96);
}

@media (hover: hover) and (pointer: fine) {
  .preset-btn:hover {
    border-color: var(--accent);
  }
}

.preset-clear {
  margin-left: auto;
  color: var(--seal);
}

/* Sections */
.section {
  padding: 64px 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.section-kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 6px;
}

.section-title {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.2;
}

.section-desc {
  margin: 0;
  color: var(--ink-muted);
  max-width: 68ch;
  font-size: 15px;
}

/* Download Center */
.download-section {
  background: color-mix(in srgb, var(--bg-subtle) 55%, transparent);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.release-meta-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 220px;
}

.inline-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.platform-group-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-muted);
  margin: 22px 0 12px;
  letter-spacing: 0.02em;
}

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

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

.download-card {
  min-width: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 200ms var(--ease-out), border-color 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}

.download-card.is-highlighted {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow-md);
}

@media (hover: hover) and (pointer: fine) {
  .download-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
  }
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.platform-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.os-glyph {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.platform-badge h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.os-req {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--ink-muted);
  font-family: var(--font-mono);
}

.status-pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.status-ready {
  background: var(--ok-soft);
  color: var(--ok);
}

.status-store {
  background: var(--seal-soft);
  color: var(--seal);
}

.card-summary {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-muted);
  flex: 1;
}

.download-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.hash-preview {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  color: var(--ink-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-mini-btn {
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--ink);
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 120ms var(--ease-out), border-color 140ms var(--ease-out);
}

.copy-mini-btn:active {
  transform: scale(0.95);
}

/* Checksums */
.checksum-panel {
  min-width: 0;
  margin-top: 26px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.checksum-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.checksum-head h3 {
  margin: 0;
  font-size: 16px;
}

.checksum-tip {
  font-size: 12.5px;
  color: var(--ink-muted);
}

.table-scroll {
  overflow-x: auto;
}

.checksum-table,
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.checksum-table th,
.checksum-table td,
.compare-table th,
.compare-table td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
}

.checksum-table th,
.compare-table th {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 700;
}

.checksum-hash {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-muted);
}

/* Features & Comparison */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.feature-card {
  min-width: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.feature-index {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
}

.feature-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.feature-card p {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-muted);
}

.compare-card {
  min-width: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
}

.compare-card h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

.compare-table .col-zhuo {
  background: var(--accent-soft);
  color: var(--ink);
}

/* Shuangpin Keymap */
.shuangpin-section {
  background: color-mix(in srgb, var(--bg-subtle) 55%, transparent);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.schema-tabs,
.guide-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.schema-tab,
.guide-tab {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--ink-muted);
  border-radius: 9px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 120ms var(--ease-out), background-color 150ms var(--ease-out), color 150ms var(--ease-out), border-color 150ms var(--ease-out);
}

.schema-tab:active,
.guide-tab:active {
  transform: scale(0.97);
}

.schema-tab.is-active,
.guide-tab.is-active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.keyboard-stage {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.kb-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  min-width: 640px;
}

.keycap {
  flex: 0 0 58px;
  min-height: 62px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 3px;
  background: var(--bg);
  padding: 6px 5px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

.keycap-letter {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  align-self: flex-start;
  line-height: 1;
}

.keycap-initial {
  font-size: 11px;
  font-weight: 700;
  color: var(--seal);
  line-height: 1.1;
}

.keycap-finals {
  font-size: 10.5px;
  color: var(--accent);
  font-family: var(--font-mono);
  text-align: center;
  line-height: 1.15;
}

/* Guide */
.guide-panel {
  display: none;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
}

.guide-panel.is-active {
  display: block;
}

.guide-steps {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14.5px;
}

.guide-note {
  margin: 0 0 12px;
  font-size: 14.5px;
  color: var(--ink-muted);
}

.code-box {
  position: relative;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}

.code-box pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  overflow-x: auto;
  padding-right: 76px;
}

.code-box .copy-mini-btn {
  position: absolute;
  top: 12px;
  right: 12px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 40px;
  font-size: 13px;
  color: var(--ink-muted);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

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

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-links a {
  color: var(--ink-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--ink);
}

/* Toast */
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
}

/* Responsive */
@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .download-grid-desktop,
  .download-grid-mobile,
  .bento-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .nav-links {
    display: none;
  }
}

@media (max-width: 560px) {
  .hero {
    padding: 32px 0 44px;
  }
  .section {
    padding: 44px 0;
  }
  .header-inner {
    min-height: 58px;
  }
  .btn-lg {
    width: 100%;
  }
}

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