:root {
  color-scheme: dark;
  --ink: #0d1011;
  --ink-2: #151b1d;
  --panel: #f6efe3;
  --panel-2: #ead9aa;
  --text: #f6efe3;
  --muted: #bfb6a5;
  --line: rgba(246, 239, 227, .18);
  --line-dark: rgba(13, 16, 17, .16);
  --red: #9d2f35;
  --red-2: #c74d4d;
  --jade: #2e6f65;
  --gold: #f2c66d;
  --blue: #243d63;
  --shadow: 0 18px 50px rgba(0, 0, 0, .26);
  --radius: 8px;
  --max: 1180px;
  font-family: "Noto Serif SC", "Songti SC", "SimSun", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-size: 16px;
  line-height: 1.65;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(246, 239, 227, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(246, 239, 227, .035) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: .42;
  z-index: -1;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: .5rem;
  padding: .6rem .85rem;
  background: var(--panel);
  color: var(--ink);
  transform: translateY(-160%);
  z-index: 50;
}

.skip-link:focus {
  transform: translateY(0);
}

.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;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 16, 17, .9);
  backdrop-filter: blur(16px);
}

.header-inner {
  width: min(100% - 2rem, var(--max));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: .72rem;
  font-weight: 900;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: var(--red);
  border: 1px solid rgba(246, 239, 227, .42);
  border-radius: 8px;
  box-shadow: inset 0 0 0 2px rgba(13, 16, 17, .28);
}

.brand-title {
  display: block;
  line-height: 1.05;
}

.brand-domain {
  display: block;
  color: var(--muted);
  font-family: "Microsoft YaHei", system-ui, sans-serif;
  font-size: .78rem;
  font-weight: 600;
}

.nav-toggle {
  min-width: 44px;
  min-height: 44px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
}

.nav-toggle-lines,
.nav-toggle-lines::before,
.nav-toggle-lines::after {
  width: 20px;
  height: 2px;
  display: block;
  background: currentColor;
}

.nav-toggle-lines {
  position: relative;
}

.nav-toggle-lines::before,
.nav-toggle-lines::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-lines::before {
  top: -7px;
}

.nav-toggle-lines::after {
  top: 7px;
}

.nav-panel {
  position: absolute;
  left: 1rem;
  right: 1rem;
  top: 76px;
  display: none;
  padding: .8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #111719;
  box-shadow: var(--shadow);
}

.nav-open .nav-panel,
.no-js .nav-panel {
  display: grid;
  gap: .35rem;
}

.nav-link,
.nav-cta {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: .55rem .78rem;
  border-radius: 8px;
  color: var(--muted);
  font-family: "Microsoft YaHei", system-ui, sans-serif;
  font-weight: 700;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--text);
  background: rgba(246, 239, 227, .08);
}

.nav-cta {
  justify-content: center;
  background: var(--panel);
  color: var(--ink);
}

.section {
  padding: 3.25rem 0;
}

.section.alt {
  background: #101719;
}

.section.paper {
  background: var(--panel);
  color: var(--ink);
}

.section-inner {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
}

.section-kicker,
.eyebrow {
  margin: 0 0 .65rem;
  color: var(--gold);
  font-family: "Microsoft YaHei", system-ui, sans-serif;
  font-size: .78rem;
  font-weight: 900;
}

.paper .section-kicker {
  color: var(--red);
}

.section-title {
  margin: 0;
  font-size: 1.85rem;
  line-height: 1.18;
}

.section-lede {
  max-width: 720px;
  margin: .85rem 0 0;
  color: var(--muted);
  font-family: "Microsoft YaHei", system-ui, sans-serif;
}

.paper .section-lede {
  color: #564d42;
}

.hero {
  min-height: 660px;
  display: grid;
  align-items: end;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(13, 16, 17, .18), rgba(13, 16, 17, .76) 70%, var(--ink)),
    url("realm-map.svg") center / cover no-repeat;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 110px;
  background: linear-gradient(180deg, transparent, var(--ink));
}

.hero-inner {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
  padding: 6.5rem 0 5.2rem;
  position: relative;
  z-index: 2;
}

.hero-copy {
  max-width: 760px;
}

.hero h1 {
  margin: 0;
  max-width: 12ch;
  font-size: 3.25rem;
  line-height: .98;
  text-wrap: balance;
}

.hero p {
  max-width: 650px;
  margin: 1.15rem 0 0;
  color: #efe7d6;
  font-family: "Microsoft YaHei", system-ui, sans-serif;
  font-size: 1.05rem;
}

.hero-actions,
.toolbar,
.filter-row,
.thread-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
}

.hero-actions {
  margin-top: 1.55rem;
}

.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .68rem 1rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-family: "Microsoft YaHei", system-ui, sans-serif;
  font-weight: 900;
}

.btn.secondary {
  border-color: rgba(246, 239, 227, .35);
  background: rgba(13, 16, 17, .44);
  color: var(--text);
}

.btn.ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--text);
}

.paper .btn.ghost {
  border-color: var(--line-dark);
  color: var(--ink);
}

.btn:hover,
.btn:focus-visible,
.nav-cta:hover,
.nav-cta:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, .2);
}

.hero-dock {
  margin-top: 2.2rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: .75rem;
}

.dock-item {
  min-height: 96px;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(17, 23, 25, .72);
  backdrop-filter: blur(8px);
}

.dock-number {
  display: block;
  color: var(--gold);
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1;
}

.dock-label {
  display: block;
  margin-top: .4rem;
  color: var(--muted);
  font-family: "Microsoft YaHei", system-ui, sans-serif;
  font-size: .9rem;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1.4rem;
}

.card,
.resource-card,
.thread-card,
.category-card,
.notice-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #151b1d;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .16);
}

