/*! 365Lab Color Lab — styles.css */

/* ============ Tokens ============ */
:root {
  --bg: #07070c;
  --bg-2: #0d0d16;
  --surface: rgba(255, 255, 255, .045);
  --surface-2: rgba(255, 255, 255, .075);
  --surface-solid: #12121d;
  --line: rgba(255, 255, 255, .1);
  --line-strong: rgba(255, 255, 255, .2);
  --text: #f2f2f7;
  --text-1: #f2f2f7;
  --text-2: #a9a9bd;
  --text-3: #6f6f85;
  --brand: #7c5cff;
  --brand-2: #ff3d81;
  --brand-3: #14e0c0;
  --warn: #ffb020;
  --ok: #2fd17a;
  --err: #ff5470;
  --ok-soft: color-mix(in oklab, var(--ok) 16%, transparent);
  --err-soft: color-mix(in oklab, var(--err) 16%, transparent);
  --warn-soft: color-mix(in oklab, var(--warn) 16%, transparent);
  --accent: var(--brand-3);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 28px;
  --shadow: 0 18px 50px -18px rgba(0, 0, 0, .8);
  --shadow-sm: 0 6px 20px -8px rgba(0, 0, 0, .6);
  --maxw: 1240px;
  --ff: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", Menlo, monospace;
  --ease: cubic-bezier(.22, .68, .32, 1);
  --section-gap: clamp(24px, 4vw, 40px);
}

