/* =========================================================
   星 & 晨 · Tools —— 深空主题设计系统
   依赖：无。仅使用系统字体。
   ========================================================= */

/* ---------- 主题变量 ---------- */
[data-theme="dark"] {
  --bg: #070910;
  --bg-2: #0a0d17;
  --panel: rgba(19, 23, 38, .58);
  --panel-2: rgba(26, 31, 50, .78);
  --inset: rgba(0, 0, 0, .30);
  --inset-2: rgba(0, 0, 0, .18);
  --border: rgba(255, 255, 255, .07);
  --border-2: rgba(255, 255, 255, .14);
  --text: #e9ebf5;
  --text-2: #a8aec5;
  --text-3: #767d97;
  --accent: #a78bfa;
  --accent-2: #7dd3fc;
  --accent-3: #f2a7c9;
  --accent-soft: rgba(167, 139, 250, .13);
  --accent-line: rgba(167, 139, 250, .38);
  --ok: #6ee7b7;
  --warn: #fbbf24;
  --danger: #fb7185;
  --shadow: 0 20px 50px -22px rgba(0, 0, 0, .95);
  --shadow-sm: 0 8px 24px -14px rgba(0, 0, 0, .8);
  --glow: 0 0 60px rgba(124, 92, 255, .12);
  --card-hover: rgba(255, 255, 255, .055);
  --star-rgb: 255, 255, 255;
  --nebula-1: rgba(108, 76, 220, .30);
  --nebula-2: rgba(46, 110, 190, .22);
  --nebula-3: rgba(190, 90, 160, .13);
  --grid-line: rgba(255, 255, 255, .028);
  --code: rgba(0, 0, 0, .32);
  --sel: rgba(167, 139, 250, .28);
}

[data-theme="light"] {
  --bg: #f5f6fb;
  --bg-2: #eef0f8;
  --panel: rgba(255, 255, 255, .78);
  --panel-2: rgba(255, 255, 255, .95);
  --inset: #f1f2f8;
  --inset-2: #f7f8fc;
  --border: rgba(20, 24, 55, .08);
  --border-2: rgba(20, 24, 55, .16);
  --text: #1a1d2c;
  --text-2: #545b74;
  --text-3: #7a829b;
  --accent: #6d4df6;
  --accent-2: #0e7fa8;
  --accent-3: #cf4a8b;
  --accent-soft: rgba(109, 77, 246, .09);
  --accent-line: rgba(109, 77, 246, .3);
  --ok: #0f9d63;
  --warn: #b07500;
  --danger: #d92d4b;
  --shadow: 0 18px 40px -24px rgba(28, 32, 70, .45);
  --shadow-sm: 0 6px 18px -12px rgba(28, 32, 70, .35);
  --glow: 0 0 50px rgba(109, 77, 246, .07);
  --card-hover: rgba(255, 255, 255, .95);
  --star-rgb: 80, 70, 150;
  --nebula-1: rgba(150, 130, 255, .17);
  --nebula-2: rgba(120, 190, 240, .17);
  --nebula-3: rgba(240, 170, 210, .13);
  --grid-line: rgba(20, 24, 55, .035);
  --code: #f1f2f8;
  --sel: rgba(109, 77, 246, .16);
}

/* ---------- 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "HarmonyOS Sans SC",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.72;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .35s ease, color .35s ease;
  overflow-x: hidden;
}

::selection { background: var(--sel); }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -.015em;
  line-height: 1.35;
}

p { margin: 0; }

img, svg { display: block; max-width: 100%; }

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- 星空背景 ---------- */
#stars {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: .85;
}

.nebula {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 45% at 18% 0%, var(--nebula-1), transparent 70%),
    radial-gradient(55% 40% at 82% 8%, var(--nebula-2), transparent 72%),
    radial-gradient(70% 60% at 50% 110%, var(--nebula-3), transparent 70%);
  filter: blur(10px);
}

.nebula::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(70% 55% at 50% 20%, #000 20%, transparent 80%);
}

/* ---------- 布局 ---------- */
.app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 34px 32px 0;
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr) 272px;
  gap: 30px;
  align-items: start;
}

.main { min-width: 0; display: flex; flex-direction: column; min-height: 82vh; }

/* ---------- 左侧栏 ---------- */
.sidebar {
  position: sticky;
  top: 34px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding-bottom: 28px;
}

.brand { text-align: center; padding: 4px 0 0; }

.avatar {
  width: 92px;
  height: 92px;
  margin: 0 auto 14px;
  border-radius: 50%;
  position: relative;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 32% 26%, #232a44, #080a13 68%);
  border: 1px solid var(--border-2);
  box-shadow: 0 0 0 6px rgba(255, 255, 255, .02), var(--glow);
  overflow: hidden;
}
[data-theme="light"] .avatar { background: radial-gradient(circle at 32% 26%, #2b3350, #0b0e1a 70%); }
.avatar svg { width: 100%; height: 100%; }

.brand-name {
  display: inline-block;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .02em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-2);
}
.brand-name .amp { color: var(--accent); margin: 0 2px; }

.brand-sub {
  margin-top: 8px;
  font-size: 11.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-3);
}

