:root {
  --bg: #f5f6f7;
  --card: #ffffff;
  --text: #111827;
  --soft-text: #6b7280;
  --muted: #9ca3af;
  --line: #e5e7eb;
  --soft: #f3f4f6;
  --blue: #2563eb;
  --blue-soft: #dbeafe;
  --red: #fe2d46;
  --orange: #ff6600;
  --gold: #ffb400;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #121418;
  --card: #1b1f27;
  --text: #f3f4f6;
  --soft-text: #d1d5db;
  --muted: #9ca3af;
  --line: #2d333d;
  --soft: #252a33;
  --blue: #3b82f6;
  --blue-soft: rgba(37, 99, 235, 0.18);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans SC", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.625;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: 56px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.header-inner {
  max-width: 1280px;
  height: 100%;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  color: #fff;
  background: var(--blue);
  font-weight: 900;
}

.topic-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}

.topic-nav button,
.topic-nav a {
  display: inline-flex;
  align-items: center;
  border: 0;
  background: transparent;
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--soft-text);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.topic-nav button.active,
.topic-nav button:hover,
.topic-nav a:hover {
  color: var(--blue);
  background: var(--blue-soft);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

input[type="search"] {
  width: 128px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--text);
  background: var(--bg);
  outline: none;
}

input[type="search"]:focus {
  border-color: var(--blue);
}

.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  cursor: pointer;
  font-weight: 800;
}

.icon-btn:hover {
  color: var(--blue);
  border-color: color-mix(in srgb, var(--blue) 40%, var(--line));
}

.live-icon {
  color: #ef4444;
  font-size: 18px;
  line-height: 1;
}

.live-icon.active {
  color: var(--blue);
  border-color: var(--blue);
  background: var(--blue-soft);
}

.live-icon.active::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  transform: translate(12px, -12px);
  animation: pulse 1.5s infinite;
}

.main-content {
  max-width: 1280px;
  margin: 56px auto 0;
  padding: 12px 24px 80px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.content-column {
  grid-column: span 8;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar {
  grid-column: span 4;
}

.ad-placeholder {
  display: grid;
  place-items: center;
  min-height: 90px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--card);
  font-size: 12px;
}

.top-strip,
.timeline-card,
.rank-panel {
  background: var(--card);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.top-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 80px;
  padding: 12px;
  border-left: 6px solid var(--blue);
}

.top-strip-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding-right: 12px;
  border-right: 1px solid var(--line);
}

.bolt {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: var(--blue);
  background: var(--blue-soft);
}

.top-strip h1 {
  margin: 0;
  font-size: 16px;
  line-height: 1.15;
}

.top-strip p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.top-story-list {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 32px;
  row-gap: 6px;
  min-width: 0;
}

.top-story-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 2px 0;
}

.top-story-list span {
  flex: 0 0 auto;
  color: color-mix(in srgb, var(--blue) 80%, transparent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 14px;
  font-weight: 800;
}

.top-story-list b {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-story-list em {
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--soft-text);
  background: var(--soft);
  font-size: 12px;
  font-style: normal;
}

.timeline-card {
  min-height: 800px;
  scroll-margin-top: 80px;
}

.timeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.timeline-head h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: var(--text);
  font-size: 20px;
}

.timeline-head h2 span {
  width: 8px;
  height: 20px;
  border-radius: 999px;
  background: var(--blue);
}

.timeline-status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.timeline-list {
  padding: 0 12px 20px 22px;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  padding: 12px 0 16px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 26px;
  bottom: 0;
  border-left: 1px solid var(--line);
}

.timeline-dot {
  position: relative;
  z-index: 1;
  width: 11px;
  height: 11px;
  margin-top: 10px;
  border: 2px solid var(--card);
  border-radius: 50%;
  background: #d1d5db;
  box-shadow: 0 0 0 1px var(--blue-soft);
}

