/* ═══════════════════════════════════════════════════════════
   DevKits Web · 深空霓虹 Glassmorphism 设计系统
   底色 #0A1628 · 主强调 #00D4AA · 辅助 #38BDF8 / #8B5CF6
   ═══════════════════════════════════════════════════════════ */

:root {
  /* 背景层级 */
  --bg0: #06090F;
  --bg1: #0A1628;
  --bg2: #0D1B30;
  --bg3: #12233C;
  --glass: rgba(255, 255, 255, 0.045);
  --glass-strong: rgba(255, 255, 255, 0.07);

  /* 边框 / 文字 */
  --bd: rgba(148, 178, 220, 0.14);
  --bd2: rgba(148, 178, 220, 0.26);
  --tx: #E6EDF7;
  --tx2: #93A3BD;
  --tx3: #7A8CA8;

  /* 强调色 */
  --acc1: #00D4AA;
  --acc2: #38BDF8;
  --acc3: #8B5CF6;
  --warn: #FFCB6B;
  --danger: #FB7185;
  --grad: linear-gradient(135deg, #00D4AA 0%, #38BDF8 100%);
  --grad2: linear-gradient(135deg, #38BDF8 0%, #8B5CF6 100%);
  --glow: 0 0 18px rgba(0, 212, 170, 0.35);
  --glow-cyan: 0 0 18px rgba(56, 189, 248, 0.30);

  /* 代码高亮 */
  --c-kw: #C792EA;
  --c-type: #82AAFF;
  --c-str: #00E5A8;
  --c-num: #F78C6C;
  --c-cmt: #6E83A5;
  --c-tag: #FFCB6B;
  --c-fn: #82AAFF;

  /* 圆角 / 阴影 */
  --r: 8px;
  --r2: 12px;
  --r3: 16px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);

  --font: 'Inter', -apple-system, 'PingFang SC', 'HarmonyOS Sans SC', 'Microsoft YaHei', sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }

body {
  font-family: var(--font);
  font-size: 13px;
  color: var(--tx);
  background: var(--bg0);
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(0, 212, 170, 0.28); color: #fff; }

/* ══════════ 背景装饰 ══════════ */
.bg-decor { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 20%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 20%, #000 30%, transparent 75%);
}
.orb {
  position: absolute; border-radius: 50%;
  opacity: 0.55;
  /* 背景本身是 radial-gradient 渐变(自带柔边), 不再叠加 filter blur(110px)
     该 blur 配合无限动画会让渲染线程每帧重采样, CPU/GPU 飙升 */
  will-change: transform;
}
.orb-1 { width: 520px; height: 520px; left: -140px; top: -160px; background: radial-gradient(circle, rgba(0, 212, 170, 0.34), transparent 65%); animation: drift1 90s ease-in-out infinite alternate; }
.orb-2 { width: 560px; height: 560px; right: -180px; top: 12%; background: radial-gradient(circle, rgba(56, 189, 248, 0.26), transparent 65%); animation: drift2 110s ease-in-out infinite alternate; }
.orb-3 { width: 460px; height: 460px; left: 32%; bottom: -220px; background: radial-gradient(circle, rgba(139, 92, 246, 0.22), transparent 65%); animation: drift3 120s ease-in-out infinite alternate; }
.noise {
  position: absolute; inset: 0; opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

@keyframes drift1 { to { transform: translate(90px, 70px) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-100px, 60px) scale(1.1); } }
@keyframes drift3 { to { transform: translate(60px, -70px) scale(1.18); } }

/* ══════════ 应用骨架 ══════════ */
.app { position: relative; z-index: 1; display: flex; flex-direction: column; height: 100vh; padding: 12px; gap: 12px; }

.glass {
  background: linear-gradient(180deg, var(--glass-strong), var(--glass));
  border: 1px solid var(--bd);
  /* blur 半径 18→8px: 玻璃质感视觉几乎不变, 渲染开销大降 */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}

/* ══════════ 顶栏 ══════════ */
.topbar {
  display: flex; align-items: center; gap: 20px;
  padding: 10px 18px; border-radius: var(--r3);
  flex-shrink: 0;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo { flex-shrink: 0; filter: drop-shadow(0 0 10px rgba(0, 212, 170, 0.45)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name {
  font-size: 17px; font-weight: 800; letter-spacing: 0.3px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-sub { font-size: 10.5px; color: var(--tx3); letter-spacing: 1px; }

.badge-local {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: 8px; padding: 3px 10px;
  font-size: 10.5px; color: var(--acc1);
  background: rgba(0, 212, 170, 0.10);
  border: 1px solid rgba(0, 212, 170, 0.28);
  border-radius: 999px; white-space: nowrap;
}

.pulse-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--acc1); flex-shrink: 0;
  animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 212, 170, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(0, 212, 170, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 212, 170, 0); }
}

.topbar-search {
  flex: 1; max-width: 380px;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; margin-left: auto;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--bd); border-radius: 999px;
  color: var(--tx3); transition: all .2s;
}
.topbar-search:focus-within { border-color: rgba(0, 212, 170, 0.5); box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.12); color: var(--acc1); }
.topbar-search input {
  flex: 1; min-width: 0; border: none; outline: none; background: none;
  font-family: var(--font); font-size: 12.5px; color: var(--tx);
}
.topbar-search input::placeholder { color: var(--tx3); }
kbd {
  font-family: var(--mono); font-size: 10.5px; color: var(--tx3);
  padding: 2px 6px; border: 1px solid var(--bd2); border-bottom-width: 2px;
  border-radius: 5px; background: rgba(255, 255, 255, 0.04); white-space: nowrap;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: var(--r);
  border: 1px solid var(--bd); background: rgba(255, 255, 255, 0.04);
  color: var(--tx2); cursor: pointer; transition: all .18s;
}
.icon-btn:hover { color: var(--acc1); border-color: rgba(0, 212, 170, 0.4); background: rgba(0, 212, 170, 0.08); box-shadow: var(--glow); }

/* ══════════ 按钮 ══════════ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; border: 1px solid transparent; border-radius: var(--r);
  font-family: var(--font); font-size: 12.5px; font-weight: 600;
  cursor: pointer; transition: all .18s; white-space: nowrap;
}
.btn-primary {
  background: var(--grad); color: #04121A;
  box-shadow: 0 2px 14px rgba(0, 212, 170, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 22px rgba(0, 212, 170, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.04); color: var(--tx2); border-color: var(--bd);
}
.btn-ghost:hover { color: var(--tx); background: var(--glass-strong); border-color: var(--bd2); }

/* ══════════ 布局 ══════════ */
.layout { flex: 1; display: flex; gap: 12px; min-height: 0; }

/* ── 侧边栏 ── */
.sidebar {
  width: 232px; min-width: 232px;
  display: flex; flex-direction: column;
  border-radius: var(--r3); overflow: hidden;
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.sidebar-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; font-size: 10.5px; color: var(--tx3);
  border-top: 1px solid var(--bd);
}

.cat-header {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border: none; background: none; border-radius: var(--r);
  color: var(--tx2); font-family: var(--font); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all .18s;
}
.cat-header:hover { background: rgba(255, 255, 255, 0.05); color: var(--tx); }
.cat-icon {
  width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; border-radius: 7px; flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--bd);
  transition: all .2s;
}
.cat-header:hover .cat-icon { background: rgba(0, 212, 170, 0.12); border-color: rgba(0, 212, 170, 0.35); box-shadow: var(--glow); }
.cat-name { flex: 1; text-align: left; }
.cat-count {
  font-family: var(--mono); font-size: 10.5px; color: var(--tx3);
  padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.06);
}
.cat-arrow { width: 14px; color: var(--tx3); transition: transform .25s; }
.cat.open .cat-arrow { transform: rotate(90deg); color: var(--acc1); }

