:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --sidebar: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --line: #dfe7f1;
  --text: #142033;
  --muted: #6c7a8c;
  --soft: #334155;
  --accent: #1d9bf0;
  --accent-strong: #3979ff;
  --cyan: #00a6c8;
  --purple: #9d4edd;
  --orange: #ff8a3d;
  --green: #20a96b;
  --radius: 8px;
  --shadow: 0 10px 26px rgba(27, 39, 62, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Noto Sans SC", system-ui, sans-serif;
}

a {
  color: inherit;
}

.site-shell {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-right: 1px solid #d6e0ec;
  padding: 24px 14px;
  background: var(--sidebar);
  box-shadow: 4px 0 16px rgba(33, 50, 74, 0.06);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #dff2ff, #edf7ff);
  color: var(--accent);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 17px;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.side-nav {
  display: grid;
  gap: 6px;
}

.side-nav-item {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--muted);
  text-decoration: none;
}

.side-nav-item:hover,
.side-nav-item.is-active {
  border-color: #cfe8ff;
  background: #eef8ff;
  box-shadow: inset 3px 0 0 var(--accent);
}

.side-nav-item strong,
.side-nav-item small {
  display: block;
}

.side-nav-item strong {
  color: var(--text);
  font-weight: 800;
}

.side-nav-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.nav-icon {
  width: 30px;
  height: 30px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: #e8f4ff;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.workspace {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 15px clamp(22px, 2.8vw, 58px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 10px rgba(33, 50, 74, 0.06);
  backdrop-filter: blur(10px);
}

.topbar strong {
  display: block;
  margin-top: 2px;
  font-size: 20px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-pill {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #cfe8ff;
  border-radius: 999px;
  padding: 0 11px;
  background: #eef8ff;
  color: #1570be;
  font-size: 12px;
  font-weight: 700;
}

.status-pill.muted {
  border-color: #d8e1ec;
  background: #f8fafc;
  color: var(--muted);
}

.topbar-link {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #d8e1ec;
  border-radius: 999px;
  padding: 0 11px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.topbar-link:hover {
  border-color: #b8d8f5;
  color: var(--accent-strong);
}

.hero,
.featured-card,
.post-card,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 24px;
  align-items: center;
  margin: 28px clamp(18px, 1.2vw, 26px) 14px;
  padding: 24px;
}

.hero h1 {
  max-width: 940px;
  margin: 8px 0;
  font-size: clamp(30px, 3vw, 42px);
  line-height: 1.1;
}

.hero p {
  max-width: 820px;
  margin: 0;
  color: var(--soft);
  font-size: 16px;
  line-height: 1.75;
}

.hero-panel {
  display: grid;
  gap: 10px;
}

.hero-panel div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface-soft);
}

.hero-panel span {
  color: var(--muted);
  font-size: 13px;
}

.hero-panel strong {
  color: var(--accent-strong);
  font-size: 22px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.3fr);
  gap: 16px;
  align-items: start;
  padding: 0 clamp(18px, 1.2vw, 26px) 58px;
}

.post-column,
.aside-column,
.post-list,
.topic-list,
.topic-layout,
.queue-list {
  display: grid;
  gap: 14px;
}

.featured-card,
.post-card,
.panel,
.topic-detail {
  padding: 20px;
}

.featured-card {
  display: grid;
  gap: 12px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.featured-card h2 {
  margin: 0;
  font-size: clamp(26px, 2.3vw, 34px);
  line-height: 1.18;
}

.featured-card p,
.post-card p,
.note-panel p {
  margin: 0;
  color: var(--soft);
  font-size: 14px;
  line-height: 1.7;
}

.featured-card a {
  width: max-content;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #b8d8f5;
  border-radius: var(--radius);
  padding: 0 12px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.post-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.post-card {
  display: grid;
  align-content: start;
  gap: 10px;
  background: #f9fbfe;
}

.post-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-meta time {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  background: #f4f8fd;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.tag.blue {
  border-color: #cfe8ff;
  background: #eef8ff;
  color: var(--accent);
}

.tag.cyan {
  border-color: #c8f4fb;
  background: #ecfeff;
  color: var(--cyan);
}

.tag.orange {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #ea7800;
}

.tag.purple {
  border-color: #ddd6fe;
  background: #f5f3ff;
  color: var(--purple);
}

.tag.green {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: var(--green);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel h2 {
  margin: 4px 0 0;
  font-size: 20px;
}

.topic-list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #f9fbfe;
  text-decoration: none;
}

.topic-list a:hover,
.topic-list a.is-selected {
  border-color: #cfe8ff;
  background: #eef8ff;
}

.topic-list a.is-selected {
  box-shadow: inset 3px 0 0 var(--accent);
}

.is-hidden {
  display: none;
}

.topic-list span {
  color: var(--muted);
  font-size: 13px;
}

.topic-list strong {
  color: var(--accent-strong);
  font-size: 20px;
}

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

.queue-list li {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #f9fbfe;
  color: var(--soft);
  font-size: 13px;
}

.note-panel {
  display: grid;
  gap: 10px;
}

.note-panel h2 {
  margin: 0;
}

.topics-hero {
  margin-bottom: 16px;
}

.topic-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0 clamp(18px, 1.2vw, 26px) 58px;
}

.topic-detail {
  scroll-margin-top: 90px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.topic-detail:target {
  border-color: #b8d8f5;
  box-shadow: inset 3px 0 0 var(--accent), var(--shadow);
}

.topic-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topic-detail-head strong {
  color: var(--accent-strong);
  font-size: 20px;
}

.topic-detail h2 {
  margin: 14px 0 8px;
  font-size: 24px;
}

.topic-detail p {
  margin: 0;
  color: var(--soft);
  font-size: 14px;
  line-height: 1.7;
}

.article-links {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.article-links a {
  min-height: 38px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: #f9fbfe;
  color: var(--soft);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.article-links a:hover {
  border-color: #cfe8ff;
  background: #eef8ff;
  color: var(--accent-strong);
}

@media (max-width: 1180px) {
  .hero,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .site-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    gap: 14px;
  }

  .topbar {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .topbar-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero,
  .content-grid {
    margin: 16px 14px 0;
    padding: 18px;
  }

  .content-grid,
  .topic-layout {
    padding: 0 14px 38px;
  }

  .hero-panel,
  .post-list,
  .topic-layout {
    grid-template-columns: 1fr;
  }
}