html[data-theme="light"] {
  --bg: #f6f6fb;
  --bg-2: #ffffff;
  --surface: rgba(12, 12, 26, .035);
  --surface-2: rgba(12, 12, 26, .06);
  --surface-solid: #ffffff;
  --line: rgba(12, 12, 30, .1);
  --line-strong: rgba(12, 12, 30, .2);
  --text: #12121c;
  --text-1: #12121c;
  --text-2: #55556b;
  --text-3: #8a8aa0;
  --shadow: 0 18px 46px -20px rgba(30, 24, 80, .3);
  --shadow-sm: 0 6px 18px -10px rgba(30, 24, 80, .28);
}
html[data-theme="light"] .card,
html[data-theme="light"] .panel,
html[data-theme="light"] .stat { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65), 0 1px 2px rgba(30, 24, 80, .06); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-gutter: stable; }
/* 防采集/克隆：禁止图片被拖拽保存（不影响文字复制与无障碍） */
img { -webkit-user-drag: none; user-drag: none; -webkit-touch-callout: none; }
/* iOS 刘海/底部安全区适配：viewport-fit=cover 已在 meta 中声明，这里把安全区注入关键位置 */
.site-header { padding-top: env(safe-area-inset-top); padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
.site-footer { padding-bottom: env(safe-area-inset-bottom); padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
.toast-host { bottom: calc(28px + env(safe-area-inset-bottom)); }
.wrap { padding-inline: max(20px, env(safe-area-inset-left)) max(20px, env(safe-area-inset-right)); }
.skip-link { top: calc(12px + env(safe-area-inset-top)); }
/* 防采集：装饰性区域禁止选择，输入与可复制区域显式开启 */
.brand, .brand-text, .brand-mark, .nav-links, .nav-tools, .lang-switch,
.icon-btn, .menu-btn, .eyebrow, .hero-cta, .footer-brand, .footer-tagline,
.footer-copyright, .footer-links, .panel-head, .card-hover, .feature-icon,
.aurora, .grid-overlay, .mini-palette, .pal-actions, .pal-info, .ad-card,
.knowledge-toc, .guide-panel { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
/* 输入框、文本域、可复制元素与代码块显式开启选择，便于正常使用 */
input, textarea, select, [contenteditable="true"], code, pre, .pal-code, .pal-name,
[data-copy], .copyable, .hex-out, .code-out, .prose p, .prose h2, .prose h3,
.guide-intro, .guide-list li, .tips-list li, .panel-body p, .panel-body li { -webkit-user-select: text; user-select: text; }
/* 打印：保持颜色准确，避免白底黑字丢失配色信息 */
@media print {
  body { background: #fff !important; }
  .aurora, .grid-overlay, .site-header, .site-footer, .toast-host, .ad-card, .hero-ads { display: none !important; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
  .gradient-text, #main > section:first-child .eyebrow, #main > section:first-child h1,
  #main > section:first-child .lead, #main > section:first-child .hero-cta, .aurora { animation: none !important; }
}

body {
  margin: 0;
  font-family: var(--ff);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 动态光斑背景 */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(58vw 48vw at 12% -6%, color-mix(in oklab, var(--brand) 42%, transparent), transparent 62%),
    radial-gradient(52vw 44vw at 96% 6%, color-mix(in oklab, var(--brand-2) 34%, transparent), transparent 60%),
    radial-gradient(60vw 52vw at 46% 104%, color-mix(in oklab, var(--brand-3) 30%, transparent), transparent 62%);
  filter: blur(28px) saturate(125%);
  opacity: .55;
  will-change: transform;
  transform: translateZ(0);
  animation: auroraShift 26s var(--ease) infinite alternate;
}
html[data-theme="light"] .aurora { opacity: .32; }
@keyframes auroraShift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-2%, 2%, 0) scale(1.07); }
  100% { transform: translate3d(2%, -2%, 0) scale(1.03); }
}
.grid-overlay {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: radial-gradient(ellipse 90% 65% at 50% 0%, #000 20%, transparent 82%);
  -webkit-mask-image: radial-gradient(ellipse 90% 65% at 50% 0%, #000 20%, transparent 82%);
  opacity: .5;
}

/* ============ Layout ============ */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }
.section { padding-block: var(--section-gap); }
.section + .section { padding-top: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1 1 auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 10px;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; }

/* ============ Header ============ */
.site-header {
  position: sticky; top: 0; z-index: 90;
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  background: color-mix(in oklab, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 14px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; color: var(--text); text-decoration: none; flex-shrink: 0; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
  background: conic-gradient(from 210deg, var(--brand-2), var(--brand), var(--brand-3), var(--brand-2));
  box-shadow: 0 0 0 1px var(--line-strong), 0 6px 18px -6px var(--brand);
  animation: spinHue 14s linear infinite;
}
@keyframes spinHue { to { filter: hue-rotate(360deg); } }
.brand-text { font-size: 16px; white-space: nowrap; }
.brand-text small { display: block; font-size: 10px; font-weight: 600; color: var(--text-3); letter-spacing: .16em; text-transform: uppercase; line-height: 1; }

.nav-links { display: flex; align-items: center; gap: 2px; margin-left: 8px; overflow: visible; }
.nav-links a {
  color: var(--text-2); text-decoration: none; font-size: 14px; font-weight: 500;
  padding: 8px 11px; border-radius: 10px; white-space: nowrap; transition: all .18s var(--ease);
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a[aria-current="page"] { color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }

/* 顶部菜单下拉分组 */
.nav-group { position: relative; }
.nav-group-btn {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--text-2); background: transparent; border: 0; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 500; padding: 8px 11px; border-radius: 10px;
  white-space: nowrap; transition: all .18s var(--ease);
}
.nav-group-btn:hover, .nav-group.open > .nav-group-btn { color: var(--text); background: var(--surface-2); }
.nav-group-btn .caret { width: 15px; height: 15px; transition: transform .2s var(--ease); }
.nav-group.open > .nav-group-btn .caret { transform: rotate(180deg); }
.nav-dropdown {
  position: absolute; top: calc(100% - 2px); left: 0; min-width: 224px; z-index: 95;
  background: var(--surface-solid); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 8px; display: grid; gap: 2px;
  opacity: 0; visibility: hidden; transform: translateY(-6px); transform-origin: top;
  transition: all .18s var(--ease);
}
.nav-group:hover > .nav-dropdown, .nav-group.open > .nav-dropdown {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.nav-drop-item {
  display: flex; align-items: center; gap: 10px; color: var(--text-2);
  text-decoration: none; font-size: 14px; font-weight: 500; padding: 9px 11px; border-radius: 9px;
  white-space: nowrap; transition: all .15s var(--ease);
}
.nav-drop-item:hover { color: var(--text); background: var(--surface-2); }
.nav-drop-item[aria-current="page"] { color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.nav-drop-ic { width: 18px; height: 18px; display: inline-flex; color: var(--brand-3); flex-shrink: 0; }
.nav-drop-ic svg { width: 18px; height: 18px; }

.nav-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn {
  width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 11px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text-2); cursor: pointer; transition: all .18s var(--ease); flex-shrink: 0;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface-2); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }

.lang-switch { display: flex; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: var(--surface); }
.lang-switch a {
  padding: 7px 11px; font-size: 12px; font-weight: 700; color: var(--text-3);
  text-decoration: none; transition: all .18s var(--ease); letter-spacing: .04em;
}
.lang-switch a:hover { color: var(--text); }
.lang-switch a.active { background: var(--brand); color: #fff; }

.menu-btn { display: none; }
@media (max-width: 1080px) {
  .nav-links {
    position: fixed; inset: 64px 0 auto 0; flex-direction: column; align-items: stretch;
    background: var(--surface-solid); border-bottom: 1px solid var(--line);
    padding: 10px 16px 18px; gap: 2px; margin: 0;
    transform: translateY(-8px); opacity: 0; pointer-events: none; transition: all .22s var(--ease);
    max-height: calc(100vh - 64px); overflow-y: auto; box-shadow: var(--shadow);
  }
  .nav-links.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-links a { padding: 12px 14px; font-size: 15px; }
  .nav-group { position: static; }
  .nav-group-btn { width: 100%; justify-content: space-between; padding: 12px 14px; font-size: 15px; }
  .nav-group-btn .caret { transition: transform .2s var(--ease); }
  .nav-group.open > .nav-group-btn .caret { transform: rotate(180deg); }
  .nav-dropdown {
    position: static; min-width: 0; box-shadow: none; border: 0; border-radius: 0;
    background: transparent; padding: 0 0 4px 12px; display: none;
    opacity: 1; visibility: visible; transform: none;
    border-left: 1px solid var(--line); margin-left: 14px;
  }
  .nav-group.open > .nav-dropdown { display: grid; }
  .nav-drop-item { padding: 11px 14px; font-size: 14.5px; }
  .menu-btn { display: inline-flex; }
  .brand-text small { display: none; }
}

/* ============ Type ============ */
h1, h2, h3, h4 { line-height: 1.18; letter-spacing: -.025em; margin: 0 0 .5em; font-weight: 800; }
h1 { font-size: clamp(30px, 5.4vw, 56px); }
h2 { font-size: clamp(23px, 3.4vw, 36px); }
h3 { font-size: clamp(18px, 2.2vw, 22px); }
p { margin: 0 0 1em; color: var(--text-2); }
a { color: var(--brand-3); }
.lead { font-size: clamp(15px, 1.7vw, 19px); color: var(--text-2); max-width: 68ch; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; color: var(--text-3);
  padding: 6px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  margin-bottom: 18px;
}
.eyebrow::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand-3); box-shadow: 0 0 10px var(--brand-3); animation: pulse 2.4s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.gradient-text {
  background: linear-gradient(100deg, var(--brand-2), var(--brand) 42%, var(--brand-3), var(--brand) 72%, var(--brand-2));
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gradientFlow 9s linear infinite;
}
@keyframes gradientFlow { to { background-position: -220% 0; } }

/* 每页标题区分层入场（仅命中页面首个区块，正文不受影响） */
#main > section:first-child .eyebrow,
#main > section:first-child h1,
#main > section:first-child .lead,
#main > section:first-child .hero-cta {
  animation: riseIn .55s var(--ease) both;
}
#main > section:first-child h1 { animation-delay: .06s; }
#main > section:first-child .lead { animation-delay: .12s; }
#main > section:first-child .hero-cta { animation-delay: .18s; }
@keyframes riseIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-size: 14px; font-weight: 600;
  font-family: inherit; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: all .18s var(--ease); user-select: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07);
}
.btn:hover { border-color: var(--line-strong); background: var(--surface-2); transform: translateY(-1px); box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, .1); }
.btn:active { transform: translateY(0); }
.btn svg { width: 17px; height: 17px; flex-shrink: 0; }
.btn-primary {
  background: linear-gradient(100deg, var(--brand), var(--brand-2));
  border-color: transparent; color: #fff;
  box-shadow: 0 10px 28px -12px var(--brand), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn-primary:hover { background: linear-gradient(100deg, var(--brand), var(--brand-2)); filter: brightness(1.08); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 10px; }
.btn-lg { padding: 14px 26px; font-size: 15px; border-radius: 14px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ============ Cards ============ */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(18px, 2.4vw, 26px); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
.card-hover { transition: all .22s var(--ease); }
.card-hover:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .09); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); }
.panel-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--surface);
}
.panel-head h2, .panel-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.panel-body { padding: 18px; }

