/* ClawPress 热搜 — 新闻纸 × 热搜榜
   排版：Fraunces（字标）/ Oswald（排名与热度数字）/ 系统中文栈
   主题：浅色纸面为主，暗色跟随系统 */

:root {
  color-scheme: light dark;
  --bg: light-dark(#f6f6f7, #101113);
  --surface: light-dark(#ffffff, #1a1b1f);
  --ink: light-dark(#1b1c1f, #f0f1f3);
  --ink-2: light-dark(#767b82, #a2a8b1);
  --line: light-dark(#e7e7ea, #2b2d33);
  --brand: light-dark(#d92c20, #ff5f52);
  --rank-1: light-dark(#e5484d, #ff6b62);
  --rank-2: light-dark(#f08c1e, #ffab3d);
  --rank-3: light-dark(#b8901a, #e7c440);
  --m-blue: light-dark(#2f6bd8, #8ab4ff);
  --m-blue-bg: light-dark(#eef4ff, #1d2b45);
  --m-green: light-dark(#1e9e54, #6fd99a);
  --m-green-bg: light-dark(#e9f9ef, #16301f);
  --m-purple: light-dark(#8a56d6, #c1a1f5);
  --m-purple-bg: light-dark(#f6efff, #2a2140);
  --badge-bao: var(--rank-1);
  --badge-re: var(--rank-2);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.5 -apple-system, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
}

/* ---------- 报头 ---------- */

.masthead {
  position: relative;
  max-width: 920px;
  margin: 0 auto;
  padding: 22px 20px 0;
}

.masthead-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
}

.theme-toggle {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.wordmark {
  font-family: "Fraunces", Georgia, serif;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--brand);
  text-decoration: none;
  font-variation-settings: "opsz" 60;
}

.wordmark span { color: var(--ink); }

.tagline {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--ink-2);
  letter-spacing: 0.02em;
}

.daynav-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding-bottom: 4px;
}

.daynav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.day-sub {
  font-size: 11px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  padding-right: 4px;
}

.theme-toggle:hover { border-color: var(--brand); color: var(--brand); }

.theme-toggle svg { width: 15px; height: 15px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle[data-mode="dark"] .icon-sun { display: block; }
.theme-toggle[data-mode="dark"] .icon-moon { display: none; }
/* data-mode="auto" 时按系统实际主题显示图标，由 JS 设置 */

.daynav-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.daynav-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.daynav-btn:disabled { opacity: 0.35; cursor: default; }

.day-label {
  min-width: 118px;
  text-align: center;
  font-family: "Oswald", "PingFang SC", sans-serif;
  font-size: 15px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}

.rule-double {
  border-top: 3px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  height: 6px;
}

/* ---------- 手机端模块 tabs ---------- */

.tabs {
  display: none;
  gap: 4px;
  padding: 8px 12px 0;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.tabs button {
  appearance: none;
  border: none;
  background: none;
  flex: 1 1 0;
  text-align: center;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  color: var(--ink-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tabs button[aria-selected="true"] {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 500;
}

/* ---------- 榜单三栏 ---------- */

.board {
  max-width: 920px;
  margin: 0 auto;
  padding: 6px 20px 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
}

.col { min-width: 0; }

.col-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  padding: 12px 2px 8px;
  font-size: 15px;
  font-weight: 500;
  border-bottom: 1px solid var(--line);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  align-self: center;
  flex: none;
}
.dot-model { background: var(--m-blue); }
.dot-tool { background: var(--m-green); }
.dot-industry { background: var(--m-purple); }

.col-sub {
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-2);
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line);
}

.item:last-child { border-bottom: none; }

.rank {
  flex: none;
  width: 20px;
  text-align: center;
  font-family: "Oswald", sans-serif;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}
.rank.r1 { color: var(--rank-1); }
.rank.r2 { color: var(--rank-2); }
.rank.r3 { color: var(--rank-3); }

.title {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
  line-height: 1.5;
}

.title:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }

.badge {
  flex: none;
  font-size: 11px;
  line-height: 1;
  padding: 3px 4px;
  border-radius: 4px;
}
.badge.b-bao { background: var(--badge-bao); color: #fff; }
.badge.b-re { background: var(--badge-re); color: #fff; }
.badge.b-xin { background: none; color: var(--m-blue); border: 1px solid var(--m-blue); }

.heat {
  flex: none;
  font-family: "Oswald", sans-serif;
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}

.board-empty {
  max-width: 920px;
  margin: 32px auto;
  padding: 0 20px;
  text-align: center;
  color: var(--ink-2);
}

/* ---------- 页脚 ---------- */

.foot {
  max-width: 920px;
  margin: 10px auto 0;
  padding: 14px 20px 26px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--ink-2);
  text-align: center;
}

.noscript {
  text-align: center;
  color: var(--ink-2);
  padding: 20px;
}

/* ---------- 摘要弹窗 ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 12, 16, 0.55);
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 80vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 22px 20px;
  box-shadow: light-dark(0 18px 48px rgba(15, 15, 20, 0.22), 0 18px 48px rgba(0, 0, 0, 0.55));
}

@media (prefers-reduced-motion: no-preference) {
  .modal-card { animation: pop 0.22s cubic-bezier(0.2, 0.7, 0.3, 1.05); }
  @keyframes pop {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: none; }
  }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover { color: var(--brand); border-color: var(--brand); }

.modal-meta {
  margin: 0 0 10px;
  font-size: 11px;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 28px;
}

.modal-title {
  margin: 0 0 10px;
  padding-right: 24px;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.45;
}

.modal-summary {
  margin: 0;
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink);
}

.modal-facts {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  margin: 16px 0;
  display: flex;
  gap: 10px 26px;
  flex-wrap: wrap;
}

.modal-facts .fact {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.modal-facts .fact-label {
  font-size: 11px;
  color: var(--ink-2);
}

.modal-facts .fact-value {
  font-size: 13px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

.modal-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 11px 16px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

.modal-link:hover { filter: brightness(1.08); }

/* ---------- 入场动画（仅首屏一次） ---------- */

@media (prefers-reduced-motion: no-preference) {
  .item {
    animation: rise 0.4s cubic-bezier(0.2, 0.7, 0.3, 1) both;
    animation-delay: calc(var(--i, 0) * 45ms);
  }
  @keyframes rise {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
  }
}

/* ---------- 响应式：手机端 tab 切换 ---------- */

@media (max-width: 719px) {
  .masthead { padding-top: 16px; }
  .masthead-row { flex-direction: column; align-items: stretch; }
  .daynav-wrap { align-items: center; padding-bottom: 10px; }
  .theme-toggle { top: 14px; right: 16px; }
  .wordmark { font-size: 26px; text-align: center; display: block; }
  .tagline { text-align: center; }

  .tabs { display: flex; }

  .board { grid-template-columns: 1fr; padding-top: 0; }
  .col { display: none; }
  .board[data-active="model"] .col[data-module="model"],
  .board[data-active="tool"] .col[data-module="tool"],
  .board[data-active="industry"] .col[data-module="industry"] { display: block; }

  .title { font-size: 14.5px; }
}
