@charset "UTF-8";
/*
 * Reset — 2026 修订版
 * 说明：旧版 reset 用 `* { outline: 0 }` 抹掉了焦点环，且给所有 table/td/th
 * 强制 1px solid #333 边框，导致主题色无法生效。这里改为不预设可见边框，
 * 焦点环交由 :focus-visible 统一处理。
 */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  word-break: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  line-height: 1.6;
}

h1,
h2,
h3,
h4 {
  font-size: inherit;
  font-weight: 600;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

td,
th {
  padding: 0;
  text-align: left;
  vertical-align: middle;
}

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

a:hover {
  text-decoration: underline;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  border-radius: 0;
}

button {
  cursor: pointer;
  text-transform: none;
}

button:disabled {
  cursor: default;
}

textarea {
  resize: vertical;
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

ul,
ol {
  list-style: none;
}

code,
kbd,
pre,
samp {
  font-family: var(--font-mono);
  font-size: 1em;
}

[hidden] {
  display: none !important;
}

/* 键盘用户看得见焦点，鼠标用户不受打扰 */
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 4px;
}

:focus:not(:focus-visible) {
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
/* ==================================================================
 * JS KeyCodes — 解构者 Complex Mission
 * 主题：system / light / dark 三态
 *   :root                                 → 浅色（默认全量定义）
 *   @media (prefers-color-scheme: dark) 内 :root:not([data-theme=light]) → 跟随系统
 *   :root[data-theme=dark]                → 手动深色，优先级最高
 * 字体：不再依赖 Google Fonts（国内访问常被墙且阻塞渲染），改用系统字体栈
 * ================================================================== */
:root {
  color-scheme: light;
  --bg: #f4f6f9;
  --bg-grad-a: rgba(70, 135, 195, 0.14);
  --bg-grad-b: rgba(139, 92, 246, 0.08);
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --sunken: #eef1f6;
  --border: rgba(49, 64, 90, 0.12);
  --border-strong: rgba(49, 64, 90, 0.24);
  --text: #16202e;
  --text-dim: #55647a;
  --text-faint: #8593a6;
  --accent: #2a6db3;
  --accent-hover: #1f5b99;
  --accent-ink: #ffffff;
  --accent-soft: rgba(42, 109, 179, 0.1);
  --accent-line: rgba(42, 109, 179, 0.34);
  --accent-grad-a: #3f88cd;
  --accent-grad-b: #1b5390;
  --scrim: rgba(244, 246, 249, 0.78);
  --warn: #a86a12;
  --warn-soft: rgba(201, 139, 42, 0.14);
  --shadow-sm: 0 1px 2px rgba(22, 32, 46, 0.06);
  --shadow-md: 0 6px 20px -8px rgba(22, 32, 46, 0.18);
  --shadow-lg: 0 20px 50px -20px rgba(22, 32, 46, 0.28);
  --ring: #2a6db3;
  --kbd-face: linear-gradient(180deg, #ffffff, #e9edf4);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
      "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", Roboto, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono",
      "Cascadia Mono", "Cascadia Code", Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --topbar-h: 60px;
  --panel-w: 420px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    color-scheme: dark;
    --bg: #0e1117;
    --bg-grad-a: rgba(79, 143, 209, 0.16);
    --bg-grad-b: rgba(139, 92, 246, 0.1);
    --surface: #151b24;
    --surface-2: #1b222d;
    --sunken: #0a0e14;
    --border: rgba(142, 163, 189, 0.16);
    --border-strong: rgba(142, 163, 189, 0.3);
    --text: #e6edf5;
    --text-dim: #9fb0c4;
    --text-faint: #6b7d92;
    --accent: #64a5e8;
    --accent-hover: #7db6f0;
    --accent-ink: #0b1220;
    --accent-soft: rgba(100, 165, 232, 0.16);
    --accent-line: rgba(100, 165, 232, 0.42);
    --accent-grad-a: #a9d2f8;
    --accent-grad-b: #4a8cd0;
    --scrim: rgba(14, 17, 23, 0.78);
    --warn: #f0b866;
    --warn-soft: rgba(240, 184, 102, 0.16);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 6px 20px -6px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 20px 50px -18px rgba(0, 0, 0, 0.85);
    --ring: #7db6f0;
    --kbd-face: linear-gradient(180deg, #232c39, #171e28);
  }
}
:root[data-theme=dark] {
  color-scheme: dark;
  --bg: #0e1117;
  --bg-grad-a: rgba(79, 143, 209, 0.16);
  --bg-grad-b: rgba(139, 92, 246, 0.1);
  --surface: #151b24;
  --surface-2: #1b222d;
  --sunken: #0a0e14;
  --border: rgba(142, 163, 189, 0.16);
  --border-strong: rgba(142, 163, 189, 0.3);
  --text: #e6edf5;
  --text-dim: #9fb0c4;
  --text-faint: #6b7d92;
  --accent: #64a5e8;
  --accent-hover: #7db6f0;
  --accent-ink: #0b1220;
  --accent-soft: rgba(100, 165, 232, 0.16);
  --accent-line: rgba(100, 165, 232, 0.42);
  --accent-grad-a: #a9d2f8;
  --accent-grad-b: #4a8cd0;
  --scrim: rgba(14, 17, 23, 0.78);
  --warn: #f0b866;
  --warn-soft: rgba(240, 184, 102, 0.16);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 6px 20px -6px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 20px 50px -18px rgba(0, 0, 0, 0.85);
  --ring: #7db6f0;
  --kbd-face: linear-gradient(180deg, #232c39, #171e28);
}

/* ------------------------------------------------------------------ *
 * 基础
 * ------------------------------------------------------------------ */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--text);
  background-color: var(--bg);
  background-image: radial-gradient(1100px 620px at 12% -12%, var(--bg-grad-a), transparent 70%), radial-gradient(900px 520px at 96% 8%, var(--bg-grad-b), transparent 68%);
  background-attachment: fixed;
  transition: background-color 0.25s ease, color 0.25s ease;
}

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

* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: var(--border-strong);
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background-color: var(--text-faint);
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 50%;
  z-index: 200;
  padding: 8px 16px;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  transform: translate(-50%, -200%);
  transition: transform 0.18s ease;
}
.skip-link:focus {
  transform: translate(-50%, 0);
  text-decoration: none;
}

/* ------------------------------------------------------------------ *
 * 顶栏
 * ------------------------------------------------------------------ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--topbar-h);
  padding: 8px 18px;
  border-bottom: 1px solid var(--border);
  background-color: var(--surface); /* 不支持半透明合成时的兜底 */
  background-color: var(--scrim);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  user-select: none;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 10px;
}
.brand-mark svg {
  width: 20px;
  height: 20px;
}

