:root {
  --bg: #F5F7FB;
  --surface: #FFFFFF;
  --surface-2: #FAFBFD;
  --line: #E4E8F0;
  --line-strong: #CFD6E4;
  --text: #0F172A;
  --text-2: #4A5568;
  --text-3: #8A94A6;
  --accent: #2563EB;
  --accent-2: #1D4ED8;
  --accent-soft: #EAF1FE;
  --ok: #0F6E56;
  --ok-soft: #E1F5EE;
  --warn: #854F0B;
  --warn-soft: #FAEEDA;
  --danger: #A32D2D;
  --danger-soft: #FCEBEB;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 28px -18px rgba(15, 23, 42, .18);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; }
h1 { font-size: 30px; }
h2 { font-size: 21px; }
h3 { font-size: 16px; }
p { margin: 0 0 12px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 820px; margin: 0 auto; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 28px;
  height: 60px;
}
.logo { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 16px; color: var(--text); }
.logo:hover { color: var(--text); }
.logo-mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), #4F8DF7);
  display: grid; place-items: center;
  box-shadow: 0 2px 6px rgba(37, 99, 235, .28);
}
.logo-mark svg { width: 15px; height: 15px; }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a {
  padding: 6px 11px; border-radius: 7px;
  color: var(--text-2); font-size: 14px;
}
.nav a:hover { background: var(--accent-soft); color: var(--accent-2); }
.nav a.active { background: var(--accent-soft); color: var(--accent-2); font-weight: 500; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: 56px 0 44px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(37, 99, 235, .055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(37, 99, 235, .055) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 0%, #000 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 75% 70% at 50% 0%, #000 30%, transparent 100%);
  pointer-events: none;
}
.hero .wrap { position: relative; }
.hero h1 { font-size: 34px; max-width: 720px; }
.hero .sub { margin-top: 14px; font-size: 16px; color: var(--text-2); max-width: 640px; }
.badge-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px;
  font-size: 12.5px; color: var(--ok);
  background: var(--ok-soft); border: 1px solid rgba(15, 110, 86, .16);
}
.dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* ---------- cards ---------- */
.tool-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  padding: 32px 0;
}
.tool-card {
  display: block; padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
  position: relative;
}
.tool-card:hover {
  transform: translateY(-2px);
  border-color: #BFD2F7;
  box-shadow: 0 2px 4px rgba(15, 23, 42, .05), 0 16px 36px -20px rgba(37, 99, 235, .45);
  color: var(--text);
}
.tool-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--ic-bg, var(--accent-soft));
  color: var(--ic, var(--accent));
  margin-bottom: 14px;
}
.tool-icon svg { width: 20px; height: 20px; }
.tool-card h3 { font-size: 16px; margin-bottom: 6px; }
.tool-card p { font-size: 13.5px; color: var(--text-2); margin: 0; }
.tool-card .meta { margin-top: 14px; font-size: 12px; color: var(--text-3); display: flex; gap: 10px; flex-wrap: wrap; }
.tool-card.soon { opacity: .62; pointer-events: none; }
.tag {
  display: inline-block; padding: 1px 7px; border-radius: 5px;
  font-size: 11.5px; background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text-3);
}
.tag.hot { background: var(--warn-soft); border-color: rgba(133, 79, 11, .18); color: var(--warn); }

