:root {
  --bg: #f4f7fc;
  --bg-soft: #eef3fb;
  --card: #ffffff;
  --ink: #16213a;
  --ink-2: #3b4866;
  --muted: #6c7892;
  --line: #e4eaf4;
  --line-2: #eef2f9;
  --brand: #2f63ff;
  --brand-600: #1f4fe0;
  --brand-700: #1a3fc0;
  --brand-50: #eaf0ff;
  --brand-100: #dde7ff;
  --amber: #b76b00;
  --amber-50: #fff5e6;
  --red: #d23b3b;
  --shadow-sm: 0 1px 2px rgba(22, 33, 58, .06), 0 2px 6px rgba(22, 33, 58, .05);
  --shadow-md: 0 6px 24px rgba(22, 33, 58, .08);
  --shadow-lg: 0 18px 50px rgba(22, 33, 58, .12);
  --radius: 16px;
  --radius-sm: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; }
/* hidden 属性优先于组件的 display 声明，避免 flex/grid 覆盖导致隐藏失效 */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .inner {
  display: flex; align-items: center; gap: 18px;
  height: 64px;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; white-space: nowrap; }
.logo .mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand) 0%, #5b8bff 100%);
  color: #fff; display: grid; place-items: center;
  font-size: 20px; font-weight: 800; box-shadow: var(--shadow-sm);
}
.nav { display: flex; gap: 6px; margin-left: 8px; }
.nav a {
  padding: 8px 12px; border-radius: 9px; color: var(--ink-2);
  font-size: 14.5px; font-weight: 500; transition: .15s; white-space: nowrap;
}
.nav a:hover { background: var(--bg-soft); color: var(--ink); }
.header-cta { margin-left: auto; white-space: nowrap; }
.menu-btn { display: none; }
.mobile-menu { display: none; }

/* 折叠菜单：窄屏隐藏横向导航，改用汉堡菜单 */
@media (max-width: 940px) {
  .site-header .inner { gap: 12px; }
  .nav { display: none; }
  .menu-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; flex-shrink: 0;
    border: 1px solid var(--line); border-radius: 10px; background: #fff;
    color: var(--ink); cursor: pointer; transition: .15s; padding: 0;
  }
  .menu-btn:hover, .menu-btn[aria-expanded="true"] { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
  .mobile-menu {
    position: absolute; left: 0; right: 0; top: 64px;
    background: #fff; border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 40px rgba(22, 33, 58, .14);
    padding: 8px 16px 14px;
  }
  .mobile-menu.open { display: block; }
  .mobile-menu a {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
    padding: 12px 6px; border-bottom: 1px solid var(--line-2); border-radius: 8px;
  }
  .mobile-menu a:last-child { border-bottom: 0; }
  .mobile-menu a:active { background: var(--bg-soft); }
  .mobile-menu .mt { font-size: 15px; font-weight: 600; color: var(--ink); }
  .mobile-menu .ms { font-size: 12.5px; color: var(--muted); text-align: right; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 11px; font-size: 14.5px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(47, 99, 255, .28); }
.btn-primary:hover { background: var(--brand-600); transform: translateY(-1px); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-sm { padding: 8px 14px; font-size: 13.5px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 64px 0 56px; }
.hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(900px 380px at 82% -8%, rgba(91, 139, 255, .18), transparent 60%),
    radial-gradient(700px 320px at 8% 0%, rgba(47, 99, 255, .10), transparent 55%);
  pointer-events: none;
}
.hero .grid-pattern {
  position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background-image: radial-gradient(rgba(47, 99, 255, .10) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 75%);
  mask-image: linear-gradient(180deg, #000, transparent 75%);
}
.hero .inner { position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px;
  background: var(--brand-50); color: var(--brand-700); border-radius: 999px;
  font-size: 13px; font-weight: 600; margin-bottom: 18px;
}
.hero h1 { font-size: 44px; line-height: 1.12; text-wrap: balance; }
.hero h1 .accent { color: var(--brand); }
.hero .sub { font-size: 17px; color: var(--muted); margin-top: 16px; max-width: 460px; }
.hero .actions { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.hero .trust { display: flex; gap: 18px; margin-top: 26px; flex-wrap: wrap; }
.hero .trust span { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--ink-2); }
.hero .trust svg { color: var(--brand); }

/* ---------- Demo card ---------- */
.demo-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow-lg); padding: 18px;
}
.demo-tabs { display: flex; gap: 6px; background: var(--bg-soft); padding: 4px; border-radius: 12px; margin-bottom: 14px; }
.demo-tabs button {
  flex: 1; border: 0; background: transparent; padding: 9px; border-radius: 9px;
  font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: .15s;
}
.demo-tabs button.active { background: #fff; color: var(--brand-700); box-shadow: var(--shadow-sm); }
.demo-io { display: flex; flex-direction: column; gap: 10px; }
.demo-field { position: relative; }
.demo-field label { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; display: block; }
.demo-field input, .demo-field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  font-size: 15px; font-family: var(--font); color: var(--ink); background: #fbfcfe; resize: none;
}
.demo-field input:focus, .demo-field textarea:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-50); }
.demo-out {
  min-height: 52px; border: 1px dashed var(--line); border-radius: 12px; padding: 12px 14px;
  background: var(--brand-50); color: var(--ink); font-size: 16px; word-break: break-all;
}
.demo-out.placeholder { color: var(--muted); background: #fbfcfe; }
.demo-hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* ---------- Section ---------- */
.section { padding: 56px 0; }
.section-head { text-align: center; margin-bottom: 36px; }
.section-head .kicker { color: var(--brand); font-weight: 700; font-size: 14px; letter-spacing: .04em; }
.section-head h2 { font-size: 30px; margin-top: 8px; }
.section-head p { color: var(--muted); margin-top: 10px; font-size: 16px; }

/* Tools grid */
.tools-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.tool-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-sm); transition: .18s; display: flex; flex-direction: column;
}
.tool-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: var(--brand-100); }
.tool-card .ic {
  width: 52px; height: 52px; border-radius: 14px; background: var(--brand-50); color: var(--brand);
  display: grid; place-items: center; margin-bottom: 16px;
}
.tool-card h3 { font-size: 20px; }
.tool-card .desc { color: var(--muted); font-size: 14.5px; margin-top: 8px; }
.tool-card ul { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-direction: column; gap: 9px; }
.tool-card li { display: flex; gap: 9px; font-size: 14px; color: var(--ink-2); align-items: flex-start; }
.tool-card li svg { color: var(--brand); flex-shrink: 0; margin-top: 3px; }
.tool-card .go { margin-top: 20px; align-self: flex-start; }

/* Features */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 20px; box-shadow: var(--shadow-sm);
}
.feature .ic { width: 40px; height: 40px; border-radius: 11px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; margin-bottom: 12px; }
.feature h4 { font-size: 15.5px; }
.feature p { color: var(--muted); font-size: 13.5px; margin-top: 6px; }