.brand-desc {
  margin: 14px auto 0;
  max-width: 208px;
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--text-2);
}

.socials { display: flex; justify-content: center; gap: 14px; margin-top: 16px; }

.social {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: var(--text-3);
  transition: .22s ease;
}
.social:hover { color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }

.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }

.nav-label {
  font-size: 10.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0 12px 8px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  height: 40px;
  padding: 0 13px;
  border-radius: 11px;
  font-size: 13.5px;
  color: var(--text-2);
  border: 1px solid transparent;
  transition: .2s ease;
}
.nav-item svg { width: 17px; height: 17px; opacity: .8; flex: none; }
.nav-item .en { margin-left: auto; font-size: 11px; color: var(--text-3); letter-spacing: .02em; }
.nav-item:hover { color: var(--text); background: rgba(255, 255, 255, .045); }
[data-theme="light"] .nav-item:hover { background: rgba(20, 24, 55, .045); }

.nav-item.is-active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(167, 139, 250, .17), rgba(125, 211, 252, .06));
  border-color: var(--border-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
[data-theme="light"] .nav-item.is-active {
  background: linear-gradient(90deg, rgba(109, 77, 246, .14), rgba(14, 127, 168, .05));
}
.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: -1px; top: 50%;
  width: 3px; height: 16px;
  transform: translateY(-50%);
  border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.nav-item.is-active svg { opacity: 1; color: var(--accent); }

/* 主题切换 */
.side-foot { margin-top: auto; padding-top: 8px; }

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 6px 8px 6px 14px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: .25s ease;
}
.theme-toggle:hover { border-color: var(--border-2); }
.theme-toggle > svg { width: 15px; height: 15px; flex: none; color: var(--accent); }
.theme-toggle .tt-label {
  flex: 1;
  font-size: 12px;
  color: var(--text-2);
  display: flex; align-items: center; gap: 7px;
  white-space: nowrap;
  text-align: left;
}
.tt-knob {
  position: relative;
  width: 52px; height: 26px;
  border-radius: 999px;
  background: var(--inset);
  border: 1px solid var(--border-2);
  flex: none;
  display: flex;
  align-items: center;
  padding: 0 3px;
}
.tt-knob span {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: linear-gradient(140deg, #f8fafc, #c9d2ea);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
  transition: transform .3s cubic-bezier(.4, 0, .2, 1);
  display: grid; place-items: center;
  color: #3b3f57;
}
[data-theme="dark"] .tt-knob span { transform: translateX(0); }
[data-theme="light"] .tt-knob span { transform: translateX(26px); }

/* ---------- 页头 ---------- */
.page-head { margin-bottom: 22px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.eyebrow svg { width: 14px; height: 14px; }

.page-head h1 {
  font-size: clamp(24px, 3.4vw, 32px);
  background: linear-gradient(100deg, var(--text) 20%, var(--accent) 78%, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  margin-top: 10px;
  max-width: 660px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-2);
}

.tag-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 23px;
  padding: 0 9px;
  border-radius: 6px;
  font-size: 11.5px;
  letter-spacing: .02em;
  color: var(--accent-3);
  background: rgba(242, 167, 201, .12);
  border: 1px solid rgba(242, 167, 201, .22);
}
[data-theme="light"] .tag { background: rgba(207, 74, 139, .07); border-color: rgba(207, 74, 139, .18); }
.tag.is-mint { color: var(--ok); background: rgba(110, 231, 183, .1); border-color: rgba(110, 231, 183, .22); }
[data-theme="light"] .tag.is-mint { background: rgba(15, 157, 99, .07); border-color: rgba(15, 157, 99, .2); }
.tag.is-sky { color: var(--accent-2); background: rgba(125, 211, 252, .1); border-color: rgba(125, 211, 252, .22); }
[data-theme="light"] .tag.is-sky { background: rgba(14, 127, 168, .07); border-color: rgba(14, 127, 168, .2); }

/* ---------- 卡片 ---------- */
.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  box-shadow: var(--shadow-sm);
  transition: border-color .25s ease, transform .25s ease, background .25s ease;
}

.card-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* 工具卡 */
.tool-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 18px 16px;
  border-radius: 15px;
  background: var(--panel);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: .26s cubic-bezier(.4, 0, .2, 1);
  overflow: hidden;
}
.tool-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(120% 80% at 12% 0%, var(--accent-soft), transparent 60%);
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}
.tool-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-2);
  box-shadow: var(--shadow);
  background: var(--card-hover);
}
.tool-card:hover::after { opacity: 1; }

