/* ============================================================
   ATLAS Toolbox - Design System
   Ink & Brass. Editorial typography, quiet surfaces.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --bg: #09090a;
  --bg-2: #0e0e10;
  --bg-3: #141416;
  --panel: rgba(255, 255, 255, 0.028);
  --panel-hover: rgba(255, 255, 255, 0.05);
  --panel-solid: #121214;
  --line: rgba(255, 255, 255, 0.075);
  --line-2: rgba(255, 255, 255, 0.14);
  --ink: #f1eee7;
  --ink-2: #b4afa5;
  --ink-3: #7d7870;
  --ink-4: #56524c;
  --accent: #d9b26c;
  --accent-2: #f0d49b;
  --accent-ink: #171006;
  --accent-soft: rgba(217, 178, 108, 0.11);
  --accent-line: rgba(217, 178, 108, 0.32);
  --ok: #8fc7a1;
  --warn: #e0b06a;
  --err: #e08d7d;
  --ok-bg: rgba(143, 199, 161, 0.1);
  --err-bg: rgba(224, 141, 125, 0.1);
  --radius: 18px;
  --radius-sm: 11px;
  --maxw: 1240px;
  --font-sans: "Geist", "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
  --font-serif: "Instrument Serif", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --font-mono: "Geist Mono", "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 60px -30px rgba(0, 0, 0, 0.8);
  --shadow-2: 0 30px 90px -40px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.04);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="light"] {
  --bg: #f6f3ec;
  --bg-2: #efeae0;
  --bg-3: #e9e3d7;
  --panel: rgba(255, 253, 247, 0.72);
  --panel-hover: #fffdf8;
  --panel-solid: #fffdf8;
  --line: rgba(24, 20, 14, 0.1);
  --line-2: rgba(24, 20, 14, 0.2);
  --ink: #191612;
  --ink-2: #554f45;
  --ink-3: #847c6f;
  --ink-4: #a79e90;
  --accent: #96652a;
  --accent-2: #b58341;
  --accent-ink: #fffaf0;
  --accent-soft: rgba(150, 101, 42, 0.08);
  --accent-line: rgba(150, 101, 42, 0.3);
  --ok: #3f7d54;
  --warn: #8a5c1c;
  --err: #a94b39;
  --ok-bg: rgba(63, 125, 84, 0.08);
  --err-bg: rgba(169, 75, 57, 0.08);
  --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 20px 60px -40px rgba(60, 45, 20, 0.25);
  --shadow-2: 0 30px 80px -45px rgba(60, 45, 20, 0.35), 0 0 0 1px rgba(24, 20, 14, 0.04);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
::selection { background: var(--accent); color: var(--accent-ink); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-4); }
img, svg, canvas { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ---------- Ambient background ---------- */
.ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.ambient-glow { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5; }
.glow-a {
  width: 62vw; height: 62vw; max-width: 900px; max-height: 900px;
  left: -18vw; top: -32vw;
  background: radial-gradient(circle at center, rgba(217, 178, 108, 0.16), transparent 62%);
}
.glow-b {
  width: 55vw; height: 55vw; max-width: 800px; max-height: 800px;
  right: -14vw; top: 8vh;
  background: radial-gradient(circle at center, rgba(104, 132, 168, 0.12), transparent 65%);
}
.ambient-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px), linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 88px 88px;
  mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 10%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 10%, transparent 75%);
  opacity: 0.42;
}
.ambient-noise {
  position: absolute; inset: 0; opacity: 0.035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
[data-theme="light"] .ambient-noise { opacity: 0.05; mix-blend-mode: multiply; }
[data-theme="light"] .glow-a { opacity: 0.75; }
[data-theme="light"] .glow-b { opacity: 0.4; }
[data-theme="light"] .ambient-grid { opacity: 0.3; }

/* ---------- Announcement ---------- */
.site-announcement {
  position: relative; z-index: 70;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 20px; border-bottom: 1px solid var(--accent-line);
  background: color-mix(in srgb, var(--accent-soft) 70%, var(--bg));
  color: var(--ink-2); font-size: 12px; text-align: center;
}
.site-announcement .pulse { flex-shrink: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 80;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner {
  max-width: var(--maxw); margin: 0 auto; height: 72px;
  display: flex; align-items: center; gap: 32px; padding: 0 28px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--accent-soft), transparent 70%), var(--bg-3);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03) inset, 0 4px 18px -6px rgba(217, 178, 108, 0.4);
}
.brand-mark svg { width: 18px; height: 18px; }
.brand-text { font-family: var(--font-serif); font-size: 21px; letter-spacing: 0.16em; line-height: 1; padding-top: 2px; }
.brand-divider { width: 1px; height: 15px; background: var(--line-2); margin: 0 1px; }
.brand-cn { font-size: 11.5px; letter-spacing: 0.24em; color: var(--ink-3); }
.main-nav { display: flex; align-items: center; gap: 2px; margin-left: 8px; }
.main-nav a {
  position: relative; padding: 8px 14px; border-radius: 8px;
  font-size: 13.5px; color: var(--ink-2); transition: color 0.2s, background 0.2s;
}
.main-nav a:hover { color: var(--ink); background: var(--panel-hover); }
.main-nav a.active { color: var(--ink); }
.main-nav a.active::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 1px;
  background: var(--accent); opacity: 0.8;
}
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.search-trigger {
  display: flex; align-items: center; gap: 9px;
  height: 36px; padding: 0 9px 0 12px; min-width: 208px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel); color: var(--ink-3);
  font-size: 12.5px; transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.search-trigger:hover { border-color: var(--line-2); color: var(--ink-2); background: var(--panel-hover); }
.search-trigger svg { width: 15px; height: 15px; flex-shrink: 0; }
.search-trigger span { flex: 1; text-align: left; }
kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 5px;
  border: 1px solid var(--line); border-radius: 5px;
  background: var(--bg-2); color: var(--ink-3);
  font-family: var(--font-mono); font-size: 10px; line-height: 1;
}
.icon-btn {
  width: 36px; height: 36px; border-radius: 9px;
  border: 1px solid transparent; background: transparent; color: var(--ink-2);
  display: grid; place-items: center; transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.icon-btn:hover { background: var(--panel-hover); color: var(--ink); border-color: var(--line); }
.icon-btn svg { width: 17px; height: 17px; }
.ic-moon { display: none; }
[data-theme="light"] .ic-sun { display: none; }
[data-theme="light"] .ic-moon { display: block; }
.menu-btn { display: none; }
.mobile-menu {
  border-top: 1px solid var(--line); padding: 10px 24px 18px;
  display: flex; flex-direction: column; gap: 2px; background: var(--bg);
}
.mobile-menu a { padding: 10px 4px; color: var(--ink-2); font-size: 14px; border-bottom: 1px solid var(--line); }

/* ---------- Layout ---------- */
.app { position: relative; z-index: 1; min-height: 60vh; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.narrow { max-width: 880px; }
.section { padding: 96px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 36px; }
.section-head .eyebrow { margin-bottom: 14px; }
.section-head h2 {
  font-family: var(--font-serif); font-weight: 400; font-size: clamp(30px, 4vw, 44px);
  line-height: 1.05; letter-spacing: -0.015em;
}
.section-head p { color: var(--ink-3); font-size: 14px; max-width: 460px; margin-top: 10px; }
.section-link {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  font-size: 12.5px; color: var(--ink-2); padding-bottom: 6px;
  border-bottom: 1px solid var(--line-2); transition: color 0.2s, border-color 0.2s;
}
.section-link:hover { color: var(--accent); border-color: var(--accent); }
.section-link svg { width: 13px; height: 13px; transition: transform 0.25s var(--ease); }
.section-link:hover svg { transform: translateX(3px); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink-3);
}
.eyebrow .slash { color: var(--accent); }
.pulse {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-line); animation: pulse 2.6s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(217, 178, 108, 0.35); }
  60% { box-shadow: 0 0 0 7px rgba(217, 178, 108, 0); }
  100% { box-shadow: 0 0 0 0 rgba(217, 178, 108, 0); }
}

