/* TimelyReach — newspaper (WSJ-like) look: serif headlines, hairline column rules,
   black-and-white with a single quiet accent. */
:root {
  --bg: #ffffff;
  --paper: #ffffff;
  --text: #111111;
  --ink-2: #333333;
  --muted: #666666;
  --rule: #d9d9d9;
  --rule-strong: #111111;
  --accent: #0274b6;
  --kicker: #0274b6;
  --notice-bg: #f6f3ea;
  --btn-bg: #111111;
  --btn-ink: #ffffff;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", Georgia, "Times New Roman", serif;
  --masthead: "Playfair Display", "Noto Serif SC", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121212;
    --paper: #121212;
    --text: #ececec;
    --ink-2: #cfcfcf;
    --muted: #9a9a9a;
    --rule: #2e2e2e;
    --rule-strong: #ececec;
    --accent: #5fb3e8;
    --kicker: #5fb3e8;
    --notice-bg: #24211a;
    --btn-bg: #ececec;
    --btn-ink: #111111;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--sans); }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 700; line-height: 1.3; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- masthead ---------- */
.utility { border-bottom: 1px solid var(--rule); font-size: .8rem; color: var(--muted); }
.utility-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; }
.utility .search input {
  font: inherit; color: var(--text); background: transparent; border: 1px solid var(--rule);
  border-radius: 2px; padding: 4px 10px; width: 200px;
}
.utility-right { display: flex; align-items: center; gap: 12px; }
.userbox { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.userbox .avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; vertical-align: middle; }
.masthead { text-align: center; padding: 18px 0 10px; }
.masthead a:hover { text-decoration: none; }
.wordmark { display: block; font-family: var(--masthead); font-weight: 900; font-size: clamp(2.2rem, 6vw, 3.6rem); letter-spacing: -.5px; line-height: 1; }
.wordmark-cn { display: block; font-family: var(--serif); font-size: 1rem; letter-spacing: .5em; margin-top: 6px; color: var(--ink-2); }
.tagline { font-family: var(--serif); font-style: italic; font-size: .85rem; color: var(--muted); margin-top: 4px; }
.sections { border-top: 1px solid var(--rule-strong); border-bottom: 3px double var(--rule-strong); }
.sections-inner { display: flex; justify-content: center; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.sections-inner::-webkit-scrollbar { display: none; }
.sections a { padding: 9px 12px; white-space: nowrap; font-size: .9rem; font-weight: 600; letter-spacing: .02em; }
.sections a.on { box-shadow: inset 0 -3px 0 var(--rule-strong); }
.sections .sep { width: 1px; background: var(--rule); margin: 9px 6px; }

/* ---------- page frame ---------- */
.main { padding-top: 20px; padding-bottom: 40px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 0 32px; }
.col-side { border-left: 1px solid var(--rule); padding-left: 24px; }
.crumbs { font-size: .8rem; color: var(--muted); margin-bottom: 14px; text-transform: uppercase; letter-spacing: .04em; }
.empty { color: var(--muted); padding: 12px 0; margin: 0; font-style: italic; font-family: var(--serif); }
.notice { background: var(--notice-bg); padding: 10px 14px; margin: 10px 0; font-size: .92rem; }
.card { margin-bottom: 28px; }
.card.narrow { max-width: 680px; margin-left: auto; margin-right: auto; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  border-top: 2px solid var(--rule-strong); padding-top: 8px; margin-bottom: 12px;
}
.section-head h2 { font-size: 1.05rem; font-family: var(--sans); font-weight: 800; letter-spacing: .03em; }
.section-head a.more { font-size: .8rem; color: var(--muted); }
.side-head { border-top: 1px solid var(--rule-strong); padding-top: 6px; margin: 0 0 8px; font: 800 .82rem/1.4 var(--sans); letter-spacing: .06em; text-transform: uppercase; }
.kicker { display: inline-block; font: 700 .72rem/1.4 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--kicker); margin-bottom: 4px; }
.meta { font-size: .78rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: center; }
.meta .stat b { font-weight: 600; color: var(--ink-2); }
.dek { font-family: var(--serif); color: var(--ink-2); margin: 4px 0 6px; }

