:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --well: #e9ecf1;
  --ink: #12161d;
  --ink-2: #3f4753;
  --ink-3: #7b8592;
  --line: #dfe3ea;
  --accent: #2b50d8;
  --accent-soft: #e4e9ff;
  --key-face: #fbfcfe;
  --key-edge: #c3c9d4;
  --shadow: 0 1px 2px rgba(16, 22, 32, .07), 0 6px 16px rgba(16, 22, 32, .06);
  --shadow-hi: 0 2px 4px rgba(16, 22, 32, .10), 0 12px 26px rgba(16, 22, 32, .12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116;
    --panel: #171b22;
    --well: #10141a;
    --ink: #e9edf4;
    --ink-2: #b3bcc9;
    --ink-3: #7c8695;
    --line: #262c36;
    --accent: #79a2ff;
    --accent-soft: #1c2740;
    --key-face: #222834;
    --key-edge: #0c0f14;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 6px 16px rgba(0, 0, 0, .35);
    --shadow-hi: 0 2px 4px rgba(0, 0, 0, .55), 0 12px 26px rgba(0, 0, 0, .45);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }

/* ---- top bar ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); }
.brand-mark {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .04em;
}
.brand-sub { font-size: 12px; font-weight: 500; color: var(--ink-3); }

.nav { display: flex; gap: 6px; }
.nav-link {
  padding: 7px 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
}
.nav-link:hover { background: var(--accent-soft); color: var(--accent); }
.nav-link.on { background: var(--accent); color: #fff; }

/* ---- layout ---- */
.wrap { max-width: 880px; margin: 0 auto; padding: 20px 18px 8px; }
.page-h { font-size: 20px; font-weight: 700; margin: 4px 0 16px; }

/* ---- status well (inset, not a button) ---- */
.well {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  margin-bottom: 18px;
  background: var(--well);
  border-radius: 14px;
  box-shadow: inset 0 1px 3px rgba(12, 17, 25, .12), inset 0 0 0 1px var(--line);
}
.well-grid { display: flex; flex-wrap: wrap; gap: 22px; }
.stat { display: flex; flex-direction: column; min-width: 108px; }
.stat-k { font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--ink-3); }
.stat-v { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-n { font-size: 11px; font-weight: 500; color: var(--ink-3); }

.well-act { display: flex; align-items: center; gap: 12px; }
.lock { font-size: 12px; font-weight: 500; color: var(--ink-3); }

/* ---- keycap button ---- */
.keycap {
  appearance: none;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  padding: 9px 18px;
  border: 1px solid var(--key-edge);
  border-radius: 11px;
  background: linear-gradient(180deg, var(--key-face), color-mix(in srgb, var(--key-face) 70%, var(--bg)));
  box-shadow: 0 2px 0 var(--key-edge), var(--shadow);
  cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease, opacity .2s ease;
}
.keycap:hover:not(:disabled) { color: var(--accent); }
.keycap:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 0 0 var(--key-edge); }
.keycap:disabled {
  cursor: not-allowed;
  color: var(--ink-3);
  background: var(--well);
  border-color: var(--line);
  box-shadow: inset 0 1px 2px rgba(12, 17, 25, .14);
  transform: none;
}
.keycap.busy { color: var(--accent); }

.readout {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  min-width: 130px;
}
.readout.hot { color: var(--accent); }

.note { font-size: 12px; color: var(--ink-3); margin: -8px 0 14px; }

/* ---- list ---- */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

.card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: var(--shadow);
}

.rank {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
  min-width: 22px;
}
.card-body { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 0; }
.card-title {
  font-size: 16.5px; font-weight: 600; line-height: 1.45; letter-spacing: .01em;
  color: var(--ink); text-decoration: none; align-self: flex-start;
}
.card-title:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.card-title:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.card-brief { font-size: 13.5px; font-weight: 400; line-height: 1.62; color: var(--ink-2); }
.card-why { font-size: 13px; font-weight: 400; line-height: 1.6; color: var(--ink-2); }
.why-k {
  font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: .04em;
  color: var(--accent); background: var(--accent-soft);
  border-radius: 5px; padding: 2px 6px; margin-right: 7px;
}
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 2px; }

.chip {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
}
.t-proj { background: #e6f5ea; color: #1c7a37; }
.t-model { background: #fdeef2; color: #b5305e; }
.t-tip { background: #fff3e0; color: #9a5b12; }
.t-paper { background: #eaf0ff; color: #2b50d8; }
.t-news { background: #eceff4; color: #4b5563; }

.host, .metric, .age { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.metric, .host { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }

/* 原文链接：做成键帽样子，明确"这才是可点的那一条" */
.card-link {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  align-self: stretch; margin-top: 4px; padding: 7px 10px;
  font-size: 12.5px; color: var(--ink-2); text-decoration: none;
  background: var(--key-face); border: 1px solid var(--line); border-radius: 9px;
  box-shadow: 0 1px 0 var(--key-edge);
  transition: transform .1s ease, border-color .1s ease, color .1s ease, box-shadow .1s ease;
}
.card-link:hover {
  transform: translateY(-1px); border-color: var(--accent); color: var(--accent);
  box-shadow: 0 1px 0 var(--accent);
}
.card-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.link-url {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
.go { font-size: 12px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; color: var(--ink-3); }
.card-link:hover .go { color: var(--accent); }

.back { margin: 18px 0 4px; font-size: 13px; font-weight: 500; }
.back a { color: var(--accent); text-decoration: none; }
.back a:hover { text-decoration: underline; }

.empty {
  padding: 26px 20px;
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--ink-2);
}
.empty h2 { margin: 0 0 8px; font-size: 16px; font-weight: 700; }

/* ---- archive ---- */
.archive { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.archive-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 11px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
}
.archive-row:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.a-date { font-weight: 600; font-variant-numeric: tabular-nums; }
.a-kind, .a-count, .a-mode { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.a-flag {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 6px;
}

.foot {
  max-width: 880px;
  margin: 0 auto;
  padding: 18px;
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-3);
}
.foot-sep { margin: 0 6px; }

@media (max-width: 620px) {
  .topbar { padding: 12px 14px; }
  .wrap { padding: 14px 12px 4px; }
  .well { flex-direction: column; align-items: stretch; }
  .well-act { justify-content: space-between; }
  .card { padding: 12px 13px; gap: 10px; }
  .card-title { font-size: 15.5px; }
  .card-brief { font-size: 13px; }
  .card-link { font-size: 12px; }
}