/* FAQ */
.faq { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
/* 独立 FAQ 页：与标题左对齐，占满内容区 */
.faq.faq-page { max-width: none; margin: 0; }
.faq details {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 16px 18px; box-shadow: var(--shadow-sm);
}
.faq summary { cursor: pointer; font-weight: 600; font-size: 15.5px; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .plus { color: var(--brand); transition: transform .2s; font-size: 20px; line-height: 1; }
.faq details[open] summary .plus { transform: rotate(45deg); }
.faq p { color: var(--muted); font-size: 14px; margin-top: 10px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: #fff; padding: 30px 0; margin-top: 20px; }
.site-footer .inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 13.5px; }
.site-footer a { color: var(--ink-2); }
.site-footer a:hover { color: var(--brand); }

/* ---------- Tool page layout ---------- */
.page-head { padding: 30px 0 6px; }
.crumbs { font-size: 13.5px; color: var(--muted); margin-bottom: 14px; }
.crumbs a:hover { color: var(--brand); }
.page-head h1 { font-size: 28px; }
.page-head .lead { color: var(--muted); margin-top: 8px; font-size: 15.5px; max-width: 640px; }

.tool-card-lg { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-top: 24px; overflow: hidden; }
.tool-bar {
  display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--bg-soft);
}
.opt-group { display: flex; align-items: center; gap: 9px; }
.opt-group > span { font-size: 13px; color: var(--muted); font-weight: 600; }
.seg { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button {
  border: 0; background: transparent; padding: 6px 12px; border-radius: 7px;
  font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: .15s;
}
.seg button.active { background: var(--brand); color: #fff; }
.tool-bar .spacer { margin-left: auto; }
.tool-bar .actions { display: flex; gap: 8px; }

.io-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.io-pane { padding: 18px 20px; display: flex; flex-direction: column; min-width: 0; }
.io-pane + .io-pane { border-left: 1px solid var(--line); }
.io-pane .pane-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.io-pane .pane-head .t { font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.io-pane .pane-head .count { font-size: 12px; color: var(--muted); }
.io-pane textarea, .io-pane .out {
  width: 100%; min-height: 240px; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; font-size: 15px; line-height: 1.75; font-family: var(--font);
  color: var(--ink); background: #fbfcfe; resize: vertical;
}
.io-pane textarea:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-50); }
.io-pane .out { background: #fff; white-space: pre-wrap; word-break: break-word; overflow: auto; }
.io-pane .out.empty { color: var(--muted); }

/* candidates */
.candidates { padding: 14px 20px; border-top: 1px solid var(--line); background: #fbfcfe; }
.candidates .lab { font-size: 12.5px; color: var(--muted); margin-bottom: 9px; font-weight: 600; }
.cand-row { display: flex; flex-wrap: wrap; gap: 8px; }
.cand {
  border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 7px 13px;
  font-size: 14px; cursor: pointer; transition: .15s; color: var(--ink);
}
.cand:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
.cand.active { border-color: var(--brand); background: var(--brand); color: #fff; }

.syllables { padding: 0 20px 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.syllables .chip { font-size: 12.5px; padding: 3px 9px; border-radius: 7px; background: var(--bg-soft); color: var(--ink-2); border: 1px solid var(--line); }
.syllables .chip.invalid { background: var(--amber-50); color: var(--amber); border-color: #f3d9ae; }
.warn { padding: 10px 20px; color: var(--amber); font-size: 13px; background: var(--amber-50); border-top: 1px solid #f3d9ae; }

/* ruby / 注音排版 */
.ruby { line-height: 2.2; font-size: 17px; }
.ruby .rc { display: inline-flex; flex-direction: column; align-items: center; vertical-align: top; margin: 0 1px; }
.ruby .rc .py { font-size: 11px; color: var(--brand); line-height: 1.1; margin-bottom: 1px; }
.ruby .rc .hz { font-size: 18px; }
.ruby .rc.poly .hz { color: var(--amber); }
.ruby .rc .hz[title] { border-bottom: 1px dotted var(--amber); }

/* doc section */
.doc { margin-top: 30px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow-sm); }
.doc h3 { font-size: 18px; margin-bottom: 12px; }
.doc ol { margin: 0; padding-left: 20px; color: var(--ink-2); font-size: 14.5px; display: flex; flex-direction: column; gap: 8px; }
.doc .tips { margin-top: 14px; font-size: 13.5px; color: var(--muted); }
.doc .tips code { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; color: var(--brand-700); }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px);
  background: #1c2438; color: #fff; padding: 11px 20px; border-radius: 12px; font-size: 14px;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: .25s; z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* responsive */
@media (max-width: 860px) {
  .hero .inner { grid-template-columns: 1fr; gap: 32px; }
  .hero h1 { font-size: 34px; }
  .nav { display: none; }
  .tools-grid { grid-template-columns: 1fr 1fr; }
  .features-grid, .io-grid { grid-template-columns: 1fr; }
  .io-pane + .io-pane { border-left: 0; border-top: 1px solid var(--line); }
  .features-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .features-grid { grid-template-columns: 1fr; }
  .tool-bar { gap: 12px; }
  .tool-bar .spacer { display: none; }
}

/* ---------- 新工具样式 ---------- */
/* 方向提示（简繁） */
.dir-note { font-size: 13px; color: var(--muted); padding: 14px 20px 0; }

/* 字典卡片 */
.dict-wrap { margin-top: 18px; }
.dict-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 16px; }
.dict-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px 20px; box-shadow: var(--shadow-sm); transition: .15s; }
.dict-card:hover { box-shadow: var(--shadow-md); border-color: var(--brand-100); }
.dict-card .ch { font-size: 48px; line-height: 1; font-weight: 700; color: var(--ink); }
.dict-card .reads { margin: 12px 0 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.dict-card .read { font-size: 14px; padding: 4px 11px; border-radius: 999px; background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.dict-card .meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--ink-2); border-top: 1px solid var(--line-2); padding-top: 10px; }
.dict-card .meta b { color: var(--ink); font-weight: 700; }
.dict-card .words { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.dict-card .words span { font-size: 13px; padding: 3px 9px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 7px; color: var(--ink-2); }
.dict-empty { color: var(--muted); font-size: 14px; padding: 12px 2px; }

/* 多音字列表 */
.poly-list { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.poly-item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.poly-item .head { display: flex; align-items: baseline; gap: 12px; }
.poly-item .read { font-size: 24px; font-weight: 700; color: var(--brand); }
.poly-item .tone { font-size: 13px; color: var(--muted); }
.poly-item .ex { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.poly-item .ex span { font-size: 14px; padding: 4px 11px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 8px; color: var(--ink-2); }
.poly-note { color: var(--muted); font-size: 13.5px; margin-top: 12px; }

/* 相关工具 */
.related { margin-top: 30px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.related a { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; box-shadow: var(--shadow-sm); transition: .15s; }
.related a:hover { border-color: var(--brand); box-shadow: var(--shadow-md); }
.related .ric { width: 38px; height: 38px; border-radius: 10px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; flex-shrink: 0; }
.related .rt { font-size: 14.5px; font-weight: 700; color: var(--ink); }
.related .rs { font-size: 12.5px; color: var(--muted); }
@media (max-width: 720px) { .related { grid-template-columns: 1fr; } }

/* ============ 新工具样式（文本/编码/换算/颜色/二维码） ============ */
/* 代码/等宽 */
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: 13.5px !important; line-height: 1.6 !important; }

/* 文本字数统计 */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 4px; }
.stat { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 14px; text-align: center; }
.stat .num { font-size: 26px; font-weight: 800; color: var(--brand-700); line-height: 1.1; word-break: break-all; }
.stat .lab { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
@media (max-width: 720px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

/* 小按钮（复制当前时间戳等） */
.mini { border: 1px solid var(--line); background: #fff; color: var(--brand); font-size: 12px; font-weight: 600; border-radius: 8px; padding: 4px 10px; cursor: pointer; transition: .15s; }
.mini:hover { border-color: var(--brand); background: var(--brand-50); }

/* 时间戳 */
.ts-now { padding: 18px 20px; background: var(--brand-50); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.ts-row { display: flex; align-items: center; gap: 12px; }
.ts-row .tl { font-size: 13px; color: var(--ink-2); width: 130px; flex-shrink: 0; }
.ts-row b { font-size: 18px; color: var(--brand-700); font-family: ui-monospace, monospace; }
.ts-conv { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.ts-box { padding: 18px 20px; }
.ts-box + .ts-box { border-left: 1px solid var(--line); }
.ts-box h3 { font-size: 15px; margin-bottom: 12px; }
.ts-inline { display: flex; gap: 8px; margin-bottom: 12px; }
.ts-inline input[type="text"], .ts-inline input[type="datetime-local"] { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-size: 14px; font-family: var(--font); background: #fbfcfe; }
.ts-inline input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.ts-out { display: flex; flex-direction: column; gap: 8px; }
.ts-out div { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; }
.ts-out span { color: var(--muted); flex-shrink: 0; }
.ts-out b { color: var(--ink); font-family: ui-monospace, monospace; text-align: right; word-break: break-all; }
@media (max-width: 720px) { .ts-conv { grid-template-columns: 1fr; } .ts-box + .ts-box { border-left: 0; border-top: 1px solid var(--line); } }

/* 单位换算 */
.conv-main { padding: 20px; }
.conv-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.conv-row input[type="number"] { width: 140px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 16px; font-weight: 600; background: #fbfcfe; }
.conv-row input[type="number"]:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.conv-row select { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px; background: #fff; color: var(--ink); cursor: pointer; min-width: 120px; }
.conv-row .arrow { color: var(--brand); font-size: 18px; font-weight: 700; }
.conv-result { background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 10px; padding: 8px 14px; min-width: 160px; text-align: center; }
.conv-result b { font-size: 18px; color: var(--brand-700); font-weight: 800; word-break: break-all; }
.conv-table { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin-top: 18px; }
.ct-row { display: flex; justify-content: space-between; gap: 8px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; font-size: 13.5px; }
.ct-row span { color: var(--muted); }
.ct-row b { color: var(--ink); font-family: ui-monospace, monospace; word-break: break-all; }

/* 颜色转换 */
.color-main { display: flex; gap: 28px; padding: 24px 20px; flex-wrap: wrap; }
.color-preview { width: 200px; height: 200px; border-radius: 18px; display: grid; place-items: center; box-shadow: var(--shadow-md); border: 1px solid var(--line); flex-shrink: 0; }
.color-preview span { background: rgba(255,255,255,.85); padding: 6px 12px; border-radius: 8px; font-family: ui-monospace, monospace; font-size: 14px; font-weight: 600; color: #1a1a1a; }
.color-controls { flex: 1; min-width: 260px; display: flex; flex-direction: column; gap: 16px; }
.color-row { display: flex; align-items: center; gap: 10px; }
.color-row label { width: 42px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.color-row input[type="color"] { width: 44px; height: 38px; border: 1px solid var(--line); border-radius: 9px; padding: 2px; background: #fff; cursor: pointer; }
.color-row .hex-input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-size: 15px; font-family: ui-monospace, monospace; background: #fbfcfe; text-transform: uppercase; }
.color-row input[type="number"] { width: 72px; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; font-size: 14px; background: #fbfcfe; }
.color-row input[type="text"][readonly] { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-size: 14px; font-family: ui-monospace, monospace; background: var(--bg-soft); color: var(--ink-2); }
.color-row input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.color-actions { display: flex; gap: 10px; margin-top: 4px; }
@media (max-width: 720px) { .color-preview { width: 100%; height: 140px; } }

/* 二维码 */
.qr-main { display: flex; gap: 24px; padding: 20px; flex-wrap: wrap; }
.qr-input { flex: 1; min-width: 260px; }
.qr-input textarea { width: 100%; min-height: 200px; border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-size: 15px; line-height: 1.7; font-family: var(--font); background: #fbfcfe; resize: vertical; }
.qr-input textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.qr-preview { width: 260px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.qr-box { width: 240px; height: 240px; border: 1px solid var(--line); border-radius: 16px; background: #fff; display: grid; place-items: center; padding: 12px; box-shadow: var(--shadow-sm); }
.qr-box svg { width: 100%; height: 100%; }
.qr-tip { font-size: 12.5px; color: var(--muted); text-align: center; }
@media (max-width: 720px) { .qr-preview { width: 100%; } .qr-box { width: 200px; height: 200px; margin: 0 auto; } }

/* ============ 首页分类 ============ */
.cat { margin-top: 40px; }
.cat:first-of-type { margin-top: 8px; }
/* 锚点跳转时为吸顶头部留出空间 */
.cat, #faq { scroll-margin-top: 78px; }
.cat-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.cat-label { font-size: 20px; font-weight: 800; color: var(--ink); position: relative; padding-left: 14px; }
.cat-label::before { content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 5px; height: 20px; border-radius: 3px; background: var(--brand); }
.cat-desc { font-size: 14px; color: var(--muted); }

/* 当前所在分类高亮 */
.nav a.active { color: var(--brand); background: var(--brand-50); font-weight: 600; }
.mobile-menu a.active .mt { color: var(--brand); }
.mobile-menu a.active .ms { color: var(--brand); opacity: .75; }

/* ============ 首页分类入口卡片 ============ */
.cat-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.cat-card {
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm); transition: .18s;
}
.cat-card:hover { border-color: var(--brand-100); box-shadow: var(--shadow-md); transform: translateY(-3px); }
.cat-card .cc-head { display: flex; align-items: center; gap: 12px; }
.cat-card .cc-ic {
  width: 44px; height: 44px; border-radius: 12px; background: var(--brand-50);
  color: var(--brand); display: grid; place-items: center; flex-shrink: 0;
}
.cat-card h3 { font-size: 18px; }
.cat-card .cc-num {
  margin-left: auto; flex-shrink: 0; font-size: 12.5px; color: var(--muted);
  background: var(--bg-soft); border-radius: 999px; padding: 3px 10px;
}
.cat-card .cc-desc { color: var(--muted); font-size: 14px; margin-top: 12px; }
.cat-card .cc-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.cat-card .cc-list span {
  font-size: 12.5px; color: var(--ink-2); background: var(--bg-soft);
  border: 1px solid var(--line-2); border-radius: 8px; padding: 3px 9px;
}
.cat-card .cc-go { margin-top: auto; padding-top: 16px; font-size: 13.5px; font-weight: 700; color: var(--brand); }

/* 分类页底部：跳转其他分类 */
.cat-switch {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm);
}
.cat-switch .cs-label { font-size: 13px; color: var(--muted); margin-right: 2px; }
.cat-switch a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 10px; font-size: 13.5px; font-weight: 600;
  color: var(--ink-2); background: var(--bg-soft); border: 1px solid var(--line); transition: .15s;
}
.cat-switch a:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
.cat-switch a span { font-size: 11.5px; font-weight: 500; color: var(--muted); }

@media (max-width: 860px) {
  .cat-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .tools-grid { grid-template-columns: 1fr; }
  .cat-cards { grid-template-columns: 1fr; }
  .cat-switch { padding: 14px; }
  .cat-switch a { padding: 7px 12px; font-size: 13px; }
}

/* ============ 文本整理 ============ */
.checks { display: flex; flex-wrap: wrap; gap: 10px 18px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--bg-soft); }
.chk { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; user-select: none; }
.chk input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }

/* ============ 进制转换 ============ */
.base-box { padding: 20px; }
.base-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width:720px){ .base-grid { grid-template-columns: 1fr; } }
.base-field label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 8px; font-weight: 600; }
.base-field textarea { width: 100%; min-height: 120px; border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-size: 15px; font-family: ui-monospace, monospace; background: #fbfcfe; line-height: 1.7; resize: vertical; }
.base-field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.base-field select { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px; background: #fff; color: var(--ink); cursor: pointer; margin-top: 8px; }

/* ============ 正则测试 ============ */
.re-main { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.re-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.re-row > label { width: 64px; font-size: 13.5px; color: var(--ink-2); font-weight: 600; flex-shrink: 0; }
.re-pat { flex: 1; min-width: 200px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 15px; font-family: ui-monospace, monospace; background: #fbfcfe; }
.re-pat:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.re-flags { display: flex; gap: 6px; }
.re-flags .f { border: 1px solid var(--line); background: #fff; border-radius: 8px; width: 34px; height: 34px; font-family: ui-monospace, monospace; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.re-flags .f.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.re-out { border: 1px solid var(--line); border-radius: 12px; padding: 14px; min-height: 120px; background: #fbfcfe; font-size: 14px; line-height: 1.9; word-break: break-all; white-space: pre-wrap; }
.re-match { background: rgba(47,99,255,.16); border-radius: 4px; padding: 0 2px; color: var(--brand-700); font-weight: 700; }
.re-list { display: flex; flex-direction: column; gap: 6px; }
.re-item { font-size: 13px; font-family: ui-monospace, monospace; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; word-break: break-all; }
.re-item .gi { color: var(--muted); margin-right: 8px; }
.re-empty { color: var(--muted); font-size: 13.5px; }

/* ============ 密码生成器 ============ */
.pw-main { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.pw-result { display: flex; gap: 10px; align-items: stretch; }
.pw-result textarea { flex: 1; min-height: 56px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 16px; font-family: ui-monospace, monospace; background: #fbfcfe; line-height: 1.5; resize: vertical; }
.pw-result textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.pw-strength { height: 8px; border-radius: 6px; background: var(--bg-soft); overflow: hidden; }
.pw-strength i { display: block; height: 100%; width: 0; transition: .2s; background: var(--brand); }
.pw-strength-label { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.pw-opts { display: flex; flex-wrap: wrap; gap: 10px 20px; }
.pw-slider { display: flex; align-items: center; gap: 12px; }
.pw-slider input[type=range] { flex: 1; accent-color: var(--brand); }
.pw-slider b { font-family: ui-monospace, monospace; color: var(--brand-700); min-width: 30px; text-align: center; }

/* ============ UUID 生成 ============ */
.uuid-main { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.uuid-list { border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; max-height: 360px; overflow: auto; }
.uuid-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-family: ui-monospace, monospace; font-size: 14px; }
.uuid-row:last-child { border-bottom: 0; }
.uuid-row .uid { flex: 1; word-break: break-all; }
.uuid-row .copymini { border: 1px solid var(--line); background: #fff; color: var(--brand); border-radius: 7px; padding: 3px 9px; font-size: 12px; cursor: pointer; }
.uuid-row .copymini:hover { background: var(--brand-50); border-color: var(--brand); }

/* ============ 文本转语音 ============ */
.tts-main { padding: 22px 20px; display: flex; flex-direction: column; gap: 16px; }
.tts-area textarea { width: 100%; min-height: 140px; border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-size: 15px; line-height: 1.7; font-family: var(--font); background: #fbfcfe; resize: vertical; }
.tts-area textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.tts-status { font-size: 13.5px; color: var(--ink-2); min-height: 20px; }

/* ============ GPA 计算器 ============ */
.seg button:disabled { opacity: .38; cursor: not-allowed; }
.gpa-main { display: flex; gap: 24px; padding: 20px; flex-wrap: wrap; align-items: flex-start; }
.gpa-table-wrap { flex: 1 1 0%; min-width: 0; overflow-x: auto; }
.gpa-table { width: 100%; min-width: 440px; border-collapse: collapse; table-layout: fixed; }
.gpa-table .c-credit { width: 92px; }
.gpa-table .c-val { width: 132px; }
.gpa-table .c-pt { width: 76px; }
.gpa-table .c-del { width: 44px; }
.gpa-table th { font-size: 12.5px; color: var(--muted); font-weight: 600; text-align: left; padding: 0 6px 8px; }
.gpa-table td { padding: 4px 6px; }
.gpa-table th:last-child, .gpa-table td:last-child { text-align: center; padding-left: 0; padding-right: 0; }
.gpa-input {
  width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px;
  font-size: 14px; font-family: var(--font); color: var(--ink); background: #fbfcfe;
}
.gpa-input:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-50); }
select.gpa-input { cursor: pointer; }
.gpa-pt { text-align: center; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; color: var(--brand-700); font-weight: 700; }
.gpa-del {
  border: 0; background: transparent; color: var(--muted); font-size: 18px; line-height: 1;
  cursor: pointer; border-radius: 8px; width: 30px; height: 30px; transition: .15s;
}
.gpa-del:hover { background: #fdecec; color: var(--red); }
.gpa-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.gpa-side { width: 268px; flex-shrink: 0; display: flex; flex-direction: column; gap: 12px; }
.gpa-hero {
  background: linear-gradient(135deg, var(--brand) 0%, #5b8bff 100%); color: #fff;
  border-radius: 14px; padding: 18px 20px; box-shadow: 0 10px 26px rgba(47, 99, 255, .26);
}
.gpa-hero .lab { font-size: 12.5px; opacity: .92; }
.gpa-hero .val { font-size: 42px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.gpa-hero .sub { font-size: 12.5px; opacity: .9; margin-top: 2px; }
.gpa-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gpa-stats .stat { padding: 10px 8px; border-radius: 9px; }
.gpa-stats .stat .num { font-size: 18px; }
.gpa-stats .stat .lab { font-size: 11.5px; margin-top: 3px; }
.gpa-hint { font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.gpa-plan { border-top: 1px solid var(--line); background: #fbfcfe; padding: 18px 20px 20px; }
.gpa-plan h3 { font-size: 15px; margin-bottom: 12px; }
.plan-row { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.plan-row label { font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.plan-row input {
  width: 132px; border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px;
  font-size: 15px; font-weight: 600; font-family: var(--font); color: var(--ink); background: #fff;
}
.plan-row input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.plan-out {
  flex: 1; min-width: 240px; display: flex; align-items: baseline; gap: 10px;
  background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 10px; padding: 10px 14px;
}
.plan-out b { font-size: 22px; font-weight: 800; color: var(--brand-700); white-space: nowrap; }
.plan-out span { font-size: 13px; color: var(--ink-2); }
.plan-out.bad { background: var(--amber-50); border-color: #f3d9ae; }
.plan-out.bad b { color: var(--amber); }
.plan-note { font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.gpa-rules {
  margin-top: 24px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden;
}
.gpa-rules summary {
  cursor: pointer; list-style: none; padding: 16px 20px; font-size: 15px; font-weight: 700;
  display: flex; justify-content: space-between; align-items: center;
}
.gpa-rules summary::-webkit-details-marker { display: none; }
.gpa-rules summary .plus { color: var(--brand); font-size: 20px; line-height: 1; transition: transform .2s; }
.gpa-rules[open] summary .plus { transform: rotate(45deg); }
.rule-body { padding: 0 20px 18px; }
.rule-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.rule-item {
  display: flex; justify-content: space-between; gap: 10px; font-size: 13px;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 8px; padding: 7px 11px;
}
.rule-item .rg { color: var(--ink-2); }
.rule-item b { color: var(--brand-700); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.rule-note { font-size: 12.5px; color: var(--muted); margin-top: 12px; line-height: 1.7; }
@media (max-width: 820px) {
  .gpa-main { flex-direction: column; }
  .gpa-side { width: 100%; max-width: 100%; }
}
@media (max-width: 720px) {
  .rule-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .tool-bar { padding: 14px 16px; }
  .opt-group { flex-wrap: wrap; }
  .seg { flex-wrap: wrap; }
  .seg button { padding: 6px 10px; font-size: 12.5px; }
  .gpa-main { padding: 16px; gap: 16px; }
  .gpa-hero .val { font-size: 36px; }
  .gpa-plan { padding: 16px; }
  .plan-row { gap: 12px; }
  .plan-row label { flex: 1 1 calc(50% - 6px); }
  .plan-row input { width: 100%; }
  .plan-out { min-width: 0; width: 100%; }
  /* 表格压到一屏内可见，避免横向滚动 */
  .gpa-table { min-width: 338px; }
  .gpa-table .c-credit { width: 58px; }
  .gpa-table .c-val { width: 112px; }
  .gpa-table .c-pt { width: 58px; }
  .gpa-table .c-del { width: 34px; }
  .gpa-table th, .gpa-table td { padding: 4px 4px; }
  .gpa-input { padding: 7px 8px; font-size: 13.5px; }
  .gpa-pt { font-size: 13px; }
}

/* ============ 图片转 Base64 ============ */
.img-main { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.img-drop { border: 2px dashed var(--line); border-radius: 14px; padding: 30px; text-align: center; color: var(--muted); cursor: pointer; transition: .15s; }
.img-drop:hover, .img-drop.over { border-color: var(--brand); background: var(--brand-50); color: var(--brand); }
.img-drop b { color: var(--brand); }
.img-preview { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.img-preview img { max-width: 200px; max-height: 200px; border-radius: 12px; border: 1px solid var(--line); }
.img-meta { font-size: 13px; color: var(--ink-2); display: flex; flex-direction: column; gap: 6px; }

/* ============ 图片处理（压缩 / 转换 / 裁剪） ============ */
.img-range { width: 132px; accent-color: var(--brand); cursor: pointer; }
.img-range:disabled { cursor: not-allowed; }
.img-range-val { font-size: 13px; color: var(--ink-2); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; min-width: 40px; }
.img-color { width: 40px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.img-color::-webkit-color-swatch-wrapper { padding: 3px; }
.img-color::-webkit-color-swatch { border: 1px solid var(--line); border-radius: 5px; }
.img-color:disabled { cursor: not-allowed; }

.cmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cmp-pane {
  margin: 0; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0;
}
.cmp-pane figcaption { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.cmp-holder {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  min-height: 170px; display: grid; place-items: center; overflow: hidden; padding: 6px;
}
.cmp-holder img, .cmp-holder canvas { max-width: 100%; max-height: 260px; display: block; border-radius: 4px; }

.img-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.img-stat {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.img-stat span { font-size: 12px; color: var(--muted); }
.img-stat b { font-size: 15px; color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.img-stat b.good { color: var(--brand); }
.img-stat b.bad { color: var(--amber); }

.img-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* 裁剪 */
.crop-wrap { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.crop-stage {
  flex: 1 1 380px; min-width: 0; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; display: grid; place-items: center; overflow: hidden;
}
.crop-stage canvas { display: block; touch-action: none; border-radius: 6px; box-shadow: var(--shadow-sm); max-width: 100%; }
.crop-side { width: 232px; display: flex; flex-direction: column; gap: 12px; flex-shrink: 0; }
.crop-info { display: flex; flex-direction: column; gap: 8px; }
.crop-quality { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
.crop-quality .img-range { flex: 1; width: auto; min-width: 0; }
.crop-side .btn { width: 100%; }
.crop-tip { font-size: 12px; color: var(--muted); line-height: 1.7; margin: 0; }

@media (max-width: 860px) {
  .cmp-grid { grid-template-columns: 1fr; }
  .img-stats { grid-template-columns: 1fr 1fr; }
  .crop-wrap { flex-direction: column; }
  .crop-side { width: 100%; }
}
@media (max-width: 620px) {
  .img-range { width: 96px; }
  .cmp-holder { min-height: 140px; }
}

/* ============ 证件照 ============ */
.idp-select {
  border: 1px solid var(--line); background: #fff; border-radius: 9px;
  padding: 6px 10px; font-size: 13px; font-weight: 600; color: var(--ink-2);
  font-family: inherit; cursor: pointer; outline: none;
}
.idp-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }

.idp-swatches { display: flex; gap: 7px; }
.swatch {
  width: 34px; height: 28px; border-radius: 8px; border: 2px solid var(--line);
  background: #fff; cursor: pointer; padding: 0; font-size: 12px; font-weight: 700;
  color: var(--muted); line-height: 1; transition: .15s;
}
.swatch:hover { border-color: var(--brand-100); }
.swatch.active { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-50); }
.swatch.original { background: linear-gradient(135deg, #fff 0 50%, #e6ecf5 50% 100%); }

.idp-wrap { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.idp-stage {
  flex: 1 1 380px; min-width: 0; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 12px; padding: 13px; display: flex; flex-direction: column;
  align-items: center; gap: 9px; overflow: hidden;
}
.idp-stage canvas {
  display: block; touch-action: none; border-radius: 3px;
  box-shadow: 0 2px 10px rgba(22, 33, 58, .14); cursor: grab; max-width: 100%;
}
.idp-hint { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.6; }

.idp-side { width: 284px; flex-shrink: 0; display: flex; flex-direction: column; gap: 14px; }
.idp-sec { display: flex; flex-direction: column; gap: 8px; }
.idp-sec + .idp-sec { border-top: 1px dashed var(--line); padding-top: 13px; }
.idp-sec .lbl { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.idp-sec .seg { width: 100%; }
.idp-sec .seg button { flex: 1; padding: 6px 4px; text-align: center; white-space: nowrap; }
.idp-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.idp-row .img-range { flex: 1; width: auto; min-width: 0; }
.idp-mini { font-size: 12px; color: var(--muted); font-weight: 600; min-width: 28px; }
.idp-num {
  width: 62px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px;
  font-size: 13.5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink); background: #fff; outline: none;
}
.idp-num:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.idp-x { color: var(--muted); font-size: 12px; }
.idp-unit { font-size: 12px; color: var(--muted); }
.idp-meta { font-size: 12px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.idp-side .btn { width: 100%; }
.idp-sec .idp-row .btn { width: auto; flex: 1; white-space: nowrap; }

@media (max-width: 860px) {
  .idp-wrap { flex-direction: column; }
  .idp-side { width: 100%; }
  .idp-side .btn { width: auto; }
  .idp-stage { width: 100%; }
}
@media (max-width: 620px) {
  .idp-swatches { gap: 6px; }
  .swatch { width: 30px; height: 26px; }
  .idp-side .idp-row .btn { flex: 1 1 auto; }
}

/* ============ 首页分类卡片 v2 ============ */
/* 卡片是可点击容器：标题与工具名都是真实链接，空白处由 JS 代理跳转 */
.cat-cards { align-items: stretch; }
.cat-card { cursor: pointer; position: relative; }
.cat-card .cc-head { align-items: flex-start; }
.cat-card .cc-ic { transition: .18s; }
.cat-card:hover .cc-ic { background: var(--brand); color: #fff; }
.cat-card h3 { font-size: 17.5px; line-height: 1.35; }
.cat-card .cc-sub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.cat-card .cc-num {
  align-self: flex-start; font-weight: 700; color: var(--brand-700);
  background: var(--brand-50); border: 1px solid var(--brand-100);
}
.cat-card .cc-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.cat-card .cc-tools a {
  font-size: 12.5px; color: var(--ink-2); background: var(--bg-soft);
  border: 1px solid var(--line-2); border-radius: 8px; padding: 4px 10px; transition: .15s;
}
.cat-card .cc-tools a:hover { color: var(--brand); border-color: var(--brand-100); background: var(--brand-50); }
.cat-card .cc-foot { margin-top: auto; padding-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cat-card .cc-go { font-size: 13.5px; font-weight: 700; color: var(--brand); }
.cat-card .cc-more { font-size: 12px; color: var(--muted); }

/* 全部工具索引 */
.all-tools {
  margin-top: 22px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.all-tools > summary {
  cursor: pointer; list-style: none; padding: 18px 22px;
  display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 700;
}
.all-tools > summary::-webkit-details-marker { display: none; }
.all-tools > summary .sub { font-size: 13px; color: var(--muted); font-weight: 500; }
.all-tools > summary .plus { margin-left: auto; color: var(--brand); font-size: 22px; line-height: 1; transition: transform .2s; }
.all-tools[open] > summary .plus { transform: rotate(45deg); }
.all-tools[open] > summary { border-bottom: 1px solid var(--line-2); }
.at-body { padding: 18px 22px 22px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px 26px; }
.at-group h4 { font-size: 13.5px; color: var(--brand-700); display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.at-group h4 span { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.at-links { display: flex; flex-direction: column; gap: 1px; }
.at-links a { font-size: 13.5px; color: var(--ink-2); padding: 4px 0; }
.at-links a:hover { color: var(--brand); }
@media (max-width: 860px) { .at-body { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .at-body { grid-template-columns: 1fr; gap: 16px; } }

/* ============ 文本对比 ============ */
.diff-main { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.diff-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.diff-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.diff-col .cl { display: flex; align-items: center; justify-content: space-between; }
.diff-col label { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.diff-col .cl span { font-size: 12px; color: var(--muted); }
.diff-col textarea {
  width: 100%; min-height: 190px; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font-size: 13.5px; line-height: 1.7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--ink); background: #fbfcfe; resize: vertical;
}
.diff-col textarea:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-50); }
.diff-sum { display: flex; gap: 8px; flex-wrap: wrap; }
.diff-sum span { font-size: 12.5px; font-weight: 600; border-radius: 999px; padding: 4px 12px; background: var(--bg-soft); border: 1px solid var(--line); color: var(--ink-2); }
.diff-sum span.add { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-700); }
.diff-sum span.del { background: #fdecec; border-color: #f6d3d3; color: var(--red); }
.diff-view {
  border: 1px solid var(--line); border-radius: 12px; overflow: auto; max-height: 540px; background: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px;
}
.diff-line { display: grid; grid-template-columns: 48px 48px 22px 1fr; align-items: start; border-bottom: 1px solid var(--line-2); }
.diff-line:last-child { border-bottom: 0; }
.diff-line .ln { text-align: right; padding: 3px 8px; color: #9aa5bd; font-size: 11.5px; user-select: none; }
.diff-line .sg { text-align: center; padding: 3px 0; color: var(--muted); user-select: none; }
.diff-line .tx { padding: 3px 10px 3px 4px; white-space: pre-wrap; word-break: break-word; }
.diff-line.add { background: var(--brand-50); }
.diff-line.add .sg, .diff-line.add .tx { color: var(--brand-700); }
.diff-line.del { background: #fdecec; }
.diff-line.del .sg, .diff-line.del .tx { color: var(--red); }
.diff-empty { padding: 28px; text-align: center; color: var(--muted); font-size: 13.5px; }
@media (max-width: 720px) {
  .diff-cols { grid-template-columns: 1fr; }
  .diff-line { grid-template-columns: 34px 34px 18px 1fr; }
}

/* ============ 哈希计算 ============ */
.hash-main { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.hash-in {
  width: 100%; min-height: 132px; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13.5px; line-height: 1.7; background: #fbfcfe; color: var(--ink); resize: vertical;
}
.hash-in:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-50); }
.hash-list { display: flex; flex-direction: column; gap: 8px; }
.hash-item { display: flex; align-items: center; gap: 10px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; }
.hash-item .hn { width: 88px; flex-shrink: 0; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.hash-item .hv {
  flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; line-height: 1.6; word-break: break-all; color: var(--ink);
}
.hash-item .hc { flex-shrink: 0; }
@media (max-width: 620px) {
  .hash-item { flex-wrap: wrap; }
  .hash-item .hv { flex: 1 1 100%; order: 3; }
}

/* ============ JWT 解析 ============ */
.jwt-main { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.jwt-in {
  width: 100%; min-height: 108px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px;
  line-height: 1.7; background: #fbfcfe; color: var(--ink); resize: vertical; word-break: break-all;
}
.jwt-in:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-50); }
.jwt-status { display: flex; gap: 8px; flex-wrap: wrap; }
.jwt-status span { font-size: 12.5px; font-weight: 600; padding: 4px 12px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--line); color: var(--ink-2); }
.jwt-status span.ok { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-700); }
.jwt-status span.warn { background: var(--amber-50); border-color: #f3d9ae; color: var(--amber); }
.jwt-status span.bad { background: #fdecec; border-color: #f6d3d3; color: var(--red); }
.jwt-parts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.jwt-part { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.jwt-part .ph {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 12px; font-size: 12.5px; font-weight: 700; color: var(--brand-700);
  background: var(--bg-soft); border-bottom: 1px solid var(--line);
}
.jwt-part pre { margin: 0; padding: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.65; overflow: auto; max-height: 300px; color: var(--ink); }
.jwt-part.sig pre { color: var(--ink-2); word-break: break-all; white-space: pre-wrap; }
.jwt-claims { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.jwt-claims .ph { padding: 9px 12px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.claim-row { display: grid; grid-template-columns: 96px 1fr auto; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line-2); font-size: 13px; align-items: baseline; }
.claim-row:last-child { border-bottom: 0; }
.claim-row b { color: var(--brand-700); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.claim-row span { color: var(--ink-2); word-break: break-all; }
.claim-row i { font-style: normal; font-size: 11.5px; color: var(--muted); }
@media (max-width: 720px) { .jwt-parts { grid-template-columns: 1fr; } }

/* ============ 日期计算 ============ */
.date-main { padding: 20px; display: flex; flex-direction: column; gap: 20px; }
.date-sec h3 { font-size: 15px; margin-bottom: 12px; }
.date-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.date-grid.four { grid-template-columns: repeat(4, 1fr); }
.date-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.date-field label { font-size: 12.5px; color: var(--muted); }
.date-field input, .date-field select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px;
  font-size: 14px; font-family: var(--font); background: #fbfcfe; color: var(--ink);
}
.date-field input:focus, .date-field select:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-50); }
.date-result {
  margin-top: 12px; background: var(--brand-50); border: 1px solid var(--brand-100);
  border-radius: 12px; padding: 14px 16px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.date-result b { font-size: 30px; font-weight: 800; color: var(--brand-700); line-height: 1.1; }
.date-result em { font-style: normal; font-size: 13.5px; color: var(--ink-2); }
.date-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.date-chips span { font-size: 12.5px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; color: var(--ink-2); }
.date-chips span b { color: var(--brand-700); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.date-chips span[data-q] { cursor: pointer; transition: .15s; }
.date-chips span[data-q]:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
.date-note { font-size: 12.5px; color: var(--muted); margin-top: 8px; line-height: 1.7; }
@media (max-width: 720px) { .date-grid, .date-grid.four { grid-template-columns: 1fr 1fr; } }

/* ============ BMI ============ */
.bmi-main { display: flex; gap: 24px; padding: 20px; flex-wrap: wrap; align-items: flex-start; }
.bmi-form { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.bmi-side { width: 292px; flex-shrink: 0; display: flex; flex-direction: column; gap: 12px; }
.bmi-hero {
  border-radius: 14px; padding: 20px; color: #fff;
  background: linear-gradient(135deg, var(--brand) 0%, #5b8bff 100%);
  box-shadow: 0 10px 26px rgba(47, 99, 255, .24);
}
.bmi-hero .lab { font-size: 12.5px; opacity: .92; }
.bmi-hero .val { font-size: 46px; font-weight: 800; line-height: 1.05; letter-spacing: -.02em; }
.bmi-hero .sub { font-size: 13px; opacity: .95; margin-top: 4px; }
.bmi-scale { position: relative; padding-top: 17px; }
.bmi-bar { height: 10px; border-radius: 999px; background: linear-gradient(90deg, #a9c8ff 0%, #5b8bff 26%, #2f63ff 48%, #f0b465 76%, var(--red) 100%); }
.bmi-marks { position: relative; height: 18px; font-size: 11px; color: var(--muted); margin-top: 4px; }
.bmi-marks span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.bmi-pointer { position: absolute; top: 0; width: 2px; height: 20px; background: var(--ink); border-radius: 2px; transform: translateX(-1px); transition: left .25s; left: 0; }
.bmi-pointer::after { content: ""; position: absolute; left: -3px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.bmi-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bmi-meta .stat { padding: 12px 8px; }
.bmi-meta .stat .num { font-size: 21px; }
.bmi-meta .stat .num.num-sm { font-size: 15px; word-break: keep-all; letter-spacing: -.01em; }
@media (max-width: 820px) {
  .bmi-main { flex-direction: column; }
  .bmi-side { width: 100%; }
}

/* ============ 录音机 ============ */
.rec-main { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.rec-stage {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px; display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.rec-time { font-size: 46px; font-weight: 800; line-height: 1; letter-spacing: .01em; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--ink); }
.rec-wave { width: 100%; height: 62px; display: block; }
.rec-btns { display: flex; align-items: center; gap: 14px; }
.rec-btn {
  width: 64px; height: 64px; border-radius: 50%; border: 0; background: var(--brand); color: #fff;
  display: grid; place-items: center; cursor: pointer; transition: .15s;
  box-shadow: 0 10px 22px rgba(47, 99, 255, .32);
}
.rec-btn:hover { background: var(--brand-600); }
.rec-btn.recording { background: var(--red); box-shadow: 0 10px 22px rgba(210, 59, 59, .3); }
.rec-btn.stop { width: 52px; height: 52px; background: #fff; color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.rec-btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.rec-status { font-size: 13px; color: var(--muted); text-align: center; }
.rec-list { display: flex; flex-direction: column; gap: 8px; }
.rec-item { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; }
.rec-item .ri-name { font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.rec-item .ri-meta { font-size: 12px; color: var(--muted); white-space: nowrap; }
.rec-item audio { flex: 1; min-width: 0; height: 34px; }
.rec-item .ri-del { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 17px; border-radius: 8px; width: 30px; height: 30px; flex-shrink: 0; }
.rec-item .ri-del:hover { background: #fdecec; color: var(--red); }
.rec-empty { font-size: 13px; color: var(--muted); text-align: center; padding: 14px 0; }
@media (max-width: 620px) {
  .rec-item { flex-wrap: wrap; }
  .rec-item audio { flex: 1 1 100%; order: 3; }
}

/* ============ 图片加水印 / 拼接 ============ */
.wm-wrap { display: flex; gap: 18px; align-items: stretch; flex-wrap: wrap; }
.wm-stage {
  flex: 1 1 380px; min-width: 0; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; display: grid; place-items: center; align-content: center;
  overflow: hidden; min-height: 220px;
}
.wm-stage canvas { max-width: 100%; max-height: 560px; width: auto; height: auto; display: block; border-radius: 6px; box-shadow: var(--shadow-sm); }
.wm-side { width: 272px; flex-shrink: 0; display: flex; flex-direction: column; gap: 13px; }
.wm-sec { display: flex; flex-direction: column; gap: 7px; }
.wm-sec + .wm-sec { border-top: 1px dashed var(--line); padding-top: 12px; }
.wm-sec .lbl { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.wm-sec .seg { width: 100%; }
.wm-sec .seg button { flex: 1; padding: 6px 4px; text-align: center; white-space: nowrap; font-size: 12.5px; }
.wm-input {
  width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px;
  font-size: 13.5px; font-family: var(--font); background: #fff; color: var(--ink);
}
.wm-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.wm-row { display: flex; align-items: center; gap: 8px; }
.wm-row .img-range { flex: 1; width: auto; min-width: 0; }
.wm-row .mini-val { font-size: 12px; color: var(--ink-2); min-width: 34px; text-align: right; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.wm-pos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.wm-pos button { border: 1px solid var(--line); background: #fff; border-radius: 7px; height: 28px; cursor: pointer; color: var(--ink-2); font-size: 10.5px; }
.wm-pos button.active { border-color: var(--brand); background: var(--brand-50); color: var(--brand-700); font-weight: 700; }
.wm-side .btn { width: 100%; }
@media (max-width: 860px) {
  .wm-wrap { flex-direction: column; }
  .wm-side { width: 100%; }
  .wm-side .btn { width: auto; }
}

.mg-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow: auto; }
.mg-item { display: flex; align-items: center; gap: 9px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 7px 9px; }
.mg-item img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: var(--bg-soft); flex-shrink: 0; }
.mg-item .mi-name { flex: 1; min-width: 0; font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-item .mi-idx { font-size: 11px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; flex-shrink: 0; }
.mg-item .mi-btn { border: 1px solid var(--line); background: #fff; border-radius: 6px; width: 24px; height: 24px; cursor: pointer; color: var(--ink-2); font-size: 12px; line-height: 1; padding: 0; }
.mg-item .mi-btn:hover { border-color: var(--brand); color: var(--brand); }

/* ============ 全站搜索 ============ */
.search-trigger {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  height: 36px; padding: 0 11px; margin-left: auto;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  color: var(--muted); font-family: inherit; font-size: 13.5px; cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.search-trigger:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
.search-trigger kbd {
  font-family: inherit; font-size: 10.5px; line-height: 1; padding: 3px 5px;
  border: 1px solid var(--line); border-radius: 5px; background: var(--bg-soft); color: var(--muted);
}
.search-trigger + .header-cta { margin-left: 10px; }

.cmd { position: fixed; inset: 0; z-index: 200; }
.cmd[hidden] { display: none; }
.cmd-back { position: absolute; inset: 0; background: rgba(16, 26, 48, .42); backdrop-filter: blur(3px); }
.cmd-panel {
  position: relative; width: min(620px, calc(100% - 28px)); margin: 11vh auto 0;
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-lg); overflow: hidden;
  animation: cmdIn .16s ease-out;
}
@keyframes cmdIn { from { opacity: 0; transform: translateY(-8px) scale(.99); } to { opacity: 1; transform: none; } }

.cmd-bar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.cmd-bar input {
  flex: 1; min-width: 0; border: 0; outline: none; font-family: inherit;
  font-size: 16px; color: var(--ink); background: transparent;
}
.cmd-bar input::placeholder { color: var(--muted); }
.cmd-bar kbd { font-family: inherit; font-size: 11px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--bg-soft); }

.cmd-list { max-height: min(56vh, 460px); overflow: auto; padding: 6px 8px 10px; }
.cmd-group { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; color: var(--muted); padding: 10px 8px 6px; }
.cmd-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px;
  color: var(--ink); scroll-margin: 6px;
}
.cmd-item:hover, .cmd-item.active { background: var(--brand-50); }
.ci-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ci-name { font-size: 14.5px; font-weight: 650; }
.cmd-item.active .ci-name { color: var(--brand-700); }
.ci-desc { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci-cat { flex-shrink: 0; font-size: 11px; color: var(--muted); background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; }
.cmd-empty { padding: 34px 12px; text-align: center; color: var(--muted); font-size: 14px; }
.cmd-empty span { font-size: 12.5px; opacity: .85; }
.cmd-foot {
  display: flex; gap: 16px; padding: 9px 16px; border-top: 1px solid var(--line);
  background: var(--bg-soft); font-size: 11.5px; color: var(--muted);
}
.cmd-foot kbd { font-family: inherit; font-size: 10.5px; padding: 1px 5px; margin-right: 2px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }

/* 工具页收藏按钮 */
.page-head h1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fav-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
  color: var(--muted); font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.fav-btn:hover { border-color: var(--brand); color: var(--brand); }
.fav-btn.on { border-color: #f0c063; color: #a9761a; background: #fff8e9; }
.fav-btn.on svg { fill: #f2b53b; stroke: #d99a1d; }

/* 首页快捷区 */
.quick { border-bottom: 1px solid var(--line); background: #fff; }
.quick .container { padding-top: 18px; padding-bottom: 18px; }
.quick-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.quick-group + .quick-group { margin-top: 12px; }
.qg-title { font-size: 12.5px; font-weight: 700; color: var(--muted); letter-spacing: .03em; margin-right: 2px; }
.q-chip {
  display: inline-flex; align-items: baseline; gap: 7px; padding: 5px 11px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
  font-size: 13px; transition: border-color .15s, background .15s, color .15s;
}
.q-chip b { font-weight: 650; color: var(--ink); }
.q-chip i { font-style: normal; font-size: 11px; color: var(--muted); }
.q-chip:hover { border-color: var(--brand); background: var(--brand-50); }
.q-chip:hover b { color: var(--brand-700); }

/* 首页搜索入口 */
.hero-search {
  display: flex; align-items: center; gap: 10px; width: 100%; max-width: 430px;
  margin: 0 0 16px; padding: 12px 14px; cursor: pointer; text-align: left;
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
  box-shadow: var(--shadow-sm); color: var(--muted); font-family: inherit; font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.hero-search:hover { border-color: var(--brand); box-shadow: 0 4px 16px rgba(47, 99, 255, .14); }
.hero-search span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-search kbd { font-family: inherit; font-size: 11px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--bg-soft); }

@media (max-width: 1080px) {
  .search-trigger { padding: 0; width: 38px; justify-content: center; }
  .search-trigger span, .search-trigger kbd { display: none; }
}
@media (max-width: 940px) {
  .search-trigger { width: 40px; }
  .search-trigger span, .search-trigger kbd { display: none; }
}
@media (max-width: 620px) {
  .cmd-panel { margin-top: 6vh; }
  .cmd-foot { display: none; }
  .ci-desc { display: none; }
  .cmd-list { max-height: 66vh; }
  .page-head h1 { gap: 8px; }
  .fav-btn { height: 28px; padding: 0 9px; }
}
@media (max-width: 480px) {
  .header-cta { display: none; }
}

/* ============ 关于本站 · 版本信息 ============ */
.ver-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px;
  border: 1px solid var(--brand-100); border-radius: 999px;
  background: var(--brand-50); color: var(--brand-700);
  font-size: 12.5px; font-weight: 700; vertical-align: middle;
}
.about-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 4px 0 26px; }
.fact { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 15px 18px; box-shadow: var(--shadow-sm); }
.fact b { display: block; font-size: 22px; letter-spacing: -.01em; color: var(--ink); line-height: 1.3; }
.fact span { font-size: 12.5px; color: var(--muted); }

.about-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow-sm); }
.about-card + .about-card { margin-top: 14px; }
.about-card h2 { font-size: 17px; margin: 0 0 6px; }
.about-card > p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.8; }
.about-card > p.sub { color: var(--muted); font-size: 13.5px; margin-bottom: 16px; }

.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pr { background: var(--bg-soft); border: 1px solid var(--line-2); border-radius: 12px; padding: 14px 16px; }
.pr b { display: block; margin-bottom: 5px; font-size: 14.5px; }
.pr p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.65; }

.ver-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.ver-tag { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; font-weight: 700; color: var(--brand-700); background: var(--brand-50); border-radius: 6px; padding: 2px 8px; }
.ver-date { font-size: 12.5px; color: var(--muted); }
.ver-group { margin-top: 13px; }
.ver-group h3 { margin: 0 0 6px; font-size: 12.5px; font-weight: 700; letter-spacing: .04em; color: var(--muted); }
.ver-group ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 13.8px; line-height: 1.9; }
.ver-group li::marker { color: var(--brand); }
.ver-group li b { color: var(--ink); font-weight: 650; }

.about-meta { display: flex; gap: 10px 24px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 4px; }
.about-meta i { font-style: normal; }
.about-meta b { color: var(--ink-2); font-weight: 600; }
.about-meta code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: var(--bg-soft); border-radius: 5px; padding: 1px 6px; color: var(--brand-700); }

@media (max-width: 860px) {
  .about-facts { grid-template-columns: repeat(2, 1fr); }
  .principles { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .about-card { padding: 18px 16px; }
  .fact { padding: 13px 15px; }
  .fact b { font-size: 19px; }
}

/* ============ 404 ============ */
.nf-wrap { padding: 72px 0 92px; text-align: center; }
.nf-code { font-size: clamp(54px, 11vw, 88px); font-weight: 800; line-height: 1; letter-spacing: -.04em; color: var(--brand-100); }
.nf-wrap h1 { font-size: clamp(21px, 3vw, 27px); margin: 12px 0 10px; }
.nf-wrap p { color: var(--muted); font-size: 14.5px; line-height: 1.8; max-width: 470px; margin: 0 auto 22px; }
.nf-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 26px; }
.nf-links { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.nf-links a { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink-2); font-size: 13.5px; transition: .15s; }
.nf-links a:hover { border-color: var(--brand); color: var(--brand-700); background: var(--brand-50); }
@media (max-width: 620px) { .nf-wrap { padding: 52px 0 70px; } }

/* 404 页撑满视口，页脚沉底 */
body.nf-body { min-height: 100vh; display: flex; flex-direction: column; }
body.nf-body .nf-wrap { flex: 1 1 auto; display: flex; align-items: center; padding: 44px 0 52px; }
body.nf-body .nf-wrap .container { width: 100%; }

/* ============ PWA 离线提示 ============ */
.net-pill {
  position: fixed; left: 50%; bottom: 18px; z-index: 90;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 15px 8px 13px; border-radius: 999px;
  background: rgba(22, 33, 58, .93); color: #fff;
  font-size: 12.8px; font-weight: 500; letter-spacing: .01em;
  box-shadow: var(--shadow-md);
  opacity: 0; transform: translate(-50%, 10px); pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.net-pill::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: #ffb340; flex: none;
}
.net-pill.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 620px) { .net-pill { bottom: 14px; font-size: 12.2px; } }

/* 安装到桌面入口（仅浏览器支持安装时出现） */
.hero .trust .install-link {
  display: inline-flex; align-items: center; gap: 7px;
  font: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--brand-700); background: var(--brand-50);
  border: 1px solid var(--brand-100); border-radius: 999px;
  padding: 4px 12px 4px 10px; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.hero .trust .install-link svg { color: var(--brand); }
.hero .trust .install-link:hover { background: #e2eaff; border-color: var(--brand); }

/* ============ 批量压缩列表 ============ */
.batch-head { display: flex; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.batch-count { font-size: 13px; color: var(--ink-2); }
.batch-count b { color: var(--ink); font-size: 15px; }
.batch-prog { flex: 1 1 150px; min-width: 110px; height: 6px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.batch-prog i { display: block; width: 0; height: 100%; background: var(--brand); border-radius: 999px; transition: width .25s ease; }
.batch-status { font-size: 12.5px; color: var(--muted); min-width: 92px; text-align: right; }

.batch-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; max-height: 452px; overflow-y: auto; padding-right: 2px; }
.brow { display: flex; align-items: center; gap: 12px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.bthumb { flex: none; width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; }
.bthumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bmeta { flex: 1 1 auto; min-width: 0; }
.bmeta .bn { font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bmeta .bd { margin-top: 2px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.bsave { flex: none; width: 66px; text-align: right; font-size: 12.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.bsave.good { color: var(--brand); }
.bsave.bad { color: var(--amber); }
.bstate { flex: none; width: 50px; text-align: center; font-size: 12px; color: var(--muted); }
.bstate.ok { color: var(--brand-700); }
.bstate.bad { color: var(--red); }
.bstate.run { color: var(--amber); }
.brow .mini { flex: none; }

@media (max-width: 620px) {
  .brow { gap: 8px; padding: 9px 10px; }
  .bthumb { width: 42px; height: 42px; }
  .bmeta .bn { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .bmeta .bd { font-size: 11.5px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .bsave { display: none; }
  /* 窄屏把「省 X%」放在文件名下方，完成后不再占一列显示「完成」 */
  .brow[data-status="done"] .bstate { display: none; }
  .bstate { width: 40px; font-size: 11.5px; }
  .brow .mini { padding: 4px 8px; }
  .batch-status { min-width: 0; }
}

/* ============ 证件照：相纸排版（多张混排） ============ */
.idp-sheet { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.idp-sheet-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.idp-sheet-tt { font-size: 12.5px; color: var(--muted); display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.idp-sheet-tt b { font-size: 13.5px; color: var(--ink); }
.idp-sheet-ctl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.idp-sheet-ctl .seg button { padding: 5px 10px; font-size: 12px; white-space: nowrap; }
.idp-sheet-body { margin-top: 12px; display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.idp-sheet-prev {
  flex: 1 1 400px; min-width: 0;
  display: flex; justify-content: center;
  padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft);
}
.idp-sheet-prev canvas {
  display: block; width: 100%; max-width: 620px; height: auto;
  background: #fff; border-radius: 3px; box-shadow: 0 1px 5px rgba(22, 33, 58, .12);
}
.idp-sheet-side { flex: 0 1 240px; min-width: 190px; }
.idp-sheet-list { display: flex; flex-wrap: wrap; gap: 8px; }
.idp-th {
  position: relative; width: 64px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; overflow: hidden; box-shadow: var(--shadow-sm);
}
.idp-th img { display: block; width: 100%; height: auto; }
.idp-th-no {
  position: absolute; left: 4px; top: 4px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: rgba(22, 33, 58, .62); color: #fff;
  font-size: 10.5px; line-height: 16px; text-align: center; font-variant-numeric: tabular-nums;
}
.idp-th-del {
  position: absolute; right: 3px; top: 3px; width: 18px; height: 18px; padding: 0;
  border: 0; border-radius: 50%; background: rgba(22, 33, 58, .62); color: #fff;
  font-size: 13px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.idp-th-del:hover { background: var(--red); }
.idp-th-empty {
  width: auto; padding: 9px 13px; border-style: dashed; box-shadow: none;
  font-size: 12px; color: var(--muted); display: flex; align-items: center;
}
.idp-sheet-tip { margin-top: 10px; font-size: 12px; color: var(--muted); line-height: 1.65; }

@media (max-width: 780px) {
  .idp-sheet-prev { flex: 1 1 100%; padding: 8px; }
  .idp-sheet-side { flex: 1 1 100%; }
  .idp-sheet-ctl { width: 100%; }
  .idp-th { width: 56px; }
}

/* 证件照操作区：窄屏把三个按钮排一行，选项各占一行 */
@media (max-width: 620px) {
  .idp-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .idp-actions .btn {
    width: 100%; justify-content: center; padding: 7px 4px;
    font-size: 12.5px; white-space: nowrap;
  }
  .idp-actions .opt-group { grid-column: 1 / -1; }
  .idp-actions .opt-group .img-range { flex: 1; width: auto; min-width: 0; }
  .idp-actions #btnSwap { order: 1; }
  .idp-actions #btnSheet { order: 2; }
  .idp-actions #btnDownload { order: 3; }
  .idp-actions .opt-group { order: 4; }
}

/* ============ 图片拼接：外观 / 水印 / 导出 ============ */
.wm-side .mini-lbl { flex: none; min-width: 30px; font-size: 12px; color: var(--muted); }
.wm-side .mini-val#borderColorVal { min-width: 58px; font-size: 11.5px; text-transform: uppercase; }
.wm-side .wm-input::placeholder { color: #9aa5b8; }

/* 未填水印文字时，位置与深浅先置灰，避免误以为已生效 */
#wmSec .seg,
#wmSec .wm-row { opacity: .42; pointer-events: none; transition: opacity .16s ease; }
#wmSec.has-text .seg,
#wmSec.has-text .wm-row { opacity: 1; pointer-events: auto; }

@media (max-width: 900px) {
  .wm-side .mini-lbl { min-width: 34px; }
}

/* ============ 九宫格切图 ============ */
.sp-stage { position: relative; display: inline-block; max-width: 100%; min-width: 0; line-height: 0; }
.sp-stage canvas {
  display: block; max-width: 100%; max-height: 560px; width: auto; height: auto;
  border-radius: 4px; box-shadow: var(--shadow-sm); cursor: crosshair;
  /* 透明背景时用棋盘格衬底，看得见留白 */
  background-image: repeating-conic-gradient(#eef1f6 0 25%, #fff 0 50%);
  background-size: 16px 16px;
}
.sp-grid { position: absolute; inset: 0; }
.sp-cell {
  position: absolute; box-sizing: border-box; border: 1px dashed rgba(47, 99, 255, .5);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .12s, box-shadow .12s;
}
.sp-cell span {
  font-size: 11px; font-weight: 700; color: #fff; background: rgba(16, 24, 40, .58);
  border-radius: 999px; padding: 1px 7px; line-height: 1.7; opacity: 0; transition: opacity .12s;
}
.sp-cell:hover { background: rgba(47, 99, 255, .2); box-shadow: inset 0 0 0 2px var(--brand); }
.sp-cell:hover span { opacity: 1; }

.sp-row { display: flex; align-items: center; gap: 7px; }
.sp-num {
  width: 54px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 7px;
  font-size: 13px; color: var(--ink-2); font-family: inherit; background: #fff;
  outline: none; text-align: center;
}
.sp-num:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.sp-count { margin-left: auto; font-size: 12px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.sp-hint { margin: 0; font-size: 11.5px; color: var(--muted); line-height: 1.65; }

@media (max-width: 620px) {
  .sp-stage canvas { max-height: 380px; }
  .sp-num { width: 46px; padding: 4px 5px; }
}
