:root {
  color-scheme: light;
  --bg: #f8faf9; --surface: #fff; --sidebar: #fcfdfc; --field: #eef2f1;
  --ink: #202a30; --muted: #59656b; --quiet: #657176; --line: #dfe4e1;
  --accent: #176b75; --accent-soft: #e7f0f0; --note: #526f72;
  --amber: #7c5a24; --amber-soft: #f3eddc;
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink); letter-spacing: 0;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #131b1d; --surface: #1b2326; --sidebar: #171f22; --field: #1c2529;
  --ink: #e7eceb; --muted: #a5b0b3; --quiet: #89979d; --line: #2b3539;
  --accent: #12ccd8; --accent-soft: #16393d; --note: #8fb8a8;
  --amber: #d3b26a; --amber-soft: #383729;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 14px; line-height: 1.6; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button, input { background: none; }
button { border: 0; }
svg { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 1.7; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a:hover { color: var(--accent); }
button:hover { color: var(--accent); }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 10; padding: 10px; background: var(--surface); }
.skip-link:focus { top: 8px; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 180px; background: var(--sidebar); border-right: 1px solid var(--line); padding: 24px 12px 16px; display: flex; flex-direction: column; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 8px; height: 50px; font-size: 22px; font-weight: 750; white-space: nowrap; }
.brand img { flex-shrink: 0; width: 26px; height: 26px; }
.sidebar .brand { margin-bottom: 25px; font-size: 20px; }
.nav-label { font-size: 11px; color: var(--quiet); padding: 8px 10px; }
.sidebar nav { display: grid; gap: 5px; margin-bottom: 20px; }
.sidebar nav a, .rss-link { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 10px; color: var(--muted); border-radius: 8px; }
.sidebar nav a[aria-current], .mobile-nav a[aria-current] { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.sidebar nav a[aria-current] svg, .mobile-nav a[aria-current] svg { color: var(--accent); }
.rss-link { font-size: 13px; }
.appearance { margin-top: auto; padding-top: 24px; }
.theme-switch { display: grid; grid-template-columns: repeat(3, 1fr); padding: 3px; border: 1px solid var(--line); border-radius: 999px; height: 34px; }
.theme-switch .theme { border-radius: 999px; width: 100%; height: 26px; }
.theme[aria-pressed="true"] { border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.theme svg { width: 14px; height: 14px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex-shrink: 0; padding: 0; color: var(--quiet); border-radius: 6px; }
.page { margin-left: 180px; padding: 24px 28px 0; }
main { max-width: 1500px; margin: 0 auto; min-height: calc(100dvh - 110px); }
.page-title { margin-bottom: 16px; }
h1 { font-size: 24px; line-height: 1.4; margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.categories { display: flex; flex-shrink: 1; overflow-x: auto; border: 1px solid var(--line); border-radius: 999px; padding: 2px; background: var(--surface); scrollbar-width: none; }
.categories a { display: flex; align-items: center; justify-content: center; padding: 6px 17px; min-height: 36px; white-space: nowrap; color: var(--muted); }
.categories a[aria-current] { background: var(--field); color: var(--ink); border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; }
.search-form { display: flex; align-items: center; width: 248px; height: 42px; flex-shrink: 0; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 0 10px; }
.search-form input { min-width: 0; width: 100%; border: 0; outline: none; padding: 6px 2px; }
.search-form:focus-within { border-color: var(--accent); }
.search-form input::placeholder { color: var(--quiet); }
#search { width: min(100%, 560px); }
#status { color: var(--quiet); min-height: 22px; margin: 18px 0; }
.day { margin-bottom: 18px; }
.day > summary { display: flex; align-items: center; gap: 18px; cursor: pointer; list-style: none; min-height: 30px; margin-bottom: 14px; }
.day > summary::-webkit-details-marker { display: none; }
.day-date { font-size: 18px; font-weight: 650; }
.day-count { color: var(--quiet); font-size: 12px; }
.day > summary svg { width: 14px; height: 14px; color: var(--quiet); }
.day:not([open]) > summary svg { transform: rotate(-90deg); }
.fold-mark { width: 8px; height: 8px; border-right: 1px solid var(--quiet); border-bottom: 1px solid var(--quiet); transform: rotate(45deg); margin: 0 3px; }
.day:not([open]) .fold-mark { transform: rotate(-45deg); }
.timeline-row { display: grid; grid-template-columns: 86px minmax(0, 1fr); margin-bottom: 14px; align-items: start; }
.timeline-time { position: relative; padding-top: 17px; color: var(--muted); font-size: 12px; font-weight: 650; font-family: ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.timeline-time::after { content: ""; position: absolute; right: 8px; top: 25px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.entry { border: 1px solid var(--line); border-radius: 8px; padding: 14px 18px; background: var(--surface); overflow-wrap: anywhere; min-width: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--quiet); font-size: 12px; }
.card-head .meta { padding-top: 5px; }
.selected { padding: 1px 8px; border-radius: 999px; color: var(--amber); background: var(--amber-soft); font-size: 11px; white-space: nowrap; font-weight: 600; }
.selected::before { content: ""; display: inline-block; width: 5px; height: 5px; background: currentColor; border-radius: 50%; margin-right: 4px; vertical-align: 1px; }
.card-tools { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.score { color: var(--accent); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); border-radius: 999px; padding: 0 8px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.star[aria-pressed="true"] { color: var(--accent); }
.star[aria-pressed="true"] svg { fill: var(--accent-soft); }
h2 { font-size: 17px; line-height: 1.6; font-weight: 650; margin: 0 0 8px; }
.summary { color: var(--muted); font-size: 15px; line-height: 1.85; margin: 0; }
.reason { color: var(--note); font-size: 13px; line-height: 1.8; margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
footer { display: flex; flex-wrap: wrap; gap: 18px; padding: 22px 0; border-top: 1px solid var(--line); color: var(--quiet); font-size: 12px; max-width: 1500px; margin: 0 auto; }
.back { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); margin-bottom: 28px; }
.detail { max-width: 860px; margin: 0 auto; padding: 16px 0 48px; overflow-wrap: anywhere; }
.detail h1 { font-size: 28px; margin: 14px 0 22px; }
.lead { font-size: 17px; color: var(--muted); line-height: 1.9; }
.detail .reason { margin-bottom: 24px; }
.body { font-size: 16px; line-height: 1.9; }
.body h2, .body h3 { margin-top: 28px; }
.body a { color: var(--accent); text-decoration: underline; }
.body pre, .body table { display: block; max-width: 100%; overflow-x: auto; }
.body pre { background: var(--field); padding: 16px; border-radius: 8px; }
.body blockquote { border-left: 3px solid var(--line); padding-left: 18px; margin-left: 0; color: var(--muted); }
.actions { display: flex; align-items: center; gap: 18px; margin-top: 28px; }
.original { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; color: var(--accent); }
.empty { padding: 40px 0; color: var(--quiet); }
.mobile-header, .mobile-nav { display: none; }
@media (max-width: 1200px) {
  .filter-bar { flex-wrap: wrap; gap: 12px; }
  .categories { max-width: 100%; }
}
@media (max-width: 960px) {
  .sidebar { display: none; }
  .mobile-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--sidebar); }
  .mobile-header .brand { font-size: 19px; }
  .mobile-header .theme-switch { width: 114px; flex-shrink: 0; }
  .mobile-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: fixed; inset: auto 0 0; z-index: 5; border-top: 1px solid var(--line); background: var(--sidebar); padding: 4px 8px max(4px, env(safe-area-inset-bottom)); }
  .mobile-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 48px; border-radius: 8px; color: var(--muted); font-size: 11px; }
  .page { margin-left: 0; padding: 20px 16px 72px; }
  .filter-bar { flex-direction: column; align-items: stretch; margin-bottom: 22px; }
  .categories a { padding-inline: 16px; }
  .search-form { width: 100%; }
  .timeline-row { grid-template-columns: 58px minmax(0, 1fr); }
  .timeline-time::after { right: 6px; }
  .entry { padding: 12px; }
  .card-head { gap: 6px; flex-wrap: wrap; }
  .card-tools { margin-left: auto; }
  .detail h1 { font-size: 24px; }
  main { min-height: calc(100dvh - 230px); }
}
@media (max-width: 480px) {
  .day > summary { gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--line); }
  .day-date { font-size: 16px; }
  .timeline-row { display: block; margin-bottom: 0; position: relative; }
  .timeline-time { display: block; padding: 2px 0 0; font-size: 11px; }
  .timeline-time::after { display: none; }
  .entry { background: none; border: 0; border-radius: 0; padding: 4px 0 18px; border-bottom: 1px solid var(--line); }
  .day-entries > :last-child .entry { border-bottom: 0; }
  h2 { font-size: 16px; }
  .summary { font-size: 14px; }
  .reason { font-size: 12px; }
  .score { font-size: 10px; }
}