/* ---------- Hero ---------- */
.hero { position: relative; padding: 84px 0 64px; }
.hero-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 28px;
  display: grid; grid-template-columns: 1.06fr 0.94fr; gap: 72px; align-items: center;
}
.hero-copy { max-width: 620px; }
.hero .eyebrow { margin-bottom: 26px; }
.hero h1 {
  font-family: var(--font-serif); font-weight: 400;
  font-size: clamp(52px, 7.4vw, 92px); line-height: 0.98; letter-spacing: -0.025em;
  margin-bottom: 26px;
}
.hero h1 .line { display: block; }
.hero h1 .accent-word { color: var(--accent); position: relative; display: inline-block; }
.hero h1 .accent-word svg {
  position: absolute; left: 2%; bottom: -0.18em; width: 96%; height: 0.1em;
  color: var(--accent); opacity: 0.42; overflow: visible;
}
.hero .lede { font-size: 16px; line-height: 1.75; color: var(--ink-2); max-width: 520px; }
.hero .lede strong { color: var(--ink); font-weight: 500; }
.hero-search {
  margin-top: 34px; display: flex; align-items: center; gap: 14px;
  height: 62px; padding: 0 12px 0 20px;
  border: 1px solid var(--line-2); border-radius: 15px;
  background: linear-gradient(180deg, var(--panel-hover), var(--panel));
  box-shadow: var(--shadow-1);
  cursor: text; transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s var(--ease);
}
.hero-search:hover { border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-1); }
.hero-search > svg { width: 19px; height: 19px; color: var(--ink-3); flex-shrink: 0; }
.hero-search input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent;
  font-size: 15px; color: var(--ink);
}
.hero-search input::placeholder { color: var(--ink-3); }
.hero-search .kbd-group { display: flex; gap: 5px; }
.hero-search .kbd-group kbd { height: 24px; min-width: 24px; font-size: 10px; }
.hero-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; }
.hero-quick .label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; color: var(--ink-4); text-transform: uppercase; margin-right: 2px; }
.quick-chip {
  font-size: 12px; color: var(--ink-2); padding: 5px 10px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--panel); transition: all 0.2s;
}
.quick-chip:hover { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }

/* hero index card */
.hero-visual { position: relative; display: flex; justify-content: center; }
.index-card {
  position: relative; width: 100%; max-width: 446px;
  border: 1px solid var(--line-2); border-radius: 22px;
  background: linear-gradient(165deg, color-mix(in srgb, var(--panel-solid) 92%, transparent), var(--bg));
  box-shadow: var(--shadow-2);
  padding: 10px; transform: rotate(-1.4deg);
  transition: transform 0.5s var(--ease);
}
.hero-visual:hover .index-card { transform: rotate(0deg) translateY(-4px); }
.index-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(130deg, rgba(255, 255, 255, 0.07), transparent 30%, transparent 70%, rgba(217, 178, 108, 0.05));
}
.index-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 14px; font-family: var(--font-mono); font-size: 9.5px;
  letter-spacing: 0.16em; color: var(--ink-3); text-transform: uppercase;
}
.index-head .dotline { display: flex; align-items: center; gap: 6px; }
.index-head .dotline i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.index-row {
  display: grid; grid-template-columns: 38px 1fr auto 18px; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px; border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s, transform 0.25s var(--ease);
}
.index-row:hover { background: var(--panel-hover); border-color: var(--line); transform: translateX(3px); }
.index-row .idx-icon {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line);
}
.index-row .idx-icon svg { width: 17px; height: 17px; }
.index-row .idx-name { font-size: 13.5px; color: var(--ink); }
.index-row .idx-cat { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.1em; color: var(--ink-4); text-transform: uppercase; }
.index-row .idx-arrow { color: var(--ink-4); width: 14px; height: 14px; }
.index-row:hover .idx-arrow { color: var(--accent); }
.index-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 6px; padding: 12px 14px; border-top: 1px solid var(--line);
  font-size: 10.5px; color: var(--ink-3);
}
.index-foot span { display: inline-flex; align-items: center; gap: 6px; }
.index-foot i { width: 5px; height: 5px; border-radius: 50%; background: var(--ok); }
.float-chip {
  position: absolute; display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px; border-radius: 99px;
  border: 1px solid var(--line-2); background: color-mix(in srgb, var(--panel-solid) 88%, transparent);
  backdrop-filter: blur(10px); font-family: var(--font-mono); font-size: 9.5px;
  letter-spacing: 0.12em; color: var(--ink-2); box-shadow: 0 12px 30px -18px #000;
}
.float-chip svg { width: 12px; height: 12px; color: var(--accent); }
.chip-1 { top: -18px; right: 8px; animation: float 7s ease-in-out infinite; }
.chip-2 { bottom: -14px; left: -18px; animation: float 8s ease-in-out infinite reverse; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

/* ---------- Marquee ---------- */
.marquee {
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  overflow: hidden; padding: 15px 0; margin-top: 56px;
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track { display: flex; width: max-content; animation: marquee 46s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
  display: inline-flex; align-items: center; gap: 22px; padding-right: 22px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-4); white-space: nowrap;
}
.marquee-track b { color: var(--accent); font-weight: 400; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Tool cards ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tool-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tool-card {
  position: relative; display: flex; flex-direction: column; min-height: 176px;
  padding: 22px 20px 18px; border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel), transparent 78%);
  overflow: hidden; transition: transform 0.35s var(--ease), border-color 0.3s, background 0.3s;
}
.tool-card::before {
  content: ""; position: absolute; width: 180px; height: 180px; right: -90px; top: -110px;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  opacity: 0; transition: opacity 0.35s; pointer-events: none;
}
.tool-card:hover { transform: translateY(-4px); border-color: var(--line-2); background: linear-gradient(180deg, var(--panel-hover), transparent 80%); }
.tool-card:hover::before { opacity: 1; }
.tool-card .card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.tool-icon {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent);
  transition: transform 0.35s var(--ease), background 0.3s;
}
.tool-icon svg { width: 18px; height: 18px; }
.tool-card:hover .tool-icon { transform: scale(1.06) rotate(-3deg); background: color-mix(in srgb, var(--accent-soft) 70%, var(--accent) 16%); }
.card-index { font-family: var(--font-mono); font-size: 9px; color: var(--ink-4); letter-spacing: 0.1em; transition: opacity 0.2s; }
.tool-card:hover .card-index { opacity: 0; }
.tool-card h3 { font-size: 14.5px; font-weight: 550; letter-spacing: -0.005em; margin-bottom: 6px; }
.tool-card p { font-size: 12.5px; line-height: 1.6; color: var(--ink-3); flex: 1; }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.card-cat { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-4); }
.card-arrow { width: 15px; height: 15px; color: var(--ink-4); opacity: 0; transform: translateX(-5px); transition: all 0.3s var(--ease); }
.tool-card:hover .card-arrow { opacity: 1; transform: none; color: var(--accent); }
.card-fav {
  position: absolute; top: 14px; right: 14px; width: 26px; height: 26px; border-radius: 7px;
  border: 0; background: transparent; color: var(--ink-4); display: grid; place-items: center;
  opacity: 0; transition: opacity 0.2s, color 0.2s, background 0.2s;
}
.tool-card:hover .card-fav, .card-fav.is-fav { opacity: 1; }
.card-fav:hover { background: var(--panel-hover); color: var(--accent); }
.card-fav svg { width: 13px; height: 13px; }
.card-fav.is-fav { color: var(--accent); }
@media (hover: none) {
  .card-fav { opacity: 1; }
  .card-index { opacity: 0; }
}