.paper .card,
.paper .resource-card {
  border-color: var(--line-dark);
  background: #fff9ea;
  color: var(--ink);
}

.card {
  padding: 1rem;
}

.card h3,
.resource-card h3,
.thread-card h3,
.category-card h3 {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.28;
}

.card p,
.resource-card p,
.thread-card p,
.category-card p {
  margin: .65rem 0 0;
  color: var(--muted);
  font-family: "Microsoft YaHei", system-ui, sans-serif;
}

.paper .card p,
.paper .resource-card p {
  color: #564d42;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: .9rem;
}

.tag,
.pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: .22rem .55rem;
  border-radius: 999px;
  font-family: "Microsoft YaHei", system-ui, sans-serif;
  font-size: .78rem;
  font-weight: 800;
}

.tag {
  border: 1px solid var(--line);
  color: var(--muted);
}

.paper .tag {
  border-color: var(--line-dark);
  color: #5d5245;
}

.pill {
  background: rgba(46, 111, 101, .18);
  color: #bdece2;
}

.status-pill {
  background: rgba(157, 47, 53, .14);
  color: #ffd3cf;
}

.paper .status-pill {
  color: var(--red);
}

.resource-tools {
  margin-top: 1.25rem;
  display: grid;
  gap: .75rem;
}

.field,
.select,
.textarea {
  width: 100%;
  min-height: 44px;
  padding: .72rem .82rem;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: #fffdf5;
  color: var(--ink);
  outline: none;
}

.field:focus,
.select:focus,
.textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(157, 47, 53, .18);
}

.filter-btn {
  min-height: 40px;
  padding: .45rem .78rem;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-family: "Microsoft YaHei", system-ui, sans-serif;
  font-weight: 800;
}

.filter-btn[aria-pressed="true"] {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.resource-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.resource-card {
  padding: 1rem;
}

.resource-meta,
.thread-meta,
.event-meta,
.base-note {
  color: var(--muted);
  font-family: "Microsoft YaHei", system-ui, sans-serif;
  font-size: .88rem;
}

.paper .resource-meta {
  color: #5d5245;
}

.event-list {
  margin-top: 1.4rem;
  display: grid;
  gap: .75rem;
}

.event-row {
  display: grid;
  grid-template-columns: 4.8rem 1fr;
  gap: .9rem;
  align-items: start;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.event-date {
  min-height: 62px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--gold);
  font-weight: 900;
}

.event-row h3 {
  margin: 0;
  font-size: 1.05rem;
}

.event-row p {
  margin: .35rem 0 0;
  color: var(--muted);
  font-family: "Microsoft YaHei", system-ui, sans-serif;
}

.community-band {
  display: grid;
  gap: 1.4rem;
  align-items: center;
}

.community-art {
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: url("community-table.svg") center / cover no-repeat;
  box-shadow: var(--shadow);
}

.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--line);
  background: #0a0c0d;
  color: var(--muted);
  font-family: "Microsoft YaHei", system-ui, sans-serif;
}

.footer-inner {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
  display: grid;
  gap: .7rem;
}

.footer a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: .18em;
}

.community-shell {
  background:
    linear-gradient(180deg, rgba(13, 16, 17, .54), #0d1011 420px),
    url("community-table.svg") center top / min(1200px, 100%) auto no-repeat,
    #0d1011;
}

.community-hero {
  padding: 3rem 0 1.5rem;
}

.community-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: start;
  margin-top: 1.2rem;
}

.community-aside {
  display: grid;
  gap: .8rem;
}

.category-card {
  padding: 1rem;
}

.category-card[data-active="true"] {
  border-color: rgba(242, 198, 109, .72);
  box-shadow: inset 4px 0 0 var(--gold);
}

.category-card button {
  width: 100%;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.thread-stream {
  display: grid;
  gap: .85rem;
}

.thread-card {
  padding: 1rem;
}

.thread-card.is-local {
  border-color: rgba(46, 111, 101, .72);
}

.thread-topline {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .65rem;
  align-items: center;
  margin-bottom: .5rem;
}

.thread-card h3 a {
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: .18em;
}

.thread-card h3 a:hover,
.thread-card h3 a:focus-visible {
  text-decoration-color: currentColor;
}

.thread-stats {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: .9rem;
  color: var(--muted);
  font-family: "Microsoft YaHei", system-ui, sans-serif;
  font-size: .84rem;
}

.compose-panel {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #151b1d;
}

.compose-panel[hidden] {
  display: none;
}

.form-grid {
  display: grid;
  gap: .75rem;
}

.textarea {
  min-height: 116px;
  resize: vertical;
}

.empty-state {
  padding: 1rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-family: "Microsoft YaHei", system-ui, sans-serif;
}

[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: no-preference) {
  .btn,
  .nav-link,
  .nav-cta,
  .card,
  .resource-card,
  .thread-card {
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
  }

  .card:hover,
  .resource-card:hover,
  .thread-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
  }
}

@media (min-width: 760px) {
  .nav-toggle {
    display: none;
  }

  .nav-panel {
    position: static;
    display: flex;
    align-items: center;
    gap: .2rem;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .hero h1 {
    font-size: 4.4rem;
  }

  .hero-dock {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .resource-tools {
    grid-template-columns: minmax(260px, 1fr) auto;
    align-items: center;
  }

  .resource-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .community-band {
    grid-template-columns: 1fr 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

@media (min-width: 1040px) {
  .section {
    padding: 4.5rem 0;
  }

  .hero {
    min-height: 720px;
  }

  .hero h1 {
    font-size: 5.35rem;
  }

  .grid.three {
    grid-template-columns: repeat(3, 1fr);
  }

  .resource-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .community-layout {
    grid-template-columns: 280px 1fr;
  }

  .community-aside {
    position: sticky;
    top: 92px;
  }
}