.tool-card .tc-top { display: flex; align-items: center; gap: 10px; }

.tc-icon {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  flex: none;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
}
.tc-icon svg { width: 17px; height: 17px; }

.tc-name { font-size: 14.5px; font-weight: 600; letter-spacing: -.005em; }
.tc-en { font-size: 11px; color: var(--text-3); letter-spacing: .04em; }

.tool-card .tc-desc {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-2);
  min-height: 42px;
}

.tool-card .tc-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 11.5px;
  color: var(--text-3);
}
.tc-foot .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); opacity: .6; }
.tc-foot .arrow { margin-left: auto; transition: transform .25s ease; }
.tool-card:hover .tc-foot .arrow { transform: translateX(3px); color: var(--accent); }

/* ---------- 区块标题 ---------- */
.section { margin-top: 30px; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}
.section-head h2 { font-size: 15px; letter-spacing: .02em; }
.section-head .count { font-size: 11.5px; color: var(--text-3); }
.section-head .line { flex: 1; height: 1px; background: var(--border); }

/* ---------- 右侧栏 ---------- */
.rail {
  position: sticky;
  top: 34px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 28px;
}

.rail-block {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 14px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.rail-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0 4px 10px;
}
.rail-title svg { width: 13px; height: 13px; }

.rail-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: 9px;
  font-size: 12.5px;
  color: var(--text-2);
  transition: .2s ease;
}
.rail-link svg { width: 14px; height: 14px; opacity: .65; flex: none; }
.rail-link em {
  margin-left: auto;
  font-style: normal;
  font-size: 11px;
  color: var(--text-3);
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--inset);
}
.rail-link:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
[data-theme="light"] .rail-link:hover { background: rgba(20, 24, 55, .045); }
.rail-link.is-active { color: var(--accent); background: var(--accent-soft); }

.rail-note {
  font-size: 12px;
  line-height: 1.8;
  color: var(--text-3);
  padding: 0 4px;
}
.rail-note b { color: var(--text-2); font-weight: 500; }

/* ---------- 工具面板 ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, .022), transparent);
}

.panel-body { padding: 18px; }

.tabs { display: flex; gap: 3px; flex-wrap: wrap; }

.tab {
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  padding: 6px 13px;
  border-radius: 8px;
  cursor: pointer;
  transition: .2s ease;
  white-space: nowrap;
}
.tab:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.tab.is-active {
  color: var(--text);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}

.pane { display: none; }
.pane.is-active { display: block; animation: fade .25s ease; }

@keyframes fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }

.field + .field { margin-top: 16px; }

.label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: .04em;
}
.label .opt { font-size: 11px; opacity: .7; }

.input, .textarea, .select {
  width: 100%;
  background: var(--inset);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 10px 13px;
  font-size: 13.5px;
  color: var(--text);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.7;
  font-family: "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12.8px;
}
.textarea.is-tall { min-height: 260px; }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--inset-2);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); opacity: .8; }
.input.is-mono, .mono {
  font-family: "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 12.8px;
  letter-spacing: 0;
}

.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
  cursor: pointer;
}
.select option { background: var(--bg-2); color: var(--text); }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.nowrap { flex-wrap: nowrap; }
.row.between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  font-size: 12.8px;
  cursor: pointer;
  transition: .2s ease;
  white-space: nowrap;
  user-select: none;
}
[data-theme="light"] .btn { background: #fff; box-shadow: 0 1px 2px rgba(20, 24, 55, .05); }
.btn:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 14px; height: 14px; }

.btn-primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #0a0d17;
  font-weight: 600;
  box-shadow: 0 6px 18px -8px rgba(140, 120, 255, .8);
}
[data-theme="light"] .btn-primary { color: #fff; }
.btn-primary:hover { filter: brightness(1.06); background: linear-gradient(120deg, var(--accent), var(--accent-2)); border-color: transparent; }

.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn-icon { width: 32px; height: 32px; padding: 0; border-radius: 9px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: rgba(255, 255, 255, .06); border-color: transparent; color: var(--text); }
[data-theme="light"] .btn-ghost { background: transparent; box-shadow: none; }
.btn.is-danger:hover { color: var(--danger); border-color: rgba(251, 113, 133, .4); background: rgba(251, 113, 133, .1); }

.btn.is-on {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

/* 分段控件 */
.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 10px;
  background: var(--inset);
  border: 1px solid var(--border);
}
.seg button {
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 7px;
  cursor: pointer;
  transition: .2s ease;
}
.seg button.is-active {
  background: var(--panel-2);
  color: var(--text);
  box-shadow: 0 2px 8px -4px rgba(0, 0, 0, .6);
}