/* ============ Tool control panel ============ */
.tool-control {
  background: linear-gradient(180deg, rgba(124, 92, 255, .07), rgba(20, 224, 192, .03));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px 24px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), var(--shadow-sm);
}
html[data-theme="light"] .tool-control {
  background: linear-gradient(180deg, rgba(124, 92, 255, .05), rgba(20, 224, 192, .02));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85), 0 1px 2px rgba(30, 24, 80, .05);
}
.control-toolbar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 18px;
}
.control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 18px 20px;
  align-items: end;
}
.control-group {
  display: flex; flex-direction: column; gap: 7px; min-width: 0;
}
.control-label {
  font-size: 12px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em;
}
.control-select {
  appearance: none; -webkit-appearance: none;
  width: 100%; padding: 10px 32px 10px 13px;
  border-radius: 12px; border: 1px solid var(--line);
  background:
    var(--surface-2)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239a9ab0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E")
    right 12px center / 12px no-repeat;
  color: var(--text-1); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background-color .15s var(--ease);
}
.control-select:hover, .control-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, .15);
  outline: none;
}
.control-range {
  width: 100%; height: 6px; margin: 8px 0 4px;
  -webkit-appearance: none; appearance: none;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line);
  cursor: pointer;
}
.control-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-3));
  border: 2px solid var(--bg-2);
  box-shadow: 0 3px 8px -2px rgba(124, 92, 255, .45);
  transition: transform .15s var(--ease);
}
.control-range::-webkit-slider-thumb:hover { transform: scale(1.15); }
.control-range::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-3));
  border: 2px solid var(--bg-2);
  box-shadow: 0 3px 8px -2px rgba(124, 92, 255, .45);
}
.color-input {
  display: flex; gap: 8px; align-items: center;
}
.color-input input[type="color"] {
  -webkit-appearance: none; appearance: none;
  width: 44px; height: 44px; padding: 0; border: 0; border-radius: 12px;
  background: transparent; cursor: pointer; overflow: hidden;
  box-shadow: 0 0 0 1px var(--line), var(--shadow-sm);
}
.color-input input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-input input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 12px; }
.color-input input[type="color"]::-moz-color-swatch { border: 0; border-radius: 12px; }
.color-input input[type="text"] {
  flex: 1; min-width: 0;
  padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text-1); font-size: 14px; font-weight: 600;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.color-input input[type="text"]:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, .15);
  outline: none;
}
.control-toggle {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
}
.control-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  width: 40px; height: 22px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  position: relative; transition: background .2s var(--ease), border-color .2s var(--ease);
}
.toggle-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--text-1); box-shadow: 0 1px 3px rgba(0,0,0,.3);
  transition: transform .2s var(--ease);
}
.control-toggle input:checked + .toggle-track {
  background: linear-gradient(135deg, var(--brand), var(--brand-3));
  border-color: transparent;
}
.control-toggle input:checked + .toggle-track .toggle-thumb { transform: translateX(18px); }
.control-toggle input:focus-visible + .toggle-track { box-shadow: 0 0 0 3px rgba(124, 92, 255, .25); }
.control-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px;
  margin-top: 20px; padding-top: 18px; border-top: 1px dashed var(--line);
}
.control-hint {
  font-size: 12px; color: var(--text-3); line-height: 1.5;
}
.btn-group { display: inline-flex; gap: 0; }
.btn-group .btn {
  border-radius: 0; margin-left: -1px;
  position: relative;
}
.btn-group .btn:first-child { border-radius: 12px 0 0 12px; margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 12px 12px 0; }
.btn-group .btn-sm:first-child { border-radius: 10px 0 0 10px; }
.btn-group .btn-sm:last-child { border-radius: 0 10px 10px 0; }
.btn-group .btn:hover, .btn-group .btn:focus { z-index: 2; }
.btn-group .btn-primary { z-index: 1; }
.btn-group .btn-primary:hover, .btn-group .btn-primary:focus { z-index: 3; }
.btn-icon { display: inline-block; margin-right: 6px; opacity: .9; }
.count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 12px; font-weight: 800; color: var(--brand-3);
}
@media (max-width: 720px) {
  .tool-control { padding: 18px; }
  .control-grid { grid-template-columns: 1fr 1fr; }
  .control-actions { flex-direction: column; align-items: stretch; }
  .control-actions .btn-group { width: 100%; }
  .control-actions .btn-group .btn { flex: 1; justify-content: center; }
  .control-hint { text-align: center; }
}
@media (max-width: 480px) {
  .control-grid { grid-template-columns: 1fr; }
  .control-toolbar { flex-direction: column; align-items: stretch; }
  .control-toolbar .btn-group { width: 100%; }
  .control-toolbar .btn-group .btn { flex: 1; justify-content: center; }
}