/* ---------- front page ---------- */
.front { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 0 32px; padding-bottom: 24px; border-bottom: 1px solid var(--rule); margin-bottom: 26px; }
.lead h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); line-height: 1.22; font-weight: 900; }
.lead .dek { font-size: 1.12rem; line-height: 1.6; }
.lead { padding-bottom: 18px; border-bottom: 1px solid var(--rule); margin-bottom: 16px; }
.subs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.subs .story { padding: 0 18px 14px; border-bottom: 1px solid var(--rule); margin-bottom: 14px; }
.subs .story:nth-child(odd) { padding-left: 0; border-right: 1px solid var(--rule); }
.subs .story:nth-child(even) { padding-right: 0; }
.story h3 { font-size: 1.12rem; line-height: 1.35; }
.story .dek { font-size: .92rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.rail .story { padding: 0 0 12px; margin-bottom: 12px; border-bottom: 1px solid var(--rule); }
.rail .story h3 { font-size: 1rem; }
.rail section + section { margin-top: 22px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid4 .story { padding: 0 16px 16px; border-right: 1px solid var(--rule); }
.grid4 .story:first-child { padding-left: 0; }
.grid4 .story:last-child { border-right: 0; padding-right: 0; }
.grid4 .story:first-child h3 { font-size: 1.3rem; }
.forums { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.forums > div { padding: 0 14px; border-right: 1px solid var(--rule); min-width: 0; }
.forums > div:first-child { padding-left: 0; }
.forums > div:last-child { border-right: 0; padding-right: 0; }
.forums h3 { font: 800 .9rem/1.4 var(--sans); margin-bottom: 6px; }
.forums .row { padding: 6px 0; }
.forums .row-stats { display: none; }
.forums .row-title { font-size: .92rem; }
.compose { display: block; font-size: .8rem; color: var(--accent); margin-top: 6px; }

/* ---------- lists (board pages, rails, JS-rendered rows) ---------- */
.rows, .sidelist, .hotlist, .comments, .levels { list-style: none; margin: 0; padding: 0; }
.rows-head { display: flex; justify-content: space-between; font: 700 .72rem/1.4 var(--sans); letter-spacing: .06em; color: var(--muted); padding: 6px 0; border-bottom: 1px solid var(--rule-strong); text-transform: uppercase; }
.row { display: flex; gap: 16px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.row:last-child { border-bottom: 0; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-family: var(--serif); font-weight: 700; font-size: 1.1rem; line-height: 1.4; }
.row-title:visited { color: var(--ink-2); }
.row .dek { font-size: .93rem; margin: 3px 0 4px; }
.row.pinned .row-title::before { content: "置顶"; font: 700 .68rem/1 var(--sans); letter-spacing: .06em; border: 1px solid currentColor; padding: 2px 4px; margin-right: 8px; vertical-align: 3px; }
.row-meta { font-size: .78rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: center; margin-top: 2px; }
.row-stats { width: 72px; text-align: right; align-items: flex-end; font-size: .75rem; color: var(--muted); display: flex; flex-direction: column; padding-top: 3px; }
.row-stats .replies { color: var(--text); font-weight: 700; font-size: .95rem; }
.row-stats .replies::after { content: " 回复"; font-weight: 400; font-size: .72rem; color: var(--muted); }
.viewcount { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); white-space: nowrap; }
.viewcount .eye { flex: none; }
.viewcount.big { font-size: .88rem; margin: 6px 0 2px; }
.tag { font: 700 .7rem/1.4 var(--sans); letter-spacing: .05em; color: var(--kicker); text-transform: uppercase; }
.tag-user { color: var(--muted); }
.tag-pick { color: #b8860b; }
.sidelist li, .hotlist li { padding: 8px 0; border-bottom: 1px solid var(--rule); font-family: var(--serif); font-size: .95rem; line-height: 1.45; }
.hotlist { counter-reset: hot; }
.hotlist li { counter-increment: hot; display: flex; gap: 10px; }
.hotlist li::before { content: counter(hot); font: 900 1.3rem/1 var(--masthead); color: var(--rule); min-width: 18px; }
.hotlist li:nth-child(-n+3)::before { color: var(--text); }
.hotlist li.muted::before { display: none; }
.levels li { display: flex; justify-content: space-between; padding: 4px 0; font-size: .88rem; border-bottom: 1px dotted var(--rule); }
.pager { display: flex; gap: 18px; justify-content: center; padding: 18px 0 4px; font-size: .9rem; }
.board-head { padding-bottom: 14px; border-bottom: 3px double var(--rule-strong); margin-bottom: 4px; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.board-head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 900; }
.board-head p { margin: 6px 0 0; font-family: var(--serif); color: var(--ink-2); }

/* ---------- article ---------- */
.article-wrap { max-width: 720px; }
.post-head { margin-bottom: 18px; }
.post-head h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); line-height: 1.22; font-weight: 900; margin: 4px 0 10px; }
.post-head .dek { font-size: 1.2rem; line-height: 1.55; color: var(--ink-2); margin-bottom: 12px; }
.byline { font-size: .82rem; color: var(--muted); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 8px 0; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.byline strong { color: var(--text); }
.post-body { font-family: var(--serif); font-size: 1.12rem; line-height: 1.85; overflow-wrap: anywhere; }
.post-body p { margin: 0 0 1.1em; }
.post-foot { border-top: 1px solid var(--rule); padding-top: 12px; margin-top: 8px; font-size: .88rem; }
.post-foot .tags a { margin-right: 10px; }
.post-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.prose ul { padding-left: 1.2em; }
.prose h2 { margin-top: 1.4em; font-size: 1.3rem; }
.prose { font-family: var(--serif); line-height: 1.8; }

/* ---------- comments ---------- */
#comments .section-head h2 { font-family: var(--serif); font-size: 1.3rem; font-weight: 900; letter-spacing: 0; }
.comment { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.comment-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: .85rem; }
.comment-head a { font-weight: 700; }
.level { font-size: .7rem; border: 1px solid var(--rule); padding: 0 5px; color: var(--muted); }
.level.lv-high { color: #b8860b; border-color: currentColor; }
.level.lv-staff { color: var(--accent); border-color: currentColor; }
.comment-meta { font-size: .76rem; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; margin: 2px 0 4px; }
.comment-body { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--serif); line-height: 1.7; }
.comment-body a { color: var(--accent); }
.comment blockquote { margin: 0 0 6px; padding: 4px 10px; border-left: 3px solid var(--rule); color: var(--muted); font-size: .9rem; white-space: pre-wrap; }
.comment-tools button { background: none; border: 0; color: var(--accent); cursor: pointer; font-size: .76rem; padding: 0 4px; }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; font-weight: 600; }
.form label.check { flex-direction: row; align-items: center; gap: 6px; font-weight: 400; }
.form-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.form input, .form select, .form textarea {
  font: inherit; font-weight: 400; color: var(--text); background: var(--paper); border: 1px solid #999; border-radius: 2px; padding: 9px 11px; width: 100%;
}
.form input[type="checkbox"] { width: auto; }
.form textarea { resize: vertical; min-height: 110px; font-family: var(--serif); }
.form-inline { flex-direction: row; }
.form-msg { min-height: 1.2em; margin: 0; font-size: .9rem; }
.form-msg.err { color: #c62828; }
.form-msg.ok { color: #2e7d32; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--btn-bg); color: var(--btn-ink); border: 1px solid var(--btn-bg); border-radius: 2px; padding: 9px 18px; font: 700 .9rem/1.2 var(--sans); letter-spacing: .02em; cursor: pointer; }
.btn:hover { text-decoration: none; opacity: .88; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-small { padding: 5px 10px; font-size: .78rem; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--rule); }
.btn-github { width: 100%; padding: 11px; }
.divider { text-align: center; color: var(--muted); margin: 18px 0 6px; font-size: .85rem; position: relative; }
.divider::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--rule); }
.divider span { background: var(--bg); padding: 0 10px; position: relative; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); }
.tab { background: none; border: 0; padding: 8px 14px; font: inherit; color: var(--muted); cursor: pointer; }
.tab.on { color: var(--text); box-shadow: inset 0 -2px 0 var(--rule-strong); font-weight: 700; }

/* ---------- footer ---------- */
.footer { border-top: 3px double var(--rule-strong); padding: 22px 0 28px; font-size: .82rem; color: var(--muted); }
.footer .wordmark { font-size: 1.6rem; color: var(--text); margin-bottom: 8px; }
.footer p { margin: 4px 0; }
.footer a { color: var(--text); }

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid4 .story:nth-child(2n) { border-right: 0; padding-right: 0; }
  .grid4 .story:nth-child(2n+1) { padding-left: 0; }
  .grid4 .story { border-bottom: 1px solid var(--rule); margin-bottom: 14px; }
  .forums { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 0; }
  .forums > div:nth-child(2n) { border-right: 0; }
  .forums > div:nth-child(2n+1) { padding-left: 0; }
}
@media (max-width: 860px) {
  .layout, .front { grid-template-columns: minmax(0, 1fr); }
  .col-side, .rail { border-left: 0; padding-left: 0; border-top: 3px double var(--rule-strong); padding-top: 14px; margin-top: 10px; }
  .sections-inner { justify-content: flex-start; }
}
@media (max-width: 600px) {
  body { font-size: 15.5px; }
  .utility .search input { width: 120px; }
  .utility .date { display: none; }
  .masthead { padding: 12px 0 8px; }
  .wordmark-cn { letter-spacing: .3em; }
  .tagline { display: none; }
  .subs, .grid4, .forums { grid-template-columns: minmax(0, 1fr); }
  .subs .story, .grid4 .story, .forums > div { padding: 0 0 12px !important; border-right: 0 !important; }
  .forums > div { border-bottom: 1px solid var(--rule); }
  .row-stats { width: 48px; }
  .row-title { font-size: 1.02rem; }
  .post-body { font-size: 1.06rem; }
  .board-head { flex-direction: column; align-items: flex-start; }
}
.comment > img, .comment > .ph { width: 40px; height: 40px; border-radius: 50%; display: block; background: var(--rule); object-fit: cover; text-align: center; line-height: 40px; font-weight: 700; color: var(--muted); }
.profile-head { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.profile-head img, .profile-head .ph { width: 56px; height: 56px; border-radius: 50%; display: block; background: var(--rule); object-fit: cover; text-align: center; line-height: 56px; font-weight: 700; color: var(--muted); }
.post-head .kicker + h1 { margin-top: 2px; }