/* featured bento */
.featured-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 208px; gap: 14px; }
.featured-grid .tool-card { min-height: 0; }
.feature-hero {
  grid-column: span 2; grid-row: span 2; padding: 30px;
  background:
    radial-gradient(ellipse 90% 80% at 100% 0%, var(--accent-soft), transparent 60%),
    linear-gradient(160deg, var(--panel-hover), var(--panel));
}
.feature-hero h3 { font-family: var(--font-serif); font-size: 34px; font-weight: 400; letter-spacing: -0.01em; line-height: 1.1; margin: 22px 0 8px; }
.feature-hero p { font-size: 13px; max-width: 340px; }
.feature-hero .feature-demo {
  margin-top: auto; border: 1px solid var(--line); border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 55%, transparent); overflow: hidden;
}
.feature-demo .demo-bar { display: flex; gap: 5px; align-items: center; height: 26px; padding: 0 10px; border-bottom: 1px solid var(--line); }
.feature-demo .demo-bar i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); }
.feature-demo pre { margin: 0; padding: 12px 14px; font-family: var(--font-mono); font-size: 11px; line-height: 1.75; color: var(--ink-2); }
.feature-demo .tk-key { color: var(--accent); }
.feature-demo .tk-str { color: var(--ok); }
.feature-demo .tk-num { color: #a9b7d0; }
[data-theme="light"] .feature-demo .tk-num { color: #4d6488; }
.feature-hero .card-foot { margin-top: 20px; }

/* ---------- Category cards ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.cat-card {
  position: relative; padding: 20px; min-height: 150px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); overflow: hidden;
  display: flex; flex-direction: column;
  transition: all 0.35s var(--ease);
}
.cat-card:hover { border-color: var(--accent-line); background: var(--panel-hover); transform: translateY(-3px); }
.cat-card .cat-num { position: absolute; right: 16px; top: 12px; font-family: var(--font-serif); font-size: 40px; line-height: 1; color: var(--ink-4); opacity: 0.35; }
.cat-card .cat-icon { width: 34px; height: 34px; color: var(--accent); margin-bottom: auto; }
.cat-card .cat-icon svg { width: 21px; height: 21px; }
.cat-card h3 { font-size: 14px; font-weight: 550; margin-top: 22px; }
.cat-card span { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.cat-card .cat-desc { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.cat-card .cat-count { position: absolute; right: 18px; bottom: 16px; font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-4); letter-spacing: 0.08em; }

/* ---------- Principles ---------- */
.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line); }
.principle { padding: 36px 36px 8px 0; border-right: 1px solid var(--line); }
.principle:last-child { border-right: 0; padding-right: 0; }
.principle + .principle { padding-left: 36px; }
.principle .p-num { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; color: var(--accent); }
.principle h3 { font-family: var(--font-serif); font-size: 24px; font-weight: 400; margin: 16px 0 10px; }
.principle p { font-size: 13px; line-height: 1.75; color: var(--ink-3); max-width: 300px; }

/* ---------- CTA ---------- */
.cta {
  position: relative; overflow: hidden; border: 1px solid var(--line-2); border-radius: 26px;
  padding: 64px 56px; display: flex; align-items: center; justify-content: space-between; gap: 40px;
  background:
    radial-gradient(ellipse 60% 120% at 90% 0%, var(--accent-soft), transparent 65%),
    linear-gradient(150deg, var(--panel-hover), var(--panel));
}
.cta::after {
  content: ""; position: absolute; right: -80px; bottom: -140px; width: 420px; height: 420px;
  border: 1px solid var(--line); border-radius: 50%; box-shadow: 0 0 0 60px rgba(255,255,255,0.012), 0 0 0 120px rgba(255,255,255,0.008);
  pointer-events: none;
}
.cta h2 { font-family: var(--font-serif); font-size: clamp(32px, 4vw, 48px); font-weight: 400; line-height: 1.05; margin-bottom: 12px; }
.cta p { color: var(--ink-3); font-size: 13.5px; }
.cta .btn-primary { height: 48px; padding: 0 26px; flex-shrink: 0; position: relative; z-index: 1; }