.tips-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.tips-list li { position: relative; padding-left: 22px; color: var(--text-2); font-size: 14px; line-height: 1.6; }
.tips-list li::before { content: "💡"; position: absolute; left: 0; top: 1px; font-size: 13px; }

/* ============ Forms ============ */
label { font-size: 13px; font-weight: 600; color: var(--text-2); display: block; margin-bottom: 6px; }
input[type="text"], input[type="search"], input[type="number"], select, textarea {
  width: 100%; padding: 10px 13px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-family: inherit; font-size: 14px;
  transition: all .18s var(--ease); -webkit-appearance: none; appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.4'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 34px;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand) 25%, transparent);
}
input[type="color"] {
  width: 100%; height: 46px; padding: 3px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer;
}
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 99px;
  background: var(--surface-2); outline: none; cursor: pointer; margin: 8px 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 3px solid var(--brand); cursor: pointer; box-shadow: var(--shadow-sm);
}
input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  border: 3px solid var(--brand); cursor: pointer;
}
textarea { min-height: 100px; resize: vertical; font-family: var(--mono); font-size: 13px; line-height: 1.6; }
.field { margin-bottom: 14px; }
.field-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer;
  transition: all .16s var(--ease); font-family: inherit; white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip[aria-pressed="true"], .chip.active {
  background: linear-gradient(100deg, var(--brand), color-mix(in oklab, var(--brand) 60%, var(--brand-3)));
  border-color: transparent; color: #fff; box-shadow: 0 6px 16px -8px var(--brand);
}

