/* ==========================================================================
   陈涛的导航 · 样式
   主题：data-theme="light|dark" 挂在 <html> 上，CSS 变量驱动
   ========================================================================== */

:root {
  --bg: #f4f6fb;
  --bg-glow-a: rgba(59, 130, 246, 0.14);
  --bg-glow-b: rgba(139, 92, 246, 0.12);
  --bg-glow-c: rgba(16, 185, 129, 0.10);
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #ffffff;
  --card: #ffffff;
  --card-hover: #fbfcff;
  --text: #17203a;
  --text-2: #5d6578;
  --text-3: #8a93a8;
  --border: #e3e8f2;
  --border-strong: #d3dae8;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.10);
  --accent-2: #8b5cf6;
  --danger: #ef4444;
  --ok: #10b981;
  --shadow-sm: 0 1px 2px rgba(23, 32, 58, 0.05), 0 2px 8px rgba(23, 32, 58, 0.05);
  --shadow-md: 0 2px 6px rgba(23, 32, 58, 0.07), 0 12px 32px rgba(23, 32, 58, 0.09);
  --radius: 14px;
  --radius-sm: 10px;
  --header-h: 58px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: "SF Mono", "Cascadia Code", Consolas, "Courier New", monospace;
}

html[data-theme="dark"] {
  --bg: #0b0f1c;
  --bg-glow-a: rgba(59, 130, 246, 0.20);
  --bg-glow-b: rgba(139, 92, 246, 0.16);
  --bg-glow-c: rgba(16, 185, 129, 0.12);
  --surface: rgba(17, 24, 40, 0.82);
  --surface-solid: #111827;
  --card: #141b2e;
  --card-hover: #1a2340;
  --text: #e9edf6;
  --text-2: #a3aec5;
  --text-3: #6b7690;
  --border: #232d47;
  --border-strong: #33415f;
  --accent: #5b9bff;
  --accent-soft: rgba(91, 155, 255, 0.14);
  --accent-2: #a78bfa;
  --danger: #f87171;
  --ok: #34d399;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.4);
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  transition: background 0.35s ease, color 0.35s ease;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent-soft); }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
input, select { font-family: inherit; }

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

/* ---------- 背景装饰 ---------- */
.bg-decor {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
}
.blob-a { width: 520px; height: 520px; top: -180px; left: -120px; background: var(--bg-glow-a); }
.blob-b { width: 460px; height: 460px; top: -140px; right: -100px; background: var(--bg-glow-b); }
.blob-c { width: 420px; height: 420px; bottom: -160px; left: 38%; background: var(--bg-glow-c); }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16.5px; letter-spacing: 0.2px; }
.brand-logo { border-radius: 8px; box-shadow: var(--shadow-sm); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 9px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
}
.btn-primary:hover { color: #fff; box-shadow: 0 6px 18px rgba(59, 130, 246, 0.35); }

.btn-ghost { background: transparent; }
.btn-dashed {
  width: 100%;
  justify-content: center;
  border-style: dashed;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
}
.btn-dashed:hover { color: var(--accent); }

.btn.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
}

.btn-mini {
  padding: 4px 10px;
  font-size: 12.5px;
  border-radius: 7px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text-2);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, transform 0.15s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }

.icon-sun { display: none; }
html[data-theme="dark"] .icon-sun { display: block; }
html[data-theme="dark"] .icon-moon { display: none; }

/* ---------- Hero 区 ---------- */
.hero {
  max-width: 860px;
  margin: 0 auto;
  padding: 52px 20px 30px;
  text-align: center;
}

.clock { margin-bottom: 26px; }
.clock-time {
  font-size: clamp(44px, 7vw, 62px);
  font-weight: 800;
  letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--text) 30%, var(--accent) 75%, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.clock-meta {
  margin-top: 8px;
  font-size: 14.5px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.clock-meta .dot { color: var(--text-3); }

/* ---------- 搜索 ---------- */
.search { max-width: 640px; margin: 0 auto; }

.engine-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 12px;
}
.engine-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-2);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.engine-chip img { width: 14px; height: 14px; border-radius: 3px; }
.engine-chip:hover { border-color: var(--accent); color: var(--accent); }
.engine-chip.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 6px 6px 6px 18px;
  box-shadow: var(--shadow-md);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-md);
}
.search-icon { color: var(--text-3); flex: none; }
.search-box input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  color: var(--text);
  height: 38px;
}
.search-box input::placeholder { color: var(--text-3); }
.search-box .btn-primary { border-radius: 999px; padding: 9px 22px; flex: none; }

/* ---------- 主体布局 ---------- */
.layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 20px 60px;
  display: grid;
  grid-template-columns: 208px 1fr;
  gap: 26px;
  align-items: start;
}

