:root {
  --bg: #0b1220;
  --bg-elevated: #121a2b;
  --bg-card: #162033;
  --border: rgba(148, 163, 184, 0.18);
  --text: #e8eef9;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-2: #818cf8;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --font: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(56, 189, 248, 0.16), transparent 50%),
    radial-gradient(900px 500px at 100% 0%, rgba(129, 140, 248, 0.14), transparent 45%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.app {
  max-width: 920px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.brand { display: flex; gap: 14px; align-items: center; }
.logo { font-size: 2rem; line-height: 1; }
.header h1 { margin: 0; font-size: 1.5rem; letter-spacing: 0.02em; }
.subtitle { margin: 4px 0 0; color: var(--muted); font-size: 0.9rem; }
.header-meta {
  color: var(--muted);
  font-size: 0.85rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  white-space: nowrap;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px;
}

.tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}
.tab.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(129, 140, 248, 0.28));
  color: var(--text);
}

.panel { display: none; }
.panel.active { display: block; }

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  align-items: center;
}

.slot-switch, .filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters label {
  display: flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 0.9rem;
}
.filters input, .filters select {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
}

.chip, .btn {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 0.9rem;
}
.chip.active {
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(56, 189, 248, 0.15);
  color: #e0f2fe;
}
.btn {
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  border: 0;
  font-weight: 600;
}
.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  font-weight: 500;
}

.content-card, .history-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.hidden { display: none !important; }
.skeleton, .empty, .error {
  color: var(--muted);
  padding: 24px 8px;
  text-align: center;
}
.error { color: var(--danger); }

.edition-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.edition-head h2 { margin: 0; font-size: 1.25rem; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  background: rgba(129, 140, 248, 0.18);
  color: #c7d2fe;
}
.badge.morning { background: rgba(251, 191, 36, 0.15); color: #fde68a; }
.badge.evening { background: rgba(56, 189, 248, 0.15); color: #bae6fd; }

.summary-box {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 18px;
  line-height: 1.6;
}

.section-title {
  margin: 20px 0 10px;
  font-size: 1.05rem;
  color: #dbeafe;
}
.news-list { list-style: none; padding: 0; margin: 0; }
.news-list li {
  padding: 12px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  line-height: 1.55;
}
.news-list li:last-child { border-bottom: 0; }
.news-list .idx {
  display: inline-flex;
  width: 1.5rem;
  height: 1.5rem;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted);
  font-size: 0.75rem;
  margin-right: 8px;
  vertical-align: top;
}
.news-list .title { font-weight: 600; }
.news-list .desc { color: var(--muted); margin-top: 4px; display: block; }
.news-list .src {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--accent);
}

.history-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  cursor: pointer;
}
.history-item:hover .hi-title { color: var(--accent); }
.hi-title { font-weight: 600; }
.hi-meta { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }
.hi-right { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }

.prose h2 { margin-top: 0; }
.prose pre {
  background: #0a1020;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  overflow: auto;
  color: #cbd5e1;
}

.footer {
  margin-top: 28px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.8rem;
}

@media (max-width: 640px) {
  .header { flex-direction: column; }
  .header-meta { align-self: flex-start; }
  .edition-head { flex-direction: column; }
}
