/* ============================================================
   AI 趋势雷达 · Claude.ai 风格（暖色奶油底 / 衬线标题 / 陶土点缀）
   ============================================================ */

:root {
  --bg: #faf9f5;
  --bg-soft: #f4f2ec;
  --surface: #ffffff;
  --surface-hover: #fdfcfa;
  --border: #e7e4db;
  --border-soft: #efede5;
  --text: #1f1e1d;
  --text-dim: #6c6a63;
  --text-faint: #9b978e;
  --accent: #d97757;
  --accent-strong: #c15f3c;
  --accent-ink: #a84d2d;
  --accent-soft: rgba(217, 119, 87, 0.10);
  --hot: #c15f3c;
  --up: #4e8c6a;
  --warn: #b58a2e;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(31, 30, 29, 0.04), 0 10px 28px rgba(31, 30, 29, 0.06);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Noto Serif SC", "Songti SC", serif;
  --sans: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(720px 420px at 12% -10%, rgba(217, 119, 87, 0.07), transparent 62%),
    radial-gradient(760px 440px at 90% -12%, rgba(190, 170, 130, 0.10), transparent 60%),
    radial-gradient(900px 500px at 50% 115%, rgba(217, 119, 87, 0.05), transparent 60%);
}

/* ---------- Header ---------- */
.hero {
  max-width: 1280px;
  margin: 0 auto;
  padding: 34px 24px 0;
}

.hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 16px; }

.logo {
  width: 54px; height: 54px;
  display: grid; place-items: center;
  font-size: 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(31, 30, 29, 0.05);
}

.brand-text h1 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.1px;
  color: var(--text);
}

.brand-text p { color: var(--text-dim); font-size: 14px; margin-top: 2px; }

.hero-right { display: flex; align-items: center; gap: 14px; }

.status {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(31, 30, 29, 0.04);
}

.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--warn);
}
.status.synced .status-dot { background: var(--up); }
.status.offline .status-dot { background: var(--text-faint); }
.status.loading .status-dot { background: var(--accent); animation: pulse 1s infinite; }

@keyframes pulse { 50% { opacity: 0.3; } }

.btn {
  font: inherit; cursor: pointer;
  background: var(--accent);
  color: #fff; border: none;
  padding: 9px 18px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 2px rgba(31, 30, 29, 0.08);
}
.btn:hover { background: var(--accent-strong); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(193, 95, 60, 0.25); }
.btn:disabled { opacity: 0.55; cursor: wait; transform: none; }

/* ---------- Tabs ---------- */
.tabs {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-top: 28px;
  border-bottom: 1px solid var(--border);
}

.tab {
  font: inherit; cursor: pointer;
  background: transparent; color: var(--text-dim);
  border: none; border-bottom: 2px solid transparent;
  padding: 12px 18px; font-size: 14.5px; font-weight: 600;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  border-radius: 10px 10px 0 0;
}
.tab:hover { color: var(--text); background: var(--bg-soft); }
.tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
  background: linear-gradient(180deg, var(--accent-soft), transparent);
}

/* ---------- Layout ---------- */
.container { max-width: 1280px; margin: 0 auto; padding: 26px 24px 30px; }

.panel[hidden] { display: none; }

.section-title {
  font-family: var(--serif);
  font-size: 21px; margin: 38px 0 6px;
  display: flex; align-items: center; gap: 8px;
  font-weight: 600;
}
.section-sub { color: var(--text-dim); font-size: 13.5px; margin-bottom: 16px; }

.panel-note {
  font-size: 13px;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 16px;
  line-height: 1.6;
}