.cat-tools { overflow-y: auto; max-height: 0; transition: max-height .3s ease; }
.cat.open .cat-tools { max-height: 560px; }

.tool-item {
  width: 100%; display: flex; align-items: center; gap: 9px;
  padding: 7px 10px 7px 16px; margin: 1px 0;
  border: none; background: none; border-radius: var(--r);
  color: var(--tx2); font-family: var(--font); font-size: 11.8px;
  cursor: pointer; text-align: left; transition: all .18s;
  position: relative;
}
.tool-item::before {
  content: ''; position: absolute; left: 6px; top: 50%; transform: translateY(-50%) scaleY(0);
  width: 2.5px; height: 14px; border-radius: 2px;
  background: var(--grad); box-shadow: var(--glow); transition: transform .2s;
}
.tool-item:hover { color: var(--tx); background: rgba(255, 255, 255, 0.05); }
.tool-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(0, 212, 170, 0.16), rgba(56, 189, 248, 0.07));
  border: 1px solid rgba(0, 212, 170, 0.28);
  font-weight: 500;
}
.tool-item.active::before { transform: translateY(-50%) scaleY(1); }
.tool-item .t-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--tx3); flex-shrink: 0; transition: all .2s; }
.tool-item.active .t-dot { background: var(--acc1); box-shadow: 0 0 8px var(--acc1); }

