/* ============================================================
   公益网站合集 · 设计系统 v3「工作台」
   index.html 与 auto.html 共用
   ============================================================ */

:root {
  color-scheme: light;

  --bg: #f6f5f2;
  --dot: rgba(23, 22, 26, 0.055);
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --border: #e8e5df;
  --border-strong: #d9d5cd;

  --text: #17161a;
  --muted: #6a675f;
  --quiet: #9c988f;

  --green: #178a54;
  --green-soft: #e7f4ec;
  --blue: #2b62d6;
  --blue-soft: #e9effc;
  --violet: #6d4bd8;
  --violet-soft: #efeafb;
  --amber: #a9701a;
  --amber-soft: #fbf1dc;

  --ink: #17161a;
  --on-ink: #ffffff;

  --radius: 12px;
  --radius-sm: 8px;
  --pill: 999px;

  --shadow-1: 0 1px 2px rgba(23, 22, 26, 0.05);
  --shadow-2: 0 10px 26px rgba(23, 22, 26, 0.09);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "SF Mono", "DM Mono", Consolas, "Roboto Mono", ui-monospace, monospace;
}

[data-theme="dark"] {
  color-scheme: dark;

  --bg: #121215;
  --dot: rgba(255, 255, 255, 0.05);
  --surface: #1a1a1f;
  --surface-2: #202027;
  --border: #2b2b32;
  --border-strong: #3d3d46;

  --text: #f1f0ec;
  --muted: #a5a29c;
  --quiet: #7b7873;

  --green: #4ade94;
  --green-soft: #14291f;
  --blue: #82a8ff;
  --blue-soft: #151f36;
  --violet: #b6a2ff;
  --violet-soft: #1f1a34;
  --amber: #f0b45c;
  --amber-soft: #2e2415;

  --ink: #f1f0ec;
  --on-ink: #17161a;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 12px 30px rgba(0, 0, 0, 0.5);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: -1px -1px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
ul, ol { list-style: none; }

.shell { width: min(1240px, calc(100% - 40px)); margin: 0 auto; }

/* ============ 顶栏 ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 58px;
}

.brand { display: inline-flex; align-items: center; gap: 9px; flex: 0 0 auto; }

.brand-mark {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-size: 13px;
}

.brand-name { font-size: 14.5px; font-weight: 700; letter-spacing: -0.01em; }
.brand-name em { font-style: normal; color: var(--muted); font-weight: 500; }

.topnav { display: flex; align-items: center; gap: 4px; margin-left: auto; }

.topnav a, .topnav button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--pill);
  background: transparent;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.topnav a:hover, .topnav button:hover {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.topnav a.is-current {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
  font-weight: 650;
}

.topnav .cta {
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 650;
}
.topnav .cta:hover { background: var(--ink); color: var(--on-ink); opacity: 0.86; }

/* ============ 主体两栏 ============ */
.layout {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: 30px;
  align-items: start;
  padding: 30px 0 56px;
  flex: 1;
}

.rail {
  position: sticky;
  top: 82px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--quiet);
}

.panel-body { padding: 12px 14px; }

/* 搜索 */
.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 12px;
  height: 40px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.search:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
  background: var(--surface);
}

.search svg { width: 15px; height: 15px; flex: 0 0 15px; fill: none; stroke: var(--quiet); stroke-width: 2; }
.search:focus-within svg { stroke: var(--green); }

.search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 13px; }
.search input::placeholder { color: var(--quiet); }

.search kbd {
  flex: 0 0 auto;
  padding: 1px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 11px;
}

.search-clear {
  display: none;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: var(--border);
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.search-clear:hover { background: var(--border-strong); color: var(--text); }
.search.has-value .search-clear { display: grid; place-items: center; }
.search.has-value kbd { display: none; }

/* 筛选列表 */
.filters { display: flex; flex-direction: column; gap: 2px; }

.filter {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: all 0.14s ease;
}

.filter:hover { background: var(--surface-2); color: var(--text); }

.filter .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 7px; opacity: 0.55; }
.filter[data-filter="bigtech"] .dot { color: var(--blue); opacity: 1; }
.filter[data-filter="relay"] .dot { color: var(--green); opacity: 1; }
.filter[data-filter="auto"] .dot { color: var(--violet); opacity: 1; }
.filter[data-filter="week"] .dot { color: var(--green); opacity: 1; }
.filter[data-filter="older"] .dot { color: var(--quiet); opacity: 1; }

.filter .cnt {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--quiet);
}

.filter.is-active { background: var(--ink); color: var(--on-ink); font-weight: 650; }
.filter.is-active .cnt { color: var(--on-ink); opacity: 0.72; }
.filter.is-active .dot { opacity: 1; }

/* 侧栏信息块 */
.rail-note { font-size: 12px; color: var(--muted); line-height: 1.7; }
.rail-note b { color: var(--text); font-weight: 600; }
.rail-note code {
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 11px;
}

.rail-list { display: flex; flex-direction: column; gap: 9px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.rail-list li { position: relative; padding-left: 15px; }
.rail-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
}
.rail-list b { color: var(--text); font-weight: 600; }
.rail-list code {
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 10.5px;
}

/* ============ 主内容 ============ */
.main { min-width: 0; display: flex; flex-direction: column; gap: 22px; }

.hero { display: flex; flex-direction: column; gap: 10px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--quiet);
}

.eyebrow::before { content: ""; width: 18px; height: 1.5px; background: var(--green); border-radius: 2px; }