/* 复选 */
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.check input { appearance: none; width: 15px; height: 15px; border-radius: 4px; border: 1px solid var(--border-2); background: var(--inset); cursor: pointer; position: relative; flex: none; }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after {
  content: ""; position: absolute; left: 4.5px; top: 1.5px;
  width: 4px; height: 8px; border: solid #0a0d17; border-width: 0 2px 2px 0; transform: rotate(42deg);
}
[data-theme="light"] .check input:checked::after { border-color: #fff; }

/* ---------- 输出/结果 ---------- */
.output {
  position: relative;
  background: var(--code);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 12px 13px;
  font-family: "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 12.8px;
  line-height: 1.7;
  color: var(--text);
  word-break: break-all;
  white-space: pre-wrap;
  min-height: 44px;
  max-height: 420px;
  overflow: auto;
}
.output.is-empty { color: var(--text-3); font-family: inherit; }

.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}
.kv {
  background: var(--inset-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.kv dt { font-size: 11px; color: var(--text-3); letter-spacing: .04em; }
.kv dd { margin: 4px 0 0; font-size: 13px; font-family: "SFMono-Regular", Menlo, Consolas, monospace; word-break: break-all; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.8px;
}
table.data th {
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-2);
  white-space: nowrap;
}
table.data td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: top;
}
table.data td.mono, table.data th.mono { font-family: "SFMono-Regular", Menlo, Consolas, monospace; font-size: 12.3px; color: var(--text); }
table.data tr:hover td { background: rgba(255, 255, 255, .022); }
table.data tr:last-child td { border-bottom: 0; }

.table-wrap { max-height: 460px; overflow: auto; border-radius: 10px; border: 1px solid var(--border); }

/* ---------- 提示 ---------- */
.hint {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 12px;
  line-height: 1.75;
  color: var(--text-3);
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid var(--border);
}
.hint svg { width: 14px; height: 14px; flex: none; margin-top: 3px; color: var(--accent); }
.hint b { color: var(--text-2); font-weight: 600; }

.note { font-size: 12px; color: var(--text-3); line-height: 1.75; }

.err {
  display: none;
  font-size: 12.5px;
  color: var(--danger);
  background: rgba(251, 113, 133, .08);
  border: 1px solid rgba(251, 113, 133, .25);
  border-radius: 9px;
  padding: 8px 12px;
  margin-top: 10px;
  white-space: pre-wrap;
}
.err.is-on { display: block; }

.ok-text { color: var(--ok); }
.warn-text { color: var(--warn); }
.danger-text { color: var(--danger); }
.dim { color: var(--text-3); }
.mono-sm { font-family: "SFMono-Regular", Menlo, Consolas, monospace; font-size: 12px; }

/* ---------- diff ---------- */
.diff {
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12.4px;
  line-height: 1.7;
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--code);
}
.diff-line { display: flex; gap: 0; white-space: pre-wrap; word-break: break-word; }
.diff-line .ln {
  flex: none;
  width: 42px;
  text-align: right;
  padding: 1px 8px;
  color: var(--text-3);
  opacity: .55;
  user-select: none;
  font-size: 11.5px;
}
.diff-line .tx { flex: 1; padding: 1px 10px 1px 4px; }
.diff-line.add { background: rgba(110, 231, 183, .10); }
.diff-line.add .tx { color: var(--ok); }
.diff-line.del { background: rgba(251, 113, 133, .10); }
.diff-line.del .tx { color: var(--danger); }
.diff-line.eq .tx { color: var(--text-2); }

/* ---------- 二维码/图片 ---------- */
.qr-stage {
  display: grid;
  place-items: center;
  padding: 22px;
  border-radius: 14px;
  background: var(--inset);
  border: 1px solid var(--border);
  min-height: 220px;
}
.qr-stage img { width: 220px; height: 220px; border-radius: 8px; background: #fff; padding: 6px; }
.dropzone {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 34px 20px;
  border-radius: 14px;
  border: 1.5px dashed var(--border-2);
  background: var(--inset-2);
  color: var(--text-3);
  font-size: 13px;
  text-align: center;
  cursor: pointer;
  transition: .22s ease;
}
.dropzone:hover, .dropzone.is-over {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--text-2);
}
.dropzone svg { width: 26px; height: 26px; opacity: .7; }
.preview-img {
  max-width: 100%;
  max-height: 320px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background:
    repeating-conic-gradient(rgba(128, 128, 128, .12) 0 25%, transparent 0 50%) 50% / 16px 16px;
}

/* 颜色预览 */
.swatch {
  height: 62px;
  border-radius: 11px;
  border: 1px solid var(--border-2);
}
.shade-strip { display: flex; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.shade-strip > div { flex: 1; height: 40px; }

/* ---------- 命令面板 ---------- */
.cmd-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  padding: 12vh 18px 0;
  background: rgba(4, 6, 12, .62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.cmd-overlay.is-open { display: block; animation: fade .18s ease; }

.cmd-box {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  background: var(--panel-2);
  border: 1px solid var(--border-2);
  border-radius: 16px;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .03);
  overflow: hidden;
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
}

.cmd-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.cmd-input-row svg { width: 17px; height: 17px; color: var(--text-3); flex: none; }
.cmd-input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 14.5px;
}
.cmd-input::placeholder { color: var(--text-3); }
.cmd-kbd {
  font-size: 10.5px;
  color: var(--text-3);
  border: 1px solid var(--border-2);
  border-radius: 5px;
  padding: 2px 5px;
  font-family: inherit;
}