/* ---------- Buttons / forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  font-size: 13px; font-weight: 450; white-space: nowrap;
  transition: all 0.2s var(--ease);
}
.btn:hover { border-color: var(--line-2); background: var(--panel-hover); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn-primary:hover { background: var(--accent-2); border-color: transparent; box-shadow: 0 8px 28px -12px var(--accent-line); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--panel-hover); color: var(--ink); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 11.5px; border-radius: 8px; gap: 5px; }
.btn-sm svg { width: 12px; height: 12px; }
.btn-icon { width: 30px; padding: 0; }
.btn[disabled] { opacity: 0.4; pointer-events: none; }

.input, .select {
  width: 100%; height: 42px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px;
  background: color-mix(in srgb, var(--bg-2) 80%, transparent);
  color: var(--ink); font-size: 13px; outline: 0;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.color-input {
  width: 42px; height: 42px; flex-shrink: 0; padding: 3px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg-2); cursor: pointer; appearance: none;
}
.color-input::-webkit-color-swatch-wrapper { padding: 0; }
.color-input::-webkit-color-swatch { border: 0; border-radius: 6px; }
.color-input::-moz-color-swatch { border: 0; border-radius: 6px; }
.input:focus, .select:focus, textarea.input:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder, textarea::placeholder { color: var(--ink-4); }
textarea.input { height: auto; min-height: 100px; padding: 11px 12px; line-height: 1.7; resize: vertical; }
.select { appearance: none; cursor: pointer; background-image: 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='%23847c6f' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label, .field-label { font-size: 11px; color: var(--ink-3); letter-spacing: 0.03em; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.field .hint { font-size: 11px; color: var(--ink-4); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-all { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; user-select: none; }
.check input { width: 15px; height: 15px; accent-color: var(--accent); margin: 0; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); }
.seg button { height: 30px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-3); font-size: 12px; transition: all 0.18s; }
.seg button:hover { color: var(--ink-2); }
.seg button.active { background: var(--panel-hover); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,0.2); }
.switch { position: relative; display: inline-block; vertical-align: middle; width: 38px; height: 22px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch .track { position: absolute; inset: 0; border-radius: 99px; background: var(--bg-3); border: 1px solid var(--line); transition: background 0.2s, border-color 0.2s; }
.switch .track::after { content: ""; position: absolute; width: 14px; height: 14px; border-radius: 50%; left: 3px; top: 3px; background: var(--ink-3); transition: transform 0.22s var(--ease), background 0.2s; }
.switch input:checked + .track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); background: var(--accent-ink); }
input[type="range"] { width: 100%; accent-color: var(--accent); height: 22px; }
.range-row { display: flex; align-items: center; gap: 14px; }
.range-value { min-width: 46px; text-align: right; font-family: var(--font-mono); font-size: 11.5px; color: var(--accent); }

/* ---------- Tool page ---------- */
.page { padding: 36px 0 100px; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--ink-4); margin-bottom: 30px; }
.breadcrumb a { color: var(--ink-3); transition: color 0.2s; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb svg { width: 11px; height: 11px; opacity: 0.5; }
.breadcrumb .current { color: var(--ink-2); }
.tool-head { display: flex; align-items: flex-start; gap: 22px; }
.tool-icon-lg {
  width: 62px; height: 62px; border-radius: 18px; flex-shrink: 0;
  display: grid; place-items: center; color: var(--accent);
  background: linear-gradient(145deg, var(--accent-soft), var(--panel));
  border: 1px solid var(--accent-line);
  box-shadow: 0 16px 40px -24px var(--accent);
}
.tool-icon-lg svg { width: 27px; height: 27px; }
.tool-title-wrap { flex: 1; min-width: 0; }
.tool-title-wrap h1 {
  font-family: var(--font-serif); font-size: clamp(32px, 4vw, 46px); font-weight: 400;
  line-height: 1.1; letter-spacing: -0.02em;
}
.tool-title-wrap p { color: var(--ink-3); font-size: 13.5px; margin-top: 8px; max-width: 720px; }
.tool-head-actions { display: flex; gap: 8px; flex-shrink: 0; }
.tool-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.meta-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 25px; padding: 0 9px;
  border: 1px solid var(--line); border-radius: 99px; background: var(--panel);
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3);
}
.meta-chip svg { width: 11px; height: 11px; color: var(--accent); }
.tool-layout { display: grid; grid-template-columns: minmax(0, 1fr) 292px; gap: 22px; margin-top: 36px; align-items: start; }
.stage {
  border: 1px solid var(--line); border-radius: 20px; overflow: hidden;
  background: linear-gradient(180deg, var(--panel), transparent 40%);
  box-shadow: var(--shadow-1);
}
.stage-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 52px; padding: 10px 18px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-2) 60%, transparent);
}
.stage-bar .dots { display: flex; gap: 5px; }
.stage-bar .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.stage-bar .stage-label { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.14em; color: var(--ink-4); text-transform: uppercase; }
.stage-tools { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.stage-body { padding: 22px; }
.tool-aside { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 92px; }
.aside-card { border: 1px solid var(--line); border-radius: 16px; padding: 18px; background: var(--panel); }
.aside-card h4 { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-4); margin-bottom: 12px; font-weight: 500; }
.aside-card p { font-size: 12px; line-height: 1.7; color: var(--ink-3); }
.aside-card p strong { color: var(--ink-2); font-weight: 500; }
.aside-list { display: flex; flex-direction: column; }
.aside-link { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); }
.aside-link:last-child { border-bottom: 0; }
.aside-link svg { width: 13px; height: 13px; color: var(--ink-4); }
.aside-link:hover { color: var(--accent); }
.aside-link:hover svg { color: var(--accent); }
.aside-link span { flex: 1; }
.aside-link small { font-family: var(--font-mono); font-size: 8.5px; color: var(--ink-4); letter-spacing: 0.06em; text-transform: uppercase; }
.privacy-note { display: flex; gap: 10px; align-items: flex-start; }
.privacy-note svg { width: 15px; height: 15px; color: var(--ok); flex-shrink: 0; margin-top: 2px; }

/* tool internals */
.panel-group { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.panel {
  border: 1px solid var(--line); border-radius: 13px; overflow: hidden;
  background: color-mix(in srgb, var(--bg-2) 65%, transparent);
  display: flex; flex-direction: column; min-width: 0;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 40px; padding: 6px 12px; border-bottom: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-4);
}
.panel-head .ph-actions { display: flex; align-items: center; gap: 4px; }
.panel-body { padding: 0; flex: 1; display: flex; flex-direction: column; }
.panel-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-4); }
.code-area {
  width: 100%; flex: 1; min-height: 280px; border: 0; outline: 0; resize: vertical;
  background: transparent; padding: 14px 16px;
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.75; color: var(--ink);
  tab-size: 2;
}
.code-area[readonly] { color: var(--ink-2); }
.code-area.short { min-height: 150px; }
.code-area.tall { min-height: 380px; }
.workbench-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.workbench-actions .spacer { flex: 1; }
.toolbar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.toolbar-row .grow { flex: 1; }
.tool-hint { font-size: 11.5px; color: var(--ink-4); line-height: 1.7; }
.status-line { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-3); }
.status-line .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.status-line.err .dot { background: var(--err); }
.status-line.err { color: var(--err); }
.code-out {
  min-height: 280px; padding: 14px 16px; margin: 0; overflow: auto;
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.75; white-space: pre-wrap; word-break: break-word;
}
.code-out.nowrap { white-space: pre; word-break: normal; }
.token-key { color: var(--accent); }
.token-str { color: var(--ok); }
.token-num { color: #9db0cd; }
.token-bool { color: #d49a7c; }
.token-null { color: var(--ink-4); }
[data-theme="light"] .token-num { color: #3f5f8f; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; margin-top: 14px; }
.stat {
  border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px; background: var(--panel);
}
.stat .s-label { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-4); }
.stat .s-value { font-family: var(--font-serif); font-size: 26px; line-height: 1.2; margin-top: 4px; }
.stat .s-value small { font-family: var(--font-sans); font-size: 10px; color: var(--ink-4); margin-left: 3px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.muted { color: var(--ink-3); }
.small { font-size: 11.5px; }
.mono { font-family: var(--font-mono); }
.center { text-align: center; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.full { width: 100%; }
.hidden { display: none !important; }

.notice {
  display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel); font-size: 12px; color: var(--ink-3);
}
.notice svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; color: var(--accent); }
.notice.ok { border-color: rgba(143,199,161,.25); background: var(--ok-bg); color: var(--ok); }
.notice.err { border-color: rgba(224,141,125,.25); background: var(--err-bg); color: var(--err); }

/* tables */
.table-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: auto; max-height: 520px; }
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.data th {
  position: sticky; top: 0; z-index: 1; text-align: left; padding: 10px 14px;
  background: var(--bg-2); color: var(--ink-4); font-weight: 500;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td { padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--ink-2); }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: var(--panel-hover); }