.brand-text {
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

/* 分段控件（主题） */
.seg {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--sunken);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.seg-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  font-size: 13px;
  color: var(--text-dim);
  border-radius: 7px;
  transition: color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.seg-btn svg {
  width: 15px;
  height: 15px;
}
.seg-btn:hover {
  color: var(--text);
}
.seg-btn.is-active {
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.btn svg {
  width: 16px;
  height: 16px;
}
.btn:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: transparent;
}
.btn-primary:hover {
  color: var(--accent-ink);
  background: var(--accent-hover);
  border-color: transparent;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
}

.btn-icon {
  padding: 8px 11px;
}

.btn-tiny {
  padding: 4px 9px;
  font-size: 12px;
  border-radius: 7px;
}

#lang-label {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ------------------------------------------------------------------ *
 * 主体布局
 * ------------------------------------------------------------------ */
main {
  display: grid;
  flex: 1 1 auto;
  /* 第二轨用 minmax(0, …) 兜住自动最小尺寸，否则内容会把「已收起」的侧栏顶开 */
  grid-template-columns: minmax(0, 1fr) minmax(0, 0fr);
  min-height: 0;
  transition: grid-template-columns 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

body.show-aside main {
  grid-template-columns: minmax(0, 1fr) minmax(0, var(--panel-w));
}

.stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  min-height: 0;
  overflow-y: auto;
}

/*
 * 宽屏：视口即画布，两栏各自内部滚动。
 * 必须用确定高度（height）而不是 min-height —— 否则侧栏拿不到确定高度，
 * .table-wrap 的 overflow-y 失效，181 行表格会把 main 撑到视口之外，
 * 把左侧读数区顶下去。
 */
@media (min-width: 1081px) {
  body {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }
}
/*
 * 必须显式写 grid-template-columns: minmax(0, 1fr)。
 * 隐式的 auto 列会按内容的 max-content 定宽，而它又不受父级宽度约束，
 * 于是 .hint-desc 这类长单行会一路把 body 的滚动宽度撑到 ~470px，
 * 窄屏上全站内容都按超宽画布排版并被裁掉右边。
 */
.stage-inner {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  justify-items: center;
  min-width: 0;
  padding: 28px 24px 12px;
}

/* ------------------------------------------------------------------ *
 * 初始提示
 * ------------------------------------------------------------------ */
.hint {
  max-width: 100%;
  text-align: center;
  user-select: none;
}

.hint-keys {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 28px;
}
.hint-keys kbd {
  display: grid;
  place-items: center;
  min-width: 58px;
  height: 58px;
  font-family: var(--font-mono);
  font-size: 20px;
  color: var(--text-dim);
  background: var(--kbd-face);
  border: 1px solid var(--border-strong);
  border-bottom-width: 3px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  animation: bob 2.4s ease-in-out infinite;
}
.hint-keys kbd:nth-child(2) {
  animation-delay: 0.18s;
}
.hint-keys kbd:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes bob {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
}
.hint-title {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 300;
  letter-spacing: -0.02em;
}

.hint-desc {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--text-dim);
  overflow-wrap: anywhere;
}