/* 搜索过滤时隐藏 */
.tool-item.hidden, .cat.hidden { display: none; }

/* ── 主内容 ── */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; border-radius: var(--r3); overflow: hidden; background: rgba(10, 22, 40, 0.55); }

.tool-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 20px; border-bottom: 1px solid var(--bd);
  flex-shrink: 0; position: relative;
}
.tool-header::after {
  content: ''; position: absolute; left: 20px; right: 20px; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, rgba(0, 212, 170, 0.6), transparent 40%);
}
.tool-title-wrap { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tool-crumb { font-size: 10.5px; color: var(--tx3); letter-spacing: 0.5px; }
.tool-title {
  font-size: 17px; font-weight: 700; color: var(--tx);
  background: linear-gradient(120deg, #fff, #BFE8DD 60%, #7FD4F5);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tool-actions { display: none; } /* 清空/复制/执行已内嵌面板，顶栏隐藏 */

/* ── 面板区 ── */
.tool-panels { flex: 1; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.panel { display: none; flex: 1; flex-direction: column; min-height: 0; padding: 14px 20px; gap: 12px; animation: panelIn .28s ease; }
.panel.active { display: flex; }
@keyframes panelIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── 配置行 ── */
.config-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  padding: 10px 14px; flex-shrink: 0;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--bd); border-radius: var(--r2);
}
.config-group { display: flex; align-items: center; gap: 7px; }
.config-label { font-size: 11px; color: var(--tx3); font-weight: 500; white-space: nowrap; }
.chip {
  padding: 4px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--bd); background: rgba(255, 255, 255, 0.04);
  font-family: var(--font); font-size: 11.5px; color: var(--tx2);
  transition: all .18s; appearance: none;
}
.chip:hover { color: var(--tx); border-color: var(--bd2); }
.chip:focus { outline: none; border-color: rgba(0, 212, 170, 0.5); box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1); }
.config-group select.chip {
  padding-right: 26px; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%237A8CA8' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}
.chip-input { min-width: 90px; padding: 4px 12px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--tx2); cursor: pointer; user-select: none; }
.check input { accent-color: var(--acc1); width: 13px; height: 13px; cursor: pointer; }

/* ── 代码分栏 ── */
.code-grid { flex: 1; display: flex; gap: 12px; min-height: 0; }
.pane {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  background: rgba(7, 13, 25, 0.75);
  border: 1px solid var(--bd); border-radius: var(--r2); overflow: hidden;
  transition: border-color .2s;
}
.pane:hover { border-color: var(--bd2); }
.pane-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 14px; flex-shrink: 0;
  background: rgba(255, 255, 255, 0.035);
  border-bottom: 1px solid var(--bd);
  font-size: 11px; font-weight: 600; color: var(--tx2); letter-spacing: 0.3px;
}
.pane-head .pane-tag { font-family: var(--mono); font-size: 10.5px; color: var(--acc1); }
.pane-meta { font-family: var(--mono); font-size: 10.5px; color: var(--tx3); font-weight: 400; }
.mini-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; font-size: 10.5px; font-family: var(--font);
  color: var(--tx2); background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--bd); border-radius: 6px; cursor: pointer; transition: all .15s;
}
.mini-btn:hover { color: var(--acc1); border-color: rgba(0, 212, 170, 0.4); }