table.data td strong { color: var(--ink); font-weight: 500; }
.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 10px; font-family: var(--font-mono); background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); }
.badge.gray { background: var(--panel); color: var(--ink-3); border-color: var(--line); }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: rgba(143,199,161,.25); }
.badge.err { background: var(--err-bg); color: var(--err); border-color: rgba(224,141,125,.25); }

/* color tool */
.color-swatch { height: 150px; border-radius: 14px; border: 1px solid var(--line); transition: background 0.2s; }
.color-row { display: grid; grid-template-columns: 90px 1fr 64px; gap: 10px; align-items: center; }
.color-code { font-family: var(--font-mono); font-size: 11px; color: var(--ink-2); }
.palette-strip { display: flex; height: 54px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.palette-strip div { flex: 1; }
.gradient-preview { height: 190px; border-radius: 14px; border: 1px solid var(--line); }
.shadow-preview { height: 190px; border-radius: 14px; border: 1px solid var(--line); display: grid; place-items: center; background: var(--bg-2); }
.shadow-box { width: 120px; height: 120px; border-radius: 14px; background: var(--panel-solid); border: 1px solid var(--line); }

/* image tool */
.dropzone {
  border: 1px dashed var(--line-2); border-radius: 14px; padding: 44px 24px;
  text-align: center; cursor: pointer; transition: all 0.25s; background: var(--panel);
}
.dropzone:hover, .dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone svg { width: 30px; height: 30px; color: var(--accent); margin: 0 auto 12px; }
.dropzone strong { font-size: 13.5px; font-weight: 500; display: block; margin-bottom: 4px; }
.dropzone span { font-size: 11.5px; color: var(--ink-4); }
.preview-frame { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--bg-2); display: grid; place-items: center; min-height: 180px; }
.preview-frame img { max-height: 340px; border-radius: 6px; }
.file-meta { display: flex; flex-wrap: wrap; gap: 14px; font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); }
.palette-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.palette-chip { border-radius: 9px; height: 64px; border: 1px solid var(--line); display: flex; align-items: flex-end; justify-content: center; padding: 6px; font-family: var(--font-mono); font-size: 8.5px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.5); cursor: pointer; }

/* qrcode */
.qr-layout { display: grid; grid-template-columns: 1.1fr .9fr; gap: 24px; }
.qr-frame { background: #fff; border-radius: 16px; padding: 18px; display: inline-flex; }
.qr-frame canvas, .qr-frame img { width: 220px; height: 220px; }
.qr-side { display: flex; flex-direction: column; gap: 14px; }

/* clock */
.world-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.clock-card { border: 1px solid var(--line); border-radius: 13px; padding: 18px; background: var(--panel); }
.clock-card .city { font-size: 12px; color: var(--ink-3); display: flex; justify-content: space-between; }
.clock-card .time { font-family: var(--font-serif); font-size: 34px; line-height: 1.2; margin-top: 8px; }
.clock-card .date { font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-4); letter-spacing: 0.05em; margin-top: 4px; }

/* diff */
.diff-view { font-family: var(--font-mono); font-size: 12px; line-height: 1.7; max-height: 480px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); }
.diff-line { display: grid; grid-template-columns: 42px 42px 1fr; gap: 0; padding: 1px 0; white-space: pre-wrap; word-break: break-word; }
.diff-line .ln { color: var(--ink-4); text-align: right; padding-right: 10px; user-select: none; font-size: 10px; }
.diff-line .dl { padding-left: 12px; border-left: 1px solid var(--line); }
.diff-line.add { background: var(--ok-bg); }
.diff-line.add .dl { color: var(--ok); }
.diff-line.del { background: var(--err-bg); }
.diff-line.del .dl { color: var(--err); }
.diff-line.same .dl { color: var(--ink-3); }

/* regex highlight */
.regex-result { white-space: pre-wrap; word-break: break-word; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.8; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); max-height: 300px; overflow: auto; }
.regex-result mark { background: var(--accent-soft); color: var(--accent-2); border-bottom: 1px solid var(--accent); border-radius: 2px; padding: 0 1px; }

