/* ============================================================
   Toolbox · 设计系统
   ============================================================ */

:root {
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono",
    Consolas, "Liberation Mono", Menlo, monospace;

  --accent: #22d3ee;
  --accent-2: #6366f1;
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;

  --radius-s: 8px;
  --radius: 12px;
  --radius-l: 16px;

  --topbar-h: 56px;
  --sidebar-w: 248px;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- 深色（默认） ---------- */
html[data-theme="dark"] {
  --bg: #0a0e13;
  --bg-2: #0e141b;
  --surface: #121a23;
  --surface-2: #17212c;
  --surface-3: #1e2a37;
  --border: #223040;
  --border-soft: #1a242f;
  --text: #e6edf5;
  --text-2: #9fb0c3;
  --text-3: #64788d;
  --shadow: 0 12px 32px -8px rgba(0, 0, 0, .6);
  --glow: 0 0 0 1px rgba(34, 211, 238, .25), 0 8px 32px -12px rgba(34, 211, 238, .45);
}

/* ---------- 亮色 ---------- */
html[data-theme="light"] {
  --bg: #f6f8fb;
  --bg-2: #eef2f7;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #eef2f7;
  --border: #dde5ee;
  --border-soft: #e8eef5;
  --text: #0f1a26;
  --text-2: #4c5f73;
  --text-3: #8496a8;
  --shadow: 0 12px 32px -12px rgba(16, 32, 48, .18);
  --glow: 0 0 0 1px rgba(14, 165, 233, .3), 0 8px 28px -14px rgba(14, 165, 233, .4);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* 背景光斑 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 500px at 12% -8%, rgba(34, 211, 238, .10), transparent 62%),
    radial-gradient(800px 480px at 92% 6%, rgba(99, 102, 241, .12), transparent 60%);
}
html[data-theme="light"] body::before {
  background:
    radial-gradient(900px 500px at 12% -8%, rgba(14, 165, 233, .12), transparent 62%),
    radial-gradient(800px 480px at 92% 6%, rgba(99, 102, 241, .10), transparent 60%);
}

::selection { background: rgba(34, 211, 238, .28); }

/* 滚动条 */
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--border); background-clip: content-box; }

/* ============================================================
   布局
   ============================================================ */
.app {
  position: relative;
  z-index: 1;
  color: var(--text);
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas:
    "topbar topbar"
    "sidebar main";
  height: 100dvh;
}

/* ---------- 顶栏 ---------- */
.topbar {
  grid-area: topbar;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-soft);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--text);
  font-weight: 650;
  letter-spacing: -.01em;
  font-size: 15px;
  padding-right: 6px;
  flex-shrink: 0;
}
.brand-mark {
  width: 26px; height: 26px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: 0 4px 14px -4px rgba(34, 211, 238, .6);
}
.brand-mark svg { width: 15px; height: 15px; fill: none; stroke: #05202a; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 460px;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 11px;
  width: 15px; height: 15px;
  fill: none; stroke: var(--text-3); stroke-width: 2;
  pointer-events: none;
}
.search-input {
  width: 100%;
  height: 36px;
  padding: 0 42px 0 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s;
}
.search-input::placeholder { color: var(--text-3); }
.search-input:focus {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}
.search-kbd {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1;
  color: var(--text-3);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 4px 6px;
  background: var(--surface-2);
  pointer-events: none;
  user-select: none;
}
.search-input:focus ~ .search-kbd { opacity: 0; }

.topbar-actions { display: flex; gap: 6px; margin-left: auto; }

.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background .16s, color .16s, border-color .16s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-soft); }
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

#themeToggle .ico-sun { display: none; }
html[data-theme="light"] #themeToggle .ico-sun { display: block; }
html[data-theme="light"] #themeToggle .ico-moon { display: none; }

.only-mobile { display: none; }

/* ---------- 侧栏 ---------- */
.sidebar {
  grid-area: sidebar;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-soft);
  padding: 12px 10px 10px;
  overflow-y: auto;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
}

.nav { display: flex; flex-direction: column; gap: 2px; }

.nav-group-title {
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 14px 10px 6px;
}
.nav-group-title:first-child { padding-top: 4px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .14s, color .14s, border-color .14s;
  position: relative;
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active {
  background: linear-gradient(100deg, color-mix(in srgb, var(--accent) 16%, var(--surface)), var(--surface));
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 32%, var(--border));
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -10px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 16px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(var(--accent), var(--accent-2));
}
.nav-ico {
  flex: 0 0 22px;
  height: 22px;
  border-radius: 6px;
  display: grid; place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  overflow: hidden;
}
.nav-item.active .nav-ico {
  background: color-mix(in srgb, var(--accent) 18%, var(--surface-2));
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border));
  color: var(--accent);
}
.nav-ico svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar-foot {
  margin-top: auto;
  padding: 12px 10px 4px;
  font-size: 11px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 7px;
}
.dot {
  width: 6px; height: 6px; border-radius: 99px;
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
  flex-shrink: 0;
}

/* ---------- 主区 ---------- */
.workspace {
  grid-area: main;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
}
.workspace-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 26px 26px 96px;
}

