:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --fg: #1f1d1a;
  --muted: #77726b;
  --border: #e6e2dc;
  --accent: #0f7b6c;
  --accent-soft: #e3f2ef;
  --accent-fg: #ffffff;
  --bad: #c2413a;
  --code-bg: #f4f2ef;
  --font: -apple-system, 'PingFang SC', 'HarmonyOS Sans SC', 'MiSans', 'Noto Sans CJK SC', 'Microsoft YaHei', system-ui, sans-serif;
  --mono: ui-monospace, 'JetBrains Mono', 'Cascadia Mono', Consolas, monospace;
  --fs: 17px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1a19;
    --surface: #242322;
    --fg: #e4e1dc;
    --muted: #9b958d;
    --border: #3a3734;
    --accent: #4fc1ad;
    --accent-soft: #1f3632;
    --accent-fg: #1b1a19;
    --bad: #ef7b73;
    --code-bg: #2a2826;
  }
  img { opacity: 0.9; }
}
html.fs15 { --fs: 15px } html.fs16 { --fs: 16px } html.fs17 { --fs: 17px } html.fs18 { --fs: 18px }
html.fs19 { --fs: 19px } html.fs20 { --fs: 20px } html.fs21 { --fs: 21px }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 var(--font);
  overflow-x: clip;
}
a { color: var(--accent); text-decoration: none; }
main { max-width: 720px; margin: 0 auto; padding: 0 16px calc(32px + env(safe-area-inset-bottom)); }

.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  height: 52px; padding: 0 16px; padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.top nav { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.top .brand { font-weight: 650; letter-spacing: 0.04em; }
.top .back { font-size: 16px; }
.top .acts a { margin-left: 16px; font-size: 15px; }

button, .btn {
  display: inline-block; font: inherit; font-size: 15px;
  padding: 9px 18px; margin: 6px 4px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--fg); cursor: pointer;
}
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn.ghost { background: transparent; }
.center { text-align: center; margin: 14px 0; }
.foot { color: var(--muted); font-size: 13px; text-align: center; margin: 10px 0; }
.foot.left { text-align: left; }
.err { color: var(--bad); }
.empty { color: var(--muted); text-align: center; margin: 48px 0 16px; }
h3.sub, h2.sub { font-size: 14px; color: var(--muted); font-weight: 500; margin: 24px 4px 8px; }

/* 文件夹 */
.folders { list-style: none; margin: 12px 0 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.folders.lead { margin-top: 16px; }
.folders li + li { border-top: 1px solid var(--border); }
.folders a { display: flex; justify-content: space-between; align-items: center; padding: 13px 16px; color: var(--fg); }
.folders .count { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.folders.lead .name { font-weight: 600; }
.folders.dim a { color: var(--muted); }

/* 文章列表 */
.list { list-style: none; margin: 8px 0 0; padding: 0; }
.list li + li { border-top: 1px solid var(--border); }
.list a { display: flex; gap: 12px; padding: 14px 2px; color: var(--fg); }
.list .thumb { flex: none; width: 80px; height: 60px; object-fit: cover; border-radius: 8px; background: var(--code-bg); order: 2; }
.list .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.list .title { font-size: 16px; font-weight: 600; line-height: 1.45; }
.list .meta { font-size: 13px; color: var(--muted); }
.list .snip { font-size: 14px; color: var(--muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.list a:visited .title { color: var(--muted); }
.pager { text-align: center; margin-top: 12px; }

/* 阅读页 */
.read h1 { font-size: calc(var(--fs) * 1.4); line-height: 1.4; margin: 20px 0 6px; }
.read .by { color: var(--muted); font-size: 14px; margin: 0; }
.read .orig, .read .note { font-size: 14px; margin: 6px 0 0; }
.read .note { color: var(--muted); }
.read .body { font-size: var(--fs); line-height: 1.8; margin-top: 18px; overflow-wrap: anywhere; }
.read .body p { margin: 0 0 1em; }
.read .body img { display: block; max-width: 100%; height: auto; margin: 1em auto; border-radius: 6px; }
.read .body h2, .read .body h3, .read .body h4 { line-height: 1.45; margin: 1.4em 0 0.6em; }
.read .body h2 { font-size: 1.25em; } .read .body h3 { font-size: 1.12em; } .read .body h4 { font-size: 1em; }
.read .body blockquote { margin: 1em 0; padding: 0.2em 1em; border-left: 3px solid var(--border); color: var(--muted); }
.read .body pre { background: var(--code-bg); padding: 12px; border-radius: 8px; overflow-x: auto; font: 13px/1.55 var(--mono); }
.read .body code { font-family: var(--mono); font-size: 0.9em; background: var(--code-bg); padding: 0 4px; border-radius: 4px; }
.read .body pre code { background: none; padding: 0; }
.read .body table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 0.88em; margin: 1em 0; }
.read .body th, .read .body td { border: 1px solid var(--border); padding: 6px 8px; }
.read .body figure { margin: 1em 0; } .read .body figcaption { color: var(--muted); font-size: 0.85em; text-align: center; }
.read .body ul, .read .body ol { padding-left: 1.4em; }
.read .body a.video { display: block; margin: 1em 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); font-weight: 600; }
.read .body a.video img { margin: 0 0 10px; }
.next { display: block; margin: 28px 0 0; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--fg); }
.next .lbl { display: block; font-size: 13px; color: var(--accent); margin-bottom: 4px; }
.next .t { font-weight: 600; line-height: 1.45; }

/* 登录与设置 */
.login { max-width: 360px; margin: 64px auto 0; text-align: center; }
.login input { width: 100%; font: inherit; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--fg); margin: 8px 0; }
.sizes { display: flex; flex-wrap: wrap; justify-content: center; }
.sizes button { width: 52px; padding: 9px 0; }
.sizes .s15 { font-size: 15px } .sizes .s16 { font-size: 16px } .sizes .s17 { font-size: 17px } .sizes .s18 { font-size: 18px }
.sizes .s19 { font-size: 19px } .sizes .s20 { font-size: 20px } .sizes .s21 { font-size: 21px }
.errbox { text-align: center; margin: 64px 0; }
.read .body hr { border: 0; border-top: 1px solid var(--border); margin: 1.6em 0; }
.list li.seen .title { color: var(--muted); }
.order { display: flex; gap: 6px; justify-content: flex-end; align-items: center; margin: 10px 0 0; font-size: 14px; }
.order button { margin: 0; padding: 5px 12px; font-size: 13px; }
.order .on { padding: 5px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 13px; }
.import { text-align: center; }
.import textarea { width: 100%; font: 12px/1.4 var(--mono); padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--fg); }