/* ---------- Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(31, 30, 29, 0.04);
}
.stat .num { font-size: 23px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.stat .num em { font-style: normal; color: var(--accent-ink); }
.stat .lbl { font-size: 12.5px; color: var(--text-faint); margin-top: 2px; }

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.search {
  flex: 1 1 240px;
  font: inherit; color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 2px rgba(31, 30, 29, 0.03);
}
.search::placeholder { color: var(--text-faint); }
.search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }

.chip {
  font: inherit; font-size: 13px; cursor: pointer;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 7px 14px; border-radius: 999px;
  transition: all 0.15s;
  box-shadow: 0 1px 2px rgba(31, 30, 29, 0.03);
}
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.active {
  color: #fff;
  background: var(--accent);
  border-color: transparent;
}

.sort {
  font: inherit; font-size: 13px;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 9px 12px;
  cursor: pointer;
  outline: none;
  box-shadow: 0 1px 2px rgba(31, 30, 29, 0.03);
}
.sort:focus { border-color: var(--accent); }

/* ---------- Cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: transform 0.16s, border-color 0.16s, box-shadow 0.16s, background 0.16s;
  box-shadow: 0 1px 2px rgba(31, 30, 29, 0.03);
}
.card:hover {
  transform: translateY(-2px);
  border-color: rgba(217, 119, 87, 0.45);
  background: var(--surface-hover);
  box-shadow: var(--shadow);
}

.card-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; margin-bottom: 10px;
}

.card-title a {
  color: var(--text); text-decoration: none;
  font-size: 17px; font-weight: 700; letter-spacing: 0.1px;
}
.card-title a:hover { color: var(--accent-strong); }
.card-owner { font-size: 12.5px; color: var(--text-faint); margin-top: 2px; }

.badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.badge {
  font-size: 11.5px; font-weight: 600;
  padding: 3px 10px; border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge-cat { color: var(--text-dim); background: var(--bg-soft); border-color: var(--border); }
.badge-dim { color: var(--hot); background: rgba(217, 119, 87, 0.09); border-color: rgba(217, 119, 87, 0.30); }
.badge-hot { color: var(--hot); background: rgba(193, 95, 60, 0.09); border-color: rgba(193, 95, 60, 0.30); }
.badge-up { color: var(--up); background: rgba(78, 140, 106, 0.10); border-color: rgba(78, 140, 106, 0.32); }
.badge-book { color: var(--warn); background: rgba(181, 138, 46, 0.10); border-color: rgba(181, 138, 46, 0.32); }
.badge-scan { color: #58708a; background: rgba(88, 112, 138, 0.09); border-color: rgba(88, 112, 138, 0.28); }

.card-summary {
  color: var(--text-dim); font-size: 13.5px;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tag {
  font-size: 11.5px; color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid rgba(217, 119, 87, 0.24);
  padding: 2px 9px; border-radius: 7px;
}

.card-meta {
  display: flex; align-items: center; gap: 14px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
  font-size: 13px; color: var(--text-dim);
}
.meta-item { display: flex; align-items: center; gap: 5px; }
.meta-item b { color: var(--text); font-weight: 600; }
.trend-up { color: var(--up); font-weight: 600; }
.trend-flat { color: var(--text-faint); }

.card-links { display: flex; gap: 8px; margin-top: 14px; }

.link-btn {
  font: inherit; font-size: 12.5px; text-decoration: none;
  color: var(--text-dim);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 6px 13px; border-radius: 10px;
  transition: all 0.14s;
  display: inline-flex; align-items: center; gap: 5px;
}
.link-btn:hover { color: var(--accent-strong); border-color: var(--accent); background: var(--accent-soft); }
.link-btn.primary { color: #fff; background: var(--accent); border-color: transparent; }
.link-btn.primary:hover { background: var(--accent-strong); }

.book-btn {
  margin-left: auto;
  font: inherit; font-size: 12.5px; cursor: pointer;
  color: var(--text-faint);
  background: transparent;
  border: 1px solid var(--border);
  padding: 6px 13px; border-radius: 10px;
  transition: all 0.14s;
}
.book-btn:hover { color: var(--warn); border-color: var(--warn); }
.book-btn.on { color: var(--warn); border-color: rgba(181, 138, 46, 0.45); background: rgba(181, 138, 46, 0.08); }

/* ---------- KOL cards ---------- */
.kol-grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }

.kol-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }

.avatar {
  width: 52px; height: 52px; border-radius: 50%;
  flex-shrink: 0;
  background-size: cover; background-position: center;
  border: 2px solid var(--border);
  display: grid; place-items: center;
  font-size: 20px; font-weight: 700; color: #fff;
}
.avatar-img { object-fit: cover; }

.kol-name { font-family: var(--serif); font-size: 18px; font-weight: 700; }
.kol-handle { font-size: 12.5px; color: var(--accent-ink); }
.kol-role { font-size: 12.5px; color: var(--text-faint); margin-top: 1px; }