.sidebar { position: sticky; top: calc(var(--header-h) + 18px); }
.sidebar-inner { display: flex; flex-direction: column; gap: 14px; }

.side-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  color: var(--text-3);
  transition: border-color 0.2s;
}
.side-search:focus-within { border-color: var(--accent); }
.side-search input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  color: var(--text);
  width: 100%;
  min-width: 0;
}
.side-search input::placeholder { color: var(--text-3); }

.cat-nav { display: flex; flex-direction: column; gap: 2px; }
.cat-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 14px;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cat-nav-item:hover { background: var(--accent-soft); color: var(--accent); }
.cat-nav-item.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.cat-nav-item .cat-emoji { font-size: 15px; width: 20px; text-align: center; flex: none; }
.cat-nav-item .cat-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-3);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
  font-variant-numeric: tabular-nums;
}
.cat-nav-item.is-active .cat-count { border-color: var(--accent); color: var(--accent); }

/* 编辑态：侧栏分类排序（行包裹 + 拖拽手柄 + 上下移按钮） */
.cat-nav-row { display: flex; align-items: center; gap: 4px; min-width: 0; }
.cat-nav-row .cat-nav-item { flex: 1; min-width: 0; }
.cat-grip {
  flex: none;
  font-size: 10px;
  letter-spacing: -2px;
  color: var(--text-3);
  cursor: grab;
  padding: 0 2px;
  user-select: none;
}
body.editing .cat-nav-item { cursor: grab; }
.cat-nav-item.dragging { opacity: 0.45; }
.cat-nav-item.drop-before { box-shadow: inset 0 2px 0 0 var(--accent); }
.cat-nav-item.drop-after { box-shadow: inset 0 -2px 0 0 var(--accent); }
.cat-nav-ops { display: flex; gap: 3px; flex: none; }
.cat-nav-ops button {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  color: var(--text-2);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.cat-nav-ops button:hover { color: var(--accent); border-color: var(--accent); }

.side-manage { border-top: 1px dashed var(--border-strong); padding-top: 12px; }
.side-manage-title { font-size: 12px; color: var(--text-3); margin-bottom: 8px; }

/* ---------- 内容区 ---------- */
.content { display: flex; flex-direction: column; gap: 30px; min-width: 0; }

.cat-section { scroll-margin-top: calc(var(--header-h) + 20px); }
.cat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.cat-head .cat-emoji { font-size: 19px; }
.cat-head h2 { font-size: 18px; font-weight: 700; letter-spacing: 0.2px; }
.cat-head .cat-count { font-size: 12.5px; color: var(--text-3); font-weight: 400; }
.cat-head .cat-ops { margin-left: auto; display: flex; gap: 6px; }

.cat-ops .icon-btn { width: 30px; height: 30px; border-radius: 8px; font-size: 13px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
  gap: 14px;
}

/* ---------- 链接卡片 ---------- */
.card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  min-width: 0;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
  background: var(--card-hover);
}

.icon {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
}
.icon .letter {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--surface-solid);
}

.card .info { min-width: 0; flex: 1; }
.card .name {
  font-size: 14.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card .name .ext { color: var(--text-3); font-size: 11px; flex: none; }
.card:hover .name .ext { color: var(--accent); }
.card .desc {
  font-size: 12.5px;
  color: var(--text-2);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card .host { font-size: 11px; color: var(--text-3); margin-top: 3px; font-family: var(--mono); }

.card .card-ops {
  position: absolute;
  top: 7px;
  right: 7px;
  display: none;
  gap: 5px;
}
body.editing .card .card-ops { display: flex; }
.card-ops button {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  color: var(--text-2);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.card-ops button:hover { color: var(--accent); border-color: var(--accent); }
.card-ops button.danger:hover { color: var(--danger); border-color: var(--danger); }

/* 卡片星标（设为常用）：始终可见，编辑态下为左侧 ops 按钮让位 */
.card-star {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 7px;
  background: none;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  color: var(--text-3);
  opacity: 0.5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  z-index: 2;
}
.card-star:hover { opacity: 1; color: #f5a623; transform: scale(1.18); }
.card-star.on { color: #f5a623; opacity: 1; }
body.editing .card .card-ops { right: 38px; }

/* 移动分类弹窗 */
.move-cat-list { display: flex; flex-direction: column; gap: 8px; }
.move-cat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text);
  text-align: left;
  transition: all 0.15s;
}
.move-cat-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.move-emoji { font-size: 15px; flex: none; }
.move-name { flex: 1; font-weight: 500; }
.move-count { font-size: 11.5px; color: var(--text-3); font-family: var(--mono); flex: none; }
.move-new-cat { width: 100%; justify-content: center; margin-top: 12px; }

/* 弹窗内的勾选行（设为常用） */
.field-check { flex-direction: row; align-items: center; gap: 9px; cursor: pointer; }
.field-check input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; flex: none; }

.cat-add-link { display: none; }
body.editing .cat-add-link { display: inline-flex; }

/* 编辑态拖拽排序 */
body.editing .card { cursor: grab; }
.card.dragging { opacity: 0.45; }
.card.drop-before { box-shadow: var(--shadow-md), -3px 0 0 0 var(--accent); }
.card.drop-after { box-shadow: var(--shadow-md), 3px 0 0 0 var(--accent); }

/* 空状态 */
.empty {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 30px 16px;
  text-align: center;
  color: var(--text-3);
  font-size: 13.5px;
}

/* ---------- 页脚 ---------- */
.footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-3);
  flex-wrap: wrap;
}
.footer-sep { opacity: 0.6; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 14, 28, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.18s ease;
}
.modal-mask[hidden] { display: none; }

