/* 热点工作台 —— 白底 / 黑灰红，2026-11-16 UI 重做
 * 设计约束：只用黑、灰、红；圆角与阴影只做体积感，不做花哨。
 */
:root {
  /* 浅色（默认） */
  --bg: #fbfbfa;
  --surface: #ffffff;
  --surface-2: #f5f5f3;
  --ink: #111111;
  --ink-2: #5f5f5c;
  --ink-3: #8f8f8b;
  --line: #e8e8e4;
  --line-2: #d6d6d1;
  --accent: #c92a1e;
  --accent-weak: #fdf1ef;
  --black: #111111;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-1: 0 1px 2px rgba(17, 17, 17, .05);
  --shadow-2: 0 2px 6px rgba(17, 17, 17, .06), 0 12px 32px -18px rgba(17, 17, 17, .25);
  --logo-bg: #111111;
  --logo-fg: #ffffff;
  --logo-bar: #c92a1e;
}

html[data-theme="dark"] {
  --bg: #0e0e0e;
  --surface: #171717;
  --surface-2: #1f1f1f;
  --ink: #ededed;
  --ink-2: #a8a8a4;
  --ink-3: #7c7c78;
  --line: #2b2b2b;
  --line-2: #3a3a3a;
  --accent: #e2564a;
  --accent-weak: #2a1715;
  --black: #ededed;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, .45), 0 12px 32px -18px rgba(0, 0, 0, .8);
  --logo-bg: #ededed;
  --logo-fg: #0e0e0e;
  --logo-bar: #e2564a;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 44px) 48px;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.65 -apple-system, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "tnum" 1;
}

::selection { background: var(--accent); color: #fff; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  padding: 14px 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.logo { flex: none; width: 44px; height: 44px; display: block; border-radius: 8px; box-shadow: var(--shadow-1); }
.logo .logo-bg { fill: var(--logo-bg); }
.logo .logo-fg { fill: var(--logo-fg); }
.logo .logo-bar { fill: var(--logo-bar); }
.brand-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.brand h1 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: .2px; line-height: 1.2; }
.brand .sub { color: var(--ink-3); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; }

.top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.clock { color: var(--ink-3); font-size: 12.5px; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.interval .select { font-size: 12px; padding: 5px 8px; }

/* ---------------- 按钮 / 表单 ---------------- */
.btn {
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  padding: 7px 15px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 13px; font-family: inherit; font-weight: 500;
  transition: background .15s, border-color .15s, color .15s, transform .06s;
  box-shadow: var(--shadow-1);
}
.btn:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--black); border-color: var(--black); color: var(--bg); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.small { padding: 4px 11px; font-size: 12px; }

input[type="search"], input[type="text"], input[type="url"], .select {
  font-family: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 10px 13px; font-size: 14.5px;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, .select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
}
.select { padding: 6px 9px; font-size: 13px; cursor: pointer; }

/* ---------------- 状态横幅 ---------------- */
.banner {
  margin: 16px 0 0; padding: 11px 16px; border-radius: var(--radius-sm);
  font-size: 13px; line-height: 1.6;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); box-shadow: var(--shadow-1);
}
.banner.ok { border-left: 3px solid var(--black); }
.banner.bad { border-left: 3px solid var(--accent); background: var(--accent-weak); color: var(--ink); }
.banner a { color: var(--accent); font-weight: 600; }

/* ---------------- 网格与卡片 ---------------- */
.grid {
  display: grid; gap: 16px; margin-top: 18px;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 18px 20px 22px;
  min-width: 0;
  transition: box-shadow .2s, border-color .2s;
}
.card:hover { box-shadow: var(--shadow-2); border-color: var(--line-2); }
.card.span-2 { grid-column: 1 / -1; }

.card h2 {
  margin: 0; font-size: 11.5px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.card-head .tag { margin: 0; }
/* 直接子级 h2（没有 .card-head 包裹的卡片）留出呼吸感 */
.card > h2 { margin-bottom: 12px; }

/* ---------------- 查资料（搜索引擎那一块） ---------------- */
.search {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin: 2px 0 14px;
}
.search input[type="search"] {
  flex: 1 1 260px; min-width: 0;
  padding: 12px 15px; font-size: 15px;
}
.search .btn { flex: none; }
.engines {
  display: flex; flex-wrap: wrap; gap: 6px 10px;
  color: var(--ink-2); font-size: 13px;
}
.engines label {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.engines label:hover { background: var(--surface-2); border-color: var(--line); }
.engines input { accent-color: var(--accent); margin: 0; }

/* 标签 */
.tag {
  font-size: 10.5px; font-weight: 600; letter-spacing: .06em;
  padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-3);
  white-space: nowrap;
}
.tag.live { color: var(--accent); border-color: var(--accent-weak); background: var(--accent-weak); }
.tag.jump { color: var(--ink-3); }

/* ---------------- 统一查询 ---------------- */
.query-form { display: flex; flex-direction: column; gap: 12px; margin-bottom: 4px; }
.query-form .row { display: flex; gap: 10px; align-items: center; }
.query-form .row.wrap { flex-wrap: wrap; gap: 10px 18px; }
.query-form input[type="search"] { flex: 1; min-width: 0; padding: 13px 16px; font-size: 15.5px; }
.query-form .label {
  font-size: 10.5px; font-weight: 700; color: var(--ink-3);
  letter-spacing: .14em; text-transform: uppercase; margin-right: 2px;
}
.chk {
  font-size: 13px; display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; color: var(--ink-2);
  padding: 3px 9px; border-radius: 999px; border: 1px solid transparent;
  transition: background .15s, border-color .15s;
}
.chk:hover { background: var(--surface-2); border-color: var(--line); }
.chk input { accent-color: var(--accent); }

.results { display: flex; flex-direction: column; gap: 20px; margin-top: 14px; }
.result-group .group-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding-bottom: 6px; margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
  font-size: 11.5px; color: var(--ink-3);
}
.result-group .group-head .name { color: var(--ink); font-size: 13px; font-weight: 600; }
.results .empty { color: var(--ink-3); font-size: 13px; padding: 8px 0; }
.results .err { color: var(--accent); font-size: 13px; padding: 8px 0; }
.results .meta-line { color: var(--ink-3); font-size: 12px; }

