/* ==========================================================================
   王大盒工具箱 · 设计系统 v2
   暖纸底色 / 柿橙主色 / 明暗双主题 / 分层阴影 / 克制的微交互
   注意：.panel .field .btn .input .textarea .result .note .dropzone .chip
   .tag-pick .grid-2 .kv .progress .spinner .work 等工具框架类是 156 个工具的
   运行时依赖（见 CONTRACT.md），只允许重新设计、不允许删除。
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --bg: #f6f4ef;            /* 暖纸 */
  --bg-deep: #efede6;
  --surface: #ffffff;
  --surface-2: #faf9f5;
  --ink: #1c1917;
  --ink-2: #44403c;
  --muted: #79716b;
  --faint: #a8a29e;
  --line: #e7e3da;
  --line-strong: #d8d3c8;
  --accent: #e8562a;        /* 柿橙 */
  --accent-hover: #d4461c;
  --accent-soft: #fdeee7;
  --accent-ink: #b23a15;
  --gold: #b8860b;
  --green: #0e9f6e;
  --green-soft: #e5f5ef;
  --red: #dc2626;
  --red-soft: #fdecec;
  --blue: #2563eb;
  --blue-soft: #e8effd;

  --shadow-xs: 0 1px 2px rgba(28, 25, 23, .05);
  --shadow-sm: 0 1px 2px rgba(28, 25, 23, .04), 0 4px 12px rgba(28, 25, 23, .05);
  --shadow-md: 0 2px 4px rgba(28, 25, 23, .04), 0 12px 32px rgba(28, 25, 23, .09);
  --shadow-lg: 0 4px 8px rgba(28, 25, 23, .05), 0 24px 56px rgba(28, 25, 23, .13);
  --ring: 0 0 0 3px rgba(232, 86, 42, .22);

  --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-xl: 28px;

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
          "Microsoft YaHei", "Noto Sans SC", "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* 旧 token 兼容别名（工具 JS 内联样式引用，见 CONTRACT.md 生态） */
  --hot: var(--red);
  --new: var(--accent);
  --gray: var(--muted);
  --gray-2: var(--faint);
  --gray-3: var(--faint);
  --page: var(--bg);
  --card: var(--surface);
  --blue-deep: var(--blue);
}

[data-theme="dark"] {
  --bg: #131110;
  --bg-deep: #0c0b0a;
  --surface: #1d1a18;
  --surface-2: #23201d;
  --ink: #f1ede5;
  --ink-2: #d6d0c4;
  --muted: #a39c90;
  --faint: #6f6a61;
  --line: #2d2a26;
  --line-strong: #3b3730;
  --accent: #ff6a3d;
  --accent-hover: #ff7f57;
  --accent-soft: #33201a;
  --accent-ink: #ff8a63;
  --green: #2fbf8f;  --green-soft: #17291f;
  --red: #f06a5d;    --red-soft: #2d1b19;
  --blue: #6d97f5;   --blue-soft: #1a2333;
  --gold: #d4a017;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .25), 0 4px 12px rgba(0, 0, 0, .3);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .38);
  --shadow-lg: 0 4px 8px rgba(0, 0, 0, .35), 0 24px 56px rgba(0, 0, 0, .5);
  --ring: 0 0 0 3px rgba(255, 106, 61, .3);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px; line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .3s ease, color .3s ease;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---------- 顶部导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex; align-items: center; gap: 18px;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center; font-size: 18px;
  background: var(--accent); color: #fff;
  box-shadow: 0 2px 8px rgba(232, 86, 42, .3);
}
[data-theme="dark"] .brand-mark { box-shadow: 0 2px 8px rgba(255, 106, 61, .25); }
.brand small { font-weight: 500; font-size: 12px; color: var(--muted); margin-left: 2px; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav-links a, .nav-links button {
  padding: 7px 13px; border-radius: 999px; border: 0; background: none;
  font-size: 14px; font-weight: 500; color: var(--ink-2); cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.nav-links a:hover, .nav-links button:hover { background: var(--bg-deep); color: var(--ink); }
.nav-spacer { flex: 1; }
.nav-search-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; min-width: 200px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--faint);
  font-size: 13.5px; cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.nav-search-btn:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.nav-search-btn .sp { flex: 1; text-align: left; }
kbd {
  font-family: var(--font); font-size: 11px; font-weight: 600;
  padding: 2px 6px; border-radius: 6px;
  background: var(--bg-deep); border: 1px solid var(--line); border-bottom-width: 2px;
  color: var(--muted);
}
.theme-toggle {
  width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-size: 16px;
  display: grid; place-items: center; box-shadow: var(--shadow-xs);
  transition: transform .2s ease, box-shadow .15s ease;
}
.theme-toggle:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 84px 0 56px;
  text-align: center;
  overflow: hidden;
}
.hero::before, .hero::after {
  content: ""; position: absolute; z-index: -1; border-radius: 50%;
  filter: blur(80px); opacity: .28; pointer-events: none;
}
.hero::before { width: 480px; height: 480px; top: -180px; left: 8%;
  background: radial-gradient(circle, rgba(232, 86, 42, .24), transparent 65%); }