.cmd-list { max-height: 52vh; overflow: auto; padding: 6px; }
.cmd-group {
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 10px 10px 6px;
}
.cmd-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: 9px;
  font-size: 13.5px;
  color: var(--text-2);
  cursor: pointer;
}
.cmd-item svg { width: 15px; height: 15px; opacity: .7; flex: none; }
.cmd-item .cm-desc { margin-left: auto; font-size: 11.5px; color: var(--text-3); max-width: 44%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd-item.is-active, .cmd-item:hover { background: var(--accent-soft); color: var(--text); }
.cmd-empty { padding: 26px; text-align: center; color: var(--text-3); font-size: 13px; }

/* 搜索框（页头/侧栏） */
.search-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: 11px;
  background: var(--inset);
  border: 1px solid var(--border);
  color: var(--text-3);
  font-size: 12.5px;
  cursor: pointer;
  transition: .2s ease;
}
.search-bar:hover { border-color: var(--border-2); color: var(--text-2); }
.search-bar svg { width: 15px; height: 15px; }
.search-bar .sk { margin-left: auto; }

/* ---------- 提示条 ---------- */
.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border-2);
  box-shadow: 0 16px 40px -16px rgba(0, 0, 0, .8);
  font-size: 12.8px;
  color: var(--text);
  backdrop-filter: blur(14px);
  animation: toastIn .26s cubic-bezier(.2, .9, .3, 1.2);
}
.toast.is-out { animation: toastOut .2s ease forwards; }
.toast svg { width: 14px; height: 14px; color: var(--ok); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px) scale(.98); } }

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: auto;
  padding: 34px 0 26px;
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
  line-height: 2;
}
.site-footer .f-brand { color: var(--text-2); }
.site-footer .f-sep { opacity: .4; margin: 0 8px; }
.site-footer a:hover { color: var(--accent); }
.site-footer .f-links { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-bottom: 4px; }

/* ---------- 移动端顶栏 ---------- */
.mobile-bar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 70;
  height: 58px;
  padding: 0 16px;
  align-items: center;
  gap: 12px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.mobile-bar .mb-brand { font-size: 14px; font-weight: 600; }
.mobile-bar .mb-brand span { color: var(--accent); }
.mobile-bar .spacer { flex: 1; }

.side-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 79;
  background: rgba(4, 6, 12, .6);
  backdrop-filter: blur(3px);
}
.side-overlay.is-open { display: block; }

/* ---------- 响应式 ---------- */
@media (max-width: 1280px) {
  .app { grid-template-columns: 224px minmax(0, 1fr); }
  .rail { display: none; }
}

/* 双栏输入输出在窄屏折为单列 */
@media (max-width: 760px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .now-bar { grid-template-columns: minmax(0, 1fr); }
  .split > * { min-width: 0; }
  .row.nowrap > .input,
  .row.nowrap > .select { min-width: 0; }
}