.modal {
  width: 440px;
  max-width: 100%;
  max-height: 90vh;
  overflow: auto;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  animation: popIn 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.modal-sm { width: 380px; }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 16px; font-weight: 700; }
.modal-head .icon-btn { width: 30px; height: 30px; font-size: 12px; border: none; background: transparent; }

.modal-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 13px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.field-label em { color: var(--danger); font-style: normal; }
.field input, .field select {
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
.field input:focus, .field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding-top: 4px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%) translateY(16px);
  z-index: 200;
  background: var(--surface-solid);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--ok);
  box-shadow: var(--shadow-md);
  border-radius: 11px;
  padding: 10px 18px;
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: min(92vw, 480px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-left-color: var(--danger); }

/* ---------- 登录验证页 ---------- */
#app[hidden] { display: none; }

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-gate[hidden] { display: none; }

.auth-card {
  width: 100%;
  max-width: 372px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-md);
  padding: 40px 34px 30px;
  text-align: center;
  animation: popIn 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.auth-card.shake { animation: shake 0.35s ease; }

.auth-logo {
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 22px rgba(59, 130, 246, 0.32);
}
.auth-title { font-size: 21px; font-weight: 800; letter-spacing: 0.3px; margin-bottom: 24px; }

.auth-field { position: relative; display: block; margin-bottom: 13px; text-align: left; }
.auth-field .auth-ico {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: 0.55;
  pointer-events: none;
  line-height: 1;
}
.auth-field input {
  width: 100%;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  border-radius: 11px;
  padding: 11px 42px 11px 38px;
  font-size: 14.5px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-field input::placeholder { color: var(--text-3); }

.auth-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  padding: 6px;
  border-radius: 8px;
  color: var(--text-3);
  line-height: 1;
}
.auth-eye:hover { color: var(--accent); }

.auth-error {
  margin: 0 0 10px;
  font-size: 12.5px;
  color: var(--danger);
  text-align: left;
  min-height: 17px;
}
.auth-error[hidden] { display: none; }

.auth-hint {
  margin: 0 0 12px;
  font-size: 12.5px;
  color: var(--text-2);
  text-align: left;
  line-height: 1.6;
}
.auth-hint[hidden] { display: none; }

.auth-submit { width: 100%; justify-content: center; padding: 10px; font-size: 14.5px; margin-top: 2px; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

/* ---------- 动画 ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn {
  from { opacity: 0; transform: scale(0.94) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; gap: 18px; padding-top: 4px; }
  .sidebar { position: sticky; top: var(--header-h); z-index: 40; padding: 10px 0; background: var(--bg); }
  .side-search { display: none; }
  .cat-nav {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .cat-nav::-webkit-scrollbar { display: none; }
  .cat-nav-item { white-space: nowrap; flex: none; }
  .cat-nav-row { flex: none; }
  .cat-nav-row .cat-nav-item { flex: none; }
  .side-manage { border-top: none; padding-top: 0; }
  .side-manage .btn-dashed { width: auto; flex: none; }
  .side-manage { display: flex; align-items: center; gap: 10px; }
  .side-manage-title { margin-bottom: 0; white-space: nowrap; }
}

@media (max-width: 560px) {
  .hero { padding: 34px 16px 22px; }
  .layout { padding: 4px 14px 46px; }
  .topbar-inner { padding: 0 14px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 11px; }
  .card { flex-direction: column; align-items: flex-start; gap: 9px; padding: 13px; }
  .card .info { width: 100%; }
  .card .host { display: none; }
  .search-box .btn-primary { padding: 9px 14px; }
  .brand-name { font-size: 15px; }
  /* 窄屏顶栏按钮只留图标，避免溢出 */
  .topbar-actions { gap: 6px; }
  .topbar-actions .btn-ghost { padding: 7px 9px; }
  .topbar-actions .btn-ghost span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
