/* 石凳 — mobile-first stylesheet. One file, no build step. */

:root {
  --bg: #f4f3ee;
  --surface: #ffffff;
  --surface-2: #f0efe8;
  --ink: #22262a;
  --muted: #676d72;
  --line: #e2e0d6;
  --accent: #3f6b52;
  --accent-ink: #ffffff;
  --accent-soft: #e3ede6;
  --warn: #a5541d;
  --warn-soft: #f6e6d8;
  --radius: 12px;
  --gutter: 16px;
  --shadow: 0 1px 2px rgba(20, 24, 20, .05);
  --font: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
          "Noto Sans CJK SC", "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151716;
    --surface: #1e2120;
    --surface-2: #262a28;
    --ink: #e6e8e5;
    --muted: #9aa19d;
    --line: #2f3432;
    --accent: #7fb394;
    --accent-ink: #10201a;
    --accent-soft: #223328;
    --warn: #e2a06a;
    --warn-soft: #3a2b1e;
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, .tab:focus-visible, .pg:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
b { font-weight: 650; }
img { max-width: 100%; height: auto; }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 16px var(--gutter) 40px; flex: 1; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.topbar-in { max-width: 1080px; margin: 0 auto; padding: 0 var(--gutter); height: 54px; display: flex; align-items: center; justify-content: flex-start; gap: 6px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-name { font-weight: 650; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* hamburger menu */
.menu { position: relative; flex: none; margin-left: -8px; }
.menu-btn { width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 0; border-radius: 10px; color: var(--ink); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.menu-btn:hover { background: var(--surface-2); }
.menu-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.bars { display: grid; gap: 5px; width: 22px; }
.bars i { display: block; height: 2px; border-radius: 2px; background: currentColor; transition: transform .18s ease, opacity .18s ease; }
.menu.open .bars i:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu.open .bars i:nth-child(2) { opacity: 0; }
.menu.open .bars i:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.menu-panel { position: absolute; top: calc(100% + 6px); left: 0; min-width: 200px; max-width: calc(100vw - 2 * var(--gutter)); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 28px rgba(20, 24, 20, .16); padding: 6px; display: grid; gap: 2px; }
.menu-panel[hidden] { display: none; }
.menu-panel a { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 8px; color: var(--ink); font-size: 16px; }
.menu-panel a:hover { background: var(--surface-2); text-decoration: none; }
.menu-panel a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); font-weight: 600; }

/* member list & simple pages */
.page-head { margin-bottom: 14px; }
.members .avatar, .members .row .avatar { width: 38px; height: 38px; font-size: 16px; margin-right: 12px; }
.members .n-view { display: block; }
.note { padding: 18px 18px 10px; line-height: 1.8; }
.note p { margin: 0 0 12px; }

.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; padding-bottom: env(safe-area-inset-bottom); }
.foot-in { max-width: 1080px; margin: 0 auto; padding: 16px var(--gutter); display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: space-between; }

/* ---------- hero ---------- */
.hero { padding: 20px 4px 8px; }
.hero-title { margin: 0; font-size: 28px; line-height: 1.25; letter-spacing: .01em; }
.hero-sub { margin: 4px 0 16px; color: var(--muted); }
.stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stats li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.stats b { display: block; font-size: 22px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stats span { color: var(--muted); font-size: 13px; }

/* ---------- home columns ---------- */
.cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 20px; }
.cat { margin-bottom: 24px; }
.cat-title { margin: 0 0 10px 2px; font-size: 15px; color: var(--muted); font-weight: 600; letter-spacing: .04em; }
.boards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.board { display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.board-icon { flex: none; width: 42px; height: 42px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 20px; }
.board-icon:hover { text-decoration: none; }
.board-icon.big { width: 52px; height: 52px; font-size: 24px; border-radius: 14px; }
.board-ico-svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.board-icon.big .board-ico-svg { width: 27px; height: 27px; }
.board-body { min-width: 0; flex: 1; }
.board-name { margin: 0; font-size: 17px; line-height: 1.35; }
.board-name a { color: var(--ink); }
.board-desc { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.board-stats { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.board-last { margin: 6px 0 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-last a { color: var(--ink); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 14px 6px; margin-bottom: 14px; box-shadow: var(--shadow); }
.card-title { margin: 0 0 6px; font-size: 15px; }
.mini { list-style: none; margin: 0; padding: 0; }
.mini li { padding: 9px 0; border-top: 1px solid var(--line); }
.mini li:first-child { border-top: 0; }
.mini-title { display: block; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-meta { display: block; color: var(--muted); font-size: 12.5px; margin-top: 1px; }

/* ---------- board / thread list ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.board-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.page-title { margin: 0; font-size: 22px; line-height: 1.35; overflow-wrap: anywhere; }

.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 -4px 12px; padding: 2px 4px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.tab:hover { text-decoration: none; color: var(--ink); }
.tab.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.rows { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.row { display: flex; gap: 12px; justify-content: space-between; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row-main { min-width: 0; flex: 1; }
.row-title { display: block; color: var(--ink); font-size: 16px; line-height: 1.45; overflow-wrap: anywhere; }
.row-title:hover { color: var(--accent); }
.row-meta { margin-top: 3px; color: var(--muted); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 0 6px; align-items: center; }
.row-nums { flex: none; text-align: right; color: var(--muted); font-size: 12.5px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.row-nums b { color: var(--ink); }
.n-view { display: none; }
.dot { opacity: .6; }
.row-last { display: none; }

.tag { display: inline-block; font-size: 11.5px; line-height: 1; padding: 3px 6px; border-radius: 5px; margin-right: 6px; vertical-align: 1px; font-weight: 600; }
.tag-top { background: var(--warn-soft); color: var(--warn); }
.tag-best { background: var(--accent-soft); color: var(--accent); }
.tag-forum { background: var(--surface-2); color: var(--muted); margin-right: 0; font-weight: 500; }
.tag-forum:hover { text-decoration: none; color: var(--ink); }

.empty { color: var(--muted); padding: 24px 14px; text-align: center; list-style: none; }

/* ---------- pagination ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 16px 0; }
.pg-list { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.pg { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-size: 14px; font-variant-numeric: tabular-nums; }
a.pg:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.pg.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 650; }
.pg.gap { background: none; border: 0; min-width: 20px; padding: 0; color: var(--muted); }
.pg-step { white-space: nowrap; }
.pg.off { opacity: .4; }
/* on phones show just the arrows + current page, not the whole number strip */
@media (max-width: 599px) {
  .pg-list .pg:not(.on):not(.gap) { display: none; }
  .pg-list .pg.gap { display: none; }
}

/* ---------- thread page ---------- */
.thread-head { margin-bottom: 14px; }
.thread-meta { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; display: flex; flex-wrap: wrap; gap: 0 6px; }
.posts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.post { display: grid; grid-template-columns: minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; scroll-margin-top: 66px; }
.post:target { border-color: var(--accent); }
.post-author { display: flex; align-items: center; gap: 10px; padding: 10px 14px 0; }
.avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; }
.who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-main { padding: 6px 14px 14px; min-width: 0; }
.post-meta { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12.5px; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.floor { color: var(--muted); font-variant-numeric: tabular-nums; }
.post-body { line-height: 1.8; overflow-wrap: anywhere; word-break: break-word; }
.post-body img { border-radius: 6px; margin: 4px 0; }
.post-body blockquote { margin: 8px 0; padding: 8px 12px; background: var(--surface-2); border-left: 3px solid var(--line); border-radius: 0 8px 8px 0; color: var(--muted); font-size: 14.5px; }
.post-body pre.code { background: var(--surface-2); padding: 10px 12px; border-radius: 8px; overflow-x: auto; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; margin: 8px 0; }
.post-body .edited { display: inline-block; color: var(--muted); font-size: 12.5px; font-style: normal; }
.post-body .attach { color: var(--muted); font-size: 13px; }
.post-video { display: block; max-width: 100%; width: 100%; max-height: 70vh; border-radius: 6px; margin: 4px 0; background: #000; }
.align-center { text-align: center; } .align-right { text-align: right; } .align-left { text-align: left; }

/* ---------- misc ---------- */
.err { text-align: center; padding: 56px 0; }
.err-code { font-size: 64px; font-weight: 700; color: var(--accent); margin: 0; line-height: 1; }
.btn { display: inline-block; background: var(--accent); color: var(--accent-ink); padding: 10px 20px; border-radius: 10px; }
.btn:hover { text-decoration: none; filter: brightness(1.06); }

/* ---------- wider screens ---------- */
@media (min-width: 600px) {
  :root { --gutter: 24px; }
  .hero-title { font-size: 34px; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .boards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .n-view { display: block; }
  .row-last { display: inline; }
  .page-title { font-size: 26px; }
}
@media (min-width: 900px) {
  .cols { grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
  .col-side { position: sticky; top: 70px; }
  .post { grid-template-columns: 150px minmax(0, 1fr); }
  .post-author { flex-direction: column; justify-content: flex-start; padding: 16px 12px; border-right: 1px solid var(--line); background: var(--surface-2); text-align: center; gap: 8px; }
  .avatar { width: 56px; height: 56px; font-size: 22px; }
  .who { max-width: 100%; }
  .post-main { padding: 12px 18px 18px; }
}

@media (prefers-reduced-motion: no-preference) {
  .board, .tab, .pg, .row { transition: border-color .15s, background-color .15s; }
  .board:hover { border-color: var(--accent); }
  .row:hover { background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
}

/* ---------- avatars, profile form, member page ---------- */
img.avatar { object-fit: cover; background: var(--surface-2); }
.avatar.xl { width: 96px; height: 96px; font-size: 38px; }
a.who { color: var(--ink); }
a.who:hover { color: var(--accent); text-decoration: none; }
.post-main .sig { margin: 14px 0 0; padding-top: 10px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 13.5px; line-height: 1.7; white-space: pre-line; overflow-wrap: anywhere; max-height: 14em; overflow: hidden; }
.post-main .sig img { max-width: 100%; height: auto; max-height: 120px; vertical-align: middle; border-radius: 4px; }
.post-main .sig a { color: inherit; text-decoration: underline; }

.notice { margin: 0 0 14px; padding: 11px 14px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 14.5px; }
.notice.ok { background: var(--accent-soft); color: var(--accent); }
.notice.bad { background: var(--warn-soft); color: var(--warn); }

.form-card { padding: 16px 16px 18px; }
.form-card .card-title { margin-bottom: 12px; font-size: 16px; }
.form-card fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.field { margin: 0 0 16px; }
.field > label:first-child { display: block; font-weight: 600; font-size: 14.5px; margin-bottom: 6px; }
.field input[type="text"], .field input[type="tel"], .field textarea {
  display: block; width: 100%; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
.field textarea { resize: vertical; min-height: 96px; line-height: 1.6; }
.field input[readonly] { background: var(--surface-2); color: var(--muted); }
.field input:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.field [aria-invalid="true"] { border-color: var(--warn); }
.hint { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.field-err { margin: 6px 0 0; color: var(--warn); font-size: 13.5px; }
.check { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--muted); font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
fieldset:disabled input, fieldset:disabled textarea { opacity: .7; }
.form-actions { margin-top: 4px; }
button.btn { border: 0; font: inherit; font-size: 15px; cursor: pointer; }
button.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn-quiet { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
button.btn-quiet { border: 1px solid var(--line); }

.avatar-edit { display: flex; gap: 16px; align-items: flex-start; }
.avatar-actions { min-width: 0; flex: 1; }
.avatar-actions .inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 8px; }
.file-pick { position: relative; display: inline-block; cursor: pointer; }
.file-pick input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; font-size: 0; }
.file-pick:focus-within .btn { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 599px) { .avatar-edit { flex-direction: column; } }

.profile-head { display: flex; gap: 16px; align-items: center; padding: 16px; }
.profile-id { min-width: 0; }
.profile-id .board-stats { margin: 4px 0 0; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0 0 8px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.sig-text { margin: 0 0 8px; white-space: pre-line; line-height: 1.7; overflow-wrap: anywhere; }
.file-pick:has(input:disabled) { opacity: .5; pointer-events: none; }

/* ---------- sign-in ---------- */
.login-card { max-width: 420px; }
.auth-hero { text-align: center; margin: 4px 0 18px; }
.auth-hero .page-title { margin: 0; }
.auth-ico { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent); margin-bottom: 10px; }
.auth-ico-svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.auth-card { margin: 0 auto; }
.auth-card .form-actions .btn { display: block; width: 100%; text-align: center; }
@media (min-width: 480px) { .auth-card .form-actions .btn { width: auto; min-width: 180px; margin: 0 auto; } }
.auth-switch { max-width: 420px; margin: 14px auto 0; text-align: center; color: var(--muted); font-size: 14px; }
.card-title { display: flex; align-items: center; gap: 8px; }
.card-title .auth-ico-svg { flex: none; width: 17px; height: 17px; color: var(--accent); stroke-width: 2; }
.topbar-user { margin-left: auto; flex: none; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--accent); font-size: 15px; padding: 8px 4px; }
.topbar-user:hover { text-decoration: none; opacity: .8; }
.topbar-auth { margin-left: auto; flex: none; display: flex; align-items: center; gap: 10px; font-size: 15px; }
.topbar-auth a { color: var(--accent); padding: 8px 4px; }
.topbar-auth a:hover { text-decoration: none; opacity: .8; }
.menu-logout { margin: 0; }
.menu-logout button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; font: inherit; font-size: 16px; color: var(--ink); background: none; border: 0; border-radius: 8px; padding: 12px 14px; cursor: pointer; }
.menu-logout button:hover { background: var(--surface-2); }
.field input[type="password"] { display: block; width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.field input[type="password"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

/* ---------- avatar picker ---------- */
.avatar-now { flex: none; }
#avatar-card.drop { outline: 2px dashed var(--accent); outline-offset: -6px; background: var(--accent-soft); }
.inline-form.js [data-plain-submit] { display: none; }
.cropper { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 12px; justify-items: center; }
.cropper[hidden] { display: none; }
.cropper-title { margin: 0; color: var(--muted); font-size: 14px; }
#crop-canvas { width: min(320px, 100%); height: auto; aspect-ratio: 1; border-radius: 12px; background: var(--surface-2); touch-action: none; cursor: grab; }
#crop-canvas:active { cursor: grabbing; }
#crop-canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.crop-zoom { display: flex; align-items: center; gap: 10px; width: min(320px, 100%); color: var(--muted); font-size: 14px; }
.crop-zoom input { flex: 1; accent-color: var(--accent); min-width: 0; }
.crop-actions { display: flex; gap: 8px; }
.cropper .hint { min-height: 1.2em; margin: 0; }
.topbar-user { display: inline-flex; align-items: center; gap: 8px; }
.topbar-user span { overflow: hidden; text-overflow: ellipsis; }
.topbar-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-2); }

/* ---------- new thread ---------- */
.board-actions { display: none; margin: 0 0 12px; }
@media (min-width: 720px) { .board-actions { display: block; } .fab { display: none !important; } }
.fab { position: fixed; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 20; display: inline-flex; align-items: center; gap: 4px;
  background: var(--accent); color: var(--accent-ink); padding: 13px 20px; border-radius: 999px; font-weight: 600; font-size: 15.5px;
  box-shadow: 0 4px 14px rgba(20, 30, 24, .28); }
.fab:hover { text-decoration: none; filter: brightness(1.06); }
main.wrap:has(.fab) { padding-bottom: 84px; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.compose fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.compose .field > label:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.count { font-weight: 400; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.count.over { color: var(--warn); }
.compose select, .compose input[type="text"] { display: block; width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.compose select:focus-visible, .compose input[type="text"]:focus-visible, .compose textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.compose [aria-invalid="true"] { border-color: var(--warn); }
.editor { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.editor:focus-within { border-color: var(--accent); }
.editor-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; padding: 6px 8px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.editor .modes { display: flex; gap: 2px; }
.mode { font: inherit; font-size: 14px; color: var(--muted); background: none; border: 0; padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.mode.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.editor .tools { display: flex; flex-wrap: wrap; gap: 4px; }
.editor .tool { font: inherit; font-size: 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; min-height: 34px; cursor: pointer; }
.editor select.tool { width: auto; padding: 6px 8px; border-radius: 8px; font-size: 14px; }
.editor .tool:hover { border-color: var(--accent); }
.editor textarea { display: block; width: 100%; min-height: 260px; border: 0; border-radius: 0; padding: 12px; font: inherit; font-size: 16px; line-height: 1.7; color: var(--ink); background: var(--surface); resize: vertical; }
.editor textarea:focus-visible { outline: 0; }
.editor .preview { min-height: 260px; padding: 12px; }
.uploads { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13.5px; }
.uploads li { margin: 2px 0; color: var(--muted); }
.uploads li.ok { color: var(--accent); }
.uploads li.bad { color: var(--warn); }
.compose-bar { position: sticky; bottom: 0; z-index: 10; display: flex; justify-content: flex-end; gap: 10px; margin: 8px calc(var(--gutter) * -1) 0; padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); border-top: 1px solid var(--line); }
.compose-bar .btn { min-width: 96px; text-align: center; }
.compose-bar button.btn:disabled { opacity: .55; cursor: not-allowed; }
.link-btn { font: inherit; background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; }
.editor [hidden], .compose [hidden] { display: none !important; }

/* ---------- reply ---------- */
.fab { transition: padding .18s ease, gap .18s ease; }
.fab .fab-label { display: inline-block; max-width: 9em; overflow: hidden; white-space: nowrap; transition: max-width .18s ease, opacity .18s ease; }
.fab.mini { padding: 13px 15px; gap: 0; }
.fab.mini .fab-label { max-width: 0; opacity: 0; }
@media (prefers-reduced-motion: reduce) { .fab, .fab .fab-label { transition: none; } }
.board-actions.bottom { margin: 12px 0 0; }
.post-tools { display: inline-flex; align-items: baseline; gap: 12px; }
.reply-link { font-size: 13px; color: var(--muted); padding: 4px 2px; }
.reply-link:hover { color: var(--accent); }
.reply-to { margin: 0 0 14px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.reply-title { margin: 0; font-size: 15px; }
.reply-title a { font-weight: 600; }
.orig { margin-top: 8px; }
.orig summary { cursor: pointer; color: var(--muted); font-size: 14px; padding: 4px 0; }
.orig .post-body { margin-top: 8px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 14.5px; max-height: 24em; overflow: auto; }

/* ---------- like / favourite under each post, and 我的收藏 ---------- */
.post-actions { display: flex; align-items: center; gap: 6px; margin: 12px 0 0; padding-top: 8px; }
.post-actions form { margin: 0; }
.act { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: 13.5px; line-height: 1; cursor: pointer; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.act:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.act:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.act .ico { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.act[disabled] { opacity: .55; cursor: not-allowed; }
.act[disabled]:hover { color: var(--muted); border-color: var(--line); }
.act-like[aria-pressed="true"], .act-fav[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.act-like[aria-pressed="true"] .ico, .act-fav[aria-pressed="true"] .ico { fill: currentColor; }
.act-count { min-width: 1ch; font-variant-numeric: tabular-nums; }
.act[aria-busy="true"] { opacity: .6; pointer-events: none; }
.temp-pw-banner { background: var(--warn-soft); color: var(--warn); text-align: center; padding: 9px 16px; font-size: 14px; line-height: 1.5; }
.temp-pw-banner p { margin: 0; max-width: 960px; margin-inline: auto; }
.temp-pw-banner a { color: inherit; text-decoration: underline; font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: min(92vw, 420px); padding: 10px 16px; border-radius: 10px; background: var(--ink); color: var(--bg); font-size: 14px; line-height: 1.5; box-shadow: 0 6px 20px rgba(0,0,0,.25); z-index: 50; }
.toast[hidden] { display: none; }

.fav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.fav-item { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); transition: opacity .2s; }
.fav-item.removing { opacity: 0; }
.fav-item.gone .fav-title { color: var(--muted); }
.fav-main { flex: 1; min-width: 0; }
.fav-title { display: block; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.fav-excerpt { margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fav-remove { margin: 0; flex: none; }
.fav-remove .act { min-height: 32px; padding: 5px 10px; font-size: 13px; }

.nav-ico-svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .75; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
