:root {
  --bg: #f1f2f5;
  --surface: #ffffff;
  --surface-alt: #f7f8fa;
  --surface-hover: #fafbfd;
  --topbar: #ececec;
  --text: #333333;
  --text-soft: #555555;
  --muted: #6b6b6b;
  --border: #e4e4e4;
  --border-soft: #ededed;
  --border-strong: #c9c9c9;
  --accent: #2b63c4;
  --accent-dark: #23529f;
  --accent-soft: #6899ec;
  --accent-wash: #eef4ff;
  --accent-ink: #ffffff;
  --accent-border: #d7e2f5;
  --hot: #d32011;
  --notice: #fffbe9;
  --notice-border: #f0e2b4;
  --radius: 3px;
  --radius-sm: 2px;
  --shell: 1000px;
  --font-body: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --shadow-stuck: 0 1px 3px rgba(0, 0, 0, 0.08);
  --cta-fill: #1f3f74;
  --cta-edge: #d8e2f0;
  --cta-elevation: 0 2px 6px rgba(0, 0, 0, 0.12);
  --cta-rail: #eaf1fc;
  --cta-sheen: #f5f9ff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

h1 {
  font-size: 24px;
  line-height: 1.45;
  margin: 0;
}

h2 {
  font-size: 19px;
  line-height: 1.5;
  margin: 0;
}

h3 {
  font-size: 17px;
  line-height: 1.5;
  margin: 0;
}

p {
  margin: 0;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--text-soft);
  text-decoration: none;
}

a:hover {
  color: var(--accent);
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.shell {
  width: var(--shell);
  max-width: calc(100% - 32px);
  margin: 0 auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- top bar ---------- */

.topbar {
  background: var(--topbar);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  line-height: 32px;
  color: var(--muted);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
}

.topbar-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.topbar-links a {
  padding: 0 4px;
  color: var(--text-soft);
}

.topbar-links .sep {
  color: var(--muted);
  padding: 0 2px;
}

.topbar-note {
  color: var(--muted);
}

/* ---------- masthead ---------- */

.masthead {
  background: var(--surface);
  padding: 12px 0;
}

.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.brand {
  display: inline-block;
}

.brand img {
  width: 236px;
  height: 40px;
}

.search {
  display: flex;
  align-items: stretch;
  width: 252px;
  max-width: 100%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: var(--radius);
}

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 6px 9px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: transparent;
}

.search button {
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: inherit;
  font-size: 14px;
  padding: 0 13px;
  cursor: pointer;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.search button:hover {
  background: var(--accent-dark);
}

/* ---------- main nav ---------- */

.mainnav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 2px solid var(--accent-soft);
}

.nav-inner {
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-inner::-webkit-scrollbar {
  display: none;
}

.mainnav ul {
  display: flex;
  align-items: stretch;
  min-width: max-content;
}

.mainnav a {
  display: block;
  padding: 0 18px;
  line-height: 48px;
  font-size: 16px;
  color: var(--text-soft);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
}

.mainnav a:hover,
.mainnav a[aria-current="page"] {
  color: var(--hot);
  border-bottom-color: var(--hot);
  text-decoration: none;
}

.mainnav.is-stuck {
  box-shadow: var(--shadow-stuck);
}

/* ---------- page frame ---------- */

.page-main {
  padding: 12px 0 28px;
}

.crumb {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 7px 12px;
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.crumb a {
  color: var(--text-soft);
}

.crumb .sep {
  margin: 0 6px;
  color: var(--muted);
}

/* ---------- notice and capacity ---------- */

.notice {
  background: var(--notice);
  border: 1px solid var(--notice-border);
  padding: 12px 16px;
  margin-bottom: 12px;
}

.notice h2 {
  font-size: 16px;
  color: var(--hot);
  margin-bottom: 6px;
}

.notice ul {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text);
}

.notice li {
  padding: 2px 0 2px 1.1em;
  position: relative;
}

.notice li::before {
  content: "·";
  position: absolute;
  left: 0;
  color: var(--hot);
}

.capacity-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: 0;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--muted);
}