.watchpoints {
  list-style: none;
  margin: 12px 0 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.watchpoints li {
  font-size: 13px; color: var(--text-dim);
  padding-left: 20px; position: relative;
}
.watchpoints li::before {
  content: "▸";
  position: absolute; left: 4px;
  color: var(--accent);
}

.platforms { display: flex; flex-wrap: wrap; gap: 7px; }
.platform-pill {
  font-size: 12px; text-decoration: none;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  background: var(--surface);
  transition: all 0.14s;
}
.platform-pill:hover { color: var(--accent-strong); border-color: var(--accent); background: var(--accent-soft); }
.platform-pill span { color: var(--text-faint); margin-right: 4px; }
.platform-pill.disabled { opacity: 0.55; cursor: default; }
.platform-pill.disabled:hover { border-color: var(--border); background: none; color: var(--text-dim); }

/* ---------- KOL 声音（观点 + 日期） ---------- */
.voices {
  margin: 14px 0 2px;
  border-top: 1px dashed var(--border);
  padding-top: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.voices-title {
  font-size: 12px; font-weight: 700; letter-spacing: 0.4px;
  color: var(--text-faint); text-transform: uppercase;
}
.voices-count { color: var(--accent); font-weight: 700; }
.voice {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 12.5px; line-height: 1.5;
  color: var(--text-dim);
  text-decoration: none;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  transition: border-color 0.15s, background 0.15s;
}
a.voice:hover {
  color: var(--accent-strong);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.voice-top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.voice-date {
  font-family: Consolas, "SF Mono", Menlo, monospace;
  font-size: 11px; color: var(--accent-strong);
  white-space: nowrap;
  background: rgba(217, 119, 87, 0.10);
  border: 1px solid rgba(217, 119, 87, 0.28);
  border-radius: 6px; padding: 1px 6px;
}
.voice-ch {
  font-size: 11px; color: var(--text-faint);
  white-space: nowrap;
  border-radius: 999px; padding: 1px 8px;
  font-weight: 700;
}
.voice-ch.ch-X { color: #0369a1; background: rgba(14, 165, 233, 0.10); border: 1px solid rgba(14, 165, 233, 0.30); }
.voice-ch.ch-site { color: var(--up); background: rgba(78, 140, 106, 0.10); border: 1px solid rgba(78, 140, 106, 0.30); }
.voice-ch.ch-media { color: var(--warn); background: rgba(181, 138, 46, 0.10); border: 1px solid rgba(181, 138, 46, 0.30); }
.voice-src {
  font-size: 11px; color: var(--text-faint);
  white-space: nowrap;
  border: 1px solid var(--border);
  border-radius: 999px; padding: 1px 8px;
}
.voice-src-name {
  font-size: 11px; color: var(--accent-strong);
  background: rgba(217, 119, 87, 0.08);
  border: 1px dashed rgba(217, 119, 87, 0.35);
  border-radius: 6px; padding: 1px 7px;
}
.voice-view { color: inherit; }
.voices-more { font-size: 11.5px; color: var(--text-faint); text-align: right; }

/* ---------- Sources ---------- */
.sources {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.source {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px;
  transition: all 0.15s;
  box-shadow: 0 1px 2px rgba(31, 30, 29, 0.03);
}
.source:hover { border-color: rgba(217, 119, 87, 0.5); transform: translateY(-2px); box-shadow: var(--shadow); }
.source .src-icon { font-size: 22px; }
.source .src-name { color: var(--text); font-size: 14px; font-weight: 600; }
.source .src-desc { color: var(--text-faint); font-size: 12px; }

/* ---------- 实时动态 Feed ---------- */
.hotwords {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.hot-label {
  font-size: 13px; font-weight: 700; color: var(--text-dim);
  margin-right: 2px;
  white-space: nowrap;
}
.chip.hot em {
  font-style: normal;
  font-size: 11px;
  color: var(--text-faint);
  margin-left: 3px;
}
.chip.hot.active em { color: rgba(255, 255, 255, 0.8); }
.hot-empty { font-size: 13px; color: var(--text-faint); }

.feed-toolbar { align-items: flex-start; }
.feed-toolbar .chips { max-width: 100%; }

.feed { display: flex; flex-direction: column; gap: 24px; }

.feed-day h3 {
  font-family: var(--serif);
  font-size: 16px; font-weight: 700;
  color: var(--text);
  padding-bottom: 9px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: baseline; gap: 8px;
}
.feed-day h3 span { font-size: 12px; font-weight: 500; color: var(--text-faint); font-family: var(--sans); }

.feed-group {
  display: flex; flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(31, 30, 29, 0.03);
}

.feed-item {
  display: flex; gap: 14px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-soft);
  transition: background 0.14s;
}
.feed-item:last-child { border-bottom: none; }
.feed-item:hover { background: var(--surface-hover); }

.feed-icon {
  width: 40px; height: 40px; flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 19px;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: 11px;
}

.feed-body { min-width: 0; flex: 1; }

.feed-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 4px;
  font-size: 12px;
}
.feed-kol { color: var(--accent-ink); font-weight: 700; }
.feed-src { color: var(--text-faint); }
.feed-time { color: var(--text-faint); }

.badge-kind-news { color: #9a6a00; background: rgba(181, 138, 46, 0.10); border-color: rgba(181, 138, 46, 0.32); }
.badge-kind-blog { color: #5f5b9e; background: rgba(95, 91, 158, 0.09); border-color: rgba(95, 91, 158, 0.28); }
.badge-kind-pod { color: #a34a6e; background: rgba(163, 74, 110, 0.09); border-color: rgba(163, 74, 110, 0.28); }
.badge-kind-official { color: var(--up); background: rgba(78, 140, 106, 0.10); border-color: rgba(78, 140, 106, 0.30); }
.badge-kind-other { color: var(--text-dim); background: var(--bg-soft); border-color: var(--border); }
.badge-guest { color: #8a6d1f; background: rgba(181, 138, 46, 0.10); border-color: rgba(181, 138, 46, 0.30); }

.feed-title {
  display: block;
  color: var(--text);
  font-size: 15px; font-weight: 600;
  text-decoration: none;
  line-height: 1.45;
}
.feed-title:hover { color: var(--accent-strong); }

.feed-desc {
  color: var(--text-dim);
  font-size: 12.5px;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feed-error {
  text-align: center;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 44px 20px;
  font-size: 14px;
  line-height: 1.8;
  box-shadow: 0 1px 2px rgba(31, 30, 29, 0.03);
}
.feed-error code {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 1px 7px;
  border-radius: 6px;
  color: var(--accent-ink);
}

/* ---------- 实时热榜（X / 微博） ---------- */
.rank-list { display: flex; flex-direction: column; gap: 8px; }

.rank-item {
  display: flex; align-items: center; gap: 14px;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
  transition: all 0.15s;
  box-shadow: 0 1px 2px rgba(31, 30, 29, 0.03);
}
.rank-item:hover {
  border-color: rgba(217, 119, 87, 0.45);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  background: var(--surface-hover);
}

.rank-num {
  width: 34px; height: 34px; flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 15px; font-weight: 700;
  color: var(--text-dim);
  background: var(--bg-soft);
  border-radius: 10px;
  font-variant-numeric: tabular-nums;
}
.rank-num.top { color: #fff; background: var(--accent); }

.rank-main {
  min-width: 0; flex: 1;
  display: flex; flex-direction: column;
}
.rank-name {
  font-size: 15px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rank-item:hover .rank-name { color: var(--accent-strong); }
.rank-meta { font-size: 12px; color: var(--text-faint); margin-top: 1px; }

.rank-heat {
  flex-shrink: 0;
  font-size: 12.5px; color: var(--text-dim);
}
.rank-heat b { color: var(--accent-ink); font-weight: 700; font-size: 13.5px; }

/* ---------- Empty / Footer / Toast ---------- */
.empty {
  text-align: center; color: var(--text-faint);
  padding: 60px 0; font-size: 14px;
}

.footer {
  max-width: 1280px; margin: 0 auto;
  padding: 30px 24px 44px;
  color: var(--text-faint); font-size: 12.5px;
  border-top: 1px solid var(--border-soft);
  display: flex; flex-direction: column; gap: 4px;
}
.footer code {
  background: var(--bg-soft); border: 1px solid var(--border-soft);
  padding: 1px 6px; border-radius: 5px; font-size: 12px;
  color: var(--text-dim);
}

.toast {
  position: fixed; left: 50%; bottom: 28px;
  transform: translateX(-50%);
  background: var(--text); color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 11px 20px; border-radius: 999px;
  font-size: 13.5px;
  box-shadow: var(--shadow);
  z-index: 50;
  animation: toastIn 0.2s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(8px); } }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .hero { padding: 22px 16px 0; }
  .container { padding: 18px 16px; }
  .brand-text h1 { font-size: 22px; }
  .cards, .kol-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .tab { padding: 10px 12px; font-size: 14px; }
}