.timeline-dot.hot {
  background: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.timeline-body {
  min-width: 0;
}

.timeline-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.timeline-meta time {
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--blue);
  background: var(--blue-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 14px;
  font-weight: 800;
}

.timeline-meta span {
  color: var(--muted);
  font-size: 14px;
}

.timeline-body > a {
  display: block;
  color: var(--text);
  font-size: 16px;
  font-weight: 550;
  line-height: 1.55;
  text-align: justify;
}

.timeline-body > a.strong {
  font-size: 17px;
  font-weight: 800;
}

.timeline-body > a:hover {
  color: var(--blue);
}

.timeline-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 5px;
  opacity: 0.68;
}

.timeline-item:hover .timeline-actions {
  opacity: 1;
}

.heat {
  padding: 1px 8px;
  border-radius: 6px;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
  font-size: 14px;
  font-weight: 800;
}

.timeline-actions button {
  border: 0;
  padding: 1px 8px;
  border-radius: 6px;
  color: #7e22ce;
  background: rgba(147, 51, 234, 0.08);
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
}

.timeline-actions button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.inline-summary {
  margin: 10px 0 0;
  padding: 12px;
  border: 1px solid rgba(147, 51, 234, 0.18);
  border-radius: 8px;
  color: var(--soft-text);
  background: linear-gradient(90deg, rgba(147, 51, 234, 0.08), rgba(37, 99, 235, 0.08));
  font-size: 15px;
  white-space: pre-line;
}

.inline-summary[data-fallback="true"] {
  border-color: rgba(245, 158, 11, 0.28);
  background: rgba(245, 158, 11, 0.08);
}

.rank-panel {
  overflow: hidden;
}

.sticky-rank {
  position: sticky;
  top: 72px;
  display: flex;
  max-height: calc(100vh - 88px);
  flex-direction: column;
}

.rank-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.rank-head h2 {
  margin: 0;
  font-size: 18px;
}

.rank-live-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.rank-live-label::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.market-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 12px 0;
}

.market-tabs button {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 0;
  color: var(--soft-text);
  background: var(--soft);
  cursor: pointer;
  font-weight: 700;
}

.market-tabs button.active {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.rank-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 3px;
  padding: 12px;
}

.rank-tabs button {
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 2px 0;
  overflow: hidden;
  color: var(--soft-text);
  background: var(--soft);
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-tabs button.active {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.18);
}

.rank-list {
  min-height: 0;
  overflow-y: auto;
  padding: 0 8px 12px;
}

.rank-list a {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 6px 4px;
  border-radius: 6px;
}

.rank-list a:hover {
  background: color-mix(in srgb, var(--soft) 72%, transparent);
}

.rank-num {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  margin-top: 2px;
  border-radius: 5px;
  color: var(--soft-text);
  background: #e5e7eb;
  font-size: 14px;
  font-weight: 900;
}

.rank-list a:nth-child(1) .rank-num {
  color: #fff;
  background: var(--red);
}

.rank-list a:nth-child(2) .rank-num {
  color: #fff;
  background: var(--orange);
}

.rank-list a:nth-child(3) .rank-num {
  color: #fff;
  background: var(--gold);
}

.rank-list b {
  color: var(--soft-text);
  font-size: 15px;
  font-weight: 550;
  line-height: 1.45;
}

.rank-list a:hover b {
  color: var(--blue);
}

.mobile-rank {
  display: none;
}

.empty {
  padding: 24px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.timeline-empty {
  margin-top: 20px;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--card);
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 24px 22px;
  display: block;
}

.footer-section strong {
  display: block;
  font-size: 15px;
}

.footer-section > span {
  color: var(--muted);
  font-size: 12px;
}

.archive-footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 10px;
}

.archive-footer-nav a,
.archive-source-list a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--soft-text);
  background: var(--soft);
}

.archive-footer-nav a {
  padding: 4px 8px;
}

.archive-footer-nav a:hover,
.archive-source-list a:hover,
.archive-source-list a.active {
  color: var(--blue);
  border-color: color-mix(in srgb, var(--blue) 35%, var(--line));
  background: var(--blue-soft);
}

.archive-footer-nav em,
.archive-source-list em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.footer-empty {
  color: var(--muted);
  font-size: 13px;
}

.archive-top-nav a {
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--soft-text);
  font-size: 16px;
  font-weight: 800;
}

.archive-top-nav a:hover {
  color: var(--blue);
  background: var(--blue-soft);
}