.hero::after { width: 520px; height: 520px; top: -120px; right: 4%;
  background: radial-gradient(circle, rgba(245, 158, 11, .22), transparent 65%); }
[data-theme="dark"] .hero::before, [data-theme="dark"] .hero::after { opacity: .3; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 13px; font-weight: 500; color: var(--muted);
  box-shadow: var(--shadow-xs);
}
.hero-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft); }
.hero-title {
  margin: 26px 0 0;
  font-size: clamp(44px, 7.5vw, 76px);
  font-weight: 900; line-height: 1.08; letter-spacing: -.025em;
}
.hero-title .mark { color: var(--accent); }
.hero-sub {
  margin: 18px auto 0; max-width: 560px;
  font-size: 17px; color: var(--muted); line-height: 1.7;
}
.hero-search {
  display: flex; align-items: center; gap: 10px;
  max-width: 620px; margin: 34px auto 0; padding: 6px 6px 6px 20px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow-md);
  transition: box-shadow .2s ease, border-color .2s ease;
}
.hero-search:focus-within { border-color: var(--accent); box-shadow: var(--shadow-md), var(--ring); }
.hero-search .s-icon { font-size: 17px; opacity: .55; }
#searchInput {
  flex: 1; border: 0; outline: none; background: none;
  font: inherit; font-size: 16px; color: var(--ink); padding: 10px 0; min-width: 0;
}
#searchInput::placeholder { color: var(--faint); }
.hero-search .go {
  flex: none; border: 0; cursor: pointer;
  padding: 11px 22px; border-radius: 13px;
  background: var(--accent); color: #fff; font-size: 14.5px; font-weight: 600;
  transition: background .15s ease, transform .15s ease;
}
.hero-search .go:hover { background: var(--accent-hover); transform: translateY(-1px); }
.hero-chips {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  margin-top: 20px;
}
.hero-chips .chip-q {
  padding: 7px 15px; border-radius: 999px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
  transition: all .15s ease;
}
.hero-chips .chip-q:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.hero-stats {
  display: flex; justify-content: center; gap: 40px;
  margin-top: 44px;
}
.hero-stats .stat { text-align: center; }
.hero-stats b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.hero-stats span { font-size: 12.5px; color: var(--faint); }

/* ---------- 通用区块 ---------- */
.section { padding: 34px 0 8px; }
.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.section-head h2 {
  margin: 0; font-size: 23px; font-weight: 800; letter-spacing: -.02em;
}
.section-head .kicker {
  font-size: 12px; font-weight: 700; letter-spacing: .12em;
  color: var(--accent); text-transform: uppercase;
}
.section-head .note { font-size: 13px; color: var(--faint); }
.section-head .more { margin-left: auto; font-size: 13.5px; font-weight: 500; color: var(--muted); cursor: pointer; border: 0; background: none; }
.section-head .more:hover { color: var(--accent); }

