
:root {
  --accent: #7d2d2d; --accent-2: #a84a38; --amber: #9a651f;
  --bg: #f4f0e8; --blue: #315f83; --faint: #a59d92; --green: #376a50;
  --ink: #211e1a; --line: #ddd4c8; --muted: #756d63;
  --paper: #fffdf8; --paper-2: #f8f3ea; --red: #a33b35;
  --radius: 14px; --shadow: 0 12px 36px rgba(61, 45, 29, .08);
  --accent-ink: #fff8ef; --notice-bg: #fff9e9; --notice-line: #dacda8; --notice-ink: #72511e;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  --serif: "Songti SC", STSong, "Noto Serif CJK SC", serif;
}
html[data-theme="modern-light"] {
  --accent: #285ea8; --accent-2: #174a8c; --amber: #a66100;
  --bg: #eef3f8; --blue: #246fa8; --faint: #8a96a5; --green: #2c7754;
  --ink: #18212d; --line: #cfd9e5; --muted: #647184;
  --paper: #ffffff; --paper-2: #f5f8fb; --red: #b33939;
  --shadow: 0 12px 36px rgba(45, 74, 112, .09); --accent-ink: #fff;
  --notice-bg: #fff7df; --notice-line: #e5ce8f; --notice-ink: #6d4a00;
  --serif: var(--sans);
}
html[data-theme="reddit"] {
  --accent: #ff4500; --accent-2: #e03d00; --amber: #d97706;
  --bg: #dae0e6; --blue: #0079d3; --faint: #878a8c; --green: #2f7d32;
  --ink: #1a1a1b; --line: #ccc; --muted: #7c7c7c;
  --paper: #ffffff; --paper-2: #f6f7f8; --red: #ea0027;
  --shadow: 0 2px 8px rgba(26, 26, 27, .08); --accent-ink: #fff;
  --notice-bg: #fff4ee; --notice-line: #ffb59b; --notice-ink: #7d2608;
  --serif: var(--sans);
}
html[data-theme="vs-light"] {
  --accent: #007acc; --accent-2: #0062a3; --amber: #a15c00;
  --bg: #f3f3f3; --blue: #0451a5; --faint: #8a8a8a; --green: #16825d;
  --ink: #1e1e1e; --line: #d4d4d4; --muted: #616161;
  --paper: #ffffff; --paper-2: #f8f8f8; --red: #a1260d;
  --shadow: 0 6px 24px rgba(0, 0, 0, .07); --accent-ink: #fff;
  --notice-bg: #fff8dc; --notice-line: #d8c77b; --notice-ink: #5f4b00;
  --serif: var(--sans);
}
html[data-theme="vs-black"] {
  color-scheme: dark;
  --accent: #007acc; --accent-2: #3794ff; --amber: #d7ba7d;
  --bg: #1e1e1e; --blue: #4fc1ff; --faint: #6a6a6a; --green: #4ec9b0;
  --ink: #d4d4d4; --line: #3c3c3c; --muted: #9d9d9d;
  --paper: #252526; --paper-2: #2d2d30; --red: #f14c4c;
  --shadow: 0 12px 36px rgba(0, 0, 0, .3); --accent-ink: #fff;
  --notice-bg: #332e1e; --notice-line: #665c35; --notice-ink: #e8d9a0;
  --serif: var(--sans);
}
html[data-theme="neon"] {
  color-scheme: dark;
  --accent: #ff2bd6; --accent-2: #c918ff; --amber: #ffe66d;
  --bg: #080611; --blue: #00f5ff; --faint: #6f6888; --green: #45ffb1;
  --ink: #f5efff; --line: #3a3053; --muted: #a79cbe;
  --paper: #11101c; --paper-2: #19162a; --red: #ff4d6d;
  --shadow: 0 12px 40px rgba(255, 43, 214, .11); --accent-ink: #0a0610;
  --notice-bg: #211a2c; --notice-line: #66517e; --notice-ink: #e7ceff;
  --serif: var(--sans);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; padding: 8px 12px; border-radius: 8px; color: var(--accent-ink); background: var(--accent); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 65%, white); outline-offset: 3px; }
