:root {
  --paper: #F4F3ED;
  --ink: #20221F;
  --muted: #62665E;
  --red: #D83D23;
  --line: #D7D8CF;
  --lime: #E3EDAB;
  --max: 1120px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 22px 80px; }
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0;
  background: rgba(244,243,237,.94); backdrop-filter: blur(8px); z-index: 20;
}
.brand b { letter-spacing: .12em; font-size: 13px; }
.brand span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border: 1px solid var(--line); background: #fff;
  border-radius: 2px; cursor: pointer; font-size: 13px;
}
.btn:hover { border-color: var(--ink); }
.btn-solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; }
.chip { font-size: 12px; color: var(--muted); padding: 6px 10px; border: 1px solid var(--line); border-radius: 2px; background: #fff; }
.hero { padding: 42px 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.eyebrow { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.hero h1 { font-size: clamp(32px, 6vw, 54px); font-weight: 500; margin: 0 0 12px; letter-spacing: -.02em; line-height: 1.15; }
.hero p { max-width: 640px; color: var(--muted); line-height: 1.8; margin: 0; font-size: 15px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 22px; align-items: center; }
.toolbar input[type=search] {
  flex: 1; min-width: 200px; height: 40px; padding: 0 12px; border: 1px solid var(--line);
  background: #fff; border-radius: 2px;
}
.layout { display: grid; grid-template-columns: 260px 1fr; gap: 28px; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }
.side h2, .main h2 { font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0 0 12px; }
.board-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.board-list li { border-bottom: 1px solid var(--line); }
.board-list a {
  display: block; padding: 12px 4px; font-size: 14px;
}
.board-list a:hover, .board-list a.on { color: var(--red); }
.board-list .meta { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.section-label {
  margin: 22px 0 8px; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
}
.thread-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.thread-table th {
  text-align: left; font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; padding: 10px 8px; border-bottom: 1px solid var(--line);
}
.thread-table td { padding: 14px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.thread-table tr:hover td { background: rgba(216,61,35,.04); }
.thread-title { font-weight: 600; line-height: 1.45; }
.thread-title .pin { display: inline-block; background: var(--lime); color: var(--ink); font-size: 11px; padding: 1px 6px; border-radius: 2px; margin-right: 6px; }
.thread-title .res { display: inline-block; background: var(--red); color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 2px; margin-right: 6px; }
.muted { color: var(--muted); font-size: 12px; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.crumb a:hover { color: var(--red); }
.post {
  border: 1px solid var(--line); background: #fff; border-radius: 2px; padding: 16px 18px; margin-bottom: 12px;
}
.post-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-size: 12px; color: var(--muted); }
.post-body { white-space: pre-wrap; line-height: 1.75; font-size: 14.5px; }
.post.resource { border-left: 3px solid var(--red); }
.composer {
  border: 1px solid var(--line); background: #fff; border-radius: 2px; padding: 16px; margin-top: 18px;
}
.composer .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.composer label { font-size: 12px; color: var(--muted); }
.composer input, .composer textarea, .composer select {
  border: 1px solid var(--line); border-radius: 2px; padding: 10px 12px; background: var(--paper);
}
.composer textarea { min-height: 120px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 12px; }
.empty { padding: 28px; border: 1px dashed var(--line); color: var(--muted); text-align: center; }
.hidden { display: none !important; }
.footer { margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }


/* bv: compact boards — list/detail first; boards in expandable panel */
.board-panel { border: 1px solid var(--line); background: #fff; border-radius: 2px; }
.board-summary {
  list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 4px;
  padding: 12px 14px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.board-summary::-webkit-details-marker { display: none; }
.board-summary-hint { font-size: 11px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--muted); }
.board-panel-body { padding: 0 12px 14px; }
.board-panel[open] .board-summary { border-bottom: 1px solid var(--line); margin-bottom: 8px; }
@media (min-width: 901px) {
  /* Desktop: keep boards open by default via JS; still allow collapse */
  .board-panel-body { max-height: none; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .side { order: -1; }
  .board-panel:not([open]) .board-panel-body { display: none; }
  .main { min-width: 0; }
  .post-body { font-size: 15px; line-height: 1.8; }
}
.lang-orig {
  display: inline-block; margin-left: 8px; font-size: 11px; color: var(--muted);
  border: 1px solid var(--line); padding: 1px 6px; border-radius: 2px; vertical-align: middle;
}
.resource-link {
  display: inline-block; margin-top: 10px; padding: 8px 12px; border: 1px solid var(--ink);
  background: var(--ink); color: #fff; font-size: 13px; border-radius: 2px;
}
.resource-link:hover { opacity: .9; }

/* bw: title on its own line; author/replies/date as a compact second line (esp. 390) */
.thread-meta-line {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  margin-top: 6px; font-size: 12px; line-height: 1.4;
}
.thread-meta-line .tm-board { opacity: .85; }
.thread-table thead { display: none; }
.thread-table td { padding: 12px 4px; }
@media (max-width: 900px) {
  .thread-meta-line { gap: 4px 10px; }
}
