:root {
  color-scheme: light;
  font-family: Inter, 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --page: #f7f8fa;
  --surface: #fff;
  --text: #1a1a1a;
  --muted: #626b7a;
  --soft: #4f5969;
  --line: #e6e9ef;
  --accent: #c64424;
  --accent-fill: #fff0e9;
  --accent-line: #f3d6cb;
  --hover: #f3f5f8;
  --rank-fill: #f0f2f5;
  --green: #278364;
  --link: #2563eb;
  --visited: #7c3aed;
  --shadow: 0 1px 2px rgb(19 30 53 / 3%);
  --bar: 60px;
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --page: #14161a;
  --surface: #1b1e23;
  --text: #eef0f3;
  --muted: #afb6c4;
  --soft: #b8c1d0;
  --line: #30343e;
  --accent: #ff9b7c;
  --accent-fill: #382720;
  --accent-line: #513831;
  --hover: #242830;
  --rank-fill: #2a2f37;
  --green: #7ad8b2;
  --link: #91b3ff;
  --visited: #c4a9ff;
  --shadow: none;
}

*, *::before, *::after { box-sizing: border-box; }
body { min-width: 0; margin: 0; background: var(--page); color: var(--text); font-size: 1rem; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: progress; opacity: .65; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
main:focus { outline: none; }
.icon { display: inline-flex; flex: 0 0 auto; width: 1.15rem; height: 1.15rem; vertical-align: middle; }
.icon svg { width: 100%; height: 100%; }

.topbar { position: sticky; top: 0; height: var(--bar); z-index: 10; border-bottom: 1px solid var(--line); background: var(--surface); }
.top-inner { display: flex; align-items: center; gap: 12px; width: min(100%, 1424px); height: 100%; margin: auto; padding: 0 30px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; font-size: 1.16rem; font-weight: 750; letter-spacing: .02em; }
.brand img { display: block; border-radius: 6px; }
.top-right { display: flex; align-items: center; gap: 16px; margin-inline-start: auto; }
.dashboard-link { display: inline-flex; align-items: center; min-height: 40px; color: var(--soft); font-size: .875rem; white-space: nowrap; }
.dashboard-link:hover { color: var(--accent); }
.freshness { display: none; color: var(--soft); font-size: .875rem; white-space: nowrap; }
.freshness.ready { display: inline-flex; align-items: center; gap: 7px; }
.freshness.ready::before { width: 6px; height: 6px; border-radius: 50%; background: var(--green); content: ''; }
.icon-button { display: inline-grid; width: 40px; height: 40px; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--soft); }
.icon-button:hover { background: var(--hover); color: var(--text); }
.menu-button, .sidebar-mobile { display: none; }

