/* GameRealm BBS — portal + forum */
:root {
  --bg: #0c1412;
  --bg-elev: #13201c;
  --bg-soft: #1a2e28;
  --ink: #e7f0ea;
  --muted: #8aa297;
  --line: rgba(126, 196, 160, 0.18);
  --accent: #3dcf8e;
  --accent-2: #e8c547;
  --accent-dim: rgba(61, 207, 142, 0.14);
  --danger: #e05a5a;
  --ok: #3dcf8e;
  --radius: 4px;
  --font-display: "Outfit", "Noto Sans SC", sans-serif;
  --font-body: "Noto Sans SC", "Outfit", sans-serif;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --max: 1120px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(61, 207, 142, 0.12), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(232, 197, 71, 0.08), transparent 50%),
    linear-gradient(180deg, #0a1210 0%, var(--bg) 40%, #0e1815 100%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.65;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
  z-index: 0;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
img { max-width: 100%; display: block; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.skip-link {
  position: absolute; left: -999px; top: 0;
}
.skip-link:focus { left: 1rem; top: 1rem; z-index: 99; background: #000; padding: .5rem 1rem; }

.wrap { width: min(100% - 2rem, var(--max)); margin-inline: auto; position: relative; z-index: 1; }
.narrow { max-width: 760px; }

.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(10, 18, 16, 0.78);
  border-bottom: 1px solid var(--line);
  transition: background .3s ease, border-color .3s ease;
}
.site-header.is-scrolled { background: rgba(8, 14, 12, 0.92); border-color: rgba(61, 207, 142, 0.28); }

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 64px; gap: 1rem;
}

.logo { display: inline-flex; align-items: center; gap: .65rem; color: var(--ink); font-family: var(--font-display); font-weight: 700; letter-spacing: 0.02em; }
.logo:hover { color: var(--ink); }
.logo-mark {
  width: 2rem; height: 2rem; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #1f9a66);
  color: #04140e; font-size: .75rem; font-weight: 700; border-radius: 2px;
}
.logo-text { font-size: 1.15rem; }

.nav { display: flex; flex-wrap: wrap; gap: .35rem 1rem; align-items: center; font-size: .92rem; }
.nav a { color: var(--muted); }
.nav a:hover, .nav .nav-cta { color: var(--ink); }
.nav-cta {
  padding: .35rem .75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--accent-dim);
}

/* Hero — one composition */
.hero {
  position: relative;
  min-height: min(88vh, 720px);
  display: grid;
  align-items: end;
  padding: 6rem 0 4.5rem;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    linear-gradient(180deg, transparent 20%, rgba(12, 20, 18, 0.75) 70%, var(--bg) 100%),
    linear-gradient(105deg, rgba(12, 40, 30, 0.9) 0%, transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1600' height='900' viewBox='0 0 1600 900'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop stop-color='%231a3d32'/%3E%3Cstop offset='1' stop-color='%230c1412'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect fill='url(%23g)' width='1600' height='900'/%3E%3Cpath d='M0 620 Q400 480 800 600 T1600 520 V900 H0Z' fill='%23091a15' opacity='.85'/%3E%3Cpath d='M0 700 Q500 560 900 680 T1600 600 V900 H0Z' fill='%230c1f18' opacity='.7'/%3E%3Ccircle cx='1180' cy='220' r='180' fill='%233dcf8e' opacity='.08'/%3E%3C/svg%3E") center/cover no-repeat;
}
.hero-content { position: relative; z-index: 1; max-width: 38rem; }
.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
  margin-bottom: .85rem;
}
.hero-title {
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  font-weight: 500;
  color: var(--accent-2);
  margin-bottom: .85rem;
}
.hero-lead { color: var(--muted); margin-bottom: 1.5rem; max-width: 34rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .7rem 1.2rem; border-radius: var(--radius);
  border: 1px solid transparent; font: inherit; cursor: pointer;
  transition: transform .2s ease, background .2s ease, border-color .2s ease, color .2s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: #042016; font-weight: 600; }
.btn-primary:hover { background: #58e0a2; color: #042016; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: transparent; border: 1px solid var(--danger); color: var(--danger); }

.section { padding: 3rem 0; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  margin-bottom: 1.25rem;
}
.section-head h1, .section-head h2, .thread-head h1, h1 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}
.muted { color: var(--muted); font-size: .92rem; }

.split {
  display: grid; gap: 2.5rem;
  grid-template-columns: 1.4fr 1fr;
}
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .nav { font-size: .85rem; gap: .25rem .7rem; }
}