.hint-touch {
  display: none;
  max-width: 28em;
  margin: 18px auto 0;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

body.is-touch .hint-touch {
  display: block;
}

/* ------------------------------------------------------------------ *
 * 读数区
 * ------------------------------------------------------------------ */
.readout {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 880px;
}

.keycode-block {
  text-align: center;
}

.keycode {
  font-family: var(--font-mono);
  font-size: clamp(84px, 19vw, 232px);
  font-weight: 200;
  font-variant-numeric: tabular-nums;
  line-height: 0.95;
  letter-spacing: -0.05em;
  color: var(--accent);
  user-select: none;
}

@supports (-webkit-background-clip: text) or (background-clip: text) {
  .keycode {
    color: transparent;
    background-image: linear-gradient(155deg, var(--accent-grad-a) 0%, var(--accent) 48%, var(--accent-grad-b) 100%);
    -webkit-background-clip: text;
    background-clip: text;
  }
}
.keycode.is-pop {
  animation: pop 0.24s cubic-bezier(0.2, 1.5, 0.4, 1);
}

@keyframes pop {
  from {
    opacity: 0.35;
    transform: scale(0.93);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.keycode-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  border-radius: 999px;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.tag svg {
  width: 13px;
  height: 13px;
  opacity: 0.55;
}

.tag-api {
  color: var(--text-dim);
  background: var(--sunken);
  border: 1px solid var(--border);
}
.tag-api:hover {
  color: var(--text);
}
.tag-api:hover svg {
  opacity: 1;
}

.tag-warn {
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px solid transparent;
}
.tag-warn:hover {
  text-decoration: none;
  border-color: var(--warn);
}

.keyname {
  font-size: 13px;
  color: var(--text-dim);
}
.keyname.is-warn {
  color: var(--warn);
}

/* 四张值卡 */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  width: 100%;
  margin-top: 34px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 12px 14px;
  overflow: hidden;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
  border-color: var(--accent-line);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card:active {
  transform: translateY(0);
}
.card::after {
  content: "";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 13px;
  height: 13px;
  opacity: 0;
  background-color: var(--text-faint);
  transition: opacity 0.15s ease;
  /* 复制图标 */
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='12' height='12' rx='2'/%3E%3Cpath d='M5 15V5a2 2 0 0 1 2-2h8'/%3E%3C/svg%3E") center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='12' height='12' rx='2'/%3E%3Cpath d='M5 15V5a2 2 0 0 1 2-2h8'/%3E%3C/svg%3E") center/contain no-repeat;
}
.card:hover::after, .card:focus-visible::after {
  opacity: 1;
}

.card-accent {
  border-color: var(--accent-line);
  background: linear-gradient(180deg, var(--accent-soft), transparent 60%), var(--surface);
}

.card-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}
.card-label em {
  padding: 1px 6px;
  font-family: var(--font-sans);
  font-size: 10px;
  font-style: normal;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 999px;
}

.card-value {
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 修饰键 */
.mods {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin-top: 16px;
}

.mod-chip {
  padding: 4px 11px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  background: transparent;
  border: 1px dashed var(--border-strong);
  border-radius: 999px;
  transition: all 0.15s ease;
}
.mod-chip.is-on {
  color: var(--accent-ink);
  background: var(--accent);
  border-style: solid;
  border-color: var(--accent);
}
.mod-chip.is-extra {
  color: var(--warn);
  background: var(--warn-soft);
  border-style: solid;
  border-color: transparent;
}
.mod-chip.is-note {
  border-style: solid;
  border-color: var(--border);
}

/* 代码片段 */
.snippet {
  width: 100%;
  margin-top: 26px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.snippet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px 8px 14px;
  font-size: 12.5px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}

.snippet-tools {
  display: flex;
  gap: 6px;
}

.snippet-body {
  padding: 14px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-dim);
  background: var(--sunken);
  tab-size: 2;
}

/* 历史 */
.history {
  width: 100%;
  margin-top: 22px;
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
  font-size: 12.5px;
  color: var(--text-faint);
}

.history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.history-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 5px 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: border-color 0.15s ease, transform 0.12s ease;
}
.history-chip:hover {
  border-color: var(--accent-line);
  transform: translateY(-1px);
}