@media (max-width: 980px) {
  body { font-size: 14.5px; }  .app {
    grid-template-columns: minmax(0, 1fr);
    padding: 76px 18px 0;
    gap: 0;
  }
  .mobile-bar { display: flex; }
  .sidebar {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    width: 268px;
    z-index: 80;
    background: var(--panel-2);
    border-right: 1px solid var(--border-2);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 26px 18px;
    overflow-y: auto;
    transform: translateX(-102%);
    transition: transform .3s cubic-bezier(.3, .8, .3, 1);
  }
  .sidebar.is-open { transform: none; box-shadow: 24px 0 60px -20px rgba(0, 0, 0, .8); }
  .brand { text-align: left; }
  .brand .avatar { width: 60px; height: 60px; margin: 0 0 12px; }
  .brand-name { border-bottom: 0; padding-bottom: 0; }
  .brand-desc { margin-left: 0; max-width: none; }
  .socials { justify-content: flex-start; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .app { padding: 72px 13px 0; }
  .card-grid, .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .panel-body { padding: 14px; }
  .card { padding: 17px; border-radius: 15px; }
  .page-head h1 { font-size: 23px; }
  .tool-card .tc-desc { min-height: 0; }
  .qr-stage img { width: 180px; height: 180px; }
  .cmd-overlay { padding-top: 8vh; }
  .section-head .line { display: none; }
}

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

/* =========================================================
   组件补充：Hero / 筛选 / 文档排版 / 小控件
   ========================================================= */

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 34px 32px 30px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background:
    linear-gradient(160deg, rgba(167, 139, 250, .10), rgba(125, 211, 252, .03) 46%, transparent 74%),
    var(--panel);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 8px;
}
.hero-halo {
  position: absolute;
  top: -120px; right: -80px;
  width: 380px; height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(167, 139, 250, .28), rgba(125, 211, 252, .10) 42%, transparent 68%);
  filter: blur(6px);
  pointer-events: none;
}
.hero-halo::after {
  content: "";
  position: absolute;
  inset: 70px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .06);
  box-shadow: 0 0 0 34px rgba(255, 255, 255, .016), 0 0 0 70px rgba(255, 255, 255, .01);
}
.hero .eyebrow { margin-bottom: 14px; }
.hero .eyebrow span {
  color: var(--text-3);
  letter-spacing: .2em;
  font-size: 10.5px;
  padding-left: 9px;
  border-left: 1px solid var(--border-2);
}
.hero h1 {
  position: relative;
  font-size: clamp(27px, 4vw, 38px);
  line-height: 1.32;
  letter-spacing: -.02em;
  background: linear-gradient(102deg, var(--text) 18%, #cdbcff 62%, var(--accent-2) 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-lede {
  position: relative;
  margin-top: 14px;
  max-width: 580px;
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--text-2);
}
.hero-search {
  position: relative;
  max-width: 470px;
  height: 46px;
  margin-top: 22px;
  border-radius: 12px;
  background: rgba(0, 0, 0, .22);
  border-color: var(--border-2);
}
[data-theme="light"] .hero-search { background: rgba(255, 255, 255, .8); }
.hero-search:hover { border-color: var(--accent-line); color: var(--text-2); }
.hero-search .sk { display: flex; gap: 4px; margin-left: auto; }
kbd {
  display: inline-block;
  font-family: inherit;
  font-size: 10.5px;
  line-height: 1.6;
  padding: 1px 5px;
  border-radius: 5px;
  color: var(--text-3);
  background: var(--inset);
  border: 1px solid var(--border-2);
}
.hero-stats {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 34px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.stat b {
  display: block;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.02em;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat span { font-size: 11.5px; color: var(--text-3); letter-spacing: .04em; }

/* ---------- 最近使用 ---------- */
.recent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.recent-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 13px;
  border-radius: 11px;
  background: var(--panel);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
  transition: .2s ease;
}
.recent-chip em { font-style: normal; font-size: 10.5px; color: var(--text-3); letter-spacing: .05em; }
.recent-chip:hover { border-color: var(--accent-line); background: var(--accent-soft); transform: translateY(-1px); }

/* ---------- 筛选条 ---------- */
.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 15px;
  background: var(--panel);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  margin-bottom: 6px;
}
.filter-input {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  height: 40px;
  border-radius: 10px;
  background: var(--inset);
  border: 1px solid var(--border);
  color: var(--text-3);
}
.filter-input svg { width: 15px; height: 15px; flex: none; }
.filter-input input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 13.5px;
  min-width: 0;
}
.filter-input input::placeholder { color: var(--text-3); }
.filter-input:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  font-size: 12.5px;
  cursor: pointer;
  transition: .2s ease;
}
.chip-btn em { font-style: normal; font-size: 10.5px; color: var(--text-3); }
.chip-btn:hover { border-color: var(--border-2); color: var(--text); }
.chip-btn.is-on {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.chip-btn.is-on em { color: var(--accent); opacity: .8; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 54px 20px;
  color: var(--text-3);
  font-size: 13px;
}
.empty-state svg { width: 26px; height: 26px; opacity: .5; }

/* ---------- CTA ---------- */
.cta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 30px;
  background:
    linear-gradient(120deg, rgba(167, 139, 250, .10), transparent 55%),
    var(--panel);
}
.cta-card h3 { font-size: 15px; }

/* ---------- 文档排版 ---------- */
.prose { padding: 26px 28px; }
.prose h2 {
  font-size: 15px;
  margin: 26px 0 10px;
  padding-left: 11px;
  border-left: 2px solid var(--accent);
  line-height: 1.2;
}
.prose h2:first-child { margin-top: 0; }
.prose p { font-size: 13.6px; line-height: 1.95; color: var(--text-2); margin: 9px 0; }
.prose p b { color: var(--text); font-weight: 600; }
.prose a.text-link { color: var(--accent); border-bottom: 1px solid var(--accent-line); }
.prose a.text-link:hover { color: var(--accent-2); }
.list-check { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 8px; }
.list-check li {
  position: relative;
  padding-left: 22px;
  font-size: 13.2px;
  line-height: 1.8;
  color: var(--text-2);
}
.list-check li::before {
  content: "";
  position: absolute;
  left: 3px; top: 9px;
  width: 5px; height: 9px;
  border: solid var(--accent);
  border-width: 0 1.6px 1.6px 0;
  transform: rotate(42deg);
}
.list-check.is-warn li::before {
  content: "";
  width: 6px; height: 6px;
  border: 0;
  border-radius: 50%;
  background: var(--warn);
  transform: none;
  top: 11px; left: 3px;
}