.board-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.board-tile {
  display: flex; flex-direction: column; gap: .45rem;
  padding: 1.15rem 1.2rem;
  border-left: 3px solid var(--accent);
  background: linear-gradient(135deg, rgba(26, 46, 40, 0.75), rgba(19, 32, 28, 0.4));
  color: inherit;
  min-height: 7.5rem;
  transition: transform .25s ease, background .25s ease, border-color .25s ease;
}
.board-tile:hover { transform: translateY(-3px); border-color: var(--accent-2); color: inherit; }
.board-tile strong { font-size: 1.05rem; }
.board-tile span { color: var(--muted); font-size: .9rem; flex: 1; }
.board-tile em { font-style: normal; color: var(--accent); font-size: .8rem; }

.thread-list, .thread-table, .side-list, .article-mini { list-style: none; }
.thread-list li, .thread-table li {
  border-bottom: 1px solid var(--line);
}
.thread-list a, .thread-table a, .side-list a {
  display: block; padding: .85rem 0; color: var(--ink);
}
.thread-list a:hover .t-title, .thread-table a:hover strong { color: var(--accent); }
.t-title, .thread-table strong { display: block; font-weight: 600; }
.t-meta { display: block; color: var(--muted); font-size: .82rem; margin-top: .25rem; }
.flags em, .badge {
  display: inline-block; font-style: normal; font-size: .7rem;
  padding: .1rem .35rem; margin-right: .35rem;
  background: var(--accent-dim); color: var(--accent); border-radius: 2px;
}
.badge.essence, .flags .essence { color: var(--accent-2); background: rgba(232, 197, 71, 0.12); }
.is-sticky { background: rgba(61, 207, 142, 0.04); }

.side-list li {
  display: flex; justify-content: space-between; gap: .75rem;
  padding: .55rem 0; border-bottom: 1px solid var(--line); font-size: .92rem;
}
.side-list span { color: var(--muted); white-space: nowrap; }

.article-mini li a {
  display: grid; grid-template-columns: 72px 1fr; gap: .75rem;
  padding: .7rem 0; color: inherit; border-bottom: 1px solid var(--line);
}
.article-mini img { width: 72px; height: 52px; object-fit: cover; background: var(--bg-soft); }
.article-mini strong { display: block; font-size: .92rem; }
.article-mini span { color: var(--muted); font-size: .8rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.article-card {
  display: flex; flex-direction: column;
  color: inherit;
  background: rgba(19, 32, 28, 0.55);
  border-bottom: 2px solid var(--accent);
  overflow: hidden;
  transition: transform .25s ease;
}
.article-card:hover { transform: translateY(-4px); color: inherit; }
.article-cover {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #1a3d32, #0c1412) center/cover;
}
.article-body { padding: 1rem 1.1rem 1.2rem; }
.article-body h2 { font-size: 1.05rem; margin-bottom: .4rem; font-family: var(--font-display); }
.article-body p { color: var(--muted); font-size: .9rem; margin-bottom: .5rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.article-hero-img {
  margin: 0 -0.5rem 1.25rem;
  background: var(--bg-soft);
  text-align: center;
  overflow: hidden;
}
.article-hero-img img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  margin: 0 auto;
}
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; color: var(--accent); margin-bottom: .5rem; }
.article-summary {
  padding: .9rem 1rem; margin: 1rem 0 1.5rem;
  border-left: 3px solid var(--accent-2);
  background: rgba(232, 197, 71, 0.06);
  color: var(--muted);
}

.post-card {
  display: grid; grid-template-columns: 140px 1fr; gap: 1rem;
  padding: 1.25rem 0; border-bottom: 1px solid var(--line);
}
@media (max-width: 640px) {
  .post-card { grid-template-columns: 1fr; }
}
.post-author { font-size: .88rem; color: var(--muted); }
.post-author strong { display: block; color: var(--ink); margin-bottom: .25rem; }
.post-meta { color: var(--muted); font-size: .8rem; margin-bottom: .6rem; }
.rich-content { overflow-wrap: anywhere; }
.rich-content p + p { margin-top: .75rem; }
.rich-content img { margin: .75rem 0; border-radius: 2px; }
.rich-content a { text-decoration: underline; }

.reply-box { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.reply-box.pulse-ok { animation: pulseOk .8s ease; }
@keyframes pulseOk {
  0% { box-shadow: 0 0 0 0 rgba(61, 207, 142, 0.45); }
  100% { box-shadow: 0 0 0 18px rgba(61, 207, 142, 0); }
}

.stack-form { display: grid; gap: .9rem; }
.stack-form label { display: grid; gap: .35rem; font-size: .9rem; color: var(--muted); }
.stack-form input, .stack-form textarea, .stack-form select {
  width: 100%; padding: .7rem .8rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(8, 14, 12, 0.7); color: var(--ink); font: inherit;
}
.stack-form input:focus, .stack-form textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim);
}