/* ---------- 工具卡片 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 14px; }
.tool-item {
  position: relative;
  display: flex; flex-direction: column; gap: 12px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.tool-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}
.tool-item .label {
  position: absolute; top: 12px; right: 12px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .02em;
  padding: 3px 8px; border-radius: 999px;
}
.tool-item .label.hot { background: var(--red-soft); color: var(--red); }
.tool-item .label.new { background: var(--accent-soft); color: var(--accent-ink); }
.tool-item .label.free { background: var(--green-soft); color: var(--green); }
.tool-item .label.partner, .tool-item .label.rec { background: var(--blue-soft); color: var(--blue); }
.tool-icon {
  width: 46px; height: 46px; border-radius: 13px;
  display: grid; place-items: center; font-size: 24px;
  background: var(--bg-deep);
  transition: transform .18s ease;
}
.tool-item:hover .tool-icon { transform: scale(1.08) rotate(-4deg); }
.tool-name { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.tool-desc {
  font-size: 12.5px; color: var(--muted); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 39px;
}
.wicon { width: 22px; height: 22px; display: block; }
.tool-icon .wicon, .pi-ico .wicon, .cat-emoji .wicon, .tp-ic .wicon { width: 24px; height: 24px; }
.g-ico .wicon { width: 17px; height: 17px; }
.e-ico .wicon, .dz-ico .wicon { width: 34px; height: 34px; }
.brand-mark .wicon, .brand-mark svg { width: 19px; height: 19px; }
.theme-toggle .wicon { width: 17px; height: 17px; }
.nav-search-btn .wicon { color: var(--muted); }
.pi-ico { width: 36px; height: 36px; border-radius: 10px; flex: none; display: grid; place-items: center; }
.g-ico { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; }
.e-ico, .dz-ico { display: inline-block; color: var(--accent); margin-bottom: 8px; }
/* 分类语义色 tint（图标色 + 由 color-mix 派生的浅底，暗色主题自动适配） */
.tint-img { color: #7c5cff; background: color-mix(in srgb, #7c5cff 11%, var(--surface)); }
.tint-pdf { color: #e8562a; background: color-mix(in srgb, #e8562a 11%, var(--surface)); }
.tint-data { color: #0e9f6e; background: color-mix(in srgb, #0e9f6e 11%, var(--surface)); }
.tint-life { color: #f59e0b; background: color-mix(in srgb, #f59e0b 11%, var(--surface)); }
.tint-education { color: #2563eb; background: color-mix(in srgb, #2563eb 11%, var(--surface)); }
.tint-text { color: #ec4899; background: color-mix(in srgb, #ec4899 11%, var(--surface)); }
.tint-doc { color: #8b5cf6; background: color-mix(in srgb, #8b5cf6 11%, var(--surface)); }
.tint-develop { color: #06b6d4; background: color-mix(in srgb, #06b6d4 11%, var(--surface)); }
.tint-video { color: #ef4444; background: color-mix(in srgb, #ef4444 11%, var(--surface)); }
.tint-pc_plugin { color: #64748b; background: color-mix(in srgb, #64748b 11%, var(--surface)); }

.tool-item .cat-chip {
  font-size: 11px; color: var(--faint); margin-top: auto; padding-top: 4px;
}

/* ---------- 分类枢纽 ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.cat-tile {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 14px;
  padding: 20px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-xs);
  transition: transform .18s ease, box-shadow .18s ease;
  cursor: pointer;
}
.cat-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.cat-tile .cat-emoji {
  width: 48px; height: 48px; border-radius: 14px; flex: none;
  display: grid; place-items: center; font-size: 25px;
}
.cat-tile .cat-name { font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; }
.cat-tile .cat-count { font-size: 12.5px; color: var(--muted); }
.cat-tile .cat-arrow {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  color: var(--faint); opacity: 0; transition: opacity .15s ease, transform .18s ease;
  font-size: 15px;
}
.cat-tile:hover .cat-arrow { opacity: 1; transform: translateY(-50%) translateX(3px); }


/* ---------- 分组视图（全部工具） ---------- */
.group { margin: 26px 0 6px; scroll-margin-top: 96px; }
.group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.group-head .g-emoji { font-size: 19px; }
.group-head h3 { margin: 0; font-size: 17px; font-weight: 750; letter-spacing: -.01em; }
.group-head .g-count { font-size: 12.5px; color: var(--faint); }
.cat-rail {
  position: sticky; top: 64px; z-index: 30;
  display: flex; gap: 8px; overflow-x: auto; padding: 10px 2px;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  scrollbar-width: none;
}
.cat-rail::-webkit-scrollbar { display: none; }
.cat-rail a {
  flex: none; padding: 7px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
  transition: all .15s ease;
}
.cat-rail a:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

/* ---------- 空状态 ---------- */
.empty {
  text-align: center; padding: 72px 20px; color: var(--muted);
  border: 1px dashed var(--line-strong); border-radius: var(--r-lg);
}
.empty .e-emoji { display: block; font-size: 40px; margin-bottom: 12px; }
.empty b { display: block; font-size: 16px; color: var(--ink); margin-bottom: 4px; }

/* ---------- ⌘K 命令面板 ---------- */
.palette-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(18, 14, 10, .45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none; align-items: flex-start; justify-content: center;
  padding: 12vh 20px 20px;
}
.palette-mask.open { display: flex; animation: fadeIn .15s ease; }
.palette {
  width: min(640px, 100%); max-height: 62vh;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 20px; box-shadow: var(--shadow-lg);
  animation: popIn .18s cubic-bezier(.2, .9, .3, 1.2);
}
.palette-input-row { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.palette-input-row .pi { font-size: 17px; opacity: .5; }
#paletteInput {
  flex: 1; border: 0; outline: none; background: none;
  font: inherit; font-size: 16.5px; color: var(--ink);
}
#paletteInput::placeholder { color: var(--faint); }
.palette-list { overflow-y: auto; padding: 8px; }
.palette-group { font-size: 11.5px; font-weight: 700; letter-spacing: .1em; color: var(--faint); padding: 10px 12px 4px; }
.palette-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px; cursor: pointer;
}
.palette-item .pi-emoji {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  display: grid; place-items: center; font-size: 18px; background: var(--bg-deep);
}
.palette-item .pi-name { font-size: 14.5px; font-weight: 600; }
.palette-item .pi-name b { color: var(--accent); }
.palette-item .pi-desc {
  font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 380px;
}
.palette-item .pi-cat { margin-left: auto; flex: none; font-size: 11.5px; color: var(--faint); }
.palette-item.active { background: var(--accent-soft); }
.palette-item.active .pi-name { color: var(--accent-ink); }
.palette-foot {
  display: flex; gap: 16px; padding: 10px 18px;
  border-top: 1px solid var(--line); font-size: 11.5px; color: var(--faint);
}
.palette-empty { padding: 40px 20px; text-align: center; color: var(--muted); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: 72px;
  border-top: 1px solid var(--line);
  background: var(--bg-deep);
  padding: 40px 0 48px;
}
.footer-grid { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.footer-brand { max-width: 400px; }
.footer-brand .brand { margin-bottom: 10px; }
.footer-brand p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.7; }
.footer-links { margin-left: auto; display: flex; gap: 28px; }
.footer-links a { font-size: 13.5px; color: var(--muted); }
.footer-links a:hover { color: var(--accent); }
.footer-base {
  margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--faint); display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between;
}

/* ---------- FAB / Toast ---------- */
.fab {
  position: fixed; right: 26px; bottom: 26px; z-index: 50;
  width: 46px; height: 46px; border-radius: 15px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 18px;
  display: grid; place-items: center; cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.fab.show { opacity: 1; transform: none; pointer-events: auto; }
.fab:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 16px);
  z-index: 120; padding: 10px 20px; border-radius: 12px;
  background: var(--ink); color: var(--bg);
  font-size: 13.5px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: all .25s ease;
  box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================================================
   工具页（tool.html）
   ========================================================================== */
.tp-wrap { max-width: 1080px; margin: 0 auto; padding: 34px 24px 60px; }
.tp-hero {
  display: flex; align-items: center; gap: 18px;
  padding: 26px 28px; margin-bottom: 26px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-xl); box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.tp-hero::after {
  content: ""; position: absolute; right: -60px; top: -80px;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  pointer-events: none;
}
.tp-ic {
  width: 64px; height: 64px; border-radius: 19px; flex: none;
  display: grid; place-items: center; font-size: 34px;
  background: var(--bg-deep); border: 1px solid var(--line);
}
.tp-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tp-title-row h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.free-tag {
  font-size: 12px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px;
  background: var(--green-soft); color: var(--green);
}
.tp-sub { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.crumb { font-size: 13px; color: var(--faint); display: flex; gap: 8px; align-items: center; }
.crumb a:hover { color: var(--accent); }
.crumb .sep { opacity: .5; }
#toolRoot { min-height: 200px; }

.related { margin-top: 44px; }
.related h3 { font-size: 18px; font-weight: 800; letter-spacing: -.01em; margin-bottom: 16px; }

/* ==========================================================================
   工具框架类（CONTRACT.md 运行时依赖 —— 重新设计，不可删除）
   ========================================================================== */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  padding: 22px;
  margin-bottom: 18px;
}
.panel > h3 {
  margin: 0 0 16px;
  font-size: 16px; font-weight: 750; letter-spacing: -.01em;
  display: flex; align-items: center; gap: 8px;
}
.panel > h3::before {
  content: ""; width: 4px; height: 15px; border-radius: 4px;
  background: var(--accent); opacity: .85;
  flex: none;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; min-width: 0; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; cursor: pointer;
  padding: 9px 18px; border-radius: 11px;
  background: var(--accent); color: #fff;
  font-size: 14px; font-weight: 600; font-family: inherit;
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
  box-shadow: 0 1px 3px rgba(232, 86, 42, .3);
}
.btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn:active { transform: none; }
.btn.ghost {
  background: var(--surface); color: var(--ink-2);
  border-color: var(--line-strong); box-shadow: var(--shadow-xs);
}
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.btn.sm { padding: 5px 12px; font-size: 12.5px; border-radius: 9px; }

.input, .textarea, select.input {
  width: 100%;
  border: 1px solid var(--line-strong); border-radius: 11px;
  background: var(--surface-2); color: var(--ink);
  font: inherit; font-size: 14px;
  padding: 9px 13px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.input:focus, .textarea:focus, select.input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: var(--ring); background: var(--surface);
}
.textarea { min-height: 130px; resize: vertical; line-height: 1.6; }
select.input { cursor: pointer; }
input[type="range"].input, input[type="range"] {
  padding: 0; accent-color: var(--accent); cursor: pointer;
}
input[type="color"] { width: 42px; height: 34px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface-2); cursor: pointer; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

.mono { font-family: var(--mono); font-size: 13px; }
.result {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 15px;
  font-size: 14px; line-height: 1.65;
  white-space: pre-wrap; word-break: break-word;
  max-height: 420px; overflow: auto;
}
.result.mono { font-family: var(--mono); font-size: 12.8px; }
.result:empty { display: none; }
.note {
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line));
  color: var(--accent-ink);
  border-radius: 12px; padding: 11px 15px;
  font-size: 13px; line-height: 1.65;
  margin: 12px 0;
}
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin: 6px 0; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; font-size: 13.5px; align-items: baseline; }
.kv .k { color: var(--muted); font-size: 12.5px; }

.tag-pick { display: flex; flex-wrap: wrap; gap: 7px; margin: 8px 0; }
.chip {
  padding: 6px 14px; border-radius: 999px; cursor: pointer; user-select: none;
  background: var(--surface-2); border: 1px solid var(--line-strong);
  font-size: 13px; font-weight: 500;
  transition: all .13s ease;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

.dropzone {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface-2);
  padding: 34px 20px; text-align: center;
  cursor: pointer; transition: all .18s ease;
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--accent); background: var(--accent-soft);
  transform: scale(1.005);
}
.dropzone.drag { box-shadow: var(--ring); }
.dz-emoji { font-size: 30px; display: block; margin-bottom: 8px; }
.dropzone div { font-size: 13.5px; color: var(--muted); }

canvas.work {
  max-width: 100%; height: auto;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.preview-img { max-width: 100%; border-radius: var(--r-md); border: 1px solid var(--line); }

table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th, table.data td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; }
table.data th { font-weight: 650; color: var(--muted); font-size: 12.5px; background: var(--surface-2); }
table.data tr:hover td { background: var(--surface-2); }

.swatch { width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--line); display: inline-block; vertical-align: middle; }

.progress {
  height: 8px; border-radius: 99px; overflow: hidden;
  background: var(--bg-deep); border: 1px solid var(--line);
}
.progress > i {
  display: block; height: 100%; width: 0;
  background: var(--accent);
  border-radius: 99px; transition: width .2s ease;
}
.spinner {
  display: inline-block; width: 15px; height: 15px;
  border: 2px solid var(--line-strong); border-top-color: var(--accent);
  border-radius: 50%; vertical-align: -3px;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .hero { padding: 56px 0 40px; }
  .hero-stats { gap: 24px; }
  .nav-search-btn { min-width: 0; }
  .nav-search-btn .sp, .nav-search-btn kbd { display: none; }
  .nav-links a, .nav-links button { padding: 7px 9px; font-size: 13.5px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .tp-hero { flex-direction: column; align-items: flex-start; }
  .footer-links { margin-left: 0; }
}
@media (max-width: 520px) {
  .hero-title { font-size: 40px; }
  .hero-search { flex-wrap: wrap; padding: 10px; border-radius: 16px; }
  .hero-search .go { width: 100%; }
  .hero-stats { gap: 18px; }
  .hero-stats b { font-size: 20px; }
}

/* ---------- 页脚信息弹窗（关于/隐私/免责/反馈） ---------- */
.imask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(18, 14, 10, .45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 14vh 20px 20px;
  animation: fadeIn .15s ease;
}
.idialog {
  width: min(560px, 100%);
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  padding: 22px 24px;
}
.idialog h3 { margin: 0 0 10px; font-size: 17px; }
.idialog p { margin: 8px 0; color: var(--ink-2); font-size: 14px; line-height: 1.7; }
.idialog .btn-row { justify-content: flex-end; }
