:root {
  color-scheme: light;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff6ff;
  --accent-line: #bfdbfe;
  --canvas: #f8faff;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --line: rgb(15 23 42 / .08);
  --line-strong: rgb(15 23 42 / .15);
  --focus: #3b82f6;
  --radius-s: 10px;
  --radius: 18px;
  --radius-l: 26px;
  --shadow-card: 0 1px 2px rgb(15 23 42 / .04), 0 8px 24px rgb(37 99 235 / .04);
  --shadow-hover: 0 14px 34px rgb(37 99 235 / .11), 0 2px 8px rgb(15 23 42 / .04);
  --shadow-dialog: 0 28px 80px rgb(15 23 42 / .24), 0 6px 20px rgb(15 23 42 / .1);
  --font-ui: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Aptos", system-ui, -apple-system, sans-serif;
  font-family: var(--font-ui);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 75% 40% at 18% -6%, rgb(96 165 250 / .13) 0%, transparent 65%),
    radial-gradient(ellipse 65% 38% at 86% 2%, rgb(167 139 250 / .11) 0%, transparent 60%),
    var(--canvas);
  color: var(--ink);
  font-size: 15.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { opacity: .42; cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .88em; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2.5px solid var(--focus);
  outline-offset: 2px;
}

.skip {
  position: fixed;
  z-index: 30;
  top: 8px;
  left: 8px;
  transform: translateY(-150%);
  padding: 10px 16px;
  color: #fff;
  background: var(--ink);
  border-radius: 8px;
}
.skip:focus { transform: none; }

/* ── 顶部清透玻璃导航 ──────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 15;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / .84);
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
}

.header-inner {
  width: min(100%, 1200px);
  height: 68px;
  margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 32px);
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand { display: inline-flex; align-items: center; gap: 11px; flex: none; }
.brand img { flex: none; border-radius: 10px; box-shadow: 0 5px 14px rgb(37 99 235 / .18); }
.brand strong { display: block; font-size: 16px; font-weight: 800; line-height: 1.2; color: var(--ink); }
.brand small { display: block; margin-top: 2px; font-size: 11px; font-weight: 650; color: var(--accent); }

.top-nav { display: flex; align-items: center; gap: 3px; margin-left: 10px; }
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.nav-link:hover { background: var(--surface-2); color: var(--ink); }
.ext-ico { width: 13px; height: 13px; opacity: .65; }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.mail-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
}
.mail-pill svg { width: 15px; height: 15px; color: var(--accent); flex: none; }
.mail-pill:hover { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }

.search-button {
  min-height: 36px;
  padding: 0 9px 0 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--canvas);
  color: var(--muted);
  font-size: 13px;
}
.search-button:hover { border-color: var(--accent-line); background: var(--surface); color: var(--ink); }
.search-button svg { width: 15px; height: 15px; flex: none; opacity: .75; }

kbd {
  white-space: nowrap;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  padding: 1px 5px;
  background: var(--surface);
  color: var(--muted);
  font: 600 10.5px/1.5 ui-monospace, monospace;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  background: var(--surface);
  color: var(--ink-2);
}
.icon-button svg { width: 18px; height: 18px; }
.icon-button:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.menu-toggle { display: none; }

.mobile-drawer {
  display: grid;
  gap: 4px;
  padding: 10px 16px 14px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.drawer-link { padding: 10px 12px; border-radius: var(--radius-s); font-size: 14.5px; font-weight: 600; color: var(--ink-2); }

/* ── 主容器 ────────────────────────────────────────── */
main {
  width: min(100%, 1200px);
  margin: 0 auto;
  padding: 26px clamp(16px, 3vw, 32px) 44px;
}

