:root {
  --bg: #ffffff;
  --surface: #fafafa;
  --surface-2: #f0f0f0;
  --ink: #1a1a1a;
  --text: #3d3d3d;
  --muted: #8a8a8a;
  --line: #e2e2e2;
  --line-strong: #bcbcbc;
  --accent: #1a1a1a;
  --paper: #ffffff;
  --paper-raised: #ffffff;
  --gold: #8a8a8a;
  --accent-soft: #f0f0f0;
  --serif: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-size: 17px;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.55; overflow: hidden; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
::selection { background: #dedede; }
.app-shell { display: flex; width: 100%; height: 100vh; overflow: hidden; background: #fff; }
.nav-rail { width: 232px; flex: 0 0 232px; display: flex; flex-direction: column; gap: 17px; padding: 17px 14px 14px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 8px; padding: 0 6px; color: var(--ink); text-decoration: none; font-weight: 500; letter-spacing: -.01em; }
.brand-mark { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid var(--ink); border-radius: 6px; background: #ebebeb; font-size: 11px; }
.search-box { min-height: 37px; display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid #d4d4d4; border-radius: 8px; background: #fff; color: #6b6b6b; }
.search-box:focus-within { border-color: var(--ink); }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; }
.search-box input::placeholder { color: #6b6b6b; }
.search-box kbd { border: 0; background: transparent; color: var(--muted); font-family: inherit; font-size: 11px; }
.primary-nav, .topic-list { display: flex; flex-direction: column; gap: 5px; }
.nav-button, .topic-button { width: 100%; display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; color: #6b6b6b; text-align: left; font-size: 13px; }
.nav-button:hover, .topic-button:hover, .nav-button.active, .topic-button.active { background: var(--surface-2); color: var(--ink); }
.nav-button b { margin-left: auto; min-width: 19px; padding: 1px 6px; border-radius: 999px; background: #e2e2e2; color: #6b6b6b; text-align: center; font-size: 10px; font-weight: 500; }
.rail-heading { display: flex; justify-content: space-between; padding: 0 6px; margin-top: 6px; color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.topic-dot { width: 8px; height: 8px; flex: none; border-radius: 999px; background: var(--ink); }
.topic-button { padding: 11px 10px; font-size: 16px; font-weight: 500; letter-spacing: -.01em; }
.topic-button small { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 400; }
.rail-foot { margin-top: auto; padding: 12px 6px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 5px; }
.rail-foot > span { color: var(--muted); font-size: 11px; }
.rail-foot strong { font-size: 20px; font-weight: 500; }
.rail-foot p { margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.mini-progress { height: 4px; overflow: hidden; border-radius: 4px; background: var(--line); }
.mini-progress span { display: block; width: 0; height: 100%; background: var(--ink); transition: width .15s ease; }
.list-column { width: 320px; flex: 0 0 320px; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: #fff; overflow: hidden; }
.list-header { padding: 17px; border-bottom: 1px solid var(--line); }
.kicker { color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.list-header h2 { margin: 4px 0 1px; font-size: 25px; font-weight: 500; line-height: 1.15; letter-spacing: -.02em; }
.list-header p { margin: 0; color: var(--muted); font-size: 12px; }
.article-list { flex: 1; overflow-y: auto; padding: 11px; display: flex; flex-direction: column; gap: 8px; }
.article-card { width: 100%; display: flex; flex-direction: column; gap: 7px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; text-align: left; cursor: pointer; }
.article-card:hover { border-color: var(--line-strong); }
.article-card[aria-current="true"] { border-color: var(--ink); background: linear-gradient(160deg, #f4f4f4, #fff); }
.article-card .card-meta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.article-card time { margin-left: auto; }
.article-card strong { font-size: 16px; font-weight: 500; line-height: 1.3; letter-spacing: -.01em; }
.article-card p { display: -webkit-box; margin: 0; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; color: #6b6b6b; font-size: 12.5px; line-height: 1.5; }
.card-progress-row { display: flex; align-items: center; gap: 8px; }
.card-progress-row span:last-child { color: var(--muted); font-size: 11px; white-space: nowrap; }
.card-progress { flex: 1; height: 3px; overflow: hidden; border-radius: 3px; background: var(--line); }
.card-progress i { display: block; height: 100%; background: var(--ink); }
.empty-list { padding: 34px 14px; text-align: center; color: var(--muted); font-size: 13px; }
.reader-main { min-width: 0; flex: 1; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.top-progress { height: 2px; flex: none; background: var(--surface-2); }
.top-progress span { display: block; width: 0; height: 100%; background: var(--ink); transition: width .1s linear; }
.reader-toolbar { min-height: 55px; flex: none; display: flex; align-items: center; gap: 8px; padding: 10px 17px; border-bottom: 1px solid var(--line); }
.toolbar-title { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.toolbar-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; font-weight: 500; letter-spacing: -.01em; }
.toolbar-title span { color: var(--muted); font-size: 11px; }
.tool-button { min-width: 36px; height: 36px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font-size: 13px; }
.tool-button:hover, .tool-button.active { background: var(--surface-2); }
.top-mode-nav { display: flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.top-mode-nav .nav-button { width: auto; min-height: 28px; gap: 5px; padding: 5px 8px; border-radius: 6px; font-size: 11px; white-space: nowrap; }
.top-mode-nav .nav-button:hover, .top-mode-nav .nav-button.active { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.top-mode-nav .nav-button b { min-width: 17px; margin-left: 1px; padding: 0 5px; font-size: 9px; }
.language-control { position: relative; }
.language-button { font-size: 11px; letter-spacing: .05em; }
.language-menu { position: absolute; top: 42px; right: 0; z-index: 20; width: 128px; padding: 6px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; box-shadow: 0 16px 40px rgba(0,0,0,.1); }
.language-menu button { width: 100%; padding: 7px 9px; border: 0; border-radius: 6px; background: transparent; text-align: left; cursor: pointer; font-size: 12px; }
.language-menu button:hover { background: var(--surface-2); }
.reader-workspace { min-height: 0; flex: 1; display: flex; overflow: hidden; }
.reader-scroll { min-width: 0; flex: 1; overflow-y: auto; scroll-behavior: smooth; }
.reader { width: min(720px, calc(100% - 56px)); margin: 0 auto; padding: 54px 0 90px; }
.reader-loading { color: var(--muted); }
.article-kicker { display: flex; align-items: center; gap: 8px; margin-bottom: 11px; color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.article-kicker::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: var(--ink); }
.reader h1 { margin: 0 0 11px; font-size: 38px; font-weight: 500; line-height: 1.1; letter-spacing: -.025em; }
.article-subtitle { margin: 0 0 9px; color: #6b6b6b; font-size: 16px; line-height: 1.5; }
.article-meta { margin-bottom: 10px; color: var(--muted); font-size: 12.5px; }
.article-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 28px; }
.article-tags span { padding: 3px 9px; border: 1px solid #d4d4d4; border-radius: 999px; color: var(--muted); font-size: 11px; }
.article-lead { margin: 0 0 28px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--text); font-size: 15px; line-height: 1.65; }
.article-section { scroll-margin-top: 28px; }
.article-section h2 { margin: 39px 0 14px; font-size: 25px; font-weight: 500; line-height: 1.2; letter-spacing: -.015em; }
.article-section p { position: relative; margin: 0 0 18px; padding: 5px 31px 5px 0; border-radius: 8px; color: var(--text); font-size: var(--font-size); line-height: 1.78; cursor: pointer; transition: background .12s ease; }
.article-section p:hover { background: #fafafa; }
.article-section p::after { content: "✦"; position: absolute; top: 7px; right: 7px; color: var(--line-strong); font-size: 11px; opacity: 0; }
.article-section p:hover::after { opacity: 1; }
.article-section p.is-saved { padding-left: 12px; border-left: 2px solid var(--ink); background: #fafafa; }
.article-section p.is-saved::after { color: var(--ink); opacity: 1; }
.sources { margin-top: 45px; padding-top: 22px; border-top: 1px solid var(--line); }
.sources h2 { margin: 0 0 12px; font-size: 16px; font-weight: 500; }
.sources ol { margin: 0; padding-left: 20px; }
.sources li { margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.sources a { color: #3d3d3d; text-underline-offset: 3px; }
.context-panel { width: 278px; flex: 0 0 278px; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: #fff; transition: width .18s ease, opacity .18s ease; }
.context-panel.closed { width: 0; flex-basis: 0; opacity: 0; overflow: hidden; border: 0; }
.context-tabs { display: flex; gap: 3px; padding: 11px; border-bottom: 1px solid var(--line); }
.context-tabs button { flex: 1; padding: 6px 5px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; }
.context-tabs button:hover, .context-tabs button.active { background: var(--surface-2); color: var(--ink); }
.context-body { flex: 1; overflow-y: auto; padding: 14px; }
.toc { display: flex; flex-direction: column; gap: 2px; }
.toc a { display: flex; gap: 9px; padding: 8px; border-radius: 7px; color: #6b6b6b; text-decoration: none; font-size: 12.5px; line-height: 1.45; }
.toc a::before { content: ""; width: 1px; align-self: stretch; background: #d4d4d4; }
.toc a:hover { background: var(--surface); color: var(--ink); }
.summary-panel { display: flex; flex-direction: column; gap: 12px; }
.summary-card { padding-left: 11px; border-left: 1px solid #d4d4d4; }
.summary-card strong { display: block; margin-bottom: 3px; font-size: 10px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }
.summary-card p { margin: 0; color: var(--text); font-size: 12.5px; line-height: 1.55; }
.notes-panel p { margin: 0 0 10px; color: #6b6b6b; font-size: 12.5px; line-height: 1.5; }
.saved-note { padding: 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; }
.saved-note + .saved-note { margin-top: 8px; }
.saved-note span { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; color: var(--muted); font-size: 12px; line-height: 1.5; }
.mobile-only { display: none; }
@media (max-width: 1180px) {
  .nav-rail { width: 205px; flex-basis: 205px; }
  .list-column { width: 286px; flex-basis: 286px; }
  .context-panel { width: 235px; flex-basis: 235px; }
}
@media (max-width: 900px) {
  .nav-rail { display: none; }
  .mobile-only { display: inline-grid; place-items: center; }
}
@media (max-width: 700px) {
  body { overflow: auto; }
  .app-shell { min-height: 100vh; height: auto; display: block; overflow: visible; }
  .list-column { width: 100%; height: auto; border-right: 0; }
  .list-column.mobile-hidden { display: none; }
  .list-header { padding: 18px; }
  .article-list { max-height: none; overflow: visible; }
  .reader-main { min-height: 100vh; }
  .reader-main.mobile-hidden { display: none; }
  .reader-workspace { overflow: visible; }
  .reader-scroll { overflow: visible; }
  .reader { width: calc(100% - 38px); padding: 38px 0 70px; }
  .reader h1 { font-size: 34px; }
  .context-panel { display: none; }
  .reader-toolbar { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); }
  .top-mode-nav .nav-button { padding-inline: 7px; }
  .top-mode-nav .nav-button > span:first-child { display: none; }
}
@media (max-width: 470px) {
  .toolbar-title span { display: none; }
  .top-mode-nav .nav-button { padding-inline: 6px; }
  .top-mode-nav #savedButton b { display: none; }
}