.page-auth .site-header { display: none; }
.auth-shell {
  min-height: 100vh; display: grid; place-items: center; padding: 2rem;
  position: relative; z-index: 1;
}
.auth-panel {
  width: min(100%, 420px);
  padding: 2rem;
  background: rgba(19, 32, 28, 0.85);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.brand-mark {
  font-family: var(--font-display); font-weight: 700; font-size: 1.6rem;
  color: var(--accent); margin-bottom: .35rem;
}
.auth-panel h1 { margin-bottom: 1rem; font-family: var(--font-display); }
.lede { color: var(--muted); margin-bottom: 1rem; }
.token-box {
  background: #07110e; border: 1px solid var(--line); padding: .85rem;
  overflow: auto; font-size: .8rem; margin: .75rem 0 1rem; color: var(--accent-2);
}

.flash {
  padding: .75rem 1rem; margin: 1rem 0; border-left: 3px solid var(--accent);
  background: rgba(61, 207, 142, 0.08);
}
.flash-error { border-color: var(--danger); background: rgba(224, 90, 90, 0.1); }
.flash-ok { border-color: var(--ok); }

.profile-head {
  display: flex; gap: 1.25rem; align-items: center; margin-bottom: 2rem;
}
.avatar {
  width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #1f9a66);
  color: #042016; font-size: 1.5rem; font-weight: 700; font-family: var(--font-display);
}

.pager { display: flex; gap: 1rem; align-items: center; margin-top: 1.5rem; }
.crumb { color: var(--muted); font-size: .88rem; margin-bottom: 1rem; }
.crumb a { color: var(--muted); }
.empty { color: var(--muted); padding: 1rem 0; list-style: none; }

.cover-upload { margin: .25rem 0 .5rem; }
.cover-label { display: block; color: var(--muted); font-size: .9rem; margin-bottom: .45rem; }
.cover-row { display: flex; gap: 1rem; align-items: stretch; flex-wrap: wrap; }
.cover-preview {
  width: 200px; height: 112px;
  background: var(--bg-soft) center/cover no-repeat;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.cover-preview.has-image { border-style: solid; border-color: var(--accent); }
.cover-actions { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: .5rem; justify-content: center; }
.cover-btn { display: inline-flex; width: fit-content; cursor: pointer; }
.cover-btn input { display: none; }

/* ===== 百家号风格写作台 ===== */
.page-bjh .site-header { display: none; }
.page-bjh .site-footer { display: none; }
.bjh-wrap { position: relative; z-index: 1; min-height: 100vh; padding-bottom: 3rem; }
.bjh-desk { max-width: 860px; margin: 0 auto; }
.bjh-topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem 1rem;
  background: rgba(10, 18, 16, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.bjh-top-left, .bjh-top-right { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.bjh-back { color: var(--muted); }
.bjh-brand { font-family: var(--font-display); font-weight: 700; color: var(--ink); }
.bjh-select {
  background: rgba(8,14,12,.8); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: .45rem .65rem; font: inherit;
}
.bjh-publish-btn { min-width: 88px; }
.bjh-paper {
  margin: 1.25rem 1rem 0;
  background: #fff;
  color: #1a1a1a;
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(0,0,0,.28);
  overflow: hidden;
}
.bjh-cover { padding: 1.25rem 1.5rem 0; }
.bjh-cover-box {
  width: 100%;
  min-height: 120px;
  max-height: none;
  border: 1px dashed #c9cdd3;
  border-radius: 6px;
  background: #f5f6f8;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color .2s ease, background-color .2s ease;
}
.bjh-cover-box:hover { border-color: #3dcf8e; background-color: #f0faf5; }
.bjh-cover-box.has-image {
  border-style: solid;
  border-color: #3dcf8e;
  background: #fff;
  padding: .5rem;
}
.bjh-cover-box img.bjh-cover-img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 480px;
  object-fit: contain;
  margin: 0 auto;
}
.bjh-cover-tip { text-align: center; color: #8a9199; pointer-events: none; padding: 1.5rem; }
.bjh-cover-tip strong { display: block; color: #4e5969; margin-bottom: .35rem; font-size: 1.05rem; }
.bjh-cover-actions {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  margin-top: .75rem;
}
.bjh-cover-actions .btn-ghost { color: #1a1a1a; border-color: #d0d5dd; }
.bjh-cover-actions .muted { color: #8a9199; }
.bjh-title {
  width: 100%; border: 0; outline: none;
  font-size: clamp(1.6rem, 3vw, 2rem); font-weight: 700;
  padding: 1.25rem 1.5rem .35rem;
  color: #111; background: transparent;
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
}
.bjh-title::placeholder { color: #c0c4cc; font-weight: 600; }
.bjh-summary {
  width: 100%; border: 0; outline: none;
  font-size: 1rem; padding: .35rem 1.5rem 1rem;
  color: #4e5969; background: transparent;
  border-bottom: 1px solid #eef0f3;
}
.bjh-summary::placeholder { color: #c0c4cc; }
.bjh-editor { background: #fff; }
.bjh-toolbar {
  border-bottom: 1px solid #eef0f3 !important;
  background: #fafbfc !important;
  position: sticky; top: 52px; z-index: 5;
}
.bjh-local-toolbar {
  display: flex; flex-wrap: wrap; gap: .35rem;
  padding: .55rem .75rem;
  align-items: center;
}
.bjh-local-toolbar button,
.bjh-local-toolbar select {
  border: 1px solid #e5e6eb;
  background: #fff;
  color: #1d2129;
  border-radius: 4px;
  padding: .35rem .55rem;
  font: inherit;
  font-size: .85rem;
  cursor: pointer;
  line-height: 1.2;
}
.bjh-local-toolbar button:hover,
.bjh-local-toolbar select:hover { border-color: #3dcf8e; color: #0b6b45; }
.bjh-local-toolbar .sep {
  width: 1px; height: 1.2rem; background: #e5e6eb; margin: 0 .2rem;
}
.bjh-editor-body,
.bjh-editable-wrap {
  min-height: 420px;
  padding: 0;
  background: #fff;
}
.bjh-editable {
  min-height: 420px;
  padding: 1.1rem 1.5rem 2.5rem;
  outline: none;
  color: #1a1a1a;
  font-size: 16px;
  line-height: 1.85;
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
}
.bjh-editable:empty:before,
.bjh-editable[data-placeholder]:not(:focus):has(> p > br:only-child):before {
  content: attr(data-placeholder);
  color: #c0c4cc;
  pointer-events: none;
}
.bjh-editable p { margin: 0 0 .85rem; }
.bjh-editable h2 { font-size: 1.35rem; margin: 1.2rem 0 .7rem; }
.bjh-editable h3 { font-size: 1.15rem; margin: 1rem 0 .6rem; }
.bjh-editable blockquote {
  margin: .9rem 0; padding: .5rem .9rem;
  border-left: 3px solid #3dcf8e; background: #f7f8fa; color: #4e5969;
}
.bjh-editable img { max-width: 100%; height: auto; display: block; margin: .85rem 0; border-radius: 4px; }
.bjh-editable ul, .bjh-editable ol { padding-left: 1.4rem; margin: 0 0 .85rem; }

.bjh-extra { margin-top: 1.5rem; }
.bjh-meta-row {
  display: flex; gap: 1rem; flex-wrap: wrap; align-items: center;
  padding: 1rem 1.5rem 0; color: #4e5969; font-size: .9rem;
}
.bjh-meta-row input {
  border: 1px solid #e5e6eb; border-radius: 4px; padding: .35rem .55rem;
  background: #fff; color: #1a1a1a; font: inherit;
}

@media (max-width: 720px) {
  .bjh-topbar { flex-direction: column; align-items: stretch; }
  .bjh-paper { margin: .75rem .5rem 0; }
  .bjh-title, .bjh-summary { padding-left: 1rem; padding-right: 1rem; }
  .bjh-cover { padding-left: 1rem; padding-right: 1rem; }
}



/* Motion */
.reveal {
  opacity: 0; transform: translateY(14px);
  animation: rise .7s ease forwards;
}
.reveal.delay-1 { animation-delay: .12s; }
.reveal.delay-2 { animation-delay: .24s; }
.reveal.delay-3 { animation-delay: .36s; }
@keyframes rise {
  to { opacity: 1; transform: none; }
}
.reveal-list > * {
  opacity: 0; transform: translateY(10px);
  animation: rise .55s ease forwards;
}
.reveal-list > *:nth-child(1) { animation-delay: .05s; }
.reveal-list > *:nth-child(2) { animation-delay: .1s; }
.reveal-list > *:nth-child(3) { animation-delay: .15s; }
.reveal-list > *:nth-child(4) { animation-delay: .2s; }
.reveal-list > *:nth-child(5) { animation-delay: .25s; }
.reveal-list > *:nth-child(6) { animation-delay: .3s; }
.reveal-list > *:nth-child(n+7) { animation-delay: .35s; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-list > * { animation: none; opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