.history-key {
  max-width: 12ch;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
}

/* ------------------------------------------------------------------ *
 * 说明与常见问题（本页唯一的可索引正文）
 * ------------------------------------------------------------------ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.info {
  flex: 0 0 auto;
  width: 100%;
  max-width: 880px;
  margin: 8px auto 0;
  padding: 0 24px;
}
.info summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--text-dim);
  list-style: none;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.info summary::-webkit-details-marker {
  display: none;
}
.info summary svg {
  width: 15px;
  height: 15px;
  transition: transform 0.2s ease;
}
.info summary:hover {
  color: var(--text);
  border-color: var(--border-strong);
}
.info[open] summary svg {
  transform: rotate(180deg);
}

.info-body {
  padding: 26px 2px 8px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-dim);
}
.info-body h2 {
  margin: 26px 0 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.info-body h2:first-child {
  margin-top: 0;
}
.info-body p {
  margin-bottom: 12px;
}
.info-body code {
  padding: 1px 5px;
  font-size: 12.5px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 5px;
}

.faq dt {
  margin-top: 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.faq dt:first-child {
  margin-top: 0;
}
.faq dd {
  margin-top: 5px;
  padding-left: 12px;
  border-left: 2px solid var(--border);
}

.info-refs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 22px;
  padding-top: 16px;
  font-size: 13px;
  border-top: 1px solid var(--border);
}
.info-refs a {
  color: var(--accent);
}
.info-refs a:hover {
  text-decoration: underline;
}

/* 页脚：body 的直接子元素，横跨整宽 —— 放在 .stage 里会在窄屏被夹到对照表之前 */
footer {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-faint);
}
footer a {
  color: var(--text-dim);
}
footer a:hover {
  color: var(--accent);
}

.footer-sep {
  opacity: 0.5;
}

/* ------------------------------------------------------------------ *
 * 对照表侧栏
 * ------------------------------------------------------------------ */
.reference {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--surface);
  border-left: 1px solid var(--border);
}