/* ── 100% 亮色晴朗工作室 Hero ──────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, .85fr);
  align-items: center;
  gap: 24px;
  min-height: 306px;
  border-radius: var(--radius-l);
  border: 1px solid rgb(37 99 235 / .14);
  background:
    radial-gradient(ellipse 65% 85% at 85% 15%, rgb(147 197 253 / .34) 0%, transparent 62%),
    radial-gradient(ellipse 55% 75% at 62% 95%, rgb(196 181 253 / .28) 0%, transparent 62%),
    radial-gradient(ellipse 40% 60% at 8% 8%, rgb(167 243 208 / .22) 0%, transparent 60%),
    linear-gradient(135deg, #ffffff 0%, #f5f9ff 58%, #f8f5ff 100%);
  box-shadow:
    0 20px 50px rgb(37 99 235 / .08),
    inset 0 1px 0 rgb(255 255 255 / .95);
}

.hero-content { position: relative; z-index: 2; padding: 40px 10px 40px 42px; }

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 13px;
  border-radius: 999px;
  border: 1px solid var(--accent-line);
  background: rgb(255 255 255 / .86);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: .09em;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgb(37 99 235 / .08);
}
.pill-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px rgb(37 99 235 / .5); }

.hero h1 {
  font-size: clamp(2.35rem, 4.3vw, 3.65rem);
  font-weight: 850;
  line-height: 1.1;
  letter-spacing: -.035em;
  text-wrap: balance;
  background: linear-gradient(125deg, #0f172a 15%, #1e40af 72%, #4f46e5 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-copy {
  margin-top: 15px;
  max-width: 34rem;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.75;
  text-wrap: pretty;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 24px; }

.hero-side {
  position: relative;
  align-self: stretch;
  min-height: 270px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 26px 32px 26px 10px;
}
.hero-side::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgb(37 99 235 / .07) 1px, transparent 1px),
    linear-gradient(rgb(37 99 235 / .07) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 80% 80% at 56% 48%, #000 35%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 56% 48%, #000 35%, transparent 80%);
}
#curve { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.hero-glass-card {
  position: relative;
  z-index: 2;
  width: min(100%, 272px);
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgb(255 255 255 / .9);
  background: rgb(255 255 255 / .76);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 16px 36px rgb(37 99 235 / .1), inset 0 1px 0 #fff;
}
.glass-row { display: flex; align-items: center; gap: 11px; }
.glass-row img { border-radius: 9px; flex: none; }
.glass-row strong { display: block; font-size: 13.5px; font-weight: 800; color: var(--ink); }
.glass-row span { display: block; font-size: 11.5px; color: var(--muted); }
.glass-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.glass-stats b { display: block; font-size: 17px; font-weight: 850; color: var(--accent); line-height: 1.2; }
.glass-stats span { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); }

/* ── 按钮 ──────────────────────────────────────────── */
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 43px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 20px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
.button svg { width: 15px; height: 15px; flex: none; }
.button.solid {
  color: #fff;
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  box-shadow: 0 8px 20px rgb(37 99 235 / .28);
}
.button.solid:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-1px); }

.button.accent-soft-btn {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line-strong);
  box-shadow: 0 4px 14px rgb(15 23 42 / .05);
}
.button.accent-soft-btn img { border-radius: 5px; }
.button.accent-soft-btn:hover:not(:disabled) { border-color: var(--accent-line); background: var(--accent-soft); transform: translateY(-1px); }

.button.secondary {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line-strong);
}
.button.secondary:hover:not(:disabled) { background: var(--surface-2); }

/* ── 通用 Section 标题 ─────────────────────────────── */
.arcade-section, .products-section, .workbench { margin-top: 40px; scroll-margin-top: 84px; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.section-title-group { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.section-title-group h2 { font-size: 1.38rem; font-weight: 850; letter-spacing: -.02em; color: var(--ink); }
.tool-count { padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 750; }
.section-sub { font-size: 13.5px; color: var(--muted); }

/* ── 摸鱼解压舱（4 款互动小游戏舞台） ──────────────── */
.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 650;
}
.sound-toggle svg { width: 16px; height: 16px; color: var(--accent); }
.sound-toggle[aria-pressed="false"] { opacity: .62; }
.sound-toggle[aria-pressed="false"] svg { color: var(--muted); }

.game-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
  margin-bottom: 16px;
}
.game-tab {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 15px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: left;
  box-shadow: var(--shadow-card);
}
.game-tab:hover { border-color: var(--accent-line); transform: translateY(-1px); }
.game-tab[aria-selected="true"] {
  border-color: var(--accent);
  background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
  box-shadow: 0 10px 26px rgb(37 99 235 / .14), inset 0 0 0 1px rgb(37 99 235 / .12);
}
.game-emoji {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--canvas);
  font-size: 20px;
  flex: none;
}
.game-tab[aria-selected="true"] .game-emoji { background: var(--accent-soft); }
.game-tab strong { display: block; font-size: 14.5px; font-weight: 800; color: var(--ink); }
.game-tab small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }

.arcade-frame {
  border-radius: var(--radius-l);
  border: 1px solid rgb(37 99 235 / .14);
  background: var(--surface);
  box-shadow: 0 20px 54px rgb(37 99 235 / .08), 0 2px 10px rgb(15 23 42 / .04);
  overflow: hidden;
}
.arcade-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, #ffffff 0%, #f8faff 100%);
}
.arcade-meta strong { font-size: 15.5px; font-weight: 800; color: var(--ink); margin-right: 10px; }
.arcade-meta span { font-size: 13px; color: var(--muted); }
.arcade-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }

.ctrl-chip {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
}
.ctrl-chip:hover { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }
.ctrl-chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.ctrl-stat {
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.arcade-stage {
  position: relative;
  min-height: 410px;
  background:
    radial-gradient(circle at 50% 45%, #ffffff 0%, #f4f8ff 72%, #eef3ff 100%);
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
}
.game-canvas {
  display: block;
  width: 100%;
  height: 410px;
  touch-action: none;
  cursor: grab;
}
.game-canvas:active { cursor: grabbing; }

/* 贪吃蛇布局 */
.snake-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 20px 16px;
  min-height: 410px;
}
.snake-board {
  width: min(360px, calc(100vw - 64px));
  height: min(360px, calc(100vw - 64px));
  border-radius: 16px;
  border: 1px solid var(--accent-line);
  background: #ffffff;
  box-shadow: 0 12px 30px rgb(37 99 235 / .1);
  touch-action: none;
}
.snake-dpad {
  display: grid;
  grid-template-columns: repeat(3, 46px);
  gap: 6px;
}
.dpad-btn {
  width: 46px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgb(15 23 42 / .05);
}
.dpad-btn:active { background: var(--accent-soft); border-color: var(--accent); transform: scale(.95); }
.dpad-empty { pointer-events: none; visibility: hidden; }

/* 无限泡泡纸 */
.bubble-wrap {
  padding: 24px 20px;
  min-height: 410px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.bubble-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  width: min(500px, 100%);
  padding: 20px;
  border-radius: 22px;
  border: 1px solid #dbeafe;
  background: linear-gradient(145deg, #f0f7ff 0%, #faf5ff 100%);
  box-shadow: inset 0 2px 10px rgb(255 255 255 / .9), 0 12px 30px rgb(37 99 235 / .08);
  touch-action: none;
}
.bubble-cell {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgb(59 130 246 / .28);
  background:
    radial-gradient(circle at 32% 28%, rgb(255 255 255 / .98) 0%, rgb(255 255 255 / .4) 24%, rgb(147 197 253 / .38) 65%, rgb(99 102 241 / .28) 100%);
  box-shadow:
    inset -3px -5px 8px rgb(59 130 246 / .22),
    inset 2px 3px 6px rgb(255 255 255 / .95),
    0 5px 12px rgb(37 99 235 / .14);
  transition: transform .14s cubic-bezier(.34, 1.56, .64, 1), opacity .16s ease, box-shadow .16s ease;
}
.bubble-cell:hover:not(.popped) { transform: scale(1.07); }
.bubble-cell.popped {
  transform: scale(.86);
  opacity: .34;
  border-style: dashed;
  background: rgb(226 232 240 / .5);
  box-shadow: inset 0 2px 4px rgb(15 23 42 / .12);
}

/* ── 独立产品横幅（轻笔记独立官网入口） ───────────── */
.product-banner {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
  align-items: center;
  gap: clamp(22px, 4vw, 46px);
  padding: clamp(24px, 3.6vw, 40px);
  border-radius: var(--radius-l);
  border: 1px solid #eadfd2;
  background:
    radial-gradient(ellipse 55% 80% at 95% 15%, rgb(184 85 58 / .11) 0%, transparent 65%),
    linear-gradient(125deg, #fffdf9 0%, #f8f2e8 100%);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.product-badge-row { display: flex; align-items: center; gap: 14px; }
.product-banner-icon { border-radius: 13px; box-shadow: 0 8px 20px rgb(120 53 30 / .18); flex: none; }
.mini-tag { display: inline-block; padding: 2px 9px; border-radius: 999px; background: #f5e5dd; color: #a6442a; font-size: 11.5px; font-weight: 750; margin-bottom: 3px; }
.product-banner-info h3 { font-size: 1.5rem; font-weight: 850; letter-spacing: -.02em; color: #1c1917; }
.product-banner-lead { margin-top: 14px; font-size: 1.08rem; font-weight: 750; color: #9c422a; }
.product-banner-desc { margin-top: 8px; color: #57534e; font-size: 14.5px; line-height: 1.72; }
.product-banner-actions { margin-top: 22px; }

.product-banner-preview { display: block; }
.preview-window {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgb(28 25 23 / .12);
  background: #fffdf9;
  box-shadow: 0 20px 44px rgb(28 25 23 / .13);
}
.preview-dots { display: flex; align-items: center; gap: 6px; padding: 9px 13px; border-bottom: 1px solid rgb(28 25 23 / .08); background: #f6f2ea; }
.preview-dots i { width: 9px; height: 9px; border-radius: 50%; background: #d6ccc0; }
.preview-dots span { margin-left: auto; font-size: 11px; font-weight: 650; color: #78716c; }
.preview-window img { width: 100%; height: auto; }
.product-banner-preview:hover .preview-window { transform: translateY(-3px); box-shadow: 0 26px 52px rgb(28 25 23 / .18); }

/* ── 顺手小工具网格 ────────────────────────────────── */
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
}
.filters button:hover { border-color: var(--line-strong); color: var(--ink); }
.filters button[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 3px 10px rgb(37 99 235 / .24);
}

.tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.tool-card {
  position: relative;
  min-width: 0;
  min-height: 156px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.tool-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgb(37 99 235 / .08), transparent 65%);
  transition: opacity .22s ease;
}
.tool-card:hover::before { opacity: 1; }
.tool-card:hover { border-color: var(--accent-line); box-shadow: var(--shadow-hover); transform: translateY(-2px); }

.tool-open {
  width: 100%;
  min-height: 156px;
  display: flex;
  align-items: start;
  flex-direction: column;
  gap: 6px;
  text-align: start;
  padding: 18px;
  border: 0;
  border-radius: inherit;
  background: transparent;
}
.tool-card-top { display: flex; align-items: center; gap: 9px; width: calc(100% - 34px); margin-bottom: 6px; }
.tool-index { margin-left: auto; font: 700 11px/1 ui-monospace, monospace; color: #94a3b8; letter-spacing: .06em; }
.tool-open strong { font-size: 16px; font-weight: 760; color: var(--ink); }
.tool-open small { font-size: 13.5px; line-height: 1.52; color: var(--muted); }
.tool-arrow { position: absolute; right: 16px; bottom: 14px; font-size: 14px; font-weight: 700; color: var(--accent); opacity: 0; transform: translateX(-4px); pointer-events: none; }
.tool-card:hover .tool-arrow, .tool-card:focus-within .tool-arrow { opacity: 1; transform: translateX(0); }

.tool-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tool-badge.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

.tool-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 11px; background: var(--tint-bg, var(--accent-soft)); color: var(--tint-fg, var(--accent)); border: 1px solid rgb(15 23 42 / .05); }
.tool-icon svg { width: 20px; height: 20px; }

.star { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: #94a3b8; }
.star svg { width: 17px; height: 17px; }
.star:hover { background: var(--surface-2); color: #f59e0b; }
.star[aria-pressed="true"] { color: #f59e0b; }

.empty { min-height: 124px; display: grid; place-items: center; text-align: center; padding: 20px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); background: var(--surface); }

/* ── 页脚 ──────────────────────────────────────────── */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 52px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.footer-brand { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.footer-brand img { border-radius: 6px; }
.footer-brand strong { color: var(--ink); font-weight: 750; }
.footer-dot { color: var(--line-strong); }
.footer-mail { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 650; }
.footer-mail:hover { text-decoration: underline; text-underline-offset: 3px; }
.footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.footer a:hover { color: var(--accent); }

/* ── 现代顶层 Dialog（动画、防穿透滚动、模糊背景） ── */
dialog {
  color: var(--ink);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow-dialog);
  opacity: 0;
  transition-property: opacity, transform, display, overlay;
  transition-duration: .22s;
  transition-timing-function: cubic-bezier(.22, 1, .36, 1);
  transition-behavior: allow-discrete;
}
@media (prefers-reduced-motion: no-preference) { dialog { transform: translateY(8px) scale(.975); } }
dialog:modal { overscroll-behavior: contain; }
dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background-color: rgb(15 23 42 / 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition-property: background-color, backdrop-filter, display, overlay;
  transition-duration: .22s;
  transition-behavior: allow-discrete;
}
:is(dialog[open]):where(:not([data-closing])) { opacity: 1; }
@starting-style { :is(dialog[open]):where(:not([data-closing])) { opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  :is(dialog[open]):where(:not([data-closing])) { transform: translateY(0) scale(1); }
  @starting-style { :is(dialog[open]):where(:not([data-closing])) { transform: translateY(8px) scale(.975); } }
}
:is(dialog[open]):where(:not([data-closing]))::backdrop {
  background-color: rgb(15 23 42 / .34);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}
@starting-style {
  :is(dialog[open]):where(:not([data-closing]))::backdrop {
    background-color: rgb(15 23 42 / 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
  }
}
@media (prefers-reduced-motion: reduce) { dialog, dialog::backdrop { transition-duration: .1s; } }

.tool-dialog { width: min(580px, calc(100% - 26px)); padding: 0; border-radius: 18px; max-height: calc(100dvh - 28px); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); padding: 18px 20px 15px; background: var(--surface); }
.dialog-head-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.dialog-icon { width: 40px; height: 40px; }
.dialog-head h2 { font-size: 1.2rem; font-weight: 800; line-height: 1.25; }
.dialog-head p { color: var(--muted); font-size: 13px; margin: 2px 0 0; }
.dialog-body { padding: 18px 20px 20px; display: grid; gap: 13px; }
.field { display: grid; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.field :is(input:not([type="color"]), select, textarea) { width: 100%; min-height: 42px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 12px; font-size: 15px; font-weight: 450; }
.field :is(input:not([type="color"]), select, textarea):focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(37 99 235 / .14); outline: none; }
.field textarea { min-height: 168px; resize: vertical; line-height: 1.62; }
.field select { appearance: none; padding-right: 34px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23475569' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 10px center / 17px; cursor: pointer; }

@media (hover: hover) and (pointer: fine) {
  @supports (appearance: base-select) {
    .field select, .field select::picker(select) { appearance: base-select; }
    .field select { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background-image: none; }
    .field select::picker-icon { color: var(--accent); margin-left: auto; }
    .field select::picker(select) { margin-top: 4px; padding: 5px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); box-shadow: 0 16px 38px rgb(15 23 42 / .16); }
    .field select option { padding: 8px 10px; border-radius: 8px; color: var(--ink); cursor: pointer; }
    .field select option:hover, .field select option:focus { background: var(--surface-2); }
    .field select option:checked { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
    .field select option::checkmark { color: var(--accent); }
  }
}

.action-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.helper { min-height: 20px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.helper:empty { min-height: 0; }
.output { min-height: 46px; padding: 11px 13px; border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--ink); border-radius: 10px; font-weight: 600; overflow-wrap: anywhere; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats span { background: var(--surface-2); border-radius: 10px; padding: 10px 8px; text-align: center; color: var(--muted); font-size: 12.5px; }
.stats strong { display: block; color: var(--ink); font-size: 19px; font-variant-numeric: tabular-nums; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.timer-clock { font: 800 clamp(2.9rem, 9vw, 4.4rem)/1.12 ui-monospace, monospace; text-align: center; color: var(--ink); font-variant-numeric: tabular-nums; }
progress { height: 8px; width: 100%; accent-color: var(--accent); border-radius: 999px; }
.color-area { display: flex; gap: 12px; align-items: end; }
.color-area label { flex: 1; }
.color-area input[type="color"] { width: 68px; height: 44px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); cursor: pointer; }
.swatch { position: relative; min-height: 88px; border-radius: 12px; border: 1px solid rgb(15 23 42 / .1); display: flex; align-items: flex-end; justify-content: space-between; padding: 10px 12px; }
.swatch-contrast { padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; backdrop-filter: blur(6px); }

/* ── 搜索弹窗 ──────────────────────────────────────── */
.search-dialog { margin: min(14vh, 108px) auto auto; border-radius: 16px; width: min(560px, calc(100% - 26px)); padding: 0; overflow: hidden; }
.search-field { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.search-ico { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search-field input { width: 100%; min-height: 40px; border: 0; background: transparent; outline: none; padding: 4px; color: var(--ink); font-size: 15px; }
.search-field .icon-button { flex: 0 0 36px; width: 36px; height: 36px; }
.search-results { padding: 8px 10px; max-height: 46vh; overflow: auto; }
.search-result { display: flex; gap: 11px; align-items: center; width: 100%; text-align: start; padding: 10px 11px; border: 0; border-radius: 10px; background: transparent; }
.search-result:hover, .search-result:focus-visible, .search-result.is-active { background: var(--accent-soft); color: var(--ink); }
.search-result-ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); flex: none; }
.search-result-ico svg { width: 15px; height: 15px; }
.search-result strong { font-size: 14.5px; font-weight: 650; }
.search-result small { margin-left: auto; color: var(--muted); font-size: 12px; }
.search-foot { padding: 8px 14px; border-top: 1px solid var(--line); background: var(--canvas); color: var(--muted); font-size: 11.5px; display: flex; justify-content: flex-end; }
.search-foot kbd { margin: 0 2px; }

.toast { position: fixed; z-index: 25; bottom: 20px; right: 20px; max-width: min(420px, calc(100% - 36px)); background: var(--ink); color: #f8fafc; border-radius: 999px; box-shadow: 0 12px 32px rgb(15 23 42 / .26); padding: 9px 18px; font-size: 13.5px; font-weight: 600; }

/* ── 文档子页 ──────────────────────────────────────── */
.docs-main { width: min(100%, 820px); margin: 0 auto; padding: 36px clamp(18px, 4vw, 34px) 48px; }
.docs-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.docs-brand { display: inline-flex; align-items: center; gap: 10px; }
.docs-brand img { border-radius: 9px; box-shadow: 0 4px 12px rgb(37 99 235 / .16); }
.docs-brand strong { display: block; font-size: 15.5px; font-weight: 800; line-height: 1.2; }
.docs-brand small { display: block; font-size: 11.5px; color: var(--accent); font-weight: 650; }
.text-link { display: inline-block; color: var(--accent); font-size: 14px; font-weight: 650; text-decoration: underline; text-decoration-color: rgb(37 99 235 / .35); text-underline-offset: 4px; }
.docs-main h1 { font-size: clamp(1.85rem, 4.5vw, 2.5rem); font-weight: 850; letter-spacing: -.03em; margin: 0 0 8px; }
.docs-main .lead { color: var(--muted); margin-bottom: 22px; font-size: 15px; }
.doc-card { padding: 22px 24px; margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-card); }
.doc-card h2 { font-size: 1.12rem; font-weight: 780; margin-bottom: 8px; color: var(--ink); }
.doc-card p { color: var(--ink-2); font-size: 14.5px; line-height: 1.72; }
.doc-card p + p { margin-top: 8px; }
.doc-card .action-row { margin-top: 14px; }
.doc-card code { overflow-wrap: anywhere; color: var(--accent); font-weight: 600; }

/* ── 响应式 ────────────────────────────────────────── */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-content { padding: 32px 26px 14px; }
  .hero-side { min-height: 175px; padding: 12px 26px 26px; justify-content: flex-start; }
  .game-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-banner { grid-template-columns: 1fr; }
  .mail-pill { display: none; }
}
@media (max-width: 760px) {
  .top-nav { display: none; }
  .menu-toggle { display: grid; }
  .search-button span, .search-button kbd { display: none; }
  .search-button { padding: 0 11px; }
  .header-inner { height: 60px; }
  main { padding: 18px 14px 32px; }
  .hero { border-radius: 20px; }
  .hero-content { padding: 24px 18px 12px; }
  .hero-side { min-height: 150px; padding: 8px 18px 20px; }
  .hero-glass-card { width: 100%; }
  .game-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .game-tab { padding: 10px 11px; }
  .game-tab small { display: none; }
  .game-canvas { height: 340px; }
  .arcade-stage { min-height: 340px; }
  .bubble-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; padding: 14px; }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tool-card, .tool-open { min-height: 140px; }
  .tool-open { padding: 13px; }
  .tool-arrow { display: none; }
  .product-banner { padding: 20px; border-radius: 20px; }
  .footer { flex-direction: column; align-items: flex-start; margin-top: 38px; }
  .search-foot { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .tool-card, .button, .nav-link, .game-tab, .ctrl-chip, .tool-arrow, .preview-window, .filters button, .mail-pill {
    transition: background-color .16s ease, border-color .16s ease, box-shadow .18s ease, transform .18s ease, opacity .16s ease, color .16s ease;
  }
}
