/* NeoZC 工具箱 —— 全站共用样式，配色与首页一致（默认浅色，可切深色） */
:root {
  --bg0: #f7f9fd;
  --bg1: #eef3fa;
  --panel: #ffffff;
  --card: #ffffff;
  --card-2: #f8fbff;
  --border: #dbe4f0;
  --border-soft: #e8eef7;
  --text: #16202f;
  --muted: #55677e;
  --subtle: #8b97a9;
  --accent: #0284c7;
  --accent2: #0d9488;
  --accent-soft: rgba(2, 132, 199, .10);
  --danger: #e11d48;
  --danger-text: #9f1239;
  --ok: #059669;
  --glow1: rgba(56, 189, 248, .14);
  --glow2: rgba(94, 234, 212, .10);
  --wash: rgba(15, 23, 42, .03);
  --wash-2: rgba(15, 23, 42, .05);
  --wash-3: rgba(15, 23, 42, .02);
  --input-bg: #ffffff;
  --code-bg: #f4f7fc;
  --code-bg-2: #eef3fa;
  --code-text: #0f3d5c;
  --on-accent: #062033;
  --thumb: #ffffff;
  --thumb-border: #dbe4f0;
  --shadow-lg: 0 18px 50px -34px rgba(15, 23, 42, .35);
  --swatch-border: rgba(15, 23, 42, .12);
  --radius: 16px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg0: #060a16;
  --bg1: #0d1425;
  --panel: #101a30;
  --card: #141f3a;
  --card-2: #121a32;
  --border: #243052;
  --border-soft: #1b2543;
  --text: #e7eefb;
  --muted: #94a3c4;
  --subtle: #5b6a8f;
  --accent: #38bdf8;
  --accent2: #5eead4;
  --accent-soft: rgba(56, 189, 248, .14);
  --danger: #fb7185;
  --danger-text: #fecdd3;
  --ok: #34d399;
  --glow1: rgba(56, 189, 248, .15);
  --glow2: rgba(94, 234, 212, .10);
  --wash: rgba(255, 255, 255, .035);
  --wash-2: rgba(255, 255, 255, .03);
  --wash-3: rgba(255, 255, 255, .02);
  --input-bg: #0a1120;
  --code-bg: #080e1b;
  --code-bg-2: #060b16;
  --code-text: #cfe9ff;
  --on-accent: #06111f;
  --thumb: #e7eefb;
  --thumb-border: #0a1120;
  --shadow-lg: 0 18px 50px -30px rgba(0, 0, 0, .9);
  --swatch-border: rgba(255, 255, 255, .14);
  color-scheme: dark;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  background:
    radial-gradient(1100px 480px at 50% -10%, var(--glow1), transparent 60%),
    radial-gradient(900px 500px at 90% 4%, var(--glow2), transparent 55%),
    linear-gradient(175deg, var(--bg0) 0%, var(--bg1) 60%, var(--bg0) 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.7;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
code, pre, .mono { font-family: var(--mono); }

/* ---------- 顶部导航 ---------- */
.tb-nav {
  display: flex; align-items: center; gap: 1.25rem;
  max-width: 1120px; margin: 0 auto; padding: 1.05rem 1.5rem;
  overflow-x: auto; white-space: nowrap;
  scrollbar-width: none;
}
.tb-nav::-webkit-scrollbar { display: none; }
.tb-nav .brand {
  font-weight: 800; font-size: 1.05rem; letter-spacing: -.02em; color: var(--text);
  margin-right: .35rem; text-decoration: none;
}
.tb-nav .brand span { color: var(--accent); }
.tb-nav a.nav-link { color: var(--muted); font-size: .92rem; text-decoration: none; }
.tb-nav a.nav-link:hover, .tb-nav a.nav-link[aria-current="page"] { color: var(--text); }
.tb-nav .nav-right { margin-left: auto; padding-right: 4.4rem; }
.tb-nav .nav-right a { color: var(--muted); font-size: .88rem; }
.tb-nav .theme-toggle {
  flex: none; margin-left: .6rem; width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 999px; border: 1px solid var(--border); background: var(--wash);
  color: var(--muted); font-size: 1rem; line-height: 1; cursor: pointer;
  transition: color .16s ease, border-color .16s ease;
}
.tb-nav .theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- 布局 ---------- */
.tb-wrap { width: 100%; max-width: 1000px; margin: 0 auto; padding: 1.4rem 1.5rem 3.5rem; }
.tb-crumb { font-size: .82rem; color: var(--subtle); margin-bottom: 1.5rem; }
.tb-crumb a { color: var(--subtle); }
.tb-crumb a:hover { color: var(--accent); }
.tb-crumb span.sep { margin: 0 .45rem; opacity: .6; }
.tb-head { margin-bottom: 1.8rem; }
.tb-eyebrow {
  font-size: .72rem; font-weight: 700; letter-spacing: .28em; text-transform: uppercase;
  color: var(--subtle); margin-bottom: .65rem;
}
.tb-head h1 { font-size: clamp(1.9rem, 5vw, 2.7rem); line-height: 1.18; letter-spacing: -.03em; font-weight: 800; }
.tb-head h1 em { font-style: normal; color: var(--accent); }
.tb-lead { color: var(--muted); margin-top: .85rem; font-size: 1.02rem; max-width: 760px; }

/* ---------- 工具面板 ---------- */
.tb-panel {
  background: linear-gradient(180deg, var(--wash-2), transparent);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.6rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-lg);
}
.panel-title {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--subtle); margin-bottom: 1.1rem;
}
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.field { display: flex; flex-direction: column; gap: .4rem; }
.field > label, .field-label { font-size: .8rem; color: var(--muted); font-weight: 600; }
.input, .select, .textarea {
  width: 100%; padding: .72rem .85rem;
  background: var(--input-bg); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: rgba(56,189,248,.6);
  box-shadow: 0 0 0 3px rgba(56,189,248,.12);
}
.textarea { min-height: 190px; resize: vertical; line-height: 1.6; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 2.2rem; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.row--end { justify-content: flex-end; }
.grow { flex: 1; min-width: 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .68rem 1.05rem; border-radius: 10px; border: 1px solid var(--border);
  background: rgba(56,189,248,.08); color: var(--text); font-weight: 600; font-size: .9rem;
  cursor: pointer; transition: background .15s, border-color .15s, transform .1s;
  white-space: nowrap;
}
.btn:hover { background: rgba(56,189,248,.16); border-color: rgba(56,189,248,.45); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: linear-gradient(115deg, var(--accent), var(--accent2)); border-color: transparent; color: var(--on-accent); }
.btn--primary:hover { filter: brightness(1.06); background: linear-gradient(115deg, var(--accent), var(--accent2)); }
.btn--ghost { background: transparent; }
.btn--small { padding: .42rem .7rem; font-size: .8rem; border-radius: 8px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.hint { color: var(--subtle); font-size: .78rem; }
.err { color: var(--danger); font-size: .85rem; min-height: 1.3em; }
.ok { color: var(--ok); font-size: .85rem; }

/* ---------- 转换结果 / 单位表 ---------- */
.result-hero {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem .8rem;
  padding: 1.15rem 1.25rem; border-radius: 14px;
  background: rgba(56,189,248,.07); border: 1px solid rgba(56,189,248,.22);
  margin: 1.1rem 0 .5rem;
}
.result-hero .value {
  font-family: var(--mono); font-size: clamp(1.4rem, 4.5vw, 2rem); font-weight: 700;
  color: var(--accent2); word-break: break-all;
}
.result-hero .unit { color: var(--muted); font-size: .95rem; }
.result-hero .eq { color: var(--subtle); }
.tb-table-wrap { overflow-x: auto; margin-top: 1rem; border: 1px solid var(--border-soft); border-radius: 12px; }
table.tb-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.tb-table th, table.tb-table td { padding: .6rem .85rem; text-align: left; border-bottom: 1px solid var(--border-soft); }
table.tb-table th { color: var(--subtle); font-weight: 600; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; background: var(--wash-3); }
table.tb-table tr:last-child td { border-bottom: none; }
table.tb-table td.num { font-family: var(--mono); color: var(--accent2); }
table.tb-table td:first-child { color: var(--muted); }
.copy-cell { text-align: right; width: 1%; white-space: nowrap; }

/* ---------- 标签页 ---------- */
.tabs { display: flex; gap: .45rem; flex-wrap: wrap; margin-bottom: 1.15rem; }
.tab {
  padding: .45rem .85rem; border-radius: 999px; border: 1px solid var(--border);
  background: transparent; color: var(--muted); font-size: .86rem; cursor: pointer;
}
.tab:hover { color: var(--text); border-color: rgba(56,189,248,.4); }
.tab[aria-selected="true"] { background: var(--accent-soft); border-color: rgba(56,189,248,.55); color: var(--text); }

/* ---------- 二维码 ---------- */
.qr-stage { display: flex; flex-wrap: wrap; gap: 1.4rem; align-items: flex-start; }
.qr-box {
  background: #fff; border-radius: 14px; padding: 14px; line-height: 0;
  box-shadow: var(--shadow-lg);
}
.qr-box canvas, .qr-box img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.qr-side { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: .8rem; }

/* ---------- 代码编辑器 ---------- */
.code-out {
  width: 100%; min-height: 220px; resize: vertical; padding: .9rem;
  background: var(--code-bg); border: 1px solid var(--border); border-radius: 12px;
  font-family: var(--mono); font-size: .86rem; line-height: 1.55; color: var(--code-text);
  white-space: pre; overflow: auto;
}
.stats { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .8rem; color: var(--subtle); }
.stats b { color: var(--muted); font-weight: 600; }

/* ---------- 正文 / FAQ ---------- */
.tb-prose { max-width: 780px; margin: 0 auto 2rem; }
.tb-prose h2 { font-size: 1.22rem; margin: 2rem 0 .75rem; letter-spacing: -.01em; }
.tb-prose h3 { font-size: 1rem; margin: 1.3rem 0 .45rem; color: var(--text); }
.tb-prose p { color: var(--muted); margin-bottom: .85rem; }
.tb-prose ul, .tb-prose ol { color: var(--muted); padding-left: 1.35rem; margin-bottom: .9rem; }
.tb-prose li { margin-bottom: .35rem; }
.tb-prose strong { color: var(--text); font-weight: 600; }
.tb-prose code { background: rgba(56,189,248,.1); border: 1px solid rgba(56,189,248,.16); padding: .08rem .35rem; border-radius: 5px; font-size: .88em; }
.tb-prose .note {
  border-left: 3px solid var(--accent); background: rgba(56,189,248,.06);
  padding: .8rem 1rem; border-radius: 0 10px 10px 0; color: var(--muted); font-size: .92rem;
}
.tb-faq { max-width: 780px; margin: 0 auto 2.4rem; }
.tb-faq h2 { font-size: 1.22rem; margin-bottom: 1rem; }
details.faq {
  border: 1px solid var(--border-soft); border-radius: 12px; padding: .9rem 1.1rem;
  margin-bottom: .65rem; background: var(--wash-3);
}
details.faq summary { cursor: pointer; font-weight: 600; color: var(--text); list-style: none; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::before { content: "+"; color: var(--accent); display: inline-block; width: 1.1em; }
details.faq[open] summary::before { content: "−"; }
details.faq p { color: var(--muted); margin-top: .55rem; font-size: .93rem; }

/* ---------- 相关工具 ---------- */
.tb-related { max-width: 1000px; margin: 0 auto; }
.tb-related h2 { font-size: 1.1rem; margin-bottom: 1rem; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .75rem; }
.related-card {
  display: block; padding: .95rem 1.05rem; border: 1px solid var(--border-soft);
  border-radius: 12px; background: var(--wash-3); color: var(--text); text-decoration: none;
  transition: border-color .15s, background .15s, transform .15s;
}
.related-card:hover { border-color: rgba(56,189,248,.45); background: rgba(56,189,248,.06); text-decoration: none; transform: translateY(-1px); }
.related-card b { display: block; font-size: .95rem; margin-bottom: .15rem; }
.related-card span { color: var(--subtle); font-size: .8rem; }

/* 工具索引页 */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.tool-card {
  display: flex; flex-direction: column; gap: .45rem; padding: 1.35rem;
  border: 1px solid var(--border-soft); border-radius: 16px;
  background: linear-gradient(180deg, var(--wash-2), transparent);
  color: var(--text); text-decoration: none; transition: border-color .16s, transform .16s, background .16s;
}
.tool-card:hover { border-color: rgba(56,189,248,.5); background: rgba(56,189,248,.05); transform: translateY(-2px); text-decoration: none; }
.tool-card .ico { font-size: 1.6rem; line-height: 1; }
.tool-card b { font-size: 1.05rem; }
.tool-card p { color: var(--muted); font-size: .88rem; line-height: 1.55; }
.tool-card .go { margin-top: auto; padding-top: .5rem; color: var(--accent); font-size: .84rem; font-weight: 600; }

/* 隐私说明条 */
.privacy-note {
  display: flex; gap: .6rem; align-items: flex-start; margin-top: 1.1rem;
  padding: .75rem .9rem; border-radius: 10px; background: rgba(94,234,212,.06);
  border: 1px solid rgba(94,234,212,.18); color: var(--muted); font-size: .82rem;
}
.privacy-note b { color: var(--accent2); }

/* ---------- 输入区 / 通用控件 ---------- */
.area {
  width: 100%; min-height: 200px; resize: vertical; padding: .9rem 1rem;
  background: var(--code-bg); border: 1px solid var(--border); border-radius: 12px;
  font-family: var(--mono); font-size: .86rem; line-height: 1.6; color: var(--code-text);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.area:focus { border-color: rgba(56,189,248,.6); box-shadow: 0 0 0 3px rgba(56,189,248,.12); }
.area--out { background: var(--code-bg-2); color: var(--accent2); }
.input.color { padding: .35rem; height: 2.9rem; cursor: pointer; }

.checks { display: flex; flex-wrap: wrap; gap: .5rem 1.1rem; margin-top: 1rem; }
.check {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .86rem; color: var(--muted); cursor: pointer; user-select: none;
}
.check input { width: 1rem; height: 1rem; accent-color: var(--accent); cursor: pointer; }
.check code { background: rgba(56,189,248,.1); padding: .05rem .3rem; border-radius: 4px; font-size: .85em; }

.range {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent2)); outline: none; cursor: pointer;
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--thumb); border: 2px solid var(--thumb-border); box-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.range::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%; background: var(--thumb);
  border: 2px solid var(--thumb-border); box-shadow: 0 2px 10px rgba(0,0,0,.25);
}

.err--on {
  padding: .7rem .85rem; border-radius: 10px; margin-top: .7rem;
  background: rgba(251,113,133,.08); border: 1px solid rgba(251,113,133,.28);
  color: var(--danger-text);
}
.err b { color: var(--danger); }

.pane.is-hidden { display: none; }
.tab.is-on { background: var(--accent-soft); border-color: rgba(56,189,248,.55); color: var(--text); }

/* ---------- 密码生成器 ---------- */
.pw {
  font-family: var(--mono); font-size: clamp(1.1rem, 3.4vw, 1.5rem); font-weight: 700;
  color: var(--accent2); word-break: break-all;
  padding: 1.1rem 1.25rem; border-radius: 14px;
  background: rgba(56,189,248,.07); border: 1px solid rgba(56,189,248,.22);
}
.pw-list { display: flex; flex-direction: column; gap: .45rem; margin-top: .9rem; }
.pw-row {
  display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  padding: .5rem .8rem; border: 1px solid var(--border-soft); border-radius: 10px;
  background: var(--wash-3);
}
.pw-row code { font-family: var(--mono); font-size: .85rem; color: var(--muted); word-break: break-all; }

/* ---------- 颜色转换 ---------- */
.swatch-table tbody td { border-bottom: none; vertical-align: middle; }
.swatch-preview {
  display: block; width: 88px; height: 88px; border-radius: 14px;
  border: 1px solid var(--swatch-border); box-shadow: 0 10px 30px -14px rgba(15,23,42,.35);
}
.ramp { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: .35rem; }
.ramp-cell {
  position: relative; height: 64px; border-radius: 9px; border: 1px solid var(--swatch-border);
  cursor: pointer; padding: 0; transition: transform .12s, border-color .12s;
}
.ramp-cell:hover { transform: translateY(-2px); border-color: var(--accent); }
.ramp-cell span {
  position: absolute; left: 0; right: 0; bottom: 4px; text-align: center;
  font-size: .62rem; font-family: var(--mono); color: rgba(255,255,255,.72);
  mix-blend-mode: difference;
}
.pill {
  display: inline-block; min-width: 1.6rem; text-align: center;
  padding: .05rem .45rem; border-radius: 999px; font-size: .78rem; font-weight: 700;
}
.pill--ok { background: rgba(52,211,153,.16); color: var(--ok); }
.pill--no { background: rgba(251,113,133,.14); color: var(--danger); }

/* ---------- 页脚 ---------- */
.tb-foot {
  border-top: 1px solid var(--border-soft); margin-top: 2rem; padding: 2rem 1.5rem 3rem;
  text-align: center; color: var(--subtle); font-size: .82rem;
}
.tb-foot .links { display: flex; gap: 1.1rem; justify-content: center; flex-wrap: wrap; margin-bottom: .8rem; }
.tb-foot a { color: var(--muted); }
.tb-foot a:hover { color: var(--accent); }

/* ---------- 多语言：同一元素内并列两种语言 ---------- */
html[lang^="en"] [data-l="zh"] { display: none !important; }
html:not([lang^="en"]) [data-l="en"] { display: none !important; }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .tb-wrap { padding: 1rem 1rem 2.5rem; }
  .tb-panel { padding: 1.15rem; border-radius: 16px; }
  .tb-nav { padding: .85rem 1rem; gap: 1rem; }
  .tb-nav .nav-right { padding-right: 4.2rem; }
  .qr-stage { justify-content: center; }
  .field-grid { grid-template-columns: 1fr; }
  .copy-cell { display: none; }
}
