:root {
  color: #172b3a;
  background: #f5f7fa;
  font: 16px/1.65 "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --ink: #172b3a;
  --subtle: #4a5e6b;
  --teal: #14676b;
  --line: #d9e2e8;
  --panel: #edf3f4;
  --paper: #fff;
  --highlight: #f3e6a8;
  --serif: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--teal); text-underline-offset: .22em; }
a:hover { text-decoration-thickness: 2px; }
button, input, textarea, select { color: inherit; font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
button, input, textarea, select { border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
button, select { min-height: 44px; padding: .45rem .8rem; }
input, textarea { min-height: 46px; padding: .55rem .75rem; width: 100%; }
textarea { resize: vertical; }
::selection { background: var(--highlight); color: var(--ink); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 4px; }
[hidden] { display: none !important; }
.skip { position: absolute; left: 1rem; transform: translateY(-150%); z-index: 3; background: var(--paper); padding: .5rem 1rem; }
.skip:focus { transform: translateY(0); }
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 76px; background: var(--paper); border-bottom: 1px solid var(--line); padding: 0 clamp(1rem, 4vw, 4rem);
}
.brand { display: inline-flex; align-items: center; gap: .75rem; color: var(--ink); text-decoration: none; font: 700 1.58rem/1 var(--serif); }
.brand-mark {
  width: 28px; height: 25px; border: 2px solid var(--teal); border-radius: 2px 7px 2px 7px;
  display: inline-block; position: relative;
}
.brand-mark::before { content: ""; position: absolute; width: 2px; background: var(--teal); inset: 4px auto 4px 11px; }
.brand-mark::after { content: ""; position: absolute; bottom: -5px; right: 4px; width: 5px; height: 11px; background: #b5d6d1; }
.top-actions { display: flex; align-items: center; gap: clamp(.5rem, 3vw, 1.7rem); }
.top-actions a { text-decoration: none; color: var(--ink); min-height: 44px; display: flex; align-items: center; gap: 6px; }
.top-actions a:hover, .navigation a:hover { color: var(--teal); }
.top-actions a span { color: var(--subtle); font-size: .75rem; border: 1px solid var(--line); padding: 0 .35em; border-radius: 4px; }
.primary { background: var(--teal); color: white; border-color: var(--teal); font-weight: 650; }
.primary:hover { background: #0d5559; }
.secondary:hover { background: var(--panel); }
.shell { max-width: 1520px; margin: 0 auto; display: grid; grid-template-columns: 190px minmax(0, 1fr); min-height: calc(100vh - 77px); }
.rail { padding: 3.2rem 1rem 1.75rem clamp(1rem, 3.5vw, 3.5rem); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2rem; }
.navigation { display: grid; gap: .35rem; }
.navigation a {
  display: flex; align-items: center; min-height: 44px; color: var(--subtle); text-decoration: none;
  border-radius: 6px; padding: .4rem .85rem; font-weight: 580; white-space: nowrap;
}
.navigation a[aria-current="page"] { color: var(--teal); background: #e1eeee; font-weight: 700; }
.rail-foot { margin-top: auto; color: var(--subtle); font-size: .8rem; padding: 0 .85rem; }
.rail-foot span { padding: 0 .3em; }
main { min-width: 0; padding: 3.1rem clamp(1.2rem, 4.25vw, 4.5rem) 4rem; outline: none; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 1.2rem; margin: 0 0 1.6rem; }
h1, h2, h3, p { margin: 0; }
h1 { font: 700 clamp(2.1rem, 4.6vw, 3.5rem)/1.19 var(--serif); text-wrap: balance; letter-spacing: -.025em; }
h2 { font-size: 1.22rem; line-height: 1.42; }
h3 { font-size: 1.04rem; }
.quiet, .meta, .empty p { color: var(--subtle); }
.meta { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem 1rem; font-size: .87rem; overflow-wrap: anywhere; }
.meta time { font-variant-numeric: tabular-nums; }
.switch { display: flex; gap: .4rem; border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; }
.switch button, .switch a { display: inline-flex; align-items: center; padding: .45rem .75rem; min-height: 44px; border: 0; border-radius: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--subtle); text-decoration: none; font-weight: 600; }
.switch [aria-current="page"], .switch button[aria-pressed="true"] { border-bottom-color: var(--teal); color: var(--teal); }
.switch a:hover, .switch button:hover { color: var(--teal); }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(13rem, 16rem); gap: clamp(1.5rem, 4vw, 4rem); align-items: start; }
.queue { min-width: 0; }
.feature { background: #e5efef; padding: clamp(1.25rem, 4vw, 2.3rem); border-radius: 12px; margin-bottom: .8rem; display: grid; gap: .85rem; }
.feature h2 { font: 700 clamp(1.6rem, 4vw, 2.3rem)/1.37 var(--serif); text-wrap: balance; }
.feature h2 a, .entry-row h2 a, .result h2 a { color: var(--ink); text-decoration: none; }
.feature h2 a:hover, .entry-row h2 a:hover, .result h2 a:hover { color: var(--teal); text-decoration: underline; }
.feature .reason { max-width: 44rem; }
.feature .meta { order: -1; }
.entry-row { display: grid; gap: .38rem; border-bottom: 1px solid var(--line); padding: 1.05rem .15rem; overflow-wrap: anywhere; }
.entry-row h2 { font-family: var(--serif); }
.reason { color: #254747; font-size: .94rem; }
.rank-note { border-top: 2px solid #669a96; padding: .9rem 0; display: grid; gap: .6rem; }
.score-line { display: flex; flex-wrap: wrap; gap: .4rem .75rem; color: var(--subtle); font-size: .86rem; }
.score-line strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.empty { border-top: 1px solid var(--line); padding: 1.4rem 0; display: grid; gap: .45rem; }
.empty button { justify-self: start; margin-top: .55rem; }
.feedback { color: #8b302b; overflow-wrap: anywhere; }
.save-form {
  position: fixed; z-index: 2; top: 84px; right: clamp(1rem, 4vw, 4rem); width: min(38rem, calc(100% - 2rem));
  background: var(--paper); box-shadow: 0 10px 30px #18374326; border-radius: 12px; padding: 1rem 1.15rem;
}
.save-form label, .stack-form label { display: block; font-weight: 650; margin-bottom: .42rem; }
.form-row { display: flex; gap: .6rem; }
.form-row button { white-space: nowrap; }
.save-form .feedback:not(:empty) { margin-top: .4rem; }
.notice {
  z-index: 3; position: fixed; max-width: calc(100% - 2rem); right: 1rem; bottom: 1rem;
  padding: .7rem 1rem; border-radius: 8px; background: #164347; color: white;
}
.back { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: .65rem; font-size: .9rem; }
.reader-head { grid-column: 1 / -1; display: grid; gap: 1rem; }
.reader-head h1 { max-width: 23em; }
.actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.reader { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, 19rem); gap: 2.35rem clamp(1.5rem, 4vw, 4rem); align-items: start; }
.prose { font: 1.12rem/1.95 var(--serif); display: grid; gap: 1.3em; max-width: 42rem; overflow-wrap: anywhere; }
.prose p { scroll-margin-top: 2rem; }
.prose mark { background: var(--highlight); color: inherit; }
.prose .timestamp { display: inline-flex; justify-content: center; align-items: center; min-width: 44px; min-height: 44px; font: .85rem/1.5 sans-serif; font-variant-numeric: tabular-nums; margin-right: .55rem; }
.margin { min-width: 0; position: sticky; top: 1rem; padding-top: .25rem; }
.margin .switch { margin-bottom: .9rem; overflow-wrap: normal; }
.margin .switch button { padding-inline: .55rem; }
.margin section { display: grid; gap: .75rem; }
.quote {
  margin: 0; padding: .55rem .65rem; background: #f6efce; color: #3c3827;
  font-family: var(--serif); white-space: pre-wrap; overflow-wrap: anywhere;
}
.annotation { display: grid; gap: .4rem; padding-bottom: .85rem; border-bottom: 1px solid var(--line); }
.annotation p, .answer { white-space: pre-wrap; overflow-wrap: anywhere; }
.annotation button { justify-self: start; }
.annotation-editor { padding: .85rem; border-radius: 10px; background: var(--panel); }
.stack-form { margin-bottom: 1.7rem; max-width: 48rem; }
.stack-form .form-row { align-items: start; }
.result, .digest, .source-block { border-top: 1px solid var(--line); padding: 1rem 0; display: grid; gap: .6rem; overflow-wrap: anywhere; }
.result p { max-width: 68ch; }
.digest .answer { max-width: 66ch; }
.source-block { max-width: 52rem; }
.source-block .stack-form { margin: 0; }
.source-feed { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .5rem 0; }
.source-feed p { overflow-wrap: anywhere; }
.loading { min-height: 4rem; }
@media (max-width: 1040px) {
  .shell { grid-template-columns: 145px minmax(0, 1fr); }
  .rail { padding-inline: 1rem; }
  .reader { grid-template-columns: minmax(0, 1fr) minmax(13.8rem, 17rem); }
}
@media (max-width: 820px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 1.8rem; }
  .rank-note { max-width: 44rem; }
  .reader { grid-template-columns: minmax(0, 1fr); }
  .margin { position: static; }
}
@media (max-width: 640px) {
  .top { min-height: 65px; }
  .brand { font-size: 1.35rem; gap: .5rem; }
  .brand-mark { transform: scale(.86); transform-origin: left center; }
  .top-actions { gap: .5rem; font-size: .85rem; }
  .top-actions a { padding-inline: .24rem; }
  .top-actions a span { display: none; }
  .shell { display: block; }
  .rail { display: block; padding: .35rem 1rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .navigation { display: flex; gap: .25rem; justify-content: space-between; }
  .navigation a { padding-inline: clamp(.25rem, 2vw, .7rem); }
  .rail-foot { display: none; }
  main { padding: 1.65rem 1rem 2.2rem; }
  .page-head { align-items: center; }
  .page-head select { font-size: .85rem; }
  .save-form { top: 72px; }
  .prose { font-size: 1.04rem; }
  .margin:has(.annotation-editor) { position: sticky; bottom: 0; align-self: end; background: var(--paper); padding: .5rem; border-top: 1px solid var(--line); max-height: 52vh; overflow: auto; }
}
