/* ═══════════════════════════════════════════════════════════
   AI选题助手 — 样式
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg: #f8f9fb;
  --card-bg: #ffffff;
  --border: #e8ecf1;
  --text: #1a1d23;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --primary: #6366f1;
  --primary-light: #eef2ff;
  --primary-dark: #4f46e5;
  --score-high: #f59e0b;
  --score-mid: #6366f1;
  --tag-tutorial: #10b981;
  --tag-money: #f59e0b;
  --tag-science: #6366f1;
  --tag-product: #3b82f6;
  --tag-hotspot: #ef4444;
  --tier-t1: #10b981;
  --tier-t2: #6b7280;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --max-width: 860px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }

/* ── Header ─────────────────────────────────────────────── */
.header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-icon { font-size: 28px; }
.logo h1 { font-size: 20px; font-weight: 700; color: var(--text); }
.logo .subtitle { font-size: 12px; color: var(--text-secondary); }

.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  transition: all 0.2s;
  border: 1px solid transparent;
}
.nav-link:hover { background: var(--primary-light); color: var(--primary); }
.nav-link.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ── Filter Bar ─────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 8px;
  padding: 16px 0;
  flex-wrap: wrap;
  overflow-x: auto;
}
.filter-tag {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.filter-tag:hover { border-color: var(--primary); color: var(--primary); }
.filter-tag.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ── News Card ──────────────────────────────────────────── */
.news-list { display: flex; flex-direction: column; gap: 12px; padding-bottom: 40px; }
.news-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.15s;
}
.news-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.card-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  flex: 1;
}
.card-title a {
  color: inherit;
  text-decoration: none;
}
.card-title a:hover { color: var(--primary); }

.score-badge {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  background: var(--primary-light);
  color: var(--primary);
}
.score-badge.high { background: #fef3c7; color: #d97706; }

.card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.source-tag {
  font-size: 12px;
  color: var(--text-muted);
  padding: 2px 8px;
  background: #f3f4f6;
  border-radius: 10px;
}
.tier-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 8px;
}
.tier-tag.t1 { background: #d1fae5; color: #065f46; }
.tier-tag.t2 { background: #e5e7eb; color: #4b5563; }
.card-time { font-size: 12px; color: var(--text-muted); }

.card-summary {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Topic Pills ────────────────────────────────────────── */
.topic-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.topic-pill {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  line-height: 1.4;
  background: #f9fafb;
  border: 1px solid var(--border);
  max-width: 320px;
}
.topic-pill .topic-tag {
  font-weight: 600;
  font-size: 11px;
  margin-right: 4px;
}
.topic-pill .topic-diff {
  color: var(--text-muted);
  font-size: 11px;
  margin-left: 4px;
}

/* ── Daily Report ───────────────────────────────────────── */
.daily-report { padding-bottom: 40px; }
.report-header {
  text-align: center;
  padding: 24px 0 8px;
}
.report-header h2 { font-size: 22px; font-weight: 700; }
.report-header .report-date { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.report-summary {
  background: linear-gradient(135deg, #eef2ff, #faf5ff);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 16px 0;
  font-size: 14px;
  color: var(--text-secondary);
  border-left: 3px solid var(--primary);
}

.section-block { margin: 20px 0; }
.section-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.section-items { display: flex; flex-direction: column; gap: 8px; }
.section-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  box-shadow: var(--shadow);
}
.section-item .si-title { font-weight: 600; color: var(--text); }
.section-item .si-summary { color: var(--text-secondary); font-size: 13px; margin-top: 2px; }

/* ── Topics Tab ─────────────────────────────────────────── */
.topic-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.topic-card .news-ref {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.topic-card .topic-idea {
  padding: 10px 14px;
  background: #f9fafb;
  border-radius: var(--radius-sm);
  margin: 6px 0;
  border-left: 3px solid var(--primary);
}
.topic-idea .idea-title { font-weight: 600; font-size: 14px; }
.topic-idea .idea-angle { color: var(--text-secondary); font-size: 13px; margin-top: 2px; }

/* ── Sources Tab ────────────────────────────────────────── */
.sources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  padding-bottom: 40px;
}
.source-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.source-card .sc-tier {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sc-tier.t1 { background: var(--tier-t1); }
.sc-tier.t2 { background: var(--tier-t2); }

/* ── Skeleton Loading ──────────────────────────────────── */
.skeleton { display: flex; flex-direction: column; gap: 12px; padding: 20px 0; }
.skel-line {
  height: 16px;
  border-radius: 8px;
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.skel-line.w50 { width: 50%; }
.skel-line.w60 { width: 60%; }
.skel-line.w70 { width: 70%; }
.skel-line.w80 { width: 80%; }
.skel-line.w90 { width: 90%; }
.skel-card {
  height: 80px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Footer ─────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}
.footer .dot { margin: 0 8px; }
.footer a { color: var(--primary); text-decoration: none; }

/* ── Social Metrics Block ─────────────────────────────────── */
.social-block {
  margin-top: 8px;
  padding: 10px 14px;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
  font-size: 12px;
}
.social-header {
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.social-header strong { color: var(--primary); }
.social-sources {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.social-src-tag {
  padding: 2px 8px;
  border-radius: 10px;
  background: #f1f5f9;
  color: var(--text-secondary);
  font-size: 11px;
}
.social-discs {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.social-disc {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
}
.social-disc a {
  color: var(--primary);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.social-disc a:hover { text-decoration: underline; }
.social-disc-score {
  flex-shrink: 0;
  padding: 1px 6px;
  border-radius: 8px;
  background: #dbeafe;
  color: #1e40af;
  font-weight: 600;
  font-size: 10px;
}
.social-disc-src {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 10px;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 640px) {
  .header .container { flex-direction: column; align-items: flex-start; }
  .nav { width: 100%; justify-content: space-between; }
  .nav-link { font-size: 13px; padding: 5px 10px; }
  .card-header { flex-direction: column; }
  .score-badge { align-self: flex-start; }
  .sources-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .topic-pill { max-width: 100%; }
}