.timeline { list-style: none; padding: 0; margin: 12px 0 0; border-left: 1px solid var(--border-2); }
.timeline li {
  position: relative;
  padding: 0 0 16px 18px;
  font-size: 13.2px;
  line-height: 1.8;
  color: var(--text-2);
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -4px; top: 9px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.timeline b { display: inline-block; min-width: 74px; color: var(--text); font-weight: 600; }

/* ---------- 工具页通用 ---------- */
.toolbar { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-left: auto; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.field-head .label { margin: 0; }
.count-pill {
  font-size: 11px;
  color: var(--text-3);
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--inset);
  border: 1px solid var(--border);
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  letter-spacing: .04em;
  padding: 1px 7px;
  border-radius: 5px;
  color: var(--accent-2);
  background: rgba(125, 211, 252, .1);
  border: 1px solid rgba(125, 211, 252, .22);
}
[data-theme="light"] .badge { background: rgba(14, 127, 168, .07); border-color: rgba(14, 127, 168, .2); }
.badge.is-warn { color: var(--warn); background: rgba(251, 191, 36, .1); border-color: rgba(251, 191, 36, .24); }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: var(--border-2);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: linear-gradient(140deg, #fff, #cbb9ff);
  border: 1px solid rgba(0, 0, 0, .15);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .45);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #e9e2ff;
  border: 0;
  cursor: pointer;
}
input[type="color"] {
  width: 42px; height: 34px;
  padding: 2px;
  border-radius: 9px;
  border: 1px solid var(--border-2);
  background: var(--inset);
  cursor: pointer;
}
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.meter { height: 5px; border-radius: 999px; background: var(--inset); overflow: hidden; border: 1px solid var(--border); }
.meter > i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--danger), var(--warn), var(--ok)); transition: width .3s ease; }

/* ---------- 当前时间横幅 ---------- */
.now-bar {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 18px 22px;
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background:
    linear-gradient(120deg, rgba(167, 139, 250, .13), rgba(125, 211, 252, .04) 62%, transparent),
    var(--inset-2);
}
.now-main { min-width: 0; }
.now-label {
  display: block;
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-3);
}
.now-val {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.25;
  margin-top: 6px;
  background: linear-gradient(110deg, var(--text), var(--accent) 88%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.now-sub { font-size: 12px; color: var(--text-2); margin-top: 6px; }
.now-side { display: flex; flex-direction: column; gap: 7px; justify-content: center; min-width: 0; }
.now-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-3);
  min-width: 0;
}
.now-row > span { flex: none; width: 58px; }
.now-row > code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-2);
}
.now-row .btn-icon { width: 24px; height: 24px; flex: none; }
.now-row .btn-icon svg { width: 12px; height: 12px; }

/* 打印 */
@media print {
  #stars, .nebula, .sidebar, .rail, .mobile-bar, .cmd-overlay, .toast-wrap { display: none !important; }
  .app { display: block; padding: 0; }
  body { background: #fff; color: #000; }
}


/* =========================================================
   补齐：哈希结果列表 / 对比度演示 / 正则高亮 / 折叠面板
   ========================================================= */
.hash-list {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--inset-2);
}
.hash-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) 30px;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  transition: background .2s ease;
}
.hash-row:last-child { border-bottom: 0; }
.hash-row:hover { background: rgba(255, 255, 255, .028); }
[data-theme="light"] .hash-row:hover { background: rgba(20, 24, 55, .028); }
.hash-alg {
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--text-3);
  text-transform: uppercase;
  white-space: nowrap;
}
.hash-val {
  font-size: 12.2px;
  line-height: 1.7;
  color: var(--text);
  word-break: break-all;
  min-width: 0;
}

.contrast-demo {
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.85;
  transition: background .3s ease, color .3s ease;
}

mark.hl {
  background: rgba(167, 139, 250, .38);
  color: var(--text);
  border-radius: 4px;
  padding: 0 2px;
  box-shadow: inset 0 -1px 0 var(--accent-line);
}
[data-theme="light"] mark.hl { background: rgba(109, 77, 246, .26); color: var(--text); }