/* 页面头部 */
.page-head { margin-bottom: 20px; }
.page-title {
  color: var(--text);
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 680;
  letter-spacing: -.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-desc { margin: 0; color: var(--text-2); font-size: 13px; }
.page-tags { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

.tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  color: var(--text-3);
  font-family: var(--font-mono);
}

/* ---------- 卡片 / 面板 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-l);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.card.flush { padding: 0; overflow: hidden; }

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  min-height: 26px;
  flex-wrap: wrap;
  row-gap: 8px;
}
/* 卡头 / 按钮行内的下拉保持紧凑，不撑满整行 */
.card-head select,
.btn-row select {
  width: auto;
  min-width: 92px;
  height: 29px;
  padding: 0 9px;
  font-size: 12px;
  border-radius: 7px;
}
.card-head .btn-row { flex-wrap: nowrap; }
.card-title {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0;
}
.card-head .spacer { flex: 1; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 12px; }
.field:last-child { margin-bottom: 0; }
.field-label {
  display: block;
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 6px;
  font-weight: 500;
}

textarea, input[type="text"], input[type="number"], select {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: 10px 12px;
  outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
  resize: vertical;
}
textarea::placeholder, input::placeholder { color: var(--text-3); }
textarea:focus, input[type="text"]:focus, input[type="number"]:focus, select:focus {
  border-color: color-mix(in srgb, var(--accent) 52%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent);
  background: var(--surface);
}
textarea { min-height: 120px; }
textarea.tall { min-height: 240px; }
select { cursor: pointer; font-family: var(--font-sans); }
input[type="number"] { font-family: var(--font-mono); }

/* 复选框 / 开关行 */
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.chk {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  transition: all .15s var(--ease);
}
.chk:hover { border-color: var(--border); color: var(--text); background: var(--surface-3); }
.chk input { display: none; }
.chk .bullet {
  width: 5px; height: 5px; border-radius: 99px;
  background: var(--text-3);
  transition: all .15s;
}
.chk.on {
  background: color-mix(in srgb, var(--accent) 14%, var(--surface-2));
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  color: var(--text);
}
.chk.on .bullet { background: var(--accent); box-shadow: 0 0 7px var(--accent); }

/* ---------- 按钮 ---------- */
.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);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s var(--ease);
  user-select: none;
}
.btn:hover { background: var(--surface-3); border-color: var(--border); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.985); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.btn-primary {
  background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 88%, #fff 4%), var(--accent-2));
  border-color: transparent;
  color: #04141b;
  font-weight: 650;
  box-shadow: 0 6px 18px -8px rgba(34, 211, 238, .75);
}
.btn-primary:hover { filter: brightness(1.06); border-color: transparent; }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-sm { height: 27px; padding: 0 10px; font-size: 12px; border-radius: 7px; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-row .spacer { flex: 1; }

/* ---------- 输出区 ---------- */
.out {
  position: relative;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: 11px 13px;
  min-height: 52px;
  max-height: 460px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}
.out.empty { color: var(--text-3); font-family: var(--font-sans); font-style: normal; }
.out.err { border-color: color-mix(in srgb, var(--err) 45%, var(--border)); background: color-mix(in srgb, var(--err) 8%, var(--surface-2)); color: #ffd9d9; }
html[data-theme="light"] .out.err { color: #8a1a1a; }
.out.ok { border-color: color-mix(in srgb, var(--ok) 38%, var(--border)); }

/* 语法高亮（JSON） */
.tok-key { color: #7dd3fc; }
.tok-str { color: #86efac; }
.tok-num { color: #fca5a5; }
.tok-bool { color: #c4b5fd; }
.tok-null { color: #94a3b8; }
html[data-theme="light"] .tok-key { color: #0369a1; }
html[data-theme="light"] .tok-str { color: #15803d; }
html[data-theme="light"] .tok-num { color: #b91c1c; }
html[data-theme="light"] .tok-bool { color: #6d28d9; }

/* ---------- 网格 ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid2 > * { min-width: 0; }
.pair { display: flex; gap: 10px; align-items: flex-start; }
.pair > * { flex: 1; min-width: 0; }

/* ---------- 统计数字 ---------- */
.stats { display: flex; flex-wrap: wrap; gap: 10px; }
.stat {
  flex: 1 1 96px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-s);
  padding: 9px 12px;
}
.stat-num {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -.02em;
}
.stat-label { font-size: 11px; color: var(--text-3); margin-top: 1px; }

/* ---------- 结果列表 ---------- */
.list { display: flex; flex-direction: column; gap: 6px; }
.list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border-radius: var(--radius-s);
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  font-family: var(--font-mono);
  font-size: 12.5px;
  transition: border-color .14s, background .14s;
}
.list-item:hover { border-color: var(--border); background: var(--surface-3); }
.list-item .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .idx { color: var(--text-3); font-size: 10.5px; min-width: 20px; }

/* ---------- 空状态 ---------- */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-3);
  font-size: 13px;
}

/* ---------- toast ---------- */
.toast-stack {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 999;
  pointer-events: none;
  align-items: center;
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 10px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  box-shadow: var(--shadow);
  animation: toast-in .26s var(--ease);
  max-width: min(88vw, 460px);
}
.toast.leaving { animation: toast-out .2s var(--ease) forwards; }
.toast::before {
  content: "";
  width: 6px; height: 6px; border-radius: 99px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  flex-shrink: 0;
}
.toast.err::before { background: var(--err); box-shadow: 0 0 8px var(--err); }
.toast.ok::before { background: var(--ok); box-shadow: 0 0 8px var(--ok); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(8px) scale(.96); }
}

/* ---------- 工具专属：正则高亮 ---------- */
.regex-view {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.85;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: 12px;
  max-height: 380px;
  overflow: auto;
}
.regex-view mark {
  background: color-mix(in srgb, var(--accent) 32%, transparent);
  color: var(--text);
  border-radius: 3px;
  padding: 1px 0;
  outline: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}

/* ---------- 工具专属：颜色 ---------- */
.swatch-big {
  height: 108px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}
.swatch-big .hexbig {
  position: absolute;
  left: 12px; bottom: 10px;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 3px 9px;
  border-radius: 7px;
  background: rgba(0, 0, 0, .42);
  color: #fff;
  backdrop-filter: blur(6px);
}
.palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 7px; }
.palette .sw {
  height: 56px;
  border-radius: 9px;
  border: 1px solid var(--border-soft);
  cursor: pointer;
  position: relative;
  transition: transform .14s var(--ease);
}
.palette .sw:hover { transform: translateY(-2px) scale(1.02); }
.palette .sw span {
  position: absolute; bottom: 3px; left: 0; right: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 9px;
  color: rgba(255, 255, 255, .9);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .8);
}

/* ---------- 工具专属：图片 ---------- */
.img-preview {
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background:
    repeating-conic-gradient(var(--surface-2) 0% 25%, var(--surface) 0% 50%) 50% / 18px 18px;
  overflow: hidden;
  padding: 10px;
}
.img-preview img { max-width: 100%; max-height: 320px; display: block; border-radius: 6px; }

/* ---------- 工具专属：二维码 ---------- */
.qr-stage {
  display: grid;
  place-items: center;
  padding: 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 200px;
}
.qr-stage canvas, .qr-stage img, .qr-stage svg { display: block; border-radius: 6px; max-width: 100%; height: auto; }

/* ---------- 表格 ---------- */
table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  font-family: var(--font-mono);
}
table.tbl th, table.tbl td {
  text-align: left;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}
table.tbl th {
  color: var(--text-3);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-family: var(--font-sans);
}
table.tbl tr:last-child td { border-bottom: none; }
table.tbl td.mono { font-family: var(--font-mono); }

/* ---------- 首页 ---------- */
.hero { padding: 18px 0 26px; }
.hero h1 {
  color: var(--text);
  font-size: 30px;
  margin: 0 0 10px;
  letter-spacing: -.03em;
  font-weight: 700;
  line-height: 1.25;
}
.hero h1 .grad {
  background: linear-gradient(100deg, var(--accent), var(--accent-2) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p { color: var(--text-2); margin: 0 0 6px; font-size: 14px; max-width: 620px; }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
  gap: 12px;
}
.tool-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px;
  transition: all .18s var(--ease);
  position: relative;
  overflow: hidden;
}
.tool-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity .2s;
  background: radial-gradient(240px 120px at 50% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%);
  pointer-events: none;
}
.tool-card:hover {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border));
  transform: translateY(-2px);
  box-shadow: 0 12px 26px -16px rgba(0, 0, 0, .6);
}
.tool-card:hover::after { opacity: 1; }
.tool-card .tc-ico {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 10px;
}
.tool-card .tc-ico svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tool-card .tc-name { color: var(--text); font-weight: 600; font-size: 13.5px; margin-bottom: 3px; }
.tool-card .tc-desc { font-size: 11.5px; color: var(--text-3); line-height: 1.5; }

/* ---------- 移动端 ---------- */
.scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(2px);
  z-index: 40;
}
.scrim.on { display: block; }

@media (max-width: 860px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "topbar"
      "main";
  }
  .only-mobile { display: grid; }
  .brand-text { display: none; }

  .sidebar {
    position: fixed;
    top: var(--topbar-h);
    bottom: 0;
    left: 0;
    width: 268px;
    z-index: 50;
    background: var(--bg-2);
    transform: translateX(-102%);
    transition: transform .24s var(--ease);
    box-shadow: 24px 0 48px -24px rgba(0, 0, 0, .8);
  }
  .sidebar.open { transform: translateX(0); }

  .workspace-inner { padding: 18px 14px 72px; }
  .grid2 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 23px; }
  .search-kbd { display: none; }
  .page-title { font-size: 19px; }
}

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

/* 数字输入不撑满整行 */
.field input[type="number"] { max-width: 140px; }

/* 可点击的 tag（按钮形态，避免 javascript: 链接） */
button.tag-btn {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  font-family: var(--font-mono);
  line-height: 1.6;
  transition: color .14s var(--ease), border-color .14s var(--ease), background .14s var(--ease);
}
button.tag-btn:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-2));
}