/* ---------- generic panel ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.panel + .panel { margin-top: 16px; }
.panel-title {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.panel-title h2 { font-size: 15px; }
.hint { font-size: 12.5px; color: var(--text-3); }

.tool-head { padding: 30px 0 22px; }
.tool-head h1 { font-size: 26px; }
.tool-head p { margin: 8px 0 0; color: var(--text-2); font-size: 14.5px; max-width: 700px; }

/* ---------- form ---------- */
label.field { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
input[type=text], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 9px 11px;
  font-family: inherit; font-size: 14.5px; color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .14s ease, box-shadow .14s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .13);
}
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%238A94A6' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
input[type=range] { width: 100%; accent-color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 14px; font-weight: 500;
  border: 1px solid transparent; cursor: pointer;
  background: var(--accent); color: #fff;
  transition: background .14s ease, transform .1s ease;
}
.btn:hover { background: var(--accent-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: var(--surface); color: var(--text-2); border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.sm { padding: 6px 11px; font-size: 13px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.switch { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.switch input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* ---------- alerts ---------- */
.note {
  display: flex; gap: 10px;
  padding: 11px 13px; border-radius: var(--radius-sm);
  font-size: 13px; line-height: 1.6;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text-2);
}
.note svg { flex: none; width: 15px; height: 15px; margin-top: 3px; }
.note.warn { background: var(--warn-soft); border-color: rgba(133, 79, 11, .16); color: var(--warn); }
.note.ok { background: var(--ok-soft); border-color: rgba(15, 110, 86, .16); color: var(--ok); }
.note.danger { background: var(--danger-soft); border-color: rgba(163, 45, 45, .16); color: var(--danger); }
.note strong { font-weight: 600; }

/* ---------- dropzone ---------- */
.dropzone {
  position: relative;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 34px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.dz-input {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0; cursor: pointer;
  font-size: 0;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone svg { width: 30px; height: 30px; color: var(--accent); margin-bottom: 10px; }
.dropzone b { display: block; font-size: 14.5px; font-weight: 500; }
.dropzone span { font-size: 12.5px; color: var(--text-3); }

/* ---------- lists ---------- */
.file-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.file-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13.5px;
}
.file-item .thumb {
  width: 42px; height: 42px; border-radius: 6px; flex: none;
  object-fit: cover; background: var(--surface-2);
  border: 1px solid var(--line);
}
.file-item .fname { flex: 1; min-width: 0; }
.file-item .fname b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .fname small { color: var(--text-3); font-size: 12px; }
.file-item .acts { display: flex; gap: 6px; flex: none; }
.x-btn {
  width: 26px; height: 26px; border-radius: 6px; flex: none;
  border: 1px solid var(--line); background: var(--surface); color: var(--text-3);
  cursor: pointer; display: grid; place-items: center; font-size: 14px; line-height: 1;
}
.x-btn:hover { background: var(--danger-soft); color: var(--danger); border-color: rgba(163, 45, 45, .2); }
.ord { display: flex; flex-direction: column; gap: 2px; flex: none; }
.ord button {
  width: 22px; height: 15px; padding: 0; line-height: 1;
  border: 1px solid var(--line); background: var(--surface); color: var(--text-3);
  border-radius: 4px; cursor: pointer; font-size: 9px;
}
.ord button:hover { background: var(--accent-soft); color: var(--accent); border-color: rgba(37, 99, 235, .25); }

/* ---------- converter layout ---------- */
.conv-grid { display: grid; grid-template-columns: 200px 1fr; gap: 16px; align-items: start; }
.cat-list { display: flex; flex-direction: column; gap: 3px; }
.cat-btn {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 11px; border-radius: 7px;
  border: 1px solid transparent; background: transparent;
  font-family: inherit; font-size: 14px; color: var(--text-2);
  cursor: pointer; text-align: left; width: 100%;
}
.cat-btn:hover { background: var(--surface-2); color: var(--text); }
.cat-btn.active { background: var(--accent-soft); color: var(--accent-2); font-weight: 500; border-color: rgba(37, 99, 235, .14); }
.cat-btn .ico { width: 16px; height: 16px; flex: none; opacity: .9; }

.conv-row { display: grid; grid-template-columns: 1fr 190px; gap: 10px; align-items: end; }
.conv-row .val-wrap { position: relative; }
.conv-row input { font-size: 17px; font-variant-numeric: tabular-nums; padding-right: 34px; }
.eq-sign { text-align: center; color: var(--text-3); font-size: 13px; margin: 10px 0; }
.result { color: var(--accent-2); font-weight: 500; }

table.rates { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.rates th, table.rates td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); }
table.rates th { font-weight: 500; color: var(--text-3); font-size: 12.5px; background: var(--surface-2); }
table.rates td:last-child, table.rates th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
table.rates tr:last-child td { border-bottom: none; }

/* ---------- tabs ---------- */
.tabs {
  display: flex; gap: 2px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  margin: -2px 0 18px;
}
.tab {
  padding: 9px 14px; border: none; background: none;
  font-family: inherit; font-size: 14px; color: var(--text-2);
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -1px; border-radius: 6px 6px 0 0;
}
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.active { color: var(--accent-2); border-bottom-color: var(--accent); font-weight: 500; }
.pane { display: none; }
.pane.active { display: block; }

/* ---------- 双栏 ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ---------- 段落/结果区 ---------- */
.text-pair { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.text-pair .seg {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); overflow: hidden;
}
.text-pair .seg .src {
  padding: 8px 11px; font-size: 13px; color: var(--text-3);
  background: var(--surface-2); border-bottom: 1px solid var(--line);
  white-space: pre-wrap; word-break: break-word;
}
.text-pair .seg .dst {
  padding: 10px 11px; font-size: 14.5px; line-height: 1.7;
  white-space: pre-wrap; word-break: break-word;
}
.mono-out {
  font-family: var(--mono); font-size: 13px; line-height: 1.7;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px;
  max-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-all;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px; font-size: 12px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text-3);
}
.chip.ok { background: var(--ok-soft); border-color: rgba(15,110,86,.16); color: var(--ok); }
.chip.warn { background: var(--warn-soft); border-color: rgba(133,79,11,.16); color: var(--warn); }
.chip.bad { background: var(--danger-soft); border-color: rgba(163,45,45,.16); color: var(--danger); }

/* ---------- misc ---------- */
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.kv > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.kv b { display: block; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kv small { color: var(--text-3); font-size: 12px; }

#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  background: #0F172A; color: #fff; font-size: 13.5px;
  padding: 9px 16px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: all .2s ease; z-index: 90;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .25);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

.faq { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 8px; }
.faq details { border-bottom: 1px solid var(--line); padding: 13px 0; }
.faq summary { cursor: pointer; font-weight: 500; font-size: 14.5px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--text-3); font-weight: 400; }
.faq details[open] summary::after { content: "\2212"; }
.faq p { margin: 9px 0 0; font-size: 13.5px; color: var(--text-2); }

.site-footer {
  margin-top: 44px; padding: 26px 0;
  border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--text-3);
}
.site-footer .wrap { display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
.site-footer a { color: var(--text-3); }
.site-footer a:hover { color: var(--accent); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 820px) {
  .hero h1 { font-size: 26px; }
  .hero { padding: 38px 0 32px; }
  .conv-grid { grid-template-columns: 1fr; }
  .cat-list { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .cat-btn { white-space: nowrap; width: auto; }
  .conv-row { grid-template-columns: 1fr; gap: 8px; }
  .site-header .wrap { height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; gap: 10px 18px; }
  .nav { margin-left: 0; width: 100%; }
  h1 { font-size: 24px; }
  .tool-head h1 { font-size: 22px; }
}

/* ---------- accessibility polish ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dropzone:focus-within {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .13);
}
input[type=range]:disabled { opacity: .45; cursor: not-allowed; }

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

/* ============================================================
   2026-11 工具中心改版
   ============================================================ */

/* ---------- 深色模式 ---------- */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0A1120;
  --surface: #101A2E;
  --surface-2: #0C1526;
  --line: #1E2B45;
  --line-strong: #2C3B58;
  --text: #E8EEF9;
  --text-2: #AAB8D0;
  --text-3: #7686A3;
  --accent: #5EA2FF;
  --accent-2: #93C5FD;
  --accent-soft: #142747;
  --ok: #5BD6B0;
  --ok-soft: #0E2E29;
  --warn: #F0C274;
  --warn-soft: #33270F;
  --danger: #F19A9A;
  --danger-soft: #3A1A1C;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 34px -22px rgba(0, 0, 0, .8);
}
html[data-theme="dark"] .site-header { background: rgba(10, 17, 32, .82); }
html[data-theme="dark"] .tool-card:hover { border-color: #2F4E86; }
html[data-theme="dark"] .hub-card:hover { border-color: #2F4E86; }
html[data-theme="dark"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%23AAB8D0' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
html[data-theme="dark"] #toast { background: #E8EEF9; color: #0F172A; }
html[data-theme="dark"] .logo-mark { box-shadow: 0 2px 10px rgba(94, 162, 255, .35); }

/* ---------- 顶栏右侧按钮 ---------- */
.header-tools { display: flex; align-items: center; gap: 6px; margin-left: 6px; flex: none; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 8px; flex: none;
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2);
  display: grid; place-items: center; cursor: pointer; padding: 0;
  transition: background .14s ease, color .14s ease, border-color .14s ease;
}
.icon-btn:hover { background: var(--accent-soft); color: var(--accent-2); border-color: rgba(37, 99, 235, .28); }
.icon-btn svg { width: 17px; height: 17px; }

/* ---------- 全站搜索弹层 ---------- */
.search-modal {
  position: fixed; inset: 0; z-index: 100; display: none;
  background: rgba(10, 17, 32, .5); backdrop-filter: blur(3px);
  padding: 10vh 16px 16px;
}
.search-modal.open { display: block; }
.search-box {
  max-width: 640px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 30px 80px -20px rgba(15, 23, 42, .45);
  overflow: hidden;
}
.search-box .s-input-row { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.search-box .s-input-row svg { width: 18px; height: 18px; color: var(--text-3); flex: none; }
.search-box input[type=search] {
  border: none; outline: none; background: transparent; width: 100%;
  font-family: inherit; font-size: 16px; color: var(--text); padding: 0;
  box-shadow: none;
}
.search-box .s-kbd { font-size: 11px; color: var(--text-3); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; flex: none; }
.search-results { max-height: min(56vh, 460px); overflow: auto; padding: 6px; }
.search-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px;
  border-radius: 9px; color: var(--text); cursor: pointer; border: 1px solid transparent;
}
.search-item:hover, .search-item.active { background: var(--accent-soft); color: var(--text); }
.search-item .si-ico {
  width: 32px; height: 32px; border-radius: 8px; flex: none;
  display: grid; place-items: center;
  background: var(--ic-bg, var(--surface-2));
  border: 1px solid var(--line); color: var(--ic, var(--accent));
}
.search-item .si-ico svg { width: 16px; height: 16px; }
.search-item .si-main { min-width: 0; flex: 1; }
.search-item b { display: block; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-item small { display: block; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-item .si-cat { font-size: 11px; color: var(--text-3); flex: none; }
.search-empty { padding: 26px 16px; text-align: center; color: var(--text-3); font-size: 13.5px; }
.search-foot { padding: 8px 14px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--text-3); display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- 工具中心布局 ---------- */
.hub {
  max-width: 1180px; margin: 0 auto; padding: 24px 20px 0;
  display: grid; grid-template-columns: 214px minmax(0, 1fr); gap: 26px; align-items: start;
}
.hub-side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 12px; }
.hub-side .panel { padding: 8px; }
.hub-nav { display: flex; flex-direction: column; gap: 2px; }
.hub-nav-btn {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px 10px; border-radius: 7px; border: 1px solid transparent;
  background: transparent; color: var(--text-2); font: inherit; font-size: 13.5px;
  cursor: pointer; text-align: left;
}
.hub-nav-btn svg { width: 16px; height: 16px; flex: none; opacity: .9; color: var(--ic, currentColor); }
.hub-nav-btn span.count { margin-left: auto; font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.hub-nav-btn:hover {
  background: #E6ECF7;
  color: var(--text);
  border-color: #D8E1F0;
}
.hub-nav-btn:hover svg { opacity: 1; }
html[data-theme="dark"] .hub-nav-btn:hover {
  background: #1B2A45;
  border-color: #2A3C5C;
  color: var(--text);
}
.hub-nav-btn.active { background: var(--accent-soft); color: var(--accent-2); font-weight: 500; border-color: rgba(37, 99, 235, .14); }
.hub-nav-btn.active:hover { background: var(--accent-soft); border-color: rgba(37, 99, 235, .22); }
.hub-nav-btn.active span.count { color: var(--accent-2); }
.hub-side-sep { height: 1px; background: var(--line); margin: 7px 4px; }
.side-note {
  padding: 12px 13px; border-radius: 10px; font-size: 12px; line-height: 1.65;
  color: var(--text-2); background: var(--surface); border: 1px solid var(--line);
}
.side-note b { color: var(--text); font-weight: 600; display: block; margin-bottom: 3px; }

.hub-main { min-width: 0; padding-bottom: 20px; }
.hub-hero {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 26px 26px 22px; box-shadow: var(--shadow);
}
.hub-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(37, 99, 235, .05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(37, 99, 235, .05) 1px, transparent 1px);
  background-size: 30px 30px;
  -webkit-mask-image: radial-gradient(ellipse 70% 100% at 85% 0%, #000 20%, transparent 80%);
  mask-image: radial-gradient(ellipse 70% 100% at 85% 0%, #000 20%, transparent 80%);
}
.hub-hero > * { position: relative; }
.hub-hero h1 { font-size: 27px; letter-spacing: -.02em; }
.hub-hero p { margin: 10px 0 0; color: var(--text-2); font-size: 14px; max-width: 640px; }
.hub-hero .badge-row { margin-top: 16px; }
.hub-hero .hub-stats { margin-top: 18px; display: flex; gap: 22px; flex-wrap: wrap; }
.hub-hero .hub-stats b { font-size: 20px; font-variant-numeric: tabular-nums; }
.hub-hero .hub-stats small { display: block; font-size: 11.5px; color: var(--text-3); }

.hub-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 22px 0 2px;
}
.hub-toolbar .hub-search { position: relative; flex: 1; min-width: 220px; }
.hub-toolbar .hub-search svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-3); pointer-events: none;
}
.hub-toolbar .hub-search input { padding-left: 36px; }
.hub-count { font-size: 12.5px; color: var(--text-3); white-space: nowrap; }

.hub-section { margin-top: 28px; scroll-margin-top: 84px; }
.hub-sec-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 11px; }
.hub-sec-head h2 { font-size: 16px; }
.hub-sec-head .hint { margin-left: auto; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 12px; }
.hub-card {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: 11px; box-shadow: var(--shadow);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.hub-card:hover {
  transform: translateY(-2px); border-color: #BFD2F7;
  box-shadow: 0 2px 4px rgba(15, 23, 42, .05), 0 16px 36px -22px rgba(37, 99, 235, .5);
}
.hub-card .card-main { display: block; padding: 15px; color: var(--text); }
.hub-card .card-main:hover { color: var(--text); }
.hub-card .tool-icon { width: 34px; height: 34px; border-radius: 9px; margin-bottom: 11px; }
.hub-card .tool-icon svg { width: 18px; height: 18px; }
.hub-card h3 { font-size: 14.5px; margin-bottom: 5px; padding-right: 24px; }
.hub-card p {
  font-size: 12.5px; line-height: 1.55; color: var(--text-2); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 39px;
}
.hub-card .meta { margin-top: 11px; font-size: 11.5px; }
.hub-card .tag { font-size: 11px; }
.fav-btn {
  position: absolute; top: 11px; right: 11px; z-index: 2;
  width: 26px; height: 26px; border-radius: 7px; border: 1px solid transparent;
  background: transparent; color: var(--text-3); font-size: 15px; line-height: 1;
  cursor: pointer; display: grid; place-items: center; padding: 0;
}
.fav-btn:hover { background: var(--warn-soft); color: var(--warn); }
.fav-btn.on { color: #D97706; }
.hub-card.hide { display: none; }
.hub-section.hide { display: none; }
.hub-empty {
  display: none; text-align: center; padding: 46px 20px; color: var(--text-3);
  background: var(--surface); border: 1px dashed var(--line-strong); border-radius: 12px; margin-top: 24px;
}
.hub-empty.show { display: block; }
.hub-empty b { display: block; color: var(--text-2); font-size: 15px; margin-bottom: 4px; }

/* ---------- 工具页通用补充 ---------- */
.crumb { font-size: 12.5px; color: var(--text-3); margin-bottom: 8px; }
.crumb a { color: var(--text-3); }
.crumb a:hover { color: var(--accent); }
.crumb span { margin: 0 5px; opacity: .6; }
.tool-head { padding-top: 26px; }
.related { margin-top: 16px; }
.related .links { display: flex; flex-wrap: wrap; gap: 8px; }
.related a {
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 13px; color: var(--text-2); background: var(--surface);
}
.related a:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.io-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.io-grid > div { min-width: 0; }
@media (max-width: 760px) { .io-grid { grid-template-columns: 1fr; } }
textarea.code { font-family: var(--mono); font-size: 13px; line-height: 1.65; }
.code-area {
  font-family: var(--mono); font-size: 13px; line-height: 1.65;
  min-height: 180px; resize: vertical; white-space: pre; overflow: auto;
}
.field-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.field-row > .grow { flex: 1; min-width: 170px; }
.field-row > label.field { margin-bottom: 0; }
.w-120 { width: 120px !important; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 9px; }
.stat {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 11px;
}
.stat b { display: block; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.35; }
.stat small { color: var(--text-3); font-size: 11.5px; }
.out-pre {
  font-family: var(--mono); font-size: 12.5px; line-height: 1.65;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 12px; margin: 0;
  max-height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-all;
}
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.seg-control { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; flex-wrap: wrap; }
.seg-control button {
  border: none; border-right: 1px solid var(--line); background: var(--surface);
  color: var(--text-2); padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer;
}
.seg-control button:last-child { border-right: none; }
.seg-control button:hover { background: var(--surface-2); color: var(--text); }
.seg-control button.active { background: var(--accent-soft); color: var(--accent-2); font-weight: 500; }
.table-scroll { overflow: auto; max-height: 480px; border: 1px solid var(--line); border-radius: 8px; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.data th { position: sticky; top: 0; background: var(--surface-2); z-index: 1; font-weight: 500; color: var(--text-2); }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }

@media (max-width: 900px) {
  .hub { grid-template-columns: 1fr; padding-top: 16px; gap: 16px; }
  .hub-side { position: static; }
  .hub-nav { flex-direction: row; overflow-x: auto; padding-bottom: 3px; }
  .hub-nav-btn { white-space: nowrap; width: auto; flex: none; }
  .hub-nav-btn span.count { margin-left: 3px; }
  .hub-side-sep { display: none; }
  .side-note { display: none; }
  .hub-hero { padding: 22px 20px 18px; }
  .hub-hero h1 { font-size: 23px; }
}
@media (max-width: 820px) {
  .site-header .wrap { flex-wrap: wrap; }
  .header-tools { order: 2; margin-left: auto; }
  .nav { order: 3; }
}

/* ---------- 文本对比 ---------- */
.diff-view {
  font-family: var(--mono); font-size: 12.5px; line-height: 1.6;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 8px; max-height: 520px; overflow: auto; padding: 4px 0;
}
.diff-line { display: flex; gap: 10px; padding: 2px 10px; white-space: pre-wrap; word-break: break-all; }
.diff-line .ln { flex: none; width: 36px; text-align: right; color: var(--text-3); user-select: none; }
.diff-line .sign { flex: none; width: 12px; text-align: center; }
.diff-line code { font: inherit; }
.diff-line.add { background: rgba(15, 110, 86, .10); color: var(--ok); }
.diff-line.del { background: rgba(163, 45, 45, .10); color: var(--danger); }
html[data-theme="dark"] .diff-line.add { background: rgba(91, 214, 176, .10); }
html[data-theme="dark"] .diff-line.del { background: rgba(241, 154, 154, .10); }

/* ---------- 正则高亮 ---------- */
.match-hl { background: #FDE68A; color: #111827; border-radius: 2px; padding: 0 1px; }
html[data-theme="dark"] .match-hl { background: #7C5E10; color: #FDE68A; }

/* ---------- Markdown 预览 ---------- */
.md-preview {
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); padding: 16px 18px;
  height: 460px; overflow: auto;
}
.md-body { font-size: 14px; line-height: 1.75; color: var(--text); }
.md-body > :first-child { margin-top: 0; }
.md-body > :last-child { margin-bottom: 0; }
.md-body h1, .md-body h2, .md-body h3, .md-body h4 { line-height: 1.3; margin: 1.1em 0 .55em; }
.md-body h1 { font-size: 1.7em; padding-bottom: .25em; border-bottom: 1px solid var(--line); }
.md-body h2 { font-size: 1.4em; padding-bottom: .2em; border-bottom: 1px solid var(--line); }
.md-body h3 { font-size: 1.18em; }
.md-body p { margin: 0 0 .8em; }
.md-body a { color: var(--accent); }
.md-body code {
  background: var(--surface-2); border: 1px solid var(--line);
  padding: .08em .35em; border-radius: 4px;
  font-family: var(--mono); font-size: .9em;
}
.md-body pre {
  background: #0F172A; color: #E5E7EB;
  padding: 12px 14px; border-radius: 8px; overflow: auto; margin: 0 0 .9em;
}
.md-body pre code { background: none; border: none; color: inherit; padding: 0; }
.md-body blockquote {
  margin: 0 0 .9em; padding: .25em 1em;
  border-left: 3px solid var(--line-strong);
  color: var(--text-2); background: var(--surface-2);
}
.md-body table { border-collapse: collapse; width: 100%; margin: 0 0 .9em; font-size: 13px; }
.md-body th, .md-body td { border: 1px solid var(--line); padding: 6px 9px; }
.md-body th { background: var(--surface-2); font-weight: 600; }
.md-body img { max-width: 100%; height: auto; border-radius: 6px; }
.md-body ul, .md-body ol { padding-left: 1.4em; margin: 0 0 .8em; }
.md-body li { margin: .2em 0; }
.md-body hr { border: none; border-top: 1px solid var(--line); margin: 1.4em 0; }
.md-body input[type=checkbox] { margin-right: 5px; }
@media (max-width: 900px) {
  .md-preview { height: 380px; }
  .md-body h1 { font-size: 1.45em; }
  .md-body h2 { font-size: 1.25em; }
}

/* hidden 属性优先于 .note / .pane 等 display 规则 */
[hidden] { display: none !important; }

@media (max-width: 900px) {
  .hub { grid-template-columns: minmax(0, 1fr); }
  .hub-side, .hub-main { min-width: 0; }
  .hub-side .panel { overflow: hidden; }
  .hub-nav { min-width: 0; max-width: 100%; }
}

/* ---------- 图标配色 ---------- */
.c-blue   { --ic: #2563EB; --ic-bg: #EAF1FE; }
.c-indigo { --ic: #4F46E5; --ic-bg: #EEF0FE; }
.c-sky    { --ic: #0369A1; --ic-bg: #E5F3FB; }
.c-cyan   { --ic: #0E7490; --ic-bg: #E5F5F8; }
.c-teal   { --ic: #0F766E; --ic-bg: #E6F5F2; }
.c-green  { --ic: #15803D; --ic-bg: #E9F7EE; }
.c-lime   { --ic: #4D7C0F; --ic-bg: #F1F7E3; }
.c-amber  { --ic: #B45309; --ic-bg: #FDF2E4; }
.c-orange { --ic: #C2410C; --ic-bg: #FCEDE6; }
.c-rose   { --ic: #BE123C; --ic-bg: #FCEAEF; }
.c-pink   { --ic: #A21CAF; --ic-bg: #FBEAFB; }
.c-violet { --ic: #7E22CE; --ic-bg: #F5EAFE; }
.c-slate  { --ic: #475569; --ic-bg: #EEF2F6; }

html[data-theme="dark"] .c-blue   { --ic: #7EB3FF; --ic-bg: #142747; }
html[data-theme="dark"] .c-indigo { --ic: #A5B4FC; --ic-bg: #1C2045; }
html[data-theme="dark"] .c-sky    { --ic: #7DD3FC; --ic-bg: #0C2A3A; }
html[data-theme="dark"] .c-cyan   { --ic: #67E8F9; --ic-bg: #0B2E36; }
html[data-theme="dark"] .c-teal   { --ic: #5EEAD4; --ic-bg: #0C2F2C; }
html[data-theme="dark"] .c-green  { --ic: #86EFAC; --ic-bg: #10301C; }
html[data-theme="dark"] .c-lime   { --ic: #D9F99D; --ic-bg: #26320D; }
html[data-theme="dark"] .c-amber  { --ic: #FCD34D; --ic-bg: #3A2A0C; }
html[data-theme="dark"] .c-orange { --ic: #FDBA74; --ic-bg: #3B1E0E; }
html[data-theme="dark"] .c-rose   { --ic: #FDA4AF; --ic-bg: #3A1420; }
html[data-theme="dark"] .c-pink   { --ic: #F0ABFC; --ic-bg: #35143A; }
html[data-theme="dark"] .c-violet { --ic: #C4B5FD; --ic-bg: #25173D; }
html[data-theme="dark"] .c-slate  { --ic: #CBD5E1; --ic-bg: #1C2534; }