/* markdown preview */
.md-preview { border: 1px solid var(--line); border-radius: 12px; padding: 24px 28px; background: var(--bg-2); max-height: 560px; overflow: auto; font-size: 13.5px; line-height: 1.8; color: var(--ink-2); }
.md-preview h1, .md-preview h2, .md-preview h3, .md-preview h4 { font-family: var(--font-serif); font-weight: 400; color: var(--ink); line-height: 1.25; margin: 1.2em 0 .5em; }
.md-preview h1 { font-size: 28px; margin-top: 0; }
.md-preview h2 { font-size: 23px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.md-preview h3 { font-size: 19px; }
.md-preview p { margin: 0 0 1em; }
.md-preview code { font-family: var(--font-mono); font-size: 11.5px; background: var(--panel-hover); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; color: var(--accent); }
.md-preview pre { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; overflow: auto; margin: 0 0 1em; }
.md-preview pre code { background: none; border: 0; padding: 0; color: var(--ink-2); font-size: 11.5px; line-height: 1.7; }
.md-preview blockquote { margin: 0 0 1em; padding: 4px 0 4px 16px; border-left: 2px solid var(--accent); color: var(--ink-3); }
.md-preview ul, .md-preview ol { margin: 0 0 1em; padding-left: 22px; }
.md-preview li { margin: 3px 0; }
.md-preview a { color: var(--accent); border-bottom: 1px solid var(--accent-line); }
.md-preview table { border-collapse: collapse; margin: 0 0 1em; font-size: 12.5px; }
.md-preview th, .md-preview td { border: 1px solid var(--line); padding: 7px 10px; }
.md-preview th { background: var(--panel); color: var(--ink); }
.md-preview hr { border: 0; border-top: 1px solid var(--line); margin: 1.6em 0; }
.md-preview img { border-radius: 8px; }

/* ---------- All tools page ---------- */
.page-head { padding: 24px 0 12px; }
.page-head h1 { font-family: var(--font-serif); font-size: clamp(40px, 6vw, 64px); font-weight: 400; line-height: 1.05; letter-spacing: -0.025em; }
.page-head p { color: var(--ink-3); margin-top: 12px; max-width: 560px; font-size: 14px; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 32px 0 26px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.filter-chip {
  height: 32px; padding: 0 13px; border-radius: 99px; border: 1px solid var(--line);
  background: transparent; color: var(--ink-3); font-size: 12px; transition: all 0.2s;
  display: inline-flex; align-items: center; gap: 7px;
}
.filter-chip:hover { border-color: var(--line-2); color: var(--ink-2); }
.filter-chip .n { font-family: var(--font-mono); font-size: 9px; color: var(--ink-4); }
.filter-chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.filter-chip.active .n { color: color-mix(in srgb, var(--accent-ink) 60%, transparent); }
.filter-spacer { flex: 1; }
.mini-search { position: relative; width: 220px; }
.mini-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 13px; height: 13px; color: var(--ink-4); }
.mini-search input { height: 32px; padding-left: 30px; font-size: 12px; border-radius: 99px; }
.empty-state { padding: 80px 20px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-state svg { width: 30px; height: 30px; color: var(--ink-4); margin: 0 auto 14px; }
.empty-state h3 { font-family: var(--font-serif); font-size: 22px; font-weight: 400; margin-bottom: 6px; }
.empty-state p { font-size: 12.5px; color: var(--ink-4); }
.result-count { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; color: var(--ink-4); text-transform: uppercase; }

/* about */
.about-hero { padding: 64px 0 48px; }
.about-hero h1 { font-family: var(--font-serif); font-size: clamp(44px, 7vw, 80px); font-weight: 400; line-height: 1; letter-spacing: -0.025em; max-width: 900px; }
.about-hero h1 em { font-style: italic; color: var(--accent); }
.about-hero .lede { font-size: 16px; color: var(--ink-2); max-width: 620px; margin-top: 24px; line-height: 1.8; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; padding: 48px 0; border-top: 1px solid var(--line); }
.about-grid h2 { font-family: var(--font-serif); font-size: 30px; font-weight: 400; margin-bottom: 16px; }
.about-grid p { font-size: 13.5px; line-height: 1.9; color: var(--ink-3); margin-bottom: 14px; }
.about-list { list-style: none; margin: 0; padding: 0; }
.about-list li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.about-list li span { font-family: var(--font-mono); font-size: 9.5px; color: var(--accent); padding-top: 3px; }
.tech-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.tech-pill { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink-3); }

/* ---------- FAQ / details ---------- */
details.faq { border-bottom: 1px solid var(--line); padding: 16px 0; }
details.faq summary { cursor: pointer; font-size: 13.5px; color: var(--ink); list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; font-family: var(--font-mono); color: var(--accent); font-size: 16px; }
details.faq[open] summary::after { content: "?"; }
details.faq p { font-size: 12.5px; color: var(--ink-3); line-height: 1.8; margin-top: 10px; }

/* ---------- Footer ---------- */
.site-footer { position: relative; z-index: 1; border-top: 1px solid var(--line); margin-top: 40px; overflow: hidden; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 60px 28px 0; }
.footer-top { display: flex; justify-content: space-between; gap: 60px; padding-bottom: 48px; }
.footer-brand p { font-size: 12.5px; color: var(--ink-3); margin-top: 16px; max-width: 280px; line-height: 1.7; }
.footer-cols { display: flex; gap: 72px; }
.footer-col h4 { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-4); font-weight: 400; margin-bottom: 14px; }
.footer-col a { display: block; font-size: 12.5px; color: var(--ink-3); padding: 4px 0; transition: color 0.2s; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 18px 0; border-top: 1px solid var(--line); font-size: 11px; color: var(--ink-4); }
.footer-meta { display: inline-flex; align-items: center; gap: 7px; }
.status-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--ok); display: inline-block; }
.footer-wordmark {
  font-family: var(--font-serif); font-size: 17vw; line-height: 0.72; text-align: center;
  color: transparent; -webkit-text-stroke: 1px var(--line-2); letter-spacing: 0.04em;
  margin-top: 20px; user-select: none; pointer-events: none;
  transform: translateY(8%); opacity: 0.75;
}

/* ---------- Command palette ---------- */
.cmdk { position: fixed; inset: 0; z-index: 200; display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; }
.cmdk-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(6px); animation: fade-in 0.2s ease; }
.cmdk-dialog {
  position: relative; width: min(640px, calc(100vw - 32px)); max-height: 76vh;
  display: flex; flex-direction: column;
  background: color-mix(in srgb, var(--panel-solid) 96%, transparent);
  border: 1px solid var(--line-2); border-radius: 16px;
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.04);
  overflow: hidden; animation: cmdk-in 0.28s var(--ease);
}
@keyframes cmdk-in { from { opacity: 0; transform: translateY(-10px) scale(0.985); } }
.cmdk-input-wrap { display: flex; align-items: center; gap: 12px; padding: 0 16px; height: 58px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.cmdk-input-wrap svg { width: 18px; height: 18px; color: var(--ink-3); flex-shrink: 0; }
.cmdk-input-wrap input { flex: 1; height: 100%; border: 0; outline: 0; background: transparent; font-size: 15px; }
.cmdk-results { overflow-y: auto; padding: 8px; flex: 1; min-height: 0; }
.cmdk-group-label { padding: 10px 10px 6px; font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-4); }
.cmdk-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 9px;
  cursor: pointer; border: 1px solid transparent;
}
.cmdk-item .ci-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line); color: var(--ink-2); flex-shrink: 0; }
.cmdk-item .ci-icon svg { width: 14px; height: 14px; }
.cmdk-item .ci-name { font-size: 13px; color: var(--ink); }
.cmdk-item .ci-desc { font-size: 10.5px; color: var(--ink-4); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-item .ci-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cmdk-item .ci-cat { font-family: var(--font-mono); font-size: 8.5px; color: var(--ink-4); letter-spacing: 0.08em; text-transform: uppercase; }
.cmdk-item .ci-enter { opacity: 0; color: var(--accent); font-family: var(--font-mono); font-size: 9px; }
.cmdk-item.active { background: var(--accent-soft); border-color: var(--accent-line); }
.cmdk-item.active .ci-icon { color: var(--accent); border-color: var(--accent-line); }
.cmdk-item.active .ci-enter { opacity: 1; }
.cmdk-foot { display: flex; align-items: center; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 10px; color: var(--ink-4); flex-shrink: 0; }
.cmdk-foot span { display: inline-flex; align-items: center; gap: 4px; }
.cmdk-foot kbd { height: 17px; min-width: 17px; font-size: 8px; }
.cmdk-count { margin-left: auto; font-family: var(--font-mono); font-size: 9px; }
.cmdk-empty { padding: 44px 20px; text-align: center; color: var(--ink-4); font-size: 12.5px; }
.cmdk-empty strong { display: block; color: var(--ink-2); font-weight: 500; font-family: var(--font-serif); font-size: 19px; margin-bottom: 6px; }

/* ---------- Toast ---------- */
.toast-root { position: fixed; z-index: 300; bottom: 28px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 16px;
  border-radius: 99px; border: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--panel-solid) 94%, transparent);
  backdrop-filter: blur(14px); box-shadow: 0 20px 50px -20px rgba(0,0,0,.8);
  font-size: 12px; color: var(--ink); animation: toast-in 0.3s var(--ease);
}
.toast svg { width: 14px; height: 14px; color: var(--ok); }
.toast.err svg { color: var(--err); }
.toast.leaving { animation: toast-out 0.25s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(.97); } }