.pane-body { flex: 1; overflow: auto; min-height: 0; position: relative; }
.code {
  font-family: var(--mono); font-size: 12px; line-height: 1.75;
  padding: 12px 16px; white-space: pre; color: #D5E0F0; tab-size: 2;
}
.code-with-gutter { display: flex; padding: 0; }
.gutter {
  position: sticky; left: 0; z-index: 1;
  flex-shrink: 0; text-align: right; padding: 12px 10px 12px 14px;
  font-family: var(--mono); font-size: 12px; line-height: 1.75;
  color: #3A4E6E; user-select: none; border-right: 1px solid rgba(148, 178, 220, 0.10);
  background: rgba(10, 19, 34, 0.98);
}

/* 代码高亮 */
.c-kw { color: var(--c-kw); }
.c-key { color: var(--c-tag); }
.d-add { color: #00E5A8; }
.d-del { color: #FB7185; }
.c-type { color: var(--c-type); }
.c-str { color: var(--c-str); }
.c-num { color: var(--c-num); }
.c-cmt { color: var(--c-cmt); font-style: italic; }
.c-tag { color: var(--c-tag); }
.c-fn { color: var(--c-fn); }
.c-p { color: #7A8BA6; }

/* ── 文本输入输出（dual / triple） ── */
.io-grid { flex: 1; display: flex; gap: 12px; min-height: 0; }
.io-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; background: rgba(7, 13, 25, 0.75); border: 1px solid var(--bd); border-radius: var(--r2); overflow: hidden; transition: border-color .2s; }
.io-pane:hover { border-color: var(--bd2); }
.io-pane textarea, .io-output {
  flex: 1; width: 100%; min-height: 0; padding: 12px 14px;
  border: none; outline: none; resize: none;
  font-family: var(--mono); font-size: 12px; line-height: 1.7;
  color: var(--tx); background: transparent;
}
.io-pane textarea::placeholder { color: #3C4C66; }
.io-output { overflow: auto; white-space: pre-wrap; word-break: break-word; color: #BFE8DD; }
.io-output .plain { color: #D5E0F0; }

/* ── 中间操作按钮列（dual-io） ── */
.io-actions {
  flex: 0 0 auto; display: flex; flex-direction: column; justify-content: center;
  align-items: center; gap: 10px; padding: 0 4px;
}
.io-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; width: 86px; height: 58px; padding: 0;
  border-radius: 12px;
}
.io-btn.btn-ghost {
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--bd);
  color: var(--tx2);
}
.io-btn.btn-ghost:hover {
  border-color: rgba(0, 212, 170, 0.4);
  color: var(--acc1);
  background: rgba(0, 212, 170, 0.08);
  box-shadow: var(--glow);
}
.io-btn.btn-primary { box-shadow: 0 2px 14px rgba(0, 212, 170, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.io-btn span { font-size: 11.5px; line-height: 1; }

/* ── 生成面板 ── */
.gen-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; }
.gen-result {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: rgba(7, 13, 25, 0.75); border: 1px solid var(--bd);
  border-radius: var(--r3); padding: 30px; min-height: 220px;
}
.gen-value {
  font-family: var(--mono); font-size: 26px; font-weight: 600; letter-spacing: 1px;
  background: var(--grad2); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 14px rgba(56, 189, 248, 0.35));
  word-break: break-all; text-align: center; max-width: 100%;
}
.gen-hint { font-size: 11px; color: var(--tx3); }
.gen-actions { display: flex; gap: 8px; }

/* 横排按钮（生成面板 / 图片面板使用） */
.io-actions--row {
  flex-direction: row; justify-content: center; padding: 2px 0;
}
.io-actions--row .io-btn { width: 92px; height: 44px; flex-direction: row; gap: 6px; }
.io-actions--row .io-btn span { font-size: 12.5px; }

/* ── 图片结果区 ── */
.img-result {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: rgba(7, 13, 25, 0.75); border: 1px solid var(--bd);
  border-radius: var(--r3); padding: 24px; min-height: 260px;
}
.img-result img {
  max-width: 100%; max-height: 300px; border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}
.img-meta { font-family: var(--mono); font-size: 12px; color: var(--tx2); }

/* ── 特殊面板（图片） ── */
.dropzone {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  border: 1.5px dashed rgba(0, 212, 170, 0.35); border-radius: var(--r3);
  background: rgba(0, 212, 170, 0.035); cursor: pointer;
  transition: all .2s; min-height: 260px; text-align: center; padding: 30px;
}
.dropzone:hover { border-color: var(--acc1); background: rgba(0, 212, 170, 0.07); box-shadow: inset 0 0 40px rgba(0, 212, 170, 0.05), var(--glow); }
.dropzone-icon {
  width: 64px; height: 64px; display: flex; align-items: center; justify-content: center;
  border-radius: 18px; background: rgba(0, 212, 170, 0.10);
  border: 1px solid rgba(0, 212, 170, 0.3); color: var(--acc1);
  animation: floatY 3.2s ease-in-out infinite;
}
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.dropzone-title { font-size: 15px; font-weight: 600; color: var(--tx); }
.dropzone-sub { font-size: 11.5px; color: var(--tx3); }
.dropzone-tags { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.tag-chip { font-size: 10.5px; color: var(--tx2); padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--bd); }

/* ── 状态栏 ── */
.status-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 20px; font-size: 11px; color: var(--tx3);
  border-top: 1px solid var(--bd); flex-shrink: 0;
}
.status-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.status-right { font-size: 10.5px; white-space: nowrap; }
.icp-link { color: var(--tx3); text-decoration: none; transition: color .2s; }
.icp-link:hover { color: var(--acc1); text-decoration: underline; }
.mono { font-family: var(--mono); }

/* ══════════ Toast ══════════ */
.toast-container { position: fixed; top: 76px; right: 24px; z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--r2);
  font-size: 12.5px; font-weight: 500; color: var(--tx);
  background: rgba(13, 27, 48, 0.92);
  border: 1px solid rgba(0, 212, 170, 0.35);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45), 0 0 20px rgba(0, 212, 170, 0.12);
  backdrop-filter: blur(14px);
  animation: toastIn .25s ease;
}
.toast.err { border-color: rgba(251, 113, 133, 0.45); }
.toast.out { animation: toastOut .3s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(24px); } }