.switch-group { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.switch-group button {
  padding: 6px 13px; border: 0; background: transparent; color: var(--text-3); font-size: 13px;
  font-weight: 600; border-radius: 9px; cursor: pointer; font-family: inherit; transition: all .16s var(--ease);
}
.switch-group button:hover { color: var(--text-2); }
.switch-group button.active { background: var(--surface-2); color: var(--text); box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, .08); }

/* ============ Palette / Swatch ============ */
.mono { font-family: var(--mono); font-variant-ligatures: none; }
.swatch { border-radius: var(--radius-sm); border: 1px solid var(--line); overflow: hidden; }

.palette-stage {
  display: flex; width: 100%; height: clamp(260px, 48vh, 480px);
  border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow);
}
.pal-col {
  position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column;
  justify-content: flex-end; align-items: center; padding: 18px 8px 22px; cursor: pointer;
  transition: flex-grow .3s var(--ease); overflow: hidden;
}
.pal-col:hover { flex-grow: 1.12; }
.pal-col::after {
  content: "";
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,.14) 0%, transparent 30%, transparent 70%, rgba(0,0,0,.08) 100%);
  opacity: 0; transition: opacity .2s var(--ease);
}
.pal-col:hover::after { opacity: 1; }
.pal-info {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  max-width: 100%;
}
.pal-col .pal-code {
  font-family: var(--mono); font-size: clamp(11px, 1.4vw, 14px); font-weight: 700;
  letter-spacing: .04em; padding: 5px 10px; border-radius: 999px; transition: all .18s var(--ease);
  white-space: nowrap;
  background: rgba(0, 0, 0, .22);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
  color: inherit;
}
.pal-col:hover .pal-code { background: rgba(0, 0, 0, .32); transform: translateY(-2px); }
.pal-col .pal-name {
  font-size: 11px; opacity: .92; text-align: center; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: rgba(0, 0, 0, .16); padding: 2px 9px; border-radius: 999px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
  display: inline-block;
  color: inherit;
}
.pal-actions {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  display: flex; flex-direction: row; gap: 0;
  opacity: 0; transition: opacity .18s var(--ease), transform .18s var(--ease);
  transform: translateY(-4px);
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
  backdrop-filter: blur(6px);
}
.pal-actions-dark { background: rgba(0, 0, 0, .18); }
.pal-actions-light { background: rgba(255, 255, 255, .25); }
.pal-col:hover .pal-actions, .pal-col:focus-within .pal-actions { opacity: 1; transform: translateY(0); }
.pal-col[data-locked="true"] .pal-actions { opacity: 1; transform: translateY(0); }
.pal-act {
  width: 30px; height: 30px; border: 0; cursor: pointer;
  background: transparent; display: inline-flex; align-items: center; justify-content: center;
  padding: 0; white-space: nowrap;
  transition: all .16s var(--ease);
}
.pal-act:hover { transform: scale(1.04); }
.pal-actions-dark .pal-act:hover { background: rgba(255, 255, 255, .18); }
.pal-actions-light .pal-act:hover { background: rgba(0, 0, 0, .08); }
.pal-act-icon { display: inline-flex; align-items: center; justify-content: center; }
.pal-act-icon svg { width: 15px; height: 15px; }
.pal-act-text { display: none; }
.pal-col.copied .pal-code { animation: palPulse .35s var(--ease); }
@keyframes palPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
@media (max-width: 720px) {
  .palette-stage { flex-direction: column; height: auto; }
  .pal-col { flex-direction: row; justify-content: space-between; align-items: center; padding: 14px 16px; min-height: 72px; }
  .pal-col:hover { flex-grow: 1; }
  .pal-actions { position: static; transform: none; opacity: 1; border-radius: 8px; }
  .pal-act { width: 32px; height: 32px; }
  .pal-info { align-items: flex-start; }
  .pal-col .pal-name { margin-top: 0; }
}