.hero h1 {
  font-size: clamp(24px, 3.4vw, 32px);
  font-weight: 750;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.lede { max-width: 62ch; color: var(--muted); font-size: 13.5px; line-height: 1.75; }
.lede strong { color: var(--text); font-weight: 600; }
.lede .accent { color: var(--violet); font-weight: 600; }

.link-inline {
  color: var(--green);
  font-weight: 600;
  border-bottom: 1px solid color-mix(in srgb, var(--green) 35%, transparent);
  transition: border-color 0.15s ease;
}
.link-inline:hover { border-color: var(--green); }

/* 统计 */
.stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

.stat {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.stat .num { font-family: var(--mono); font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.stat .lbl { font-size: 11.5px; color: var(--muted); }
.stat.is-green .num { color: var(--green); }
.stat.is-blue .num { color: var(--blue); }
.stat.is-violet .num { color: var(--violet); }
.stat.is-amber .num { color: var(--amber); }

/* 推广卡片 */
.promos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

.promo {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.promo:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.promo-amber:hover { border-color: var(--amber); }
.promo-violet:hover { border-color: var(--violet); }

.promo-icon {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 18px;
}
.promo-amber .promo-icon { background: var(--amber-soft); }
.promo-violet .promo-icon { background: var(--violet-soft); }

.promo-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.promo-body strong { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.promo-body small { font-size: 12px; color: var(--muted); line-height: 1.55; }

.promo-arrow { flex: 0 0 auto; color: var(--quiet); font-size: 17px; transition: transform 0.18s ease, color 0.18s ease; }
.promo:hover .promo-arrow { transform: translateX(3px); }
.promo-amber:hover .promo-arrow { color: var(--amber); }
.promo-violet:hover .promo-arrow { color: var(--violet); }

/* 区块标题 */
.section { display: flex; flex-direction: column; gap: 12px; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.section-head h2 { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.section-head .meta { margin-left: auto; font-family: var(--mono); font-size: 11.5px; color: var(--quiet); }

/* 模型官网 chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--pill);
  font-size: 12.5px;
  font-weight: 550;
  transition: all 0.15s ease;
}

.chip:hover { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.chip span { font-family: var(--mono); font-size: 10.5px; color: var(--quiet); }
.chip:hover span { color: inherit; opacity: 0.75; }

/* 结果条 */
.resultbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--muted);
}

.resultbar .big { font-family: var(--mono); font-size: 20px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.resultbar .hint { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--quiet); }

/* ============ 卡片网格 ============ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 13px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 15px 17px 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--border-strong); }

.card-head { display: flex; align-items: center; gap: 8px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--pill);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.badge-bigtech { color: var(--blue); background: var(--blue-soft); }
.badge-relay { color: var(--green); background: var(--green-soft); }
.badge-auto { color: var(--violet); background: var(--violet-soft); }

.stamp {
  margin-left: auto;
  padding: 2px 8px;
  border: 1px solid color-mix(in srgb, var(--amber) 32%, transparent);
  border-radius: var(--pill);
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.card-title { font-size: 14.5px; font-weight: 680; letter-spacing: -0.012em; line-height: 1.4; }

.card-desc {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.65;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.card-domain {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--quiet);
}

.go {
  margin-left: auto;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--pill);
  background: var(--surface-2);
  font-size: 11.5px;
  font-weight: 650;
  transition: all 0.16s ease;
}

.go:hover { background: var(--green); border-color: var(--green); color: #fff; }

.card--auto { border-style: dashed; }
.card--auto .go:hover { background: var(--violet); border-color: var(--violet); }

.card-date { font-family: var(--mono); font-size: 10.5px; color: var(--quiet); white-space: nowrap; }

/* 搜索高亮 */
mark { background: color-mix(in srgb, var(--amber) 30%, transparent); color: inherit; padding: 0 2px; border-radius: 3px; }

/* 空状态 */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 56px 24px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}
.empty .ico { font-size: 26px; line-height: 1; }
.empty strong { font-size: 14px; }
.empty p { font-size: 12.5px; color: var(--muted); }

/* 同步状态条 */
.syncbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 11px 15px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--violet);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--muted);
}

.syncbar b { font-family: var(--mono); color: var(--text); font-weight: 700; }
.syncbar .tail { margin-left: auto; font-size: 11px; color: var(--quiet); }

.pulse {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--violet);
  animation: pulse 2.6s ease-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--violet) 45%, transparent); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ============ 页脚 ============ */
.footer { border-top: 1px solid var(--border); background: var(--surface); }

.footer-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 0;
  font-size: 11.5px;
  color: var(--quiet);
}

.footer-brand { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-weight: 650; }
.footer-brand i { font-style: normal; color: var(--green); }
.footer-inner p { flex: 1 1 260px; }
.footer-time { margin-left: auto; font-family: var(--mono); white-space: nowrap; }

/* ============ 响应式 ============ */
@media (max-width: 980px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 22px; }
  .rail { position: static; }
  .filters { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .filter { width: auto; padding: 7px 12px; border: 1px solid var(--border); background: var(--surface); }
  .filter .cnt { margin-left: 4px; }
  .panel-body:has(.filters) { display: flex; gap: 6px; flex-wrap: wrap; }
}

@media (max-width: 640px) {
  .shell { width: calc(100% - 28px); }
  .topbar-inner { height: 54px; gap: 10px; }
  .brand-name em { display: none; }
  .promos { grid-template-columns: minmax(0, 1fr); }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .topnav a:not(.cta) { display: none; }
  .resultbar .hint { display: none; }
  .syncbar .tail { margin-left: 0; width: 100%; }
}