.archive-page {
  max-width: 1280px;
  margin: 56px auto 0;
  padding: 16px 24px 80px;
}

.archive-hero,
.archive-source-panel,
.archive-list-panel {
  border-radius: 6px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.archive-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-left: 6px solid var(--blue);
}

.archive-hero p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.archive-hero h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
}

.archive-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.archive-stats span {
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--soft-text);
  background: var(--soft);
  font-size: 13px;
  font-weight: 700;
}

.archive-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.archive-source-panel {
  position: sticky;
  top: 72px;
  align-self: start;
  padding: 12px;
}

.archive-source-panel h2,
.archive-list-head h2 {
  margin: 0;
  font-size: 18px;
}

.archive-source-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.archive-source-list a {
  justify-content: space-between;
  padding: 8px 10px;
  font-weight: 750;
}

.archive-list-panel {
  overflow: hidden;
}

.archive-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.archive-list-head select {
  min-width: 130px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: var(--bg);
}

.archive-cluster-list {
  padding: 0 12px 14px;
}

.archive-cluster {
  padding: 14px 0 16px;
  border-bottom: 1px solid var(--line);
}

.archive-cluster:last-child {
  border-bottom: 0;
}

.archive-cluster-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.archive-cluster-meta time,
.archive-cluster-meta span,
.archive-cluster-meta b {
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--soft);
  color: var(--soft-text);
  font-size: 12px;
  font-weight: 800;
}

.archive-cluster-meta time {
  color: var(--blue);
  background: var(--blue-soft);
}

.archive-cluster-meta b {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.archive-cluster h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.45;
}

.archive-cluster h3 a:hover {
  color: var(--blue);
}

.archive-cluster p {
  margin: 6px 0 0;
  color: var(--soft-text);
  font-size: 14px;
}

.archive-related {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.archive-related a {
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 5px;
  overflow: hidden;
  color: var(--soft-text);
  background: var(--soft);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-related a:hover {
  color: var(--blue);
}

.archive-empty {
  margin: 20px 0;
}

.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 28px;
  z-index: 60;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--blue);
  background: var(--card);
  box-shadow: var(--shadow);
  cursor: pointer;
  font-size: 0;
  font-weight: 900;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.back-to-top::before {
  content: "";
  width: 12px;
  height: 12px;
  border-top: 3px solid currentColor;
  border-left: 3px solid currentColor;
  transform: translateY(3px) rotate(45deg);
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
}

@media (max-width: 1023px) {
  .site-header {
    position: relative;
  }

  .main-content,
  .archive-page {
    display: block;
    margin-top: 0;
    padding: 12px 12px 64px;
  }

  .content-column {
    display: flex;
  }

  .sidebar {
    display: none;
  }

  .mobile-rank {
    display: block;
  }

  .brand {
    font-size: 21px;
  }

  .topic-nav {
    display: none;
  }

  .top-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .top-strip-title {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 10px;
  }

  .archive-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .archive-footer-nav,
  .archive-stats {
    justify-content: flex-start;
  }

  .archive-layout {
    grid-template-columns: 1fr;
  }

  .archive-source-panel {
    position: static;
  }

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

@media (max-width: 720px) {
  .header-inner {
    padding: 0 12px;
  }

  .brand-icon {
    width: 34px;
    height: 34px;
  }

  .brand span:last-child {
    font-size: 20px;
  }

  .header-actions input {
    width: 108px;
  }

  .header-actions {
    gap: 6px;
  }

  .header-actions .icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    padding: 0;
    line-height: 1;
    font-size: 20px;
  }

  .header-actions .live-icon {
    font-size: 22px;
  }

  .header-actions .live-icon.active::after {
    top: 5px;
    right: 5px;
    width: 9px;
    height: 9px;
    transform: none;
  }

  .top-story-list {
    grid-template-columns: 1fr;
  }

  .timeline-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .timeline-body > a {
    font-size: 17px;
  }

  .archive-source-list {
    grid-template-columns: 1fr;
  }

  .archive-list-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .back-to-top {
    right: 14px;
    bottom: 18px;
    width: 40px;
    height: 40px;
  }

  .back-to-top::before {
    width: 11px;
    height: 11px;
  }
}