.mini-palette { display: flex; height: 68px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); }
.mini-palette span { flex: 1; transition: flex .25s var(--ease); }
.mini-palette:hover span:hover { flex: 1.7; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .pal-grid { grid-template-columns: repeat(4, 1fr); }

/* 显示器信息键值行 */
.kv { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.kv .k { color: var(--text-2); font-size: 13px; }
.kv .v { margin-left: auto; color: var(--text-1); font-size: 13px; text-align: right; }
@media (max-width: 860px) { .pal-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .pal-grid { grid-template-columns: 1fr; } }

/* 色阶条 */
.scale-row { display: flex; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); }
.scale-cell {
  flex: 1; min-width: 0; aspect-ratio: 1 / 1.5; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end; padding-bottom: 8px; cursor: pointer;
  font-size: 10px; font-family: var(--mono); font-weight: 700; transition: transform .16s var(--ease);
}
.scale-cell:hover { transform: scaleY(1.06); z-index: 2; }
.scale-cell b { font-size: 11px; }
@media (max-width: 640px) { .scale-cell { aspect-ratio: 1 / 2.4; font-size: 9px; } }

/* ============ Table ============ */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tbl th { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 700; }
.tbl tbody tr:nth-child(even) { background: color-mix(in oklab, var(--surface) 55%, transparent); }
.tbl tbody tr { transition: background .14s var(--ease); }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* 配色审计矩阵 */
.audit-table { border-collapse: separate; border-spacing: 4px; font-size: 12.5px; font-family: var(--mono); }
.audit-table th, .audit-table td { padding: 0; }
.audit-table thead th, .audit-table tbody th { background: transparent; border: 0; }
.audit-table .sw {
  display: inline-block; width: 26px; height: 26px; border-radius: 8px;
  border: 1px solid var(--line-strong); box-shadow: var(--shadow-sm); vertical-align: middle;
}
.audit-table td {
  min-width: 52px; text-align: center; padding: 8px 6px; border-radius: 9px;
  font-weight: 700; color: var(--text-1); border: 1px solid var(--line);
  transition: transform .14s var(--ease), box-shadow .14s var(--ease);
}
.audit-table td:hover { transform: scale(1.06); box-shadow: var(--shadow-sm); z-index: 2; position: relative; }
.audit-table td.diag { background: transparent; border-color: transparent; color: var(--text-3); }

/* ============ Badge ============ */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
}
.badge-ok { background: color-mix(in oklab, var(--ok) 20%, transparent); color: var(--ok); }
.badge-err { background: color-mix(in oklab, var(--err) 20%, transparent); color: var(--err); }
.badge-warn { background: color-mix(in oklab, var(--warn) 20%, transparent); color: var(--warn); }
.badge-neutral { background: var(--surface-2); color: var(--text-2); }

/* ============ Toast ============ */
.toast-host {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none;
}
.toast {
  padding: 11px 20px; border-radius: 999px; background: var(--surface-solid);
  border: 1px solid var(--line-strong); color: var(--text); font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow); animation: toastIn .28s var(--ease);
  display: flex; align-items: center; gap: 9px; max-width: 92vw;
}
.toast .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); flex-shrink: 0; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } }
.toast.out { animation: toastOut .22s var(--ease) forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px) scale(.97); } }

/* ============ Footer ============ */
.site-footer { border-top: 1px solid var(--line); margin-top: var(--section-gap); padding-block: 28px 24px; background: color-mix(in oklab, var(--bg-2) 55%, transparent); }
.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 6px 28px;
  align-items: start;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.footer-brand { grid-column: 1; grid-row: 1; align-self: center; margin-bottom: 0; }
.footer-tagline { grid-column: 1; grid-row: 2; margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-3); }
.footer-links { grid-column: 2; grid-row: 1; justify-self: end; align-self: center; display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; }
.footer-links a { position: relative; color: var(--text-1); text-decoration: none; font-size: 14px; font-weight: 500; transition: color .16s var(--ease); }
.footer-links a:hover { color: var(--accent); }
.footer-links a:not(:last-child)::after { content: ""; position: absolute; right: -11px; top: 50%; transform: translateY(-50%); width: 1px; height: 12px; background: var(--line); }
.footer-copyright { grid-column: 2; grid-row: 2; justify-self: end; font-size: 12px; color: var(--text-3); line-height: 1.5; }
@media (max-width: 720px) {
  .footer-inner { grid-template-columns: 1fr; gap: 14px; border-bottom: none; padding-bottom: 0; }
  .footer-brand, .footer-tagline, .footer-links, .footer-copyright { grid-column: 1; grid-row: auto; justify-self: start; }
  .footer-copyright { margin-top: -4px; }
}

/* ============ Hero ============ */
.hero { position: relative; padding-block: clamp(44px, 8vw, 96px) clamp(28px, 4vw, 52px); }
.hero-inner { max-width: 860px; }
.hero h1 { margin-bottom: 18px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }

/* ============ 顶部右侧广告位（由 src/assets/ads.js 统一控制） ============
   位置：首页 / 功能页 hero 区域右侧，与截图红框对齐。
   尺寸：桌面宽度 450px，3 条横向广告位，总高度约 220px。 */
.hero-ads-layout {
  display: grid;
  grid-template-columns: 1fr 450px;
  gap: 28px;
  align-items: start;
}
.hero-content-col { min-width: 0; }
.hero-ads {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
/* 首页 hero 彩色条在双栏布局下跨两列显示，占满整个 wrap */
.hero-ads-layout > #heroStrip { grid-column: 1 / -1; }
.ad-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.ad-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}
.ad-card a { display: block; text-decoration: none; }
.ad-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 600 / 90;
  object-fit: cover;
}
.ad-card-google .adsbygoogle {
  display: block;
  width: 100%;
  height: 51px;
}
@media (max-width: 1240px) {
  .hero-ads-layout { grid-template-columns: 1fr; }
  .hero-ads { margin-top: 18px; max-width: 640px; }
  .hero-ads .ad-card img,
  .hero-ads .ad-card-google .adsbygoogle { aspect-ratio: 600 / 90; height: auto; }
}
.kbd {
  display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 7px;
  border: 1px solid var(--line-strong); border-bottom-width: 2px; background: var(--surface-2);
  font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--text);
}