body {
  margin: 0; color: var(--ink); background: var(--bg);
  font: 14px/1.65 var(--sans); transition: color .2s, background .2s;
}
a { color: var(--ink); text-decoration: none; transition: color .15s, border-color .15s, background .15s, transform .15s; }
a:hover { color: var(--accent); }
button, input, select, textarea { color: inherit; font: inherit; }
.shell { width: min(1240px, calc(100% - 36px)); margin: 0 auto; }
.topbar {
  position: sticky; top: 0; z-index: 20; min-height: 68px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(14px);
}
.topbar-inner { min-height: 68px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; justify-self: start; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark {
  display: grid; place-items: center; width: 36px; height: 36px;
  background: var(--paper); border: 2px solid var(--accent); border-radius: 10px;
  overflow: hidden; flex: 0 0 auto; box-shadow: 0 3px 10px color-mix(in srgb, var(--accent) 15%, transparent);
}
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: cover; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.2; }
.brand-copy strong { font: 700 17px/1.2 var(--serif); }
.brand-copy small { color: var(--muted); font-size: 10px; }
.nav {
  display: flex; align-items: center; justify-content: center; gap: 3px;
  padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper-2);
}
.nav a { min-width: 68px; padding: 7px 12px; color: var(--muted); border-radius: 8px; text-align: center; font-weight: 600; }
.nav a:hover { color: var(--ink); background: var(--paper); }
.nav a.active { color: var(--accent-ink); background: var(--accent); box-shadow: 0 3px 10px color-mix(in srgb, var(--accent) 20%, transparent); }
.top-actions { display: flex; justify-content: flex-end; gap: 8px; }
.theme-select {
  min-height: 36px; max-width: 152px; padding: 6px 28px 6px 10px;
  border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: var(--paper);
}
.identity-button { max-width: 146px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 7px 12px; border: 1px solid var(--line);
  border-radius: 9px; color: var(--ink); background: var(--paper); cursor: pointer; font-weight: 600;
}
.btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.btn.primary { color: var(--accent-ink); border-color: var(--accent); background: var(--accent); }
.btn.primary:hover { color: var(--accent-ink); background: var(--accent-2); }
.page { padding: 30px 0 54px; }
.forum-hero {
  position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr auto;
  align-items: end; gap: 30px; padding: 28px 30px; margin-bottom: 16px;
  border: 1px solid var(--line); border-radius: 20px; background: var(--paper); box-shadow: var(--shadow);
}
.forum-hero::after {
  position: absolute; top: -100px; right: -80px; width: 240px; height: 240px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent); border-radius: 50%; content: "";
}
.forum-hero > * { position: relative; z-index: 1; }
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, h3 { font-family: var(--serif); }
h1 { margin: 5px 0 0; font-size: clamp(28px, 4vw, 42px); line-height: 1.15; letter-spacing: .02em; }
h2 { margin: 0; font-size: 24px; line-height: 1.25; }
h3 { margin: 0; font-size: 18px; line-height: 1.3; }
.lede, .muted { color: var(--muted); }
.lede { margin: 8px 0 0; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(74px, 1fr)); gap: 8px; }
.metric { min-width: 86px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper-2); }
.metric strong { display: block; color: var(--accent); font: 700 23px/1.1 var(--serif); }
.metric span { color: var(--muted); font-size: 11px; }
.toolbar {
  display: flex; align-items: center; gap: 10px; padding: 10px;
  border: 1px solid var(--line); border-radius: 14px 14px 0 0; background: var(--paper);
}
.tabs { display: flex; gap: 3px; }
.tab { padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; }
.tab:hover { color: var(--ink); background: var(--paper-2); }
.tab.active { color: var(--accent-ink); background: var(--accent); }
.mode-switch { display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 0; }
.mode-button { border: 1px solid var(--line); background: var(--paper-2); cursor: pointer; }
.mode-button[aria-selected="true"] { color: var(--accent-ink); border-color: var(--accent); background: var(--accent); }
.post-mode-panel { padding-top: 4px; }
.search-form { display: flex; gap: 7px; margin-left: auto; min-width: min(410px, 45vw); }
.search-input, .form-input, .form-select, .reply-textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; color: var(--ink);
  background: var(--paper); outline: none;
}
.search-input, .form-input, .form-select { min-height: 38px; padding: 8px 11px; }
.search-input:focus, .form-input:focus, .form-select:focus, .reply-textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent);
}
.board-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.board-card {
  position: relative; overflow: hidden; min-height: 150px; padding: 20px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: 0 7px 24px rgba(61, 45, 29, .04);
}
.board-card::after { position: absolute; right: -24px; bottom: -36px; color: color-mix(in srgb, var(--accent) 9%, transparent); font: 700 100px/1 var(--serif); content: attr(data-mark); }
.board-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.board-card > * { position: relative; z-index: 1; }
.board-card strong { display: block; margin: 5px 0; font: 700 25px/1.2 var(--serif); }
.board-card .board-count { color: var(--accent); font-weight: 700; }
.filter-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 12px;
  border: 1px solid var(--line); border-top: 0; background: var(--paper-2);
}
.filter-bar label { color: var(--muted); font-size: 11px; }
.filter-bar .form-select { width: auto; min-width: 126px; min-height: 34px; padding-top: 5px; padding-bottom: 5px; font-size: 12px; }
.filter-bar .board-search { flex: 1 1 240px; min-width: 180px; min-height: 34px; }
.filter-summary { margin-left: auto; color: var(--muted); font-size: 11px; }
.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.pagination .active { color: var(--accent-ink); border-color: var(--accent); background: var(--accent); }
.thread-list { overflow: hidden; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 14px 14px; background: var(--paper); box-shadow: 0 7px 24px rgba(61, 45, 29, .04); }
.thread-row {
  display: grid; grid-template-columns: 72px minmax(0, 1fr) 190px; gap: 16px;
  align-items: center; min-height: 112px; padding: 16px 18px; border-bottom: 1px solid var(--line);
}
.thread-row:last-child { border-bottom: 0; }
.thread-row:hover { background: color-mix(in srgb, var(--accent) 3%, var(--paper)); }
.reply-count {
  display: grid; place-items: center; width: 48px; height: 48px; margin: auto;
  border: 1px solid var(--line); border-radius: 12px; background: var(--paper-2); color: var(--muted);
}
.reply-count strong { display: block; color: var(--accent); font: 700 18px/1 var(--serif); text-align: center; }
.reply-count small { display: block; margin-top: 3px; font-size: 9px; }
.thread-main { min-width: 0; }
.thread-title { margin: 3px 0 5px; font-size: 19px; }
.thread-title a:hover { color: var(--accent); }
.thread-excerpt { overflow: hidden; color: var(--muted); white-space: nowrap; text-overflow: ellipsis; }
.thread-side { color: var(--muted); font-size: 12px; text-align: right; }
.thread-side strong { display: block; overflow: hidden; color: var(--ink); font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.thread-score { color: var(--amber); font-weight: 700; }
.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px;
  border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--paper-2); font-size: 11px;
}
.pill.accent { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 28%, var(--line)); background: color-mix(in srgb, var(--accent) 5%, var(--paper)); }
.pill.link:hover { color: var(--accent); border-color: var(--accent); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-cloud a { padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--paper-2); font-size: 11px; }
.tag-cloud a:hover, .tag-cloud a.active { color: var(--accent); border-color: var(--accent); }
.meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; color: var(--muted); font-size: 12px; }
.section-card, .panel {
  padding: 18px; margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper); box-shadow: 0 7px 24px rgba(61, 45, 29, .04);
}
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.breadcrumbs { margin-bottom: 12px; color: var(--muted); font-size: 12px; }
.breadcrumbs a { color: var(--muted); }
.thread-head { padding: 20px 22px; border: 1px solid var(--line); border-radius: 14px 14px 0 0; background: var(--paper); }
.thread-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.thread-head h1 { font-size: clamp(26px, 3.5vw, 38px); }
.thread-controls { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.control-link { padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--paper); font-size: 12px; }
.control-link:hover, .control-link.active { color: var(--accent); border-color: var(--accent); }
.floor-list { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 14px 14px; background: var(--paper); box-shadow: var(--shadow); }
.floor {
  display: grid; grid-template-columns: 154px minmax(0, 1fr); min-height: 210px;
  border-bottom: 1px solid var(--line); scroll-margin-top: 86px;
}
.floor:last-child { border-bottom: 0; }
.floor:target { box-shadow: inset 4px 0 var(--accent); }
.floor-author { padding: 22px 16px; border-right: 1px solid var(--line); background: var(--paper-2); text-align: center; }
.avatar {
  display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line)); border-radius: 16px;
  color: var(--accent); background: var(--paper); font: 700 24px/1 var(--serif);
}
.author-name { overflow-wrap: anywhere; font-weight: 700; }
.author-type { color: var(--muted); font-size: 11px; }
.floor-content { display: flex; min-width: 0; flex-direction: column; padding: 24px 26px 16px; }
.floor-title { margin-bottom: 12px; color: var(--muted); font-size: 12px; }
.floor-body { flex: 1; max-width: 820px; font-size: 15px; line-height: 1.85; }
.floor-body h2 { margin: 24px 0 8px; font-size: 22px; }
.floor-body h3 { margin: 18px 0 7px; font-size: 18px; }
.floor-body p { margin: 9px 0; }
.floor-body ul, .floor-body ol { margin: 8px 0 14px; padding-left: 22px; }
.floor-body blockquote { margin: 14px 0; padding: 8px 14px; border-left: 4px solid var(--blue); color: var(--muted); background: var(--paper-2); }
.floor-body .task-item { list-style: none; margin-left: -20px; }
.floor-body .task-item input { margin-right: 8px; accent-color: var(--accent); }
.heading-anchor { margin-left: -1em; padding-right: .25em; color: var(--faint); opacity: 0; }
.floor-body h2:hover .heading-anchor, .floor-body h3:hover .heading-anchor, .floor-body h4:hover .heading-anchor, .heading-anchor:focus { opacity: 1; }
.article-toc { padding: 12px 16px; margin: 8px 0 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-2); }
.article-toc ol { margin-bottom: 0; }
.article-toc .toc-level-2 { margin-left: 12px; }
.article-toc .toc-level-3 { margin-left: 24px; }
.floor-body code { padding: 2px 5px; border-radius: 5px; background: var(--paper-2); }
.code-block { overflow: hidden; margin: 18px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--paper-2); }
.code-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 7px 11px; border-bottom: 1px solid var(--line); color: var(--muted); font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.code-copy { padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: var(--paper); cursor: pointer; }
.code-copy:hover { color: var(--accent); border-color: var(--accent); }
.code-block pre { overflow: auto; max-height: 70vh; margin: 0; padding: 16px 18px; background: transparent; tab-size: 2; }
.code-block code { display: block; min-width: max-content; padding: 0; color: var(--ink); background: transparent; font: 13px/1.72 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.article-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 10px; margin: 22px 0; }
.article-gallery.single { display: block; }
.article-image { min-width: 0; margin: 0; }
.article-image img { display: block; width: 100%; height: clamp(190px, 28vw, 330px); border: 1px solid var(--line); border-radius: 10px; background: var(--paper-2); box-shadow: 0 8px 28px rgba(20, 20, 20, .08); object-fit: contain; }
.article-gallery.single .article-image img { width: auto; max-width: 100%; height: auto; max-height: 76vh; margin: 0 auto; }
.article-image figcaption { margin-top: 7px; color: var(--muted); font-size: 12px; text-align: center; }
.external-image-consent { display: grid; place-items: center; width: 100%; min-height: 150px; padding: 18px; border: 1px dashed var(--line); border-radius: 10px; color: var(--blue); background: var(--paper-2); cursor: pointer; }
.image-lightbox { width: min(94vw, 1200px); max-width: none; padding: 12px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: var(--paper); }
.image-lightbox::backdrop { background: rgba(0, 0, 0, .78); }
.image-lightbox img { display: block; max-width: 100%; max-height: 84vh; margin: auto; object-fit: contain; }
.image-lightbox .dialog-actions { margin-top: 8px; }
.markdown-editor { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.markdown-editor:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent); }
.editor-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; min-height: 42px; padding: 5px 7px; border-bottom: 1px solid var(--line); background: var(--paper-2); }
.editor-tool, .editor-mode { min-width: 32px; min-height: 30px; padding: 4px 8px; border: 1px solid transparent; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; font-size: 12px; font-weight: 700; }
.editor-tool:hover, .editor-mode:hover { color: var(--ink); border-color: var(--line); background: var(--paper); }
.editor-mode.active { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: var(--paper); }
.editor-spacer { flex: 1; }
.editor-status { color: var(--muted); font-size: 10px; }
.markdown-editor .reply-textarea { min-height: 180px; padding: 14px 16px; border: 0; border-radius: 0; box-shadow: none; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.markdown-editor.tall .reply-textarea { min-height: 320px; }
.editor-preview { min-height: 180px; max-width: none; padding: 14px 16px; background: var(--paper); }
.markdown-editor.tall .editor-preview { min-height: 320px; }
.editor-preview-empty { color: var(--muted); }
.image-picker { margin-top: 10px; padding: 12px; border: 1px dashed var(--line); border-radius: 12px; background: var(--paper-2); transition: border-color .15s, background .15s; }
.image-picker.dragging { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--paper)); }
.image-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.image-drop-label { display: inline-flex; align-items: center; gap: 7px; color: var(--blue); cursor: pointer; font-weight: 700; }
.attachment-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.image-preview-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 9px; margin-top: 10px; }
.image-preview-card { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.image-preview-card img { display: block; width: 100%; height: 110px; border-bottom: 1px solid var(--line); background: var(--paper-2); object-fit: contain; }
.image-preview-meta { padding: 7px 8px; }
.image-preview-name { overflow: hidden; display: block; color: var(--ink); font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.image-preview-size { color: var(--muted); font-size: 10px; }
.image-preview-actions { display: flex; gap: 4px; margin-top: 6px; }
.image-preview-actions button { flex: 1; min-height: 26px; padding: 2px 5px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: var(--paper-2); cursor: pointer; font-size: 10px; }
.image-preview-actions button:hover { color: var(--accent); border-color: var(--accent); }
.image-picker-error { margin-top: 7px; color: var(--red); font-size: 11px; }
.format-hint { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.floor-foot { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px; margin-top: 18px; color: var(--muted); font-size: 11px; }
.core-capture { position: relative; }
.core-capture > summary { list-style: none; }
.core-capture > summary::-webkit-details-marker { display: none; }
.capture-panel { width: min(420px, 88vw); padding: 13px; margin-top: 7px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); box-shadow: var(--shadow); color: var(--ink); text-align: left; }
.thread-controls .capture-panel { position: absolute; z-index: 4; right: 0; }
.capture-panel .form-label { margin-top: 8px; }
.capture-panel .btn { width: 100%; margin-top: 10px; }
.capture-note { color: var(--muted); font-size: 11px; }
.reply-link { color: var(--blue); cursor: pointer; }
.reply-context { display: grid; gap: 2px; padding: 8px 10px; margin-bottom: 10px; border-left: 3px solid var(--blue); color: var(--muted); background: var(--paper-2); font-size: 12px; }
.reply-context strong { color: var(--blue); }
.replying-to { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; margin: 8px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--paper-2); }
.floor-rating { margin-right: auto; }
.floor-rating > summary {
  padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--amber); background: var(--paper-2); font-weight: 700; list-style: none;
}
.floor-rating > summary::-webkit-details-marker { display: none; }
.floor-rating[open] { flex: 1 0 100%; order: 2; }
.floor-rating-panel { display: grid; gap: 8px; padding: 10px; margin-top: 7px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-2); }
.floor-rating:not([open]) > .floor-rating-panel { display: none; }
.public-ratings { display: flex; flex-wrap: wrap; gap: 5px; max-height: 86px; overflow: auto; }
.public-rating { padding: 2px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--paper); white-space: nowrap; }
.mini-rating-form { display: grid; grid-template-columns: 78px minmax(110px, 1fr) auto; gap: 6px; }
.mini-rating-form .form-select, .mini-rating-form .form-input { min-height: 32px; padding: 5px 8px; font-size: 12px; }
.mini-rating-form .btn { min-height: 32px; padding: 5px 9px; font-size: 12px; }
.local-floor .floor-content { background: color-mix(in srgb, var(--blue) 3%, var(--paper)); }
.agent-floor .floor-author { background: color-mix(in srgb, var(--blue) 7%, var(--paper)); }
.agent-floor .avatar { color: var(--blue); border-color: color-mix(in srgb, var(--blue) 25%, var(--line)); }
.notice { padding: 11px 14px; margin: 14px 0; border: 1px solid var(--notice-line); border-radius: 10px; color: var(--notice-ink); background: var(--notice-bg); }
.warning { border-color: var(--notice-line); color: var(--notice-ink); background: var(--notice-bg); }
.empty { padding: 22px; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; text-align: center; }
.related-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.related-card { padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper-2); }
.related-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.related-card h3 { margin: 4px 0; font-size: 17px; }
.extension-panel ul { margin-bottom: 0; }
.facts { display: grid; grid-template-columns: 120px 1fr; margin: 12px 0 0; }
.facts dt, .facts dd { padding: 7px 0; border-top: 1px solid var(--line); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.metadata-json { overflow: auto; max-height: 360px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper-2); white-space: pre-wrap; }
.interaction-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr); gap: 16px; align-items: start; }
.reply-box { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.reply-textarea { min-height: 132px; padding: 12px 14px; resize: vertical; line-height: 1.65; }
.form-row { display: grid; grid-template-columns: minmax(160px, 1fr) auto; gap: 9px; margin-top: 10px; }
.form-label { display: block; margin: 10px 0 5px; color: var(--muted); font-size: 12px; }
.agent-hints { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.agent-hint { padding: 4px 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--blue); background: var(--paper-2); cursor: pointer; font-size: 11px; }
.agent-hint:hover { border-color: var(--blue); }
.mention { color: var(--blue); font-weight: 700; }
.people-hints { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.person-hint { color: var(--accent); }
.rating-box { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.score-big { color: var(--amber); font: 700 38px/1 var(--serif); }
.stars { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; margin: 10px 0; }
.stars input { position: absolute; opacity: 0; pointer-events: none; }
.stars label { color: var(--line); cursor: pointer; font-size: 27px; line-height: 1; }
.stars label:hover, .stars label:hover ~ label, .stars input:checked ~ label { color: var(--amber); }
.draft-accent { border-left: 4px solid var(--amber); }
details summary { cursor: pointer; color: var(--muted); }
.identity-dialog {
  width: min(430px, calc(100% - 28px)); padding: 0; border: 1px solid var(--line);
  border-radius: 16px; color: var(--ink); background: var(--paper); box-shadow: var(--shadow);
}
.identity-dialog::backdrop { background: rgba(20, 16, 13, .42); backdrop-filter: blur(3px); }
.dialog-body { padding: 24px; }
.dialog-body h2 { margin: 4px 0 8px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.library-groups { display: grid; gap: 14px; }
.library-group { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.library-file {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 9px 0;
  border-top: 1px solid var(--line);
}
.library-file:first-of-type { margin-top: 10px; }
.library-path { overflow-wrap: anywhere; color: var(--blue); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.raw-paper { overflow: auto; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.raw-paper pre { margin: 0; font: 13px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.back-top { display: block; margin: 18px 0 0 auto; width: max-content; color: var(--muted); font-size: 12px; }
footer { padding: 26px 0; border-top: 1px solid var(--line); color: var(--muted); background: var(--paper-2); font-size: 12px; }
@media (max-width: 980px) {
  .topbar-inner { grid-template-columns: auto 1fr; padding: 8px 0; }
  .nav { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; overflow-x: auto; }
  .top-actions { grid-column: 2; grid-row: 1; }
  .forum-hero { grid-template-columns: 1fr; }
  .board-grid { grid-template-columns: 1fr; }
  .thread-row { grid-template-columns: 62px minmax(0, 1fr) 130px; }
}
@media (max-width: 720px) {
  .shell { width: calc(100% - 20px); }
  .topbar-inner { grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
  .brand { min-width: 0; gap: 6px; }
  .brand-mark { width: 30px; height: 30px; }
  .brand-copy strong { overflow: hidden; font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
  .top-actions { gap: 4px; }
  .top-actions .btn { min-width: 32px; padding: 6px 7px; }
  .brand-copy small, .top-actions .button-label { display: none; }
  .theme-select { width: 82px; padding-left: 7px; padding-right: 20px; }
  .identity-button { max-width: 44px; }
  .page { padding-top: 18px; }
  .forum-hero { padding: 23px 20px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .toolbar { align-items: stretch; flex-direction: column; border-radius: 12px 12px 0 0; }
  .filter-bar { align-items: stretch; }
  .filter-bar .form-select { flex: 1 1 45%; min-width: 0; }
  .filter-summary { width: 100%; margin-left: 0; }
  .tabs { overflow-x: auto; }
  .tab { flex: 0 0 auto; }
  .search-form { width: 100%; min-width: 0; margin: 0; }
  .thread-row { grid-template-columns: 48px minmax(0, 1fr); gap: 10px; padding: 14px 11px; }
  .thread-side { grid-column: 2; text-align: left; }
  .reply-count { width: 40px; height: 40px; }
  .thread-excerpt { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .thread-head-row { flex-direction: column; }
  .thread-controls { justify-content: flex-start; }
  .floor { display: block; }
  .floor-author { display: grid; grid-template-columns: 42px 1fr; gap: 10px; padding: 12px 14px; border-right: 0; border-bottom: 1px solid var(--line); text-align: left; }
  .avatar { grid-row: 1 / span 2; width: 42px; height: 42px; margin: 0; border-radius: 12px; font-size: 18px; }
  .floor-content { min-height: 180px; padding: 18px 16px 14px; }
  .interaction-grid, .related-grid { grid-template-columns: 1fr; }
  .article-gallery { grid-template-columns: 1fr; }
  .article-image img { height: auto; max-height: 64vh; }
  .editor-status { display: none; }
  .image-preview-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-row { grid-template-columns: 1fr; }
  .mini-rating-form { grid-template-columns: 72px minmax(0, 1fr); }
  .mini-rating-form .btn { grid-column: 1 / -1; }
  .library-file { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