/* ---------------- 列表 ---------------- */
.list { display: flex; flex-direction: column; max-height: 452px; overflow: auto; margin: 0 -6px; padding: 0 6px; }
.list::-webkit-scrollbar { width: 8px; }
.list::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; }
.list.loading, .list.error { color: var(--ink-3); font-size: 13px; padding: 8px 0; }
.list.error {
  color: var(--ink-2); background: var(--accent-weak);
  border-left: 3px solid var(--accent); border-radius: 6px;
  padding: 12px 14px; line-height: 1.65;
}
.list.error a { color: var(--accent); font-weight: 600; }

.item {
  display: flex; gap: 11px; align-items: baseline;
  padding: 9px 8px; margin: 0 -8px;
  border-radius: 8px; text-decoration: none; color: inherit;
  border-bottom: 1px solid var(--line);
  transition: background .12s, transform .12s;
}
.item:last-child { border-bottom: none; }
.item:hover { background: var(--surface-2); transform: translateX(2px); }
.item .idx {
  flex: none; width: 20px; text-align: right;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums;
}
.item .body { flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.item .title { display: block; font-size: 14px; line-height: 1.5; transition: color .12s; }
.item:hover .title { color: var(--accent); }
.item .meta {
  display: block; margin-top: 3px; font-size: 11.5px; color: var(--ink-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.item .go {
  flex: none; font-size: 11px; font-family: inherit; color: var(--ink-3);
  border: 1px solid var(--line-2); background: var(--surface); border-radius: 6px;
  padding: 1px 7px; cursor: pointer; opacity: 0;
  transition: opacity .12s, color .12s, border-color .12s;
}
.item:hover .go { opacity: 1; }
.item .go:hover { color: var(--accent); border-color: var(--accent); }
@media (hover: none) { .item .go { opacity: 1; } }

/* ---------------- 链接块 ---------------- */
.links { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.links a, .links .site {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; min-width: 0;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink-2);
  text-decoration: none; font-size: 13px;
  transition: border-color .15s, color .15s, background .15s;
}
.links a:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-weak); }
.links .site span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.links .del {
  flex: none; border: none; background: transparent; color: var(--ink-3);
  cursor: pointer; font-size: 15px; padding: 0 2px; font-family: inherit; line-height: 1;
}
.links .del:hover { color: var(--accent); }

/* ---------------- 表单 ---------------- */
.add-form { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.add-form input { flex: 1 1 130px; min-width: 0; padding: 8px 10px; font-size: 13px; }
.hidden { display: none !important; }

/* ---------------- 记忆面板 ---------------- */
.mem-info { font-size: 12.5px; color: var(--ink-2); margin-bottom: 12px; }
.mem-info dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; }
.mem-info dt { color: var(--ink-3); }
.mem-info dd { margin: 0; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mem-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.mem-upload { display: inline-flex; align-items: center; cursor: pointer; }

.hint { color: var(--ink-3); font-size: 12px; margin: 10px 0 0; line-height: 1.6; }
.hint code, .mem-info code, .foot code {
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 1px 5px; border-radius: 4px; font-size: 11px; color: var(--ink-2);
}

/* 骨架屏 */
.skel { display: flex; flex-direction: column; gap: 14px; padding: 6px 0; }
.skel i {
  display: block; height: 12px; border-radius: 4px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
.skel i:nth-child(2) { width: 82%; }
.skel i:nth-child(3) { width: 64%; }
.skel i:nth-child(4) { width: 76%; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ---------------- 页脚 ---------------- */
.foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 22px; padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--ink-3); font-size: 12px;
}
.foot a { color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--line-2); }
.foot a:hover { color: var(--accent); border-color: var(--accent); }
.countdown { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.countdown.live { color: var(--accent); font-weight: 600; }

/* ---------------- file:// 启动引导（见 app.js） ---------------- */
.boot {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 22px;
  padding: 40px 20px; text-align: center;
}
.boot .big-h { width: clamp(96px, 16vw, 150px); height: auto; border-radius: 12px; box-shadow: var(--shadow-2); }
.boot h1 { margin: 0; font-size: clamp(21px, 3vw, 28px); letter-spacing: .2px; }
.boot p { margin: 0; color: var(--ink-2); font-size: 14px; max-width: 560px; line-height: 1.75; }
.boot .steps {
  text-align: left; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-1);
  padding: 16px 20px; font-size: 13.5px; color: var(--ink-2); max-width: 560px; width: 100%;
}
.boot .steps code {
  display: block; margin: 6px 0 12px; padding: 8px 11px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px;
  font-size: 12.5px; color: var(--ink); white-space: pre-wrap; word-break: break-all;
}
.boot .steps code:last-child { margin-bottom: 0; }
.boot .actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.boot .status { color: var(--ink-3); font-size: 12.5px; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 620px) {
  .grid { grid-template-columns: 1fr; }
  .card { padding: 16px 16px 18px; }
  .brand h1 { font-size: 16px; }
  .logo { width: 38px; height: 38px; }
  .clock { display: none; }
  .item .go { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