/* ============ Feature card ============ */
.feature { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; height: 100%; }
.feature-icon {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, color-mix(in oklab, var(--brand) 22%, var(--surface-2)), color-mix(in oklab, var(--brand-3) 18%, var(--surface-2)));
  border: 1px solid var(--line); color: var(--brand-3);
  transition: all .2s var(--ease);
}
.feature:hover .feature-icon { color: var(--text); border-color: var(--line-strong); transform: scale(1.06); }
.feature-icon svg { width: 21px; height: 21px; }
.feature h3 { font-size: 17px; margin: 0; }
.feature p { font-size: 14px; margin: 0; }

/* ============ Contrast preview ============ */
.contrast-preview { border-radius: var(--radius); padding: clamp(20px, 3vw, 34px); border: 1px solid var(--line); transition: background .18s var(--ease); }
.contrast-preview h3 { margin-top: 0; }
.ratio-big { font-size: clamp(40px, 7vw, 66px); font-weight: 800; line-height: 1; letter-spacing: -.04em; font-family: var(--mono); }

/* ============ Gradient ============ */
.gradient-stage { height: clamp(200px, 34vh, 330px); border-radius: var(--radius-lg); border: 1px solid var(--line); box-shadow: var(--shadow); }
.stop-list { display: flex; flex-direction: column; gap: 10px; }
.stop-item { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.stop-item input[type="color"] { width: 46px; height: 38px; flex-shrink: 0; padding: 2px; }
.stop-item input[type="range"] { flex: 1; margin: 0; }

/* ============ Code block ============ */
.code-box { position: relative; }
.code-box pre {
  margin: 0; padding: 16px 16px; border-radius: var(--radius-sm); background: var(--surface-solid);
  border: 1px solid var(--line); overflow-x: auto; font-family: var(--mono); font-size: 12.5px;
  line-height: 1.7; color: var(--text-2); max-height: 340px;
}
.code-box .copy-fab { position: absolute; top: 9px; right: 9px; }

/* ============ Misc ============ */
.divider { height: 1px; background: var(--line); border: 0; margin-block: 28px; }
.note { font-size: 13px; color: var(--text-3); }
.dropzone {
  border: 2px dashed var(--line-strong); border-radius: var(--radius-lg); padding: clamp(28px, 6vw, 60px) 20px;
  text-align: center; cursor: pointer; transition: all .2s var(--ease); background: var(--surface);
}
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: color-mix(in oklab, var(--brand) 8%, transparent); }
.dropzone svg { width: 42px; height: 42px; color: var(--text-3); margin-bottom: 10px; }

/* ============ Knowledge article ============ */
.prose { max-width: 820px; margin: 0 auto; }
.prose .ksec { padding: 6px 0 22px; border-bottom: 1px dashed var(--line); margin-bottom: 22px; }
.prose .ksec:last-of-type { border-bottom: 0; }
.prose h2 { font-size: clamp(19px, 3.4vw, 24px); margin: 0 0 12px; letter-spacing: -0.01em; }
.prose p { color: var(--text-2); line-height: 1.85; margin: 0 0 12px; font-size: 15px; }
.prose .example { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; color: var(--text-1); }

.color-preview-lg {
  height: clamp(150px, 24vh, 230px); border-radius: var(--radius-lg); border: 1px solid var(--line);
  display: grid; place-items: center; box-shadow: var(--shadow); transition: background .2s var(--ease);
}
.color-preview-lg .big-hex { font-family: var(--mono); font-size: clamp(22px, 4vw, 40px); font-weight: 800; letter-spacing: -.01em; }

.faq details {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 18px;
  background: var(--surface); margin-bottom: 10px;
}
.faq summary { cursor: pointer; font-weight: 700; font-size: 15px; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 20px; color: var(--text-3); font-weight: 400; flex-shrink: 0; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 12px 0 0; font-size: 14px; }

.copyable { cursor: pointer; transition: all .16s var(--ease); }
.copyable:hover { color: var(--text); }

.tag {
  display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--surface-2);
  font-size: 11px; font-weight: 600; color: var(--text-3);
}

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.stat {
  padding: 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); transition: all .18s var(--ease);
}
.stat:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.stat .k { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); font-weight: 700; }
.stat .v { font-size: 17px; font-weight: 700; font-family: var(--mono); margin-top: 3px; word-break: break-all; }