details.details {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--inset-2);
  overflow: hidden;
}
details.details > summary {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
details.details > summary::-webkit-details-marker { display: none; }
details.details > summary::before {
  content: "";
  width: 0; height: 0;
  border-left: 5px solid var(--text-3);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform .22s ease;
  flex: none;
}
details.details[open] > summary::before { transform: rotate(90deg); }
details.details[open] > summary { border-bottom: 1px solid var(--border); color: var(--text); }
details.details > *:not(summary) { margin: 10px 12px; }

/* 单行 flex 行内的输入框应可收缩，不把后面的按钮/选项挤到下一行 */
.row.nowrap > .input,
.row.nowrap > .select,
.row.nowrap > .field { flex: 1 1 auto; width: auto; min-width: 0; }
.row.nowrap > .row { flex: none; flex-wrap: nowrap; }

/* 浅色主题下的开关滑块，避免白底白圆看不明 */
[data-theme="light"] .tt-knob { background: #e2e5f1; }
[data-theme="light"] .tt-knob span {
  background: linear-gradient(140deg, #8b72ff, #5b6ef5);
  color: #fff;
  box-shadow: 0 2px 7px rgba(109, 77, 246, .38);
}


/* =========================================================
   HTTP 头审计 / SSL 证书面板
   ========================================================= */
.hh-statusline {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 11px;
  background: var(--inset-2);
  border: 1px solid var(--border);
  font-size: 13px;
}
.hh-statusline b {
  font-size: 17px;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  letter-spacing: .02em;
}

.audit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
}
.audit-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.audit-item {
  display: grid;
  grid-template-columns: 19px 158px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 8px 11px;
  border-radius: 9px;
  background: var(--inset-2);
  border: 1px solid var(--border);
  font-size: 12.4px;
  line-height: 1.65;
}
.ai-mark {
  width: 17px; height: 17px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
  margin-top: 1px;
}
.audit-item.ok .ai-mark { background: rgba(110, 231, 183, .18); color: var(--ok); }
.audit-item.warn .ai-mark { background: rgba(251, 191, 36, .2); color: var(--warn); }
.audit-item.fail .ai-mark { background: rgba(251, 113, 133, .18); color: var(--danger); }
.audit-item.fail { border-color: rgba(251, 113, 133, .22); }
.ai-label { color: var(--text); font-weight: 500; }
.ai-detail { color: var(--text-2); }

/* SSL 证书 */
.ssl-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: var(--inset-2);
}
.ssl-banner.is-ok { border-color: rgba(110, 231, 183, .34); background: rgba(110, 231, 183, .07); }
.ssl-banner.is-warn { border-color: rgba(251, 191, 36, .34); background: rgba(251, 191, 36, .07); }
.ssl-banner.is-danger { border-color: rgba(251, 113, 133, .34); background: rgba(251, 113, 133, .07); }
.sb-icon {
  width: 36px; height: 36px;
  border-radius: 11px;
  display: grid; place-items: center;
  flex: none;
  background: rgba(255, 255, 255, .06);
}
[data-theme="light"] .sb-icon { background: rgba(20, 24, 55, .05); }
.sb-icon svg { width: 19px; height: 19px; }
.is-ok .sb-icon { color: var(--ok); }
.is-warn .sb-icon { color: var(--warn); }
.is-danger .sb-icon { color: var(--danger); }
.sb-title { font-size: 14.5px; font-weight: 600; }
.sb-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; line-height: 1.6; }
.ssl-track {
  height: 5px;
  margin-top: 10px;
  border-radius: 999px;
  background: var(--inset);
  border: 1px solid var(--border);
  overflow: hidden;
}
.ssl-track > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: width .45s ease;
}
.ssl-days {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.01em;
}
.is-ok .ssl-days { color: var(--ok); }
.is-warn .ssl-days { color: var(--warn); }
.is-danger .ssl-days { color: var(--danger); }

.san-list { display: flex; flex-wrap: wrap; gap: 6px; }
.san-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 7px;
  background: var(--inset);
  border: 1px solid var(--border);
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 11.8px;
  color: var(--text-2);
  word-break: break-all;
}
.san-chip i {
  font-style: normal;
  font-size: 9.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.warn-list {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  background: rgba(251, 191, 36, .09);
  border: 1px solid rgba(251, 191, 36, .26);
  font-size: 12px;
  line-height: 1.85;
  color: var(--warn);
}

/* =========================================================
   小屏最终覆盖（必须放在最后：组件样式定义在此断点之后）
   ========================================================= */
@media (max-width: 620px) {
  .hero { padding: 22px 18px 20px; border-radius: 17px; }
  .hero h1 { font-size: 24px; line-height: 1.36; }
  .hero-lede { font-size: 12.8px; }
  .hero-search { margin-top: 16px; height: 42px; }
  .hero-search > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hero-search .sk { display: none; }
  .hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
    margin-top: 20px;
    padding-top: 16px;
  }
  .stat b { font-size: 18px; }
  .stat span { font-size: 11px; }
  .now-bar { padding: 14px 15px; }
  .now-val { font-size: 24px; }
  .audit-item { grid-template-columns: 19px minmax(0, 1fr); }
  .audit-item .ai-detail { grid-column: 1 / -1; padding-left: 29px; }
  .ssl-banner { flex-wrap: wrap; }
  .ssl-banner > div:last-child { text-align: left !important; }
}