.home-title {
  font-size: 26px;
  line-height: 1.4;
  color: var(--text);
  margin: 0 0 10px;
  padding: 0 2px;
}

.home-lede {  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 0;
  padding: 12px 14px 14px;
  margin-bottom: 14px;
  font-size: 16px;
  line-height: 1.85;
  color: var(--text);
}

/* ---------- board groups ---------- */

.board-group {
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 14px;
}

.group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}

.group-head h2 {
  font-size: 19px;
  color: var(--text);
}

.group-head span {
  font-size: 12px;
  color: var(--muted);
}

.board-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 64px 250px;
  gap: 12px;
  align-items: center;
  padding: 14px;
}

.board-row + .board-row {
  border-top: 1px dashed var(--border-soft);
}

.board-row:hover {
  background: var(--surface-hover);
}

.board-badge {
  width: 44px;
  height: 44px;
  border: 1px solid var(--accent-border);
  background: var(--accent-wash);
  color: var(--accent);
  font-size: 20px;
  line-height: 42px;
  text-align: center;
  border-radius: var(--radius-sm);
}

.board-body h3 a {
  color: var(--text);
  font-size: 17px;
}

.board-body h3 a:hover {
  color: var(--accent);
}

.board-body p {
  margin-top: 3px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

.board-count {
  text-align: right;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.board-count strong {
  display: block;
  font-size: 18px;
  color: var(--text);
}

.board-pick {
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

.board-pick span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.board-pick a {
  color: var(--text-soft);
}

/* ---------- thread tables ---------- */

.thread-board {
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 14px;
}

.table-caption {
  font-size: 19px;
  padding: 9px 14px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}

.thread-head,
.thread-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px 92px;
  gap: 12px;
  align-items: start;
  padding: 11px 14px;
}

.thread-head {
  font-size: 13px;
  color: var(--muted);
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}

.thread-row {
  border-bottom: 1px solid var(--border-soft);
}

.thread-row:last-child {
  border-bottom: 0;
}

.thread-row:hover {
  background: var(--surface-hover);
}

.thread-title {
  font-size: 17px;
  line-height: 1.55;
  min-width: 0;
}

.thread-title a {
  color: var(--text);
}

.thread-title a:hover {
  color: var(--accent);
}

.thread-summary {
  margin-top: 3px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

.thread-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.thread-col {
  font-size: 14px;
  line-height: 1.8;
}

.tag {
  display: inline-block;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.6;
  padding: 1px 7px;
  border-radius: var(--radius-sm);
}

a.tag:hover {
  border-color: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}

/* ---------- tag cloud ---------- */

.tag-block {
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 14px;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px;
}

.tag-cloud a {
  font-size: 14px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
}

.tag-cloud a span {
  margin-left: 5px;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- about ---------- */

.about-block {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 14px;
}

.about-block h2 {
  font-size: 19px;
  margin-bottom: 6px;
}

.about-block p {
  font-size: 15px;
  line-height: 1.85;
  color: var(--text-soft);
}

/* ---------- board layout ---------- */

.board-grid {
  display: grid;
  grid-template-columns: minmax(0, 770px) 218px;
  gap: 12px;
  align-items: start;
}

.board-head {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 12px 14px;
}

.board-head h1 {
  font-size: 24px;
  margin-bottom: 4px;
}

.board-stats {
  font-size: 13px;
  color: var(--muted);
}

.board-intro {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 0;
  padding: 12px 14px;
}

.board-intro p {
  font-size: 16px;
  line-height: 1.85;
  color: var(--text);
  margin-bottom: 10px;
}

.board-intro p:last-child {
  margin-bottom: 0;
}

.board-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.side-box {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 10px 12px;
}

.side-box h2 {
  font-size: 15px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.side-box ul {
  font-size: 14px;
  line-height: 1.7;
}

.side-box li {
  padding: 3px 0;
}

.side-note {
  font-size: 13px;
  line-height: 1.75;
  color: var(--muted);
}

/* ---------- article thread ---------- */

.thread-card {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--border);
}

.thread-side {
  background: var(--surface-alt);
  border-right: 1px solid var(--border);
  padding: 14px 12px;
  font-size: 13px;
  line-height: 1.6;
  min-width: 0;
}

.side-label {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}

.side-label:first-child {
  margin-top: 0;
}

.side-value {
  margin-top: 2px;
  font-size: 14px;
}

.side-tags {
  margin-top: 4px;
}

.side-tag {
  margin-bottom: 6px;
}

.side-back {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}

.thread-body {
  padding: 16px 22px 20px;
  min-width: 0;
}

.thread-body h1 {
  font-size: 24px;
  line-height: 1.5;
  margin-bottom: 8px;
}

.thread-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}

.thread-meta .sep {
  color: var(--muted);
}

.post-body p {
  font-size: 16px;
  line-height: 1.85;
  color: var(--text);
  margin-bottom: 14px;
}

.post-body p:last-child {
  margin-bottom: 0;
}

.reminder {
  margin-top: 18px;
  background: var(--notice);
  border: 1px solid var(--notice-border);
  padding: 10px 12px;
}

.reminder h2 {
  font-size: 15px;
  color: var(--hot);
  margin-bottom: 6px;
}

.reminder ul {
  font-size: 14px;
  line-height: 1.75;
}

.reminder li {
  padding: 1px 0;
}

.related {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.related h2 {
  font-size: 17px;
  margin-bottom: 8px;
}

.related li {
  padding: 4px 0;
  font-size: 15px;
  line-height: 1.7;
}

.rel-col {
  font-size: 13px;
  color: var(--muted);
}

/* ---------- plain cards and search ---------- */

.plain-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 18px 22px;
}

.plain-card h1 {
  font-size: 24px;
  margin-bottom: 10px;
}

.plain-card p {
  font-size: 16px;
  line-height: 1.85;
  color: var(--text);
  margin-bottom: 12px;
}

.plain-card p:last-child {
  margin-bottom: 0;
}

.search-page-form {
  width: 100%;
  max-width: 420px;
  margin: 6px 0 4px;
}

.search-status {
  font-size: 14px;
  color: var(--muted);
  margin: 12px 0 0;
}

.search-results li {
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}

.search-results li:last-child {
  border-bottom: 0;
}

.search-results a {
  font-size: 16px;
  color: var(--text);
}

.search-results span {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- footer ---------- */

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: 20px;
  padding: 16px 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 2fr);
  gap: 20px;
}

.footer-brand a {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.footer-brand p {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--muted);
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.footer-cols h2 {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 6px;
}

.footer-cols ul {
  font-size: 13px;
  line-height: 1.7;
}

.footer-cols li {
  padding: 2px 0;
}

.copyright {
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .board-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .board-side {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .board-row {
    grid-template-columns: 48px minmax(0, 1fr) 56px;
    align-items: start;
  }

  .board-pick {
    grid-column: 2 / -1;
    margin-top: 4px;
  }
}

@media (max-width: 720px) {
  .masthead-inner {
    justify-content: flex-start;
  }

  .brand img {
    width: 200px;
    height: 34px;
  }

  .search {
    width: 100%;
  }

  .thread-head {
    display: none;
  }

  .thread-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    padding: 12px 14px;
  }

  .thread-col {
    font-size: 13px;
  }

  .thread-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .thread-side {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 10px 14px;
  }

  .side-label {
    margin-top: 0;
  }

  .side-value,
  .side-tags {
    margin-top: 0;
  }

  .side-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }

  .side-tag {
    margin-bottom: 0;
  }

  .side-back {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .thread-body {
    padding: 14px 16px 18px;
  }

  .thread-body h1 {
    font-size: 22px;
  }

  .footer-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .shell {
    max-width: calc(100% - 20px);
  }

  .board-row {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .board-count {
    grid-column: 2;
    display: flex;
    align-items: baseline;
    gap: 4px;
    text-align: left;
  }

  .board-count strong {
    display: inline;
    font-size: 14px;
  }

  .board-pick {
    grid-column: 2;
  }

  .board-side {
    grid-template-columns: minmax(0, 1fr);
  }

  .capacity-bar {
    font-size: 12px;
  }

  .plain-card {
    padding: 14px 16px;
  }
}