.shell { display: grid; grid-template-columns: 240px minmax(0, 1040px); justify-content: start; gap: 32px; width: min(100%, 1424px); margin: auto; padding: 0 32px 0 0; }
.sidebar { position: sticky; top: var(--bar); align-self: start; height: calc(100dvh - var(--bar)); overflow: auto; padding: 17px 12px; border-inline-end: 1px solid var(--line); background: var(--surface); scrollbar-width: thin; }
.home-link, .nav-link { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 6px 9px; border-radius: 8px; }
.home-link { font-size: .94rem; font-weight: 650; }
.home-icon, .source-icon { display: inline-grid; flex: 0 0 auto; width: 26px; height: 26px; place-items: center; border-radius: 7px; }
.home-icon { color: var(--accent); }
.home-link:hover, .nav-link:hover { background: var(--hover); }
.home-link[aria-current], .nav-link[aria-current] { background: var(--accent-fill); color: var(--accent); }
.nav-heading { margin: 17px 9px 8px; color: var(--muted); font-size: .875rem; font-weight: 650; }
.nav-filter, .story-filter { display: flex; align-items: center; gap: 7px; color: var(--muted); }
.nav-filter { margin: 0 4px 9px; min-height: 37px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--page); }
.nav-filter input, .story-filter input { width: 100%; min-width: 0; border: 0; background: transparent; color: var(--text); outline: none; }
.nav-filter input { font-size: .875rem; }
.nav-filter input::placeholder, .story-filter input::placeholder { color: var(--muted); }
.nav-filter:focus-within, .story-filter:focus-within { border-color: var(--accent); }
.nav-filter .icon, .story-filter .icon { width: 1rem; height: 1rem; }
.nav-link { font-size: .875rem; }
.source-icon { background: #4b6179; color: #fff; font-size: .72rem; font-weight: 750; line-height: 1; white-space: nowrap; }
.nav-name { overflow-wrap: anywhere; font-weight: 580; }
.nav-channel { margin-inline-start: auto; color: var(--muted); font-size: .75rem; text-align: right; }
.nav-empty { padding-inline: 8px; color: var(--muted); font-size: .875rem; }

main { min-width: 0; padding-top: 26px; }
.main-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px 24px; padding: 4px 1px 19px; }
.page-title { min-width: 0; }
h1 { margin: 0; font-size: clamp(1.65rem, 2.1vw, 2.06rem); font-weight: 750; line-height: 1.25; letter-spacing: -.03em; overflow-wrap: anywhere; }
.page-title p { margin: 7px 0 0; color: var(--muted); font-size: .875rem; }
.page-actions { display: flex; min-width: 0; max-width: 100%; align-items: center; gap: 8px; margin-top: 2px; }
.action-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--soft); font-size: .875rem; white-space: nowrap; }
.action-button .icon { width: 1rem; height: 1rem; }
.action-button:hover { border-color: var(--accent-line); background: var(--accent-fill); color: var(--accent); }
.story-filter { width: 210px; min-width: 0; min-height: 42px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.story-filter input { font-size: .875rem; }

.notice { margin: 0 0 13px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--soft); font-size: .875rem; }
.notice.error { border-color: var(--accent-line); color: var(--accent); }
.content { display: grid; gap: 15px; min-width: 0; }
.results-layout { min-width: 0; }
.ad-group { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 300px)); justify-content: center; align-items: start; gap: 12px; min-width: 0; }
.ad-group:empty { display: none; }
.ad-rail { grid-template-columns: minmax(0, 1fr); }
.ad-inline { grid-column: 1 / -1; }
#ads-top:not(:empty) { margin-bottom: 15px; }
#ads-bottom:not(:empty) { margin-top: 15px; }
.ad-card { align-self: start; justify-self: center; width: min(100%, 300px); margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
.ad-label { position: absolute; inset: auto 6px 6px auto; padding: 2px 5px; border-radius: 4px; background: rgb(16 20 26 / 82%); color: #fff; font-size: .688rem; line-height: 1.4; pointer-events: none; }
.ad-cta { display: none; }
.ad-text-only .ad-cta { display: inline-block; margin: 10px 44px 10px 12px; color: var(--accent); font-size: .875rem; }
.ad-text-only a { min-height: 44px; }
.ad-text-only a:hover .ad-cta { text-decoration: underline; }
.ad-card a { position: relative; display: block; width: 100%; }
.ad-card a:focus-visible { outline-offset: -3px; }
.ad-card img { display: block; width: 100%; height: auto; }
#ad-contact { display: inline-block; margin-inline-start: 8px; color: var(--link); }
#ad-contact:hover { text-decoration: underline; }
@media (min-width: 1200px) {
  .shell:has(.with-rail), body:has(.with-rail) .top-inner { width: min(100%, 1662px); }
  .shell:has(.with-rail) { grid-template-columns: 240px minmax(0, 1fr); }
  .results-layout.with-rail { display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; gap: 18px; }
  .results-layout.with-rail .platform-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr)); }
}
@media (min-width: 1280px) {
  .results-layout.with-rail .platform-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1199.98px) {
  .results-layout.with-inline .platform-grid { grid-template-columns: 1fr; }
}
.section { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.section-heading { display: flex; align-items: center; gap: 10px; min-height: 55px; padding: 11px 19px; border-bottom: 1px solid var(--line); }
.section-heading h2 { margin: 0; font-size: 1rem; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.count { flex-shrink: 0; color: var(--muted); font-size: .813rem; }
.stories { margin: 0; padding: 0 19px; list-style: none; }
.story { display: flex; align-items: flex-start; gap: 12px; min-width: 0; padding: 16px 0; border-bottom: 1px solid var(--line); }
.story:last-child { border-bottom: none; }
.rank { display: inline-grid; flex: 0 0 auto; min-width: 25px; height: 24px; place-items: center; border-radius: 5px; background: var(--rank-fill); color: var(--soft); font-size: .75rem; font-weight: 720; font-variant-numeric: tabular-nums; }
.rank-1, .rank-2, .rank-3 { background: var(--accent-fill); color: var(--accent); }
.rank-1 { background: #dc4d2a; color: #fff; }
.rank-2 { background: #b55314; color: #fff; }
.story-detail { flex: 1; min-width: 0; }
.story-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 8px; margin: 3px 0 0; font-variant-numeric: tabular-nums; color: var(--muted); font-size: .813rem; }
.story-meta span + span::before { margin-inline-end: 8px; content: "·"; }
.board-more:hover { color: var(--accent); }
.story-title { display: inline; color: var(--link); font-size: 1rem; overflow-wrap: anywhere; }
.story-title:visited { color: var(--visited); }
.story-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.platform-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; align-items: start; }
.platform-list .story { align-items: flex-start; }
.board-more { display: block; margin: 0 19px; padding: 10px 0; border-top: 1px solid var(--line); color: var(--soft); font-size: .875rem; }
.empty, .section-note { margin: 0; padding: 14px 19px; color: var(--muted); font-size: .875rem; }
.section-note { padding-block: 9px; border-bottom: 1px solid var(--line); }
.news-source-note { margin: 0; padding: 23px 0 28px; color: var(--muted); font-size: .813rem; }
body:has(> .site-footer) { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
body:has(> .site-footer) > :is(main, .shell) { margin-block: 0; }
body > :is(.admin-shell, .file-shell) { width: 100%; }
.privacy-top { justify-content: space-between; }
.privacy-content { width: min(92%, 1400px); margin-inline: auto; padding: clamp(28px, 4vw, 56px) clamp(16px, 3.6vw, 48px); border-inline-start: 1px solid var(--line); overflow-wrap: anywhere; }
.privacy-content h1 { margin: 0; padding-block-end: clamp(16px, 2vw, 28px); border-bottom: 1px solid var(--line); font-size: clamp(1.75rem, 3vw, 2.25rem); line-height: 1.3; }
.privacy-content p { margin: clamp(18px, 2vw, 28px) 0 0; color: var(--text); font-size: clamp(1rem, 1.5vw, 1.25rem); line-height: 1.85; }
@media (max-width: 640px) {
  .privacy-content { width: 100%; border-inline-start: 0; }
}
.privacy-content a { color: var(--link); text-decoration: underline; }
.site-footer { margin-top: auto; padding: 14px max(12px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: .8125rem; line-height: 1.65; }
.site-footer-links, .site-footer-meta { display: flex; justify-content: center; flex-wrap: wrap; column-gap: 1rem; }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover, .site-footer a:focus-visible { text-decoration: underline; }


@media (max-width: 1050px) {
  .shell { grid-template-columns: 204px minmax(0, 1fr); gap: 20px; padding-inline-end: 20px; }
  .top-inner { padding-inline: 20px; }
  .platform-grid { grid-template-columns: 1fr; }
}

@media (max-width: 767.98px) {
  :root { --bar: 56px; }
  .top-inner { gap: 8px; padding-inline: max(12px, env(safe-area-inset-left)); }
  .brand { gap: 7px; font-size: 1rem; }
  .brand img { width: 29px; height: 29px; }
  .top-right { gap: 9px; }
  .freshness { font-size: .75rem; }
  .freshness.ready { gap: 5px; }
  .icon-button { width: 42px; height: 42px; }
  .menu-button { display: inline-grid; border-color: transparent; }
  .shell { display: block; padding: 15px max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); }
  main { padding-top: 0; }
  .sidebar { position: fixed; z-index: 21; inset: 0 auto 0 0; width: min(84vw, 320px); height: 100dvh; padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); border: 0; border-inline-end: 1px solid var(--line); visibility: hidden; transform: translateX(-100%); transition: transform 150ms ease, visibility 150ms; }
  .drawer-open { overflow: hidden; }
  .drawer-open .sidebar { visibility: visible; transform: translateX(0); }
  .sidebar-mobile { display: flex; align-items: center; justify-content: space-between; margin: 0 0 8px 8px; font-weight: 700; }
  .scrim { position: fixed; inset: 0; z-index: 20; width: 100%; border: 0; background: rgb(17 23 32 / 44%); }
  .main-heading { flex-wrap: wrap; padding: 0 0 13px; }
  .page-title p { margin-top: 4px; }
  .page-actions { flex: 1 1 280px; justify-content: flex-end; margin-top: 0; }
  .action-button { min-height: 42px; }
  .story-filter { flex: 1 1 160px; max-width: 250px; }
  .content, .platform-grid { gap: 11px; }
  .section-heading { min-height: 48px; padding: 9px 12px; }
  .stories { padding-inline: 12px; }
  .story { gap: 8px; padding-block: 10px; }
  .board-more { margin-inline: 12px; }
  .empty, .section-note { padding-inline: 12px; }
}

@media (max-width: 405px) {
  .page-title { flex-basis: 100%; }
  .story-filter { padding-inline: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
}

@media (max-width: 405px) {
  .top-right { gap: 4px; }
  .freshness.ready { display: none; }
}