.reference-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 14px 12px 20px;
}
.reference-head h2 {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

.reference-search {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0 20px;
}
.reference-search > svg {
  position: absolute;
  left: 11px;
  width: 16px;
  height: 16px;
  color: var(--text-faint);
  pointer-events: none;
}
.reference-search input {
  width: 100%;
  padding: 9px 34px;
  font-size: 13.5px;
  background: var(--sunken);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.reference-search input::placeholder {
  color: var(--text-faint);
}
.reference-search input::-webkit-search-cancel-button {
  display: none;
}
.reference-search input:focus {
  background: var(--surface);
  border-color: var(--accent-line);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-clear {
  position: absolute;
  right: 8px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: var(--text-faint);
  border-radius: 50%;
}
.search-clear svg {
  width: 13px;
  height: 13px;
}
.search-clear:hover {
  color: var(--text);
  background: var(--sunken);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 20px 4px;
}

.chip {
  padding: 4px 10px;
  font-size: 12px;
  color: var(--text-dim);
  background: var(--sunken);
  border: 1px solid transparent;
  border-radius: 999px;
  transition: all 0.15s ease;
}
.chip:hover {
  color: var(--text);
  border-color: var(--border-strong);
}
.chip.is-active {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}

/* 用无衬线体：等宽字体在 11.5px 下渲染中文会发糊 */
.reference-meta {
  padding: 10px 20px 8px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--text-faint);
}

.table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 8px 20px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.table {
  width: 100%;
  font-size: 13px;
}
.table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.table thead th:first-child {
  text-align: right;
}
.table tbody tr {
  cursor: pointer;
  /* 让 scrollIntoView 的目标行不被 sticky 表头压住 */
  scroll-margin-top: 34px;
  scroll-margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.12s ease;
}
.table tbody tr:hover {
  background: var(--surface-2);
}
.table tbody tr.is-active {
  background: var(--accent-soft);
}
.table tbody tr.is-active .cell-code {
  color: var(--accent);
  font-weight: 700;
}
.table td {
  padding: 7px 12px;
}

.cell-code {
  width: 84px;
  min-width: 84px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  text-align: right;
}

.cell-name {
  color: var(--text);
}

.table-empty {
  padding: 34px 12px;
  font-size: 13px;
  color: var(--text-faint);
  text-align: center;
}

/* ------------------------------------------------------------------ *
 * Toast
 * ------------------------------------------------------------------ */
/* 放右下角：底部居中会压住页脚和说明区的折叠按钮 */
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 150;
  max-width: min(80vw, 420px);
  padding: 9px 18px;
  overflow: hidden;
  font-size: 13px;
  color: var(--accent-ink);
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
  background: var(--accent);
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ------------------------------------------------------------------ *
 * 响应式
 * ------------------------------------------------------------------ */
@media (max-width: 1240px) {
  :root {
    --panel-w: 360px;
  }
}
/* 中屏及以下：单列堆叠，对照表常驻在下方 */
@media (max-width: 1080px) {
  main,
  body.show-aside main {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
  }
  .stage {
    overflow: visible;
  }
  .stage-inner {
    padding: 22px 16px 4px;
  }
  .reference {
    border-top: 1px solid var(--border);
    border-left: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .table-wrap {
    max-height: none;
    padding: 0 12px 24px;
    overflow-y: visible;
  }
  #panel-toggle,
  .reference-close {
    display: none;
  }
  .keycode {
    font-size: clamp(72px, 26vw, 168px);
  }
  .cards {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    margin-top: 26px;
  }
  .info {
    padding: 0 16px;
    margin-top: 20px;
  }
}
@media (max-width: 720px) {
  .topbar {
    padding: 8px 12px;
  }
  .seg-btn {
    padding: 6px 8px;
  }
  .seg-btn span {
    display: none;
  }
  #lang-label {
    display: inline;
  }
  .brand-text {
    font-size: 15px;
  }
  .card-value {
    font-size: 17px;
  }
  .reference-head,
  .chips,
  .reference-meta {
    padding-left: 14px;
    padding-right: 14px;
  }
  .reference-search {
    margin: 0 14px;
  }
  .cell-code {
    width: 62px;
    min-width: 62px;
  }
  .table {
    font-size: 12.5px;
  }
  .snippet-body {
    font-size: 12px;
  }
}
/* 高对比度偏好 */
@media (prefers-contrast: more) {
  :root {
    --border: var(--border-strong);
  }
}
/* 打印 */
@media print {
  .topbar,
  .toast,
  footer,
  .chips,
  .reference-search,
  .skip-link {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
}