/* ══════════ 滚动条 ══════════ */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148, 178, 220, 0.22); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 212, 170, 0.45); }

/* ══════════ 响应式 ══════════ */
@media (max-width: 980px) {
  .sidebar { width: 190px; min-width: 190px; }
  .badge-local, .brand-sub { display: none; }
}

/* ══════════ 用户区 / 认证弹窗 / 热度榜 ══════════ */
.user-area { display: flex; align-items: center; gap: 8px; }
.user-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px; cursor: pointer;
  font-size: 12px; color: var(--tx);
  background: rgba(0, 212, 170, 0.10);
  border: 1px solid rgba(0, 212, 170, 0.28);
  transition: all .18s; white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis;
}
.user-chip:hover { box-shadow: var(--glow); }
.auth-btn { font-size: 12px; padding: 5px 12px; }

.auth-mask {
  position: fixed; inset: 0; z-index: 1000;
  display: none; align-items: center; justify-content: center;
  background: rgba(4, 8, 16, 0.72);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: maskIn .2s ease;
}
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }
.auth-modal {
  position: relative; width: 360px; max-width: 92vw;
  padding: 28px 30px 24px; border-radius: var(--r3);
  background: linear-gradient(180deg, rgba(19, 33, 55, 0.97), rgba(10, 22, 40, 0.98));
  border: 1px solid var(--bd2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55), 0 0 40px rgba(0, 212, 170, 0.08);
  animation: modalIn .25s ease;
}
.auth-modal-sm { width: 420px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
.auth-close {
  position: absolute; top: 12px; right: 14px;
  width: 28px; height: 28px; border-radius: 8px;
  border: 1px solid var(--bd); background: rgba(255, 255, 255, 0.04);
  color: var(--tx3); cursor: pointer; transition: all .15s;
}
.auth-close:hover { color: var(--danger); border-color: rgba(251, 113, 133, 0.4); }
.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.auth-brand {
  font-size: 18px; font-weight: 800; letter-spacing: 0.3px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.auth-tabs { display: flex; gap: 6px; margin-bottom: 16px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--bd); border-radius: 10px; padding: 4px; }
.auth-tab {
  flex: 1; padding: 7px 0; border: none; border-radius: 7px;
  background: none; color: var(--tx3); font-family: var(--font); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .18s;
}
.auth-tab.active { background: rgba(0, 212, 170, 0.14); color: var(--acc1); box-shadow: inset 0 0 0 1px rgba(0, 212, 170, 0.3); }
.auth-input {
  width: 100%; padding: 10px 14px; margin-bottom: 10px;
  border-radius: 10px; border: 1px solid var(--bd);
  background: rgba(255, 255, 255, 0.05); color: var(--tx);
  font-family: var(--font); font-size: 13px; outline: none; transition: all .18s;
}
.auth-input:focus { border-color: rgba(0, 212, 170, 0.5); box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.12); }
.auth-input::placeholder { color: var(--tx3); }
/* 授权码输入行：输入框 + 发送按钮并排 */
.auth-code-row { display: flex; gap: 8px; margin-bottom: 10px; }
.auth-code-row .auth-code-input { flex: 1; margin-bottom: 0; }
.auth-send {
  flex-shrink: 0; padding: 0 14px; white-space: nowrap;
  border-radius: 10px; font-size: 12.5px;
}
.auth-send:disabled { opacity: 0.6; cursor: wait; }
.auth-err { min-height: 18px; font-size: 12px; color: var(--danger); margin-bottom: 4px; }
.auth-submit { width: 100%; justify-content: center; padding: 10px 0; font-size: 14px; }
.auth-submit:disabled { opacity: 0.6; cursor: wait; }