/* ---------- Animations ---------- */
@keyframes fade-in { from { opacity: 0; } }
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.view-enter { animation: view-in 0.45s var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } }
.stagger > * { opacity: 0; transform: translateY(12px); animation: stagger-in 0.55s var(--ease) forwards; }
.stagger > *:nth-child(1) { animation-delay: 0.02s; }
.stagger > *:nth-child(2) { animation-delay: 0.05s; }
.stagger > *:nth-child(3) { animation-delay: 0.08s; }
.stagger > *:nth-child(4) { animation-delay: 0.11s; }
.stagger > *:nth-child(5) { animation-delay: 0.14s; }
.stagger > *:nth-child(6) { animation-delay: 0.17s; }
.stagger > *:nth-child(7) { animation-delay: 0.2s; }
.stagger > *:nth-child(8) { animation-delay: 0.23s; }
@keyframes stagger-in { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .hero-inner { gap: 48px; }
  .tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .feature-hero { grid-column: span 2; }
  .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tool-layout { grid-template-columns: minmax(0, 1fr) 260px; }
}
@media (max-width: 900px) {
  .main-nav { display: none; }
  .menu-btn { display: grid; }
  .search-trigger { min-width: 0; width: 36px; padding: 0; justify-content: center; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .header-inner { gap: 16px; padding: 0 20px; }
  .hero { padding-top: 52px; }
  .hero-inner { grid-template-columns: 1fr; gap: 52px; }
  .hero-visual { order: 2; }
  .hero-copy { max-width: 640px; }
  .index-card { max-width: 520px; transform: none; }
  .chip-2 { left: 8px; }
  .tool-layout { grid-template-columns: 1fr; }
  .tool-aside { position: static; display: grid; grid-template-columns: 1fr 1fr; }
  .tool-aside .aside-card:first-child { grid-column: span 2; }
  .footer-top { flex-direction: column; gap: 40px; }
  .principles { grid-template-columns: 1fr; }
  .principle, .principle + .principle { border-right: 0; padding: 28px 0; border-bottom: 1px solid var(--line); }
  .principle:last-child { border-bottom: 0; }
  .cta { flex-direction: column; align-items: flex-start; padding: 44px 36px; }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 760px) {
  .wrap, .hero-inner { padding: 0 20px; }
  .section { padding: 68px 0; }
  .hero-search .kbd-group { display: none; }
  .input, .select, .code-area, .hero-search input, .cmdk-input-wrap input { font-size: 16px; }
  .tool-grid, .featured-grid, .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-hero { grid-column: span 2; grid-row: auto; }
  .featured-grid { grid-auto-rows: auto; }
  .featured-grid .feature-hero { grid-row: auto; min-height: 350px; }
  .featured-grid .tool-card { min-height: 168px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 16px; }
  .footer-cols { gap: 40px; flex-wrap: wrap; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .world-grid { grid-template-columns: 1fr 1fr; }
  .palette-grid { grid-template-columns: repeat(4, 1fr); }
  .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .panel-group, .split, .qr-layout { grid-template-columns: 1fr; }
  .tool-head { flex-wrap: wrap; }
  .tool-title-wrap { flex: 1 1 calc(100% - 84px); }
  .tool-head-actions { order: 6; flex-basis: calc(100% - 84px); margin-left: 84px; }
  .tool-aside { grid-template-columns: 1fr; }
  .tool-aside .aside-card:first-child { grid-column: auto; }
  .page { padding-top: 24px; }
  .footer-wordmark { font-size: 26vw; }
}
@media (max-width: 520px) {
  .tool-grid, .featured-grid, .cat-grid { grid-template-columns: 1fr; }
  .feature-hero { grid-column: span 1; }
  .featured-grid .feature-hero { grid-row: auto; }
  .featured-grid .tool-card { min-height: 160px; }
  .hero h1 { font-size: 48px; }
  .hero-search { height: 56px; }
  .hero-quick { display: none; }
  .brand-cn, .brand-divider { display: none; }
  .world-grid { grid-template-columns: 1fr; }
  .palette-grid { grid-template-columns: repeat(3, 1fr); }
  .tool-title-wrap h1 { font-size: 30px; }
  .tool-head-actions { margin-left: 84px; }
  .cta { padding: 34px 24px; }
  .footer-inner { padding: 44px 20px 0; }
  .cmdk { padding-top: 6vh; }
}


/* loader preview keyframes */
@keyframes atlas-spin { to { transform: rotate(360deg); } }
@keyframes atlas-bounce { 0%,80%,100% { transform: scale(.55); opacity:.55 } 40% { transform: scale(1); opacity:1 } }
@keyframes atlas-bars { 0%,100% { transform: scaleY(.45); opacity:.55 } 50% { transform: scaleY(1); opacity:1 } }
/* ---------- Left category rail ---------- */
.app-shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); max-width: 1560px; margin: 0 auto; align-items: start; }
.app { min-width: 0; }
.cat-rail { position: sticky; top: 96px; align-self: start; max-height: calc(100vh - 112px); overflow: auto; padding: 30px 16px 50px 24px; border-right: 1px solid var(--line); scrollbar-width: thin; }
.rail-title { display: flex; align-items: baseline; justify-content: space-between; font-family: var(--font-mono); font-size: 8px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-4); padding: 0 10px 12px; }
.rail-title span { color: var(--accent); font-size: 9px; }
.rail-group-title { font-family: var(--font-mono); font-size: 8px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-4); padding: 22px 10px 9px; }
.rail-all, .rail-item { display: flex; align-items: center; gap: 9px; min-height: 34px; padding: 7px 10px; border-radius: 8px; color: var(--ink-3); font-size: 12px; border: 1px solid transparent; transition: background .2s, color .2s, border-color .2s; }
.rail-all svg, .rail-item svg { width: 15px; height: 15px; flex: 0 0 auto; color: var(--ink-4); }
.rail-all span, .rail-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-all em, .rail-item em { font-family: var(--font-mono); font-size: 8px; font-style: normal; color: var(--ink-4); }
.rail-all:hover, .rail-item:hover { color: var(--ink); background: var(--panel); }
.rail-all.active, .rail-item.active { color: var(--ink); background: var(--accent-soft); border-color: var(--accent-line); }
.rail-all.active svg, .rail-item.active svg { color: var(--accent); }
.rail-all.active em, .rail-item.active em { color: var(--accent); }
.rail-all { margin-bottom: 2px; }
.rail-all svg { color: var(--accent); }
@media (max-width: 1100px) {
  .app-shell { display: block; }
  .cat-rail { position: sticky; top: 72px; z-index: 40; max-height: none; display: flex; align-items: center; gap: 5px; overflow-x: auto; padding: 9px 16px; border-right: 0; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(16px); }
  .rail-title, .rail-group-title { display: none; }
  .rail-all, .rail-item { flex: 0 0 auto; min-height: 30px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); }
  .rail-all em, .rail-item em { display: none; }
  .rail-all { margin: 0 3px 0 0; }
}
@media (max-width: 760px) {
  .cat-rail { top: 64px; padding: 8px 12px; }
  .rail-all, .rail-item { font-size: 11px; }
}/* crop box */
.crop-grid { position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(to right, rgba(255,255,255,.38) 1px, transparent 1px), linear-gradient(to bottom, rgba(255,255,255,.38) 1px, transparent 1px); background-size: 33.333% 33.333%; }
.crop-size { position: absolute; top: -24px; left: 0; padding: 3px 7px; border-radius: 4px; background: #fff; color: #111; font-family: var(--font-mono); font-size: 9px; line-height: 1.2; white-space: nowrap; }
.crop-handle { position: absolute; width: 14px; height: 14px; border: 2px solid #111; border-radius: 50%; background: #fff; box-shadow: 0 1px 5px rgba(0,0,0,.4); z-index: 2; touch-action: none; }
.crop-handle[data-h="nw"] { left: -8px; top: -8px; cursor: nwse-resize; }
.crop-handle[data-h="ne"] { right: -8px; top: -8px; cursor: nesw-resize; }
.crop-handle[data-h="sw"] { left: -8px; bottom: -8px; cursor: nesw-resize; }
.crop-handle[data-h="se"] { right: -8px; bottom: -8px; cursor: nwse-resize; }/* new tools strip */
.new-strip { padding: 24px 0 0; }
.new-strip-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.new-strip-head a { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 8px; letter-spacing: .1em; color: var(--ink-4); }
.new-strip-head a:hover { color: var(--accent); }
.new-strip-head a svg { width: 12px; height: 12px; }
.new-strip-list { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.new-chip { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; padding: 7px 10px; border: 1px solid var(--accent-line); border-radius: 7px; background: var(--accent-soft); color: var(--ink-2); font-size: 11.5px; white-space: nowrap; transition: background .2s, color .2s; }
.new-chip:hover { background: var(--accent); color: var(--accent-ink); }
.new-chip svg { width: 13px; height: 13px; color: var(--accent); }
.new-chip:hover svg { color: var(--accent-ink); }
.new-chip svg:last-child { width: 10px; height: 10px; opacity: .65; }
@media (max-width: 760px) { .new-strip { padding-top: 16px; } .new-strip-head { align-items: flex-start; flex-direction: column; gap: 6px; } }/* feedback */
.feedback-fab { position: fixed; right: 24px; bottom: 24px; z-index: 120; display: inline-flex; align-items: center; gap: 8px; padding: 11px 16px; border: 1px solid var(--accent-line); border-radius: 999px; background: var(--panel-solid); color: var(--ink-2); font-size: 12px; box-shadow: 0 14px 40px -14px rgba(0,0,0,.8); backdrop-filter: blur(12px); transition: background .2s, color .2s, transform .2s; }
.feedback-fab:hover { background: var(--accent); color: var(--accent-ink); transform: translateY(-2px); }
.feedback-fab:hover .pulse { background: var(--accent-ink); }
.feedback-modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; }\n.feedback-modal[hidden] { display: none; }
.feedback-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.62); backdrop-filter: blur(5px); }
.feedback-dialog { position: relative; width: min(560px,100%); max-height: 88vh; overflow: auto; padding: 24px; border: 1px solid var(--line-2); border-radius: 18px; background: var(--panel-solid); box-shadow: 0 40px 120px -30px rgba(0,0,0,.9); animation: modal-in .24s var(--ease); }
.feedback-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.feedback-head h3 { font-family: var(--font-serif); font-size: 28px; font-weight: 400; margin-top: 6px; }
.feedback-head p { font-size: 11.5px; color: var(--ink-4); margin-top: 4px; }
.feedback-error { margin-top: 12px; padding: 9px 11px; border-radius: 8px; background: var(--err-bg); border: 1px solid rgba(224,141,125,.3); color: var(--err); font-size: 11.5px; }
.feedback-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
@media (max-width: 600px) { .feedback-fab { right: 14px; bottom: 14px; padding: 10px 13px; } .feedback-dialog { padding: 20px; } .feedback-actions { align-items: flex-start; flex-direction: column; } }/* AI navigation */
.ai-page-head { padding-bottom: 26px; }
.ai-toolbar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:14px; }
.ai-chips { display:flex; gap:6px; overflow-x:auto; padding-bottom:12px; scrollbar-width:thin; }
.ai-chip { flex:0 0 auto; padding:7px 11px; border:1px solid var(--line); border-radius:999px; background:var(--panel); color:var(--ink-3); font-size:11.5px; }
.ai-chip span { font-family:var(--font-mono); font-size:8px; color:var(--ink-4); margin-left:3px; }
.ai-chip:hover { border-color:var(--accent-line); color:var(--ink); }
.ai-chip.active { background:var(--accent-soft); border-color:var(--accent-line); color:var(--accent); }
.ai-section { margin-top:28px; }
.ai-section-head { display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin-bottom:12px; }
.ai-section-head h2 { font-family:var(--font-serif); font-size:26px; font-weight:400; }
.ai-section-head span { font-family:var(--font-mono); font-size:8px; color:var(--ink-4); letter-spacing:.1em; }
.ai-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.ai-card { display:flex; flex-direction:column; min-height:150px; padding:15px; border:1px solid var(--line); border-radius:12px; background:var(--panel); transition:border-color .2s, background .2s, transform .2s; }
.ai-card:hover { border-color:var(--accent-line); background:var(--panel-hover); transform:translateY(-2px); }
.ai-card-top { display:flex; align-items:center; gap:6px; font-family:var(--font-mono); font-size:8px; color:var(--ink-4); letter-spacing:.06em; }
.ai-card-top svg { width:12px; height:12px; color:var(--accent); }
.ai-card h3 { font-family:var(--font-serif); font-size:21px; font-weight:400; line-height:1.2; margin:12px 0 7px; }
.ai-card p { font-size:11.5px; line-height:1.7; color:var(--ink-3); display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; flex:1; }
.ai-open { display:inline-flex; align-items:center; gap:4px; margin-top:12px; font-family:var(--font-mono); font-size:8px; letter-spacing:.08em; color:var(--accent); }
.ai-open svg { width:11px; height:11px; }
@media (max-width:1100px) { .ai-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:640px) { .ai-grid { grid-template-columns:1fr; } .ai-section-head h2 { font-size:22px; } }