.empty {
  text-align: center; padding: 48px 20px; color: var(--text-3);
  border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface);
}
.empty::before { content: "◌"; display: block; font-size: 26px; margin-bottom: 8px; opacity: .5; }

::selection { background: var(--brand); color: #fff; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); background-clip: padding-box; }

.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { color: var(--text-2); padding-left: 1.3em; }
.prose li { margin-bottom: .5em; }
.prose code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }

/* 工具页「关于 / 原理」与 条款/隐私/关于页 的 prose 内容卡片化 */
.wrap.prose {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
html[data-theme="light"] .wrap.prose {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85), 0 1px 2px rgba(30, 24, 80, .05);
}
.wrap.prose > h2 {
  position: relative;
  font-size: clamp(20px, 3.6vw, 26px);
  font-weight: 800;
  letter-spacing: -.015em;
  margin: 0 0 18px;
  padding-left: 16px;
  color: var(--text);
}
.wrap.prose > h2::before {
  content: "";
  position: absolute; left: 0; top: .25em; bottom: .25em;
  width: 5px; border-radius: 999px;
  background: linear-gradient(180deg, var(--brand), var(--brand-3));
}
.wrap.prose > h3 {
  position: relative;
  font-size: clamp(15px, 2.4vw, 17px);
  font-weight: 700;
  margin: 18px 0 10px;
  padding-left: 14px;
  color: var(--text-1);
}
.wrap.prose > h3:first-child { margin-top: 0; }
.wrap.prose > h3::before {
  content: "";
  position: absolute; left: 0; top: .35em; bottom: .35em;
  width: 4px; border-radius: 999px;
  background: linear-gradient(180deg, var(--brand-3), var(--brand));
}
.wrap.prose > p {
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.8;
  margin: 0 0 16px;
  padding-left: 14px;
}
.wrap.prose > p:last-child { margin-bottom: 0; }
@media (max-width: 720px) {
  .wrap.prose { padding: 20px; }
  .wrap.prose > h2 { margin-bottom: 16px; }
  .wrap.prose > h3 { margin-top: 16px; }
}

/* ============ Knowledge page ============ */
.knowledge-toc {
  background: linear-gradient(180deg, rgba(124, 92, 255, .08), rgba(20, 224, 192, .04));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px 24px;
  margin-bottom: 28px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
html[data-theme="light"] .knowledge-toc {
  background: linear-gradient(180deg, rgba(124, 92, 255, .06), rgba(20, 224, 192, .03));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 1px 2px rgba(30, 24, 80, .05);
}
.knowledge-toc .toc-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px;
}
.knowledge-toc .toc-head .toc-icon {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; font-size: 18px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.knowledge-toc .toc-head h2 {
  margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.01em;
  background: linear-gradient(100deg, var(--brand), var(--brand-3));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.knowledge-toc ol {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px;
}
.knowledge-toc li a {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 11px 9px 9px; border-radius: var(--radius-sm);
  color: var(--text-1); text-decoration: none; font-size: 14px; font-weight: 500;
  transition: transform .16s var(--ease), background .16s var(--ease), box-shadow .16s var(--ease);
}
.knowledge-toc li a:hover,
.knowledge-toc li a:focus-visible {
  background: var(--surface-2);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
  outline: none;
}
.knowledge-toc li a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.knowledge-toc .toc-num {
  flex: 0 0 auto;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-3));
  box-shadow: 0 4px 10px -4px rgba(124, 92, 255, .45);
  transition: transform .16s var(--ease), box-shadow .16s var(--ease);
}
.knowledge-toc li a:hover .toc-num,
.knowledge-toc li a:focus-visible .toc-num {
  transform: scale(1.12);
  box-shadow: 0 6px 14px -4px rgba(124, 92, 255, .55);
}
.knowledge-toc .toc-label {
  line-height: 1.35;
}
@media (max-width: 720px) {
  .knowledge-toc { padding: 18px 18px 20px; }
  .knowledge-toc ol { grid-template-columns: 1fr; }
}

/* Knowledge article sections */
.prose .ksec h2 {
  position: relative; padding-left: 16px;
  font-weight: 800; letter-spacing: -.015em;
}
.prose .ksec h2::before {
  content: "";
  position: absolute; left: 0; top: .28em; bottom: .28em; width: 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--brand), var(--brand-3));
}

/* Tool intro / usage guide — 与使用提示面板保持一致的清爽样式 */
.guide-panel {
  background: var(--surface);
  border: 1px solid var(--line);
}
.guide-intro {
  margin: 0 0 14px;
  color: var(--text-1);
  font-size: 15px;
  line-height: 1.8;
}
.guide-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.guide-list li {
  position: relative;
  padding-left: 24px;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.7;
}
.guide-list li::before {
  content: "📘";
  position: absolute; left: 0; top: 1px;
  font-size: 13px;
}

