:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --accent-strong: #1d4ed8;
  --purple: #7c3aed;
  --purple-soft: #ede9fe;
  --amber: #d97706;
  --amber-soft: #fef3c7;
  --green: #15803d;
  --green-soft: #dcfce7;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  --radius-lg: 18px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  background: linear-gradient(180deg, #f8fafc 0%, #f5f7fb 100%);
  color: var(--text);
  font-family: "IBM Plex Sans SC", "PingFang SC", "Noto Sans SC", sans-serif;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 18px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.brand-kicker,
.intro-kicker,
.sidebar-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-block h1 {
  margin: 6px 0 4px;
  font-family: "Space Grotesk", "IBM Plex Sans SC", sans-serif;
  font-size: 1.9rem;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.brand-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.topbar-stats {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.stat-card {
  min-width: 140px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #fff, #f8fbff);
  box-shadow: var(--shadow);
}

.stat-card:nth-child(2) {
  background: linear-gradient(135deg, #fff, #f5f3ff);
}

.stat-card:nth-child(3) {
  background: linear-gradient(135deg, #fff, #fffbeb);
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 0.98rem;
}

.workspace {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
  padding: 22px 0 36px;
  height: calc(100vh - 93px);
  min-height: 0;
}

.sidebar {
  display: grid;
  gap: 14px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.sidebar-section,
.intro-card,
.news-card,
.article-content-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.sidebar-section {
  padding: 16px;
}

.sidebar-title {
  margin-top: 8px;
  font-size: 1.25rem;
  font-weight: 700;
}

.sidebar-copy {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

.search-input {
  width: 100%;
  margin-top: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  font: inherit;
  background: var(--surface-soft);
}

.search-input:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

.toggle-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.toggle-chip,
.bookmark-button {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-size: 0.84rem;
  cursor: pointer;
  transition: 0.2s ease;
}

.toggle-chip.is-active,
.toggle-chip:hover {
  color: var(--accent-strong);
  border-color: #bfdbfe;
  background: var(--accent-soft);
}

.bookmark-button.is-active,
.bookmark-button:hover {
  color: #92400e;
  border-color: #fcd34d;
  background: var(--amber-soft);
}

.sidebar-nav-section {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.nav-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.nav-item {
  width: 100%;
  text-align: left;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  cursor: pointer;
  transition: 0.2s ease;
}

.nav-item:hover {
  border-color: #c4b5fd;
  background: linear-gradient(135deg, #faf5ff, #f8fbff);
}

.nav-item.is-read {
  opacity: 0.82;
}

.nav-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 0.78rem;
}

.nav-title {
  margin-top: 8px;
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
}

.nav-meta {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--purple);
  font-size: 0.78rem;
}

.status-read,
.status-bookmark,
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
}

.status-read,
.status-pill.read {
  color: var(--green);
  background: var(--green-soft);
}

.status-bookmark,
.status-pill.bookmark {
  color: #92400e;
  background: var(--amber-soft);
}

.main-panel {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.intro-card {
  padding: 18px 20px;
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.45), rgba(237, 233, 254, 0.35)), #fff;
}

.intro-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.intro-head h2 {
  margin: 6px 0 0;
  font-size: 1.45rem;
}

.intro-badge {
  padding: 9px 12px;
  border-radius: 999px;
  background: var(--purple-soft);
  color: #6d28d9;
  font-size: 0.84rem;
  font-weight: 600;
}

.intro-text {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.72;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.meta-pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  font-size: 0.84rem;
}

.meta-pill span {
  color: var(--muted);
}

.news-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.news-card {
  overflow: hidden;
}

.news-card.is-read {
  opacity: 0.88;
}

.news-card-inner {
  padding: 18px 20px;
}

.news-card-inner.is-featured {
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.26), rgba(254, 243, 199, 0.2)), #fff;
}

.card-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.8rem;
}

.card-dot {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: #94a3b8;
}

.card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 18px;
  margin-top: 12px;
}

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

.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.tag-pill {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.news-title {
  margin: 10px 0 0;
  font-size: 1.28rem;
  line-height: 1.35;
}

.title-link {
  color: inherit;
  text-decoration: none;
}

.title-link:hover {
  color: var(--accent-strong);
}

.news-summary {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.75;
}

.heat-box {
  align-self: start;
  padding: 12px 13px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--purple-soft), #fff);
  border: 1px solid #ddd6fe;
  color: #334155;
  font-size: 0.86rem;
  line-height: 1.7;
}

.card-footer {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

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

.mini-takeaways span {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: #92400e;
  font-size: 0.78rem;
}

.card-actions,
.article-action-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.read-more-link,
.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--purple-soft);
  color: #6d28d9;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
}

.read-more-link:hover,
.back-link:hover {
  background: #ddd6fe;
}

.article-page {
  background: linear-gradient(180deg, #f8fafc, #eef2ff 48%, #f8fafc 100%);
  height: auto;
  overflow: auto;
}

.article-topbar {
  align-items: center;
}

.article-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.article-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 22px;
}

.article-sidebar {
  position: sticky;
  top: 106px;
  align-self: start;
  display: grid;
  gap: 12px;
}

.side-box {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.tone-blue {
  background: linear-gradient(135deg, #eff6ff, #ffffff);
}

.tone-purple {
  background: linear-gradient(135deg, #f5f3ff, #ffffff);
}

.tone-amber {
  background: linear-gradient(135deg, #fffbeb, #ffffff);
}

.article-side-value {
  margin-top: 8px;
  font-size: 1rem;
  font-weight: 700;
}

.article-content-card {
  padding: 24px 26px;
}

.article-header {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.article-tags {
  margin-top: 12px;
}

.article-title {
  margin: 12px 0 0;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  line-height: 1.16;
  letter-spacing: -0.04em;
}

.article-summary {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.85;
}

.prose {
  color: #1e293b;
  font-size: 0.98rem;
  line-height: 2;
  padding-top: 22px;
}

.prose p {
  margin: 0 0 16px;
}

.prose p.section {
  color: #6d28d9;
  font-weight: 700;
  margin-top: 22px;
}

.article-source-row {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
}

.empty-state {
  padding: 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  color: var(--muted);
}

.empty-state.small {
  padding: 14px;
  font-size: 0.88rem;
}

@media (max-width: 1120px) {
  body {
    height: auto;
    overflow: auto;
  }

  .workspace,
  .article-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .sidebar,
  .main-panel {
    overflow: visible;
    padding-right: 0;
  }

  .article-sidebar {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .topbar-inner,
  .workspace,
  .article-shell {
    width: min(100% - 20px, 1320px);
  }

  .topbar-inner,
  .card-head,
  .intro-head,
  .card-footer,
  .article-sidebar {
    grid-template-columns: 1fr;
    display: grid;
  }

  .topbar-stats {
    flex-wrap: wrap;
  }

  .article-content-card {
    padding: 20px 18px;
  }
}