/* 我的使用统计 */
.mine-title { font-size: 15px; font-weight: 700; color: var(--tx); margin-bottom: 14px; }
.mine-empty { color: var(--tx3); font-size: 13px; text-align: center; padding: 24px 0; }
.mine-list { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; }
.mine-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.04); }
.mine-rank { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; font-family: var(--mono); font-size: 11px; color: var(--tx3); background: rgba(255, 255, 255, 0.06); }
.mine-name { flex: 1; font-size: 13px; color: var(--tx); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mine-count { font-family: var(--mono); font-size: 12px; color: var(--acc1); }

/* 首页热度榜 */
.rank-panel { margin-top: 14px; }
.rank-panel-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.rank-panel-head .rp-title { font-size: 14px; font-weight: 700; color: var(--tx); }
.rank-panel-head .rp-sub { font-size: 11px; color: var(--tx3); }
.rank-list { display: flex; flex-direction: column; gap: 6px; }
.rank-item {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px;
  border-radius: 10px; cursor: pointer; background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent; transition: all .18s;
}
.rank-item:hover { background: rgba(0, 212, 170, 0.07); border-color: rgba(0, 212, 170, 0.25); }
.rank-no { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; font-family: var(--mono); font-size: 11px; color: var(--tx3); background: rgba(255, 255, 255, 0.06); flex-shrink: 0; }
.rank-no.top { background: rgba(0, 212, 170, 0.16); color: var(--acc1); }
.rank-name { flex: 1; font-size: 13px; color: var(--tx); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rank-bar { flex: 0 0 120px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.rank-fill { display: block; height: 100%; border-radius: 3px; background: var(--grad); box-shadow: 0 0 8px rgba(0, 212, 170, 0.4); transition: width .6s ease; }
.rank-count { font-family: var(--mono); font-size: 12px; color: var(--acc1); flex-shrink: 0; }
.rank-empty { color: var(--tx3); font-size: 12.5px; padding: 18px 0; text-align: center; }

/* 工具卡片热度徽标 */
.tool-card .heat-badge {
  position: absolute; top: 10px; right: 10px;
  font-family: var(--mono); font-size: 10.5px; color: var(--acc1);
  background: rgba(0, 212, 170, 0.12); border: 1px solid rgba(0, 212, 170, 0.3);
  padding: 1px 7px; border-radius: 999px;
}
.tool-card { position: relative; }

/* UUID 多值网格（两个一行） */
.uuid-grid { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 100%; }
.uuid-cell {
  flex: 0 0 calc(50% - 5px); min-width: 260px;
  font-family: var(--mono); font-size: 16px; color: var(--tx);
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--bd);
  border-radius: 10px; padding: 10px 14px; text-align: center;
  word-break: break-all; transition: border-color .18s;
}
.uuid-cell:hover { border-color: rgba(0, 212, 170, 0.4); }

