/* =========================================================
   星火论坛 — 视觉系统
   纸张 / 油墨 / 红旗红 / 旧金色
   ========================================================= */

:root {
  --paper: #f3ede2;
  --paper-deep: #e9e0d1;
  --surface: #fbf8f1;
  --surface-strong: #fffdf8;
  --ink: #211b17;
  --ink-soft: #3c332c;
  --muted: #776b61;
  --muted-soft: #9a8e82;
  --red: #9e1b1b;
  --red-dark: #741111;
  --red-deep: #4b0909;
  --red-wash: rgba(158, 27, 27, 0.08);
  --gold: #b78b43;
  --gold-soft: #d5b77e;
  --line: rgba(33, 27, 23, 0.12);
  --line-strong: rgba(33, 27, 23, 0.22);
  --shadow-sm: 0 1px 2px rgba(40, 25, 15, 0.04);
  --shadow-md: 0 14px 40px rgba(51, 29, 17, 0.09);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
  --radius: 5px;
  --topbar-h: 72px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 0%, rgba(183, 139, 67, 0.06), transparent 32%),
    radial-gradient(circle at 88% 8%, rgba(158, 27, 27, 0.045), transparent 26%);
}

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

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.auth-tab,
.sort-tab,
.category-pick,
.mobile-cat {
  user-select: none;
}

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

svg {
  display: block;
}

::selection {
  background: var(--red);
  color: #fff8ec;
}

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--paper);
  font-family: var(--serif);
  font-size: 20px;
}

/* ---------- 品牌 ---------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 3px;
  background: var(--red);
  color: #fff8ea;
  box-shadow: inset 0 0 0 1px rgba(255, 248, 234, 0.18);
}

.brand-mark svg {
  width: 18px;
  height: 18px;
}

.brand-mark--light {
  background: rgba(255, 248, 234, 0.1);
  border: 1px solid rgba(255, 248, 234, 0.28);
  box-shadow: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
}

.brand-text strong {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.brand-text small {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--muted);
  white-space: nowrap;
}

.brand--light {
  color: #f9efdf;
}

.brand--light .brand-text small {
  color: rgba(249, 239, 223, 0.55);
}

/* ---------- 载入 ---------- */

.boot {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--paper);
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.boot.is-gone {
  opacity: 0;
  visibility: hidden;
}

.boot-star {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 4px;
  background: var(--red);
  color: #fff6e8;
  animation: boot-breathe 1.8s ease-in-out infinite;
}

.boot-star svg {
  width: 27px;
  height: 27px;
}

.boot p {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
}

.boot-line {
  width: 92px;
  height: 1px;
  overflow: hidden;
  background: var(--line);
}

.boot-line::after {
  content: "";
  display: block;
  width: 40%;
  height: 100%;
  background: var(--red);
  animation: boot-line 1.2s ease-in-out infinite;
}

@keyframes boot-breathe {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(158, 27, 27, 0.16); }
  50% { transform: scale(1.035); box-shadow: 0 0 0 10px rgba(158, 27, 27, 0); }
}

@keyframes boot-line {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(340%); }
}

/* =========================================================
   登录 / 注册
   ========================================================= */

.auth {
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(400px, 0.86fr);
  min-height: 100dvh;
  background: var(--paper);
}

.auth-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  overflow: hidden;
  padding: 38px 48px 30px;
  color: #f9efdf;
  background:
    radial-gradient(circle at 87% 12%, rgba(208, 157, 75, 0.2), transparent 30%),
    radial-gradient(circle at 4% 94%, rgba(0, 0, 0, 0.34), transparent 46%),
    linear-gradient(142deg, #8f1a1a 0%, #701111 38%, #520b0b 68%, #350606 100%);
  isolation: isolate;
}

.auth-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    repeating-linear-gradient(90deg, transparent 0, transparent 79px, rgba(255, 245, 226, 0.035) 80px),
    linear-gradient(180deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.25));
}

.visual-grain {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.24;
  mix-blend-mode: soft-light;
  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.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

.visual-star {
  position: absolute;
  z-index: 0;
  top: 13%;
  right: -13%;
  width: min(57vw, 720px);
  height: min(57vw, 720px);
  color: rgba(237, 199, 128, 0.11);
  transform: rotate(12deg);
  pointer-events: none;
}

.visual-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.edition {
  font-size: 10px;
  letter-spacing: 0.17em;
  color: rgba(249, 239, 223, 0.55);
  white-space: nowrap;
}

.visual-main {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  width: min(100%, 680px);
  padding: 48px 0 34px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 15px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--red);
}

.eyebrow--light {
  color: var(--gold-soft);
}

.eyebrow-line {
  display: inline-block;
  width: 26px;
  height: 1px;
  background: currentColor;
}

.visual-main h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3.15rem, 5.65vw, 5.9rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.visual-main h1 .accent {
  position: relative;
  display: inline-block;
  color: var(--gold-soft);
}

.visual-main h1 .accent::after {
  content: "";
  position: absolute;
  left: -2px;
  right: 8px;
  bottom: 7%;
  height: 9%;
  border-radius: 50%;
  background: rgba(213, 183, 126, 0.3);
  transform: rotate(-1.2deg);
}

.visual-lead {
  max-width: 430px;
  margin: 30px 0 0;
  color: rgba(249, 239, 223, 0.72);
  font-size: 14px;
  line-height: 1.95;
  letter-spacing: 0.015em;
}

.visual-pillars {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 34px;
  color: rgba(249, 239, 223, 0.82);
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.2em;
}

.visual-pillars i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold-soft);
  opacity: 0.6;
}

.visual-quote {
  position: relative;
  z-index: 2;
  max-width: 520px;
  margin: 0;
  padding: 17px 0 2px 22px;
  border-left: 1px solid rgba(213, 183, 126, 0.45);
}

.quote-mark {
  position: absolute;
  top: -16px;
  left: 18px;
  font-family: Georgia, serif;
  font-size: 50px;
  line-height: 1;
  color: rgba(213, 183, 126, 0.34);
}

.visual-quote blockquote {
  margin: 0;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.8;
  color: rgba(249, 239, 223, 0.86);
}

.visual-quote figcaption {
  margin-top: 7px;
  font-size: 10px;
  letter-spacing: 0.13em;
  color: rgba(249, 239, 223, 0.48);
}

.visual-foot {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 26px;
  margin-top: 28px;
  border-top: 1px solid rgba(255, 245, 226, 0.12);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: rgba(249, 239, 223, 0.4);
}

.auth-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 42px clamp(24px, 5vw, 72px) 26px;
  background:
    linear-gradient(90deg, rgba(33, 27, 23, 0.035) 1px, transparent 1px) 0 0 / 100% 100%,
    var(--paper);
}

.auth-panel::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.25);
}

.auth-card {
  width: min(100%, 418px);
  animation: rise-in 0.55s cubic-bezier(0.22, 0.8, 0.3, 1) both;
}

@keyframes rise-in {
  from { transform: translateY(14px); }
  to { transform: translateY(0); }
}

.auth-mobile-brand {
  display: none;
}

.auth-heading {
  margin-bottom: 26px;
}

.auth-heading .eyebrow {
  margin-bottom: 13px;
}

.auth-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(26px, 2.6vw, 32px);
  line-height: 1.28;
  letter-spacing: -0.02em;
}

.auth-heading p:last-child {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.auth-tabs {
  position: relative;
  display: flex;
  gap: 30px;
  margin-bottom: 25px;
  border-bottom: 1px solid var(--line);
}

.auth-tab {
  position: relative;
  padding: 0 0 12px;
  border: 0;
  background: none;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--muted-soft);
  transition: color 0.2s ease;
}

.auth-tab:hover {
  color: var(--ink);
}

.auth-tab.is-active {
  color: var(--red);
}

.tab-ink {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 32px;
  height: 2px;
  background: var(--red);
  transition: transform 0.3s cubic-bezier(0.22, 0.8, 0.3, 1), width 0.3s ease;
}

.auth-tabs.is-register .tab-ink {
  transform: translateX(62px);
  width: 32px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 17px;
  animation: form-in 0.3s ease both;
}

@keyframes form-in {
  from { transform: translateY(5px); }
  to { transform: translateY(0); }
}

.form-banner {
  padding: 10px 12px;
  border: 1px solid rgba(158, 27, 27, 0.25);
  border-left: 2px solid var(--red);
  background: rgba(158, 27, 27, 0.055);
  color: var(--red-dark);
  font-size: 12px;
  line-height: 1.6;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.field-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.field input {
  width: 100%;
  height: 48px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--surface-strong);
  font-size: 14px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.field input::placeholder {
  color: #b0a499;
}

.field input:hover {
  border-color: rgba(33, 27, 23, 0.34);
}

.field input:focus {
  outline: none;
  border-color: var(--red);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(158, 27, 27, 0.08);
}

.field input[aria-invalid="true"] {
  border-color: var(--red);
  background: rgba(158, 27, 27, 0.025);
}

.input-wrap {
  position: relative;
  display: block;
}

.input-wrap input {
  padding-right: 46px;
}

.peek {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--muted-soft);
  transform: translateY(-50%);
  transition: color 0.18s ease, background 0.18s ease;
}

.peek:hover {
  color: var(--ink);
  background: rgba(33, 27, 23, 0.045);
}

.peek svg {
  width: 18px;
  height: 18px;
}

.field-error {
  display: block;
  min-height: 0;
  color: var(--red);
  font-size: 11px;
  line-height: 1.5;
}

.field-error:empty {
  display: none;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: -2px;
}

.form-note {
  color: var(--muted-soft);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.check {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
  cursor: pointer;
  user-select: none;
}

.check input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.check-box {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--surface-strong);
  color: transparent;
  transition: all 0.18s ease;
}

.check-box svg {
  width: 11px;
  height: 11px;
}

.check input:checked + .check-box {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.check input:focus-visible + .check-box {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.check--agree {
  align-items: flex-start;
  margin-top: 1px;
  color: var(--muted);
  font-size: 11.5px;
}

.check--agree .check-box {
  margin-top: 1px;
}

.text-link {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: var(--red);
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.password-meter {
  display: flex;
  gap: 4px;
  height: 3px;
  margin-top: -2px;
}

.password-meter i {
  flex: 1;
  background: var(--line);
  transition: background 0.2s ease;
}

.password-meter.is-weak i:nth-child(1) { background: #b54b3f; }
.password-meter.is-fair i:nth-child(-n+2) { background: #b78b43; }
.password-meter.is-good i:nth-child(-n+3) { background: #6e7f4d; }
.password-meter.is-strong i { background: #3f6152; }

.btn-auth {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  height: 51px;
  margin-top: 3px;
  padding: 0 18px 0 21px;
  border: 0;
  border-radius: 3px;
  background: var(--red);
  color: #fff8ec;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  box-shadow: 0 7px 20px rgba(116, 17, 17, 0.15);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-auth:hover {
  background: var(--red-dark);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(116, 17, 17, 0.2);
}

.btn-auth:active {
  transform: translateY(0);
}

.btn-auth:disabled {
  opacity: 0.68;
  cursor: wait;
  transform: none;
}

.btn-auth svg {
  width: 19px;
  height: 19px;
  transition: transform 0.2s ease;
}

.btn-auth:hover svg {
  transform: translateX(3px);
}

.auth-switch {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.auth-switch button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--red);
  font-weight: 600;
}

.auth-legal {
  margin: 17px 0 0;
  color: var(--muted-soft);
  font-size: 10px;
  line-height: 1.65;
  text-align: center;
}

.auth-copyright {
  position: absolute;
  bottom: 22px;
  left: 0;
  right: 0;
  margin: 0;
  color: var(--muted-soft);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-align: center;
}

/* =========================================================
   论坛框架
   ========================================================= */

.app {
  min-height: 100dvh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--line);
  background: rgba(243, 237, 226, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 27px;
  width: min(100%, 1280px);
  height: var(--topbar-h);
  margin: 0 auto;
  padding: 0 28px;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.topnav a {
  position: relative;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 13px;
  transition: color 0.18s ease;
}

.topnav a:hover {
  color: var(--ink);
}

.topnav a.is-active {
  color: var(--red);
  font-weight: 600;
}

.topnav a.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 1px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--red);
  transform: translateX(-50%);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  min-width: 0;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 226px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255, 253, 248, 0.66);
  color: var(--muted-soft);
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.search:focus-within {
  border-color: rgba(158, 27, 27, 0.55);
  background: var(--surface-strong);
  box-shadow: 0 0 0 3px rgba(158, 27, 27, 0.06);
}

.search svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 12px;
}

.search input::placeholder {
  color: var(--muted-soft);
}

.search kbd {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted-soft);
  background: rgba(255, 255, 255, 0.6);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn--primary {
  background: var(--red);
  color: #fff8ec;
  box-shadow: 0 4px 12px rgba(116, 17, 17, 0.12);
}

.btn--primary:hover {
  background: var(--red-dark);
  transform: translateY(-1px);
}

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

.btn--ghost:hover {
  border-color: var(--red);
  color: var(--red);
  background: rgba(158, 27, 27, 0.03);
}

.user-menu {
  position: relative;
}

.user-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 3px 7px 3px 4px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.user-trigger:hover,
.user-trigger[aria-expanded="true"] {
  border-color: var(--line);
  background: rgba(255, 253, 248, 0.8);
}

.user-name {
  max-width: 90px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chevron {
  width: 14px;
  height: 14px;
  color: var(--muted-soft);
  transition: transform 0.18s ease;
}

.user-trigger[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--red);
  color: #fff8ec;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.avatar--sm {
  width: 30px;
  height: 30px;
  font-size: 13px;
}

.avatar--lg {
  width: 52px;
  height: 52px;
  font-size: 20px;
}

.user-popover {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 50;
  width: 268px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-strong);
  box-shadow: var(--shadow-md);
  animation: pop-in 0.2s ease both;
}

@keyframes pop-in {
  from { transform: translateY(-5px) scale(0.99); }
  to { transform: translateY(0) scale(1); }
}

.popover-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.popover-head > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.popover-head strong {
  font-family: var(--serif);
  font-size: 15px;
}

.popover-head span:last-child {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.popover-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 12px 0;
}

.popover-stats span {
  display: flex;
  flex-direction: column;
  gap: 1px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.popover-stats b {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
}

.popover-joined {
  padding: 8px 10px;
  border-radius: 2px;
  background: rgba(33, 27, 23, 0.035);
  color: var(--muted-soft);
  font-size: 9.5px;
  letter-spacing: 0.04em;
}

.popover-logout {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  margin-top: 9px;
  padding: 9px 8px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--red);
  font-size: 12px;
  text-align: left;
  transition: background 0.18s ease;
}

.popover-logout:hover {
  background: var(--red-wash);
}

.popover-logout svg {
  width: 16px;
  height: 16px;
}

/* ---------- 布局 ---------- */

.layout {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  gap: 36px;
  width: min(100%, 1280px);
  margin: 0 auto;
  padding: 32px 28px 70px;
}

.sidebar {
  position: sticky;
  top: calc(var(--topbar-h) + 24px);
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 17px;
  max-height: calc(100dvh - var(--topbar-h) - 48px);
  overflow-y: auto;
  scrollbar-width: none;
}

.sidebar::-webkit-scrollbar {
  display: none;
}

.side-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.profile-card {
  position: relative;
  padding: 21px 20px 17px;
  overflow: hidden;
}

.profile-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--red), rgba(158, 27, 27, 0.35));
}

.profile-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.role-tag {
  padding: 2px 7px;
  border: 1px solid rgba(183, 139, 67, 0.3);
  border-radius: 2px;
  background: rgba(183, 139, 67, 0.08);
  color: #87652c;
  font-size: 9px;
  letter-spacing: 0.12em;
}

.profile-card h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.3;
}

.profile-handle {
  margin: 2px 0 0;
  color: var(--muted-soft);
  font-family: var(--mono);
  font-size: 10px;
}

.profile-bio {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 15px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.profile-stats div {
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: center;
}

.profile-stats b {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.2;
}

.profile-stats span {
  color: var(--muted-soft);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.profile-joined {
  margin: 10px 0 0;
  color: var(--muted-soft);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.side-block {
  padding: 18px 15px 14px;
}

.side-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 5px 10px;
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}

.side-rule {
  flex: 1;
  height: 1px;
  background: var(--line);
}

.category-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.category-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 9px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12px;
  text-align: left;
  transition: background 0.16s ease, color 0.16s ease;
}

.category-btn::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--cat, var(--muted-soft));
  opacity: 0.85;
}

.category-btn .cat-count {
  margin-left: auto;
  color: var(--muted-soft);
  font-family: var(--mono);
  font-size: 9.5px;
}

.category-btn:hover {
  background: rgba(33, 27, 23, 0.04);
}

.category-btn.is-active {
  background: var(--red-wash);
  color: var(--red);
  font-weight: 600;
}

.category-btn.is-active .cat-count {
  color: var(--red);
}

.side-quote {
  position: relative;
  overflow: hidden;
  padding: 20px 19px 18px;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 100% 0%, rgba(213, 183, 126, 0.16), transparent 45%),
    linear-gradient(145deg, #7d1414, #520b0b);
  color: rgba(249, 239, 223, 0.88);
  box-shadow: 0 10px 25px rgba(75, 9, 9, 0.12);
}

.side-quote-star {
  position: absolute;
  top: -12px;
  right: -11px;
  width: 75px;
  height: 75px;
  color: rgba(213, 183, 126, 0.1);
  transform: rotate(15deg);
}

.side-quote blockquote {
  position: relative;
  margin: 0;
  font-family: var(--serif);
  font-size: 13.5px;
  line-height: 1.85;
}

.side-quote cite {
  display: block;
  margin-top: 9px;
  color: rgba(249, 239, 223, 0.5);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.side-note {
  margin: 0 2px;
  color: var(--muted-soft);
  font-size: 9.5px;
  line-height: 1.8;
  letter-spacing: 0.05em;
}

.content {
  min-width: 0;
}

/* ---------- 信息流 ---------- */

.feed-hero {
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 30px;
  overflow: hidden;
  padding: 29px 32px 27px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--red);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 86% 35%, rgba(183, 139, 67, 0.1), transparent 38%),
    var(--surface);
  box-shadow: var(--shadow-sm);
}

.feed-hero::after {
  content: "01";
  position: absolute;
  right: 22px;
  bottom: 12px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  color: var(--muted-soft);
  opacity: 0.7;
}

.hero-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.feed-hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(24px, 2.5vw, 33px);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.hero-lead {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.01em;
}

.hero-right {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 15px;
  min-width: 220px;
}

.hero-star {
  position: absolute;
  top: -62px;
  right: -48px;
  width: 150px;
  height: 150px;
  color: rgba(158, 27, 27, 0.055);
  transform: rotate(11deg);
  pointer-events: none;
}

.hero-stats {
  position: relative;
  display: flex;
  gap: 19px;
  margin-top: auto;
}

.hero-stats div {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
}

.hero-stats b {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--red);
}

.hero-stats span {
  color: var(--muted-soft);
  font-size: 9px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.mobile-categories {
  display: none;
}

.feed-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 50px;
  padding: 0 2px;
}

.sort-tabs {
  display: flex;
  align-items: center;
  gap: 19px;
}

.sort-tab {
  position: relative;
  padding: 7px 0;
  border: 0;
  background: none;
  color: var(--muted-soft);
  font-size: 12px;
  font-weight: 500;
}

.sort-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.sort-tab.is-active {
  color: var(--ink);
  font-weight: 700;
}

.sort-tab.is-active::after {
  transform: scaleX(1);
}

.result-summary {
  margin: 0;
  color: var(--muted-soft);
  font-size: 10px;
  text-align: right;
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.post-card {
  position: relative;
  display: block;
  padding: 21px 23px 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover {
  border-color: rgba(158, 27, 27, 0.36);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(51, 29, 17, 0.07);
}

.post-card.is-pinned {
  border-left: 2px solid var(--red);
}

.post-card-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
}

.post-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border: 1px solid color-mix(in srgb, var(--tag) 24%, transparent);
  border-radius: 2px;
  background: color-mix(in srgb, var(--tag) 7%, transparent);
  color: var(--tag);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.7;
}

.post-tag::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--tag);
}

.pin-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 2px;
  background: var(--red);
  color: #fff8ec;
  font-size: 8.5px;
  letter-spacing: 0.08em;
}

.pin-badge svg {
  width: 9px;
  height: 9px;
}

.post-index {
  margin-left: auto;
  color: var(--muted-soft);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  opacity: 0.65;
}

.post-card h2 {
  max-width: 760px;
  margin: 0 0 7px;
  font-family: var(--serif);
  font-size: 20.5px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.01em;
  transition: color 0.18s ease;
}

.post-card:hover h2 {
  color: var(--red);
}

.post-excerpt {
  display: -webkit-box;
  max-width: 760px;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.post-card-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(33, 27, 23, 0.075);
}

.post-author {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 10.5px;
}

.post-author .avatar {
  width: 23px;
  height: 23px;
  font-size: 10px;
}

.post-author time {
  color: var(--muted-soft);
  font-size: 9.5px;
}

.post-author time::before {
  content: "·";
  margin-right: 6px;
  color: var(--muted-soft);
}

.post-metrics {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
}

.metric {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 7px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--muted-soft);
  font-size: 10px;
  transition: color 0.16s ease, background 0.16s ease;
}

.metric svg {
  width: 13px;
  height: 13px;
}

button.metric:hover {
  background: var(--red-wash);
  color: var(--red);
}

.metric.is-liked {
  color: var(--red);
}

.metric.is-liked svg {
  fill: var(--red);
  stroke: var(--red);
}

.metric:disabled {
  opacity: 0.6;
  cursor: default;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 20px 0 4px;
}

.load-more-wrap .btn {
  min-width: 160px;
  height: 40px;
}

.skeleton-card {
  padding: 22px 23px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.sk {
  height: 11px;
  margin-bottom: 10px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(33, 27, 23, 0.055), rgba(33, 27, 23, 0.095), rgba(33, 27, 23, 0.055));
  background-size: 220% 100%;
  animation: shimmer 1.4s ease infinite;
}

.sk--tag { width: 68px; height: 18px; }
.sk--title { width: 68%; height: 20px; margin-top: 15px; }
.sk--line { width: 94%; }
.sk--line2 { width: 62%; }
.sk--foot { width: 45%; height: 9px; margin-top: 18px; }

@keyframes shimmer {
  from { background-position: 120% 0; }
  to { background-position: -120% 0; }
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 55px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.4);
  text-align: center;
}

.empty-state svg {
  width: 30px;
  height: 30px;
  margin-bottom: 12px;
  color: var(--muted-soft);
}

.empty-state h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 19px;
}

.empty-state p {
  margin: 5px 0 17px;
  color: var(--muted);
  font-size: 12px;
}

/* ---------- 文章详情 ---------- */

.detail-view {
  animation: form-in 0.3s ease both;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 11px;
  transition: color 0.18s ease;
}

.back-link:hover {
  color: var(--red);
}

.back-link svg {
  width: 15px;
  height: 15px;
}

.article {
  padding: 30px clamp(20px, 4.6vw, 48px) 28px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--red);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.article-head {
  padding-bottom: 21px;
  border-bottom: 1px solid var(--line);
}

.article-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.article h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(25px, 3.1vw, 38px);
  line-height: 1.4;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 19px;
}

.author-block {
  display: flex;
  align-items: center;
  gap: 9px;
}

.author-block .avatar {
  width: 34px;
  height: 34px;
  font-size: 13px;
}

.author-block div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.author-block strong {
  font-size: 11.5px;
  font-weight: 600;
}

.author-block span {
  color: var(--muted-soft);
  font-size: 9.5px;
}

.article-meta time {
  margin-left: auto;
  color: var(--muted-soft);
  font-size: 9.5px;
  letter-spacing: 0.03em;
}

.article-body {
  max-width: 760px;
  padding: 25px 0 10px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 2.02;
  letter-spacing: 0.01em;
  overflow-wrap: break-word;
}

.article-body p {
  margin: 0 0 1.05em;
}

.article-body p:last-child {
  margin-bottom: 0;
}

.article-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11px;
  transition: all 0.18s ease;
}

.like-btn svg {
  width: 15px;
  height: 15px;
}

.like-btn:hover {
  border-color: rgba(158, 27, 27, 0.4);
  color: var(--red);
}

.like-btn.is-liked {
  border-color: rgba(158, 27, 27, 0.4);
  background: var(--red-wash);
  color: var(--red);
}

.like-btn.is-liked svg {
  fill: var(--red);
  stroke: var(--red);
}

.article-action-note {
  margin-left: auto;
  color: var(--muted-soft);
  font-size: 9.5px;
}

.author-card {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 18px 0 0;
  padding: 17px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.45);
}

.author-card .avatar {
  width: 40px;
  height: 40px;
  font-size: 16px;
}

.author-card-copy {
  min-width: 0;
}

.author-card-copy strong {
  font-family: var(--serif);
  font-size: 14px;
}

.author-card-copy p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.comments-section {
  margin-top: 22px;
  padding: 25px clamp(18px, 3.6vw, 34px) 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.comments-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.comments-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
}

.comments-head span {
  color: var(--muted-soft);
  font-family: var(--mono);
  font-size: 9.5px;
}

.comment-form {
  margin: 16px 0 4px;
  padding-bottom: 19px;
  border-bottom: 1px solid var(--line);
}

.comment-form textarea {
  width: 100%;
  min-height: 88px;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--surface-strong);
  font-size: 12.5px;
  line-height: 1.75;
  resize: vertical;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.comment-form textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(158, 27, 27, 0.07);
}

.comment-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 9px;
}

.comment-form-row span {
  color: var(--muted-soft);
  font-size: 9.5px;
}

.comment-form-row .btn {
  height: 34px;
}

.comment-list {
  display: flex;
  flex-direction: column;
}

.comment-item {
  display: flex;
  gap: 11px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(33, 27, 23, 0.07);
}

.comment-item:last-child {
  border-bottom: 0;
  padding-bottom: 2px;
}

.comment-item .avatar {
  width: 30px;
  height: 30px;
  font-size: 12px;
}

.comment-main {
  flex: 1;
  min-width: 0;
}

.comment-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.comment-head strong {
  font-size: 11px;
  font-weight: 600;
}

.comment-head time {
  color: var(--muted-soft);
  font-size: 9px;
}

.comment-floor {
  margin-left: auto;
  color: var(--muted-soft);
  font-family: var(--mono);
  font-size: 8.5px;
  opacity: 0.7;
}

.comment-main p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.85;
  overflow-wrap: break-word;
}

.comment-empty {
  padding: 26px 0 12px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.site-foot {
  margin-top: 42px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted-soft);
}

.foot-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.foot-brand svg {
  width: 12px;
  height: 12px;
  color: var(--red);
}

.site-foot p {
  margin: 7px 0 0;
  font-size: 10px;
  line-height: 1.7;
}

.foot-meta {
  letter-spacing: 0.12em;
  opacity: 0.65;
}

/* =========================================================
   弹窗 / 提示
   ========================================================= */

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 17, 11, 0.55);
  backdrop-filter: blur(4px);
}

.modal {
  position: relative;
  width: min(100%, 640px);
  max-height: min(88dvh, 820px);
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 30px 80px rgba(25, 12, 6, 0.35);
  animation: modal-in 0.28s cubic-bezier(0.22, 0.8, 0.3, 1) both;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-in {
  from { transform: translateY(14px) scale(0.985); }
  to { transform: translateY(0) scale(1); }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding: 23px 25px 17px;
  border-bottom: 1px solid var(--line);
}

.modal-head-copy {
  flex: 1;
  min-width: 0;
}

.modal-head .eyebrow {
  margin-bottom: 8px;
  font-size: 9px;
}

.modal-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.modal-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  transition: all 0.18s ease;
}

.modal-close:hover {
  border-color: var(--line-strong);
  background: rgba(33, 27, 23, 0.04);
  color: var(--ink);
}

.modal-close svg {
  width: 16px;
  height: 16px;
}

.modal-body {
  padding: 21px 25px 24px;
}

.modal-body .field + .field {
  margin-top: 15px;
}

.category-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.category-pick {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  transition: all 0.16s ease;
}

.category-pick:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.category-pick.is-active {
  border-color: var(--red);
  background: var(--red-wash);
  color: var(--red);
  font-weight: 600;
}

.post-textarea {
  width: 100%;
  min-height: 230px;
  padding: 13px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--surface-strong);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.9;
  resize: vertical;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.post-textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(158, 27, 27, 0.07);
}

.title-input {
  height: 46px;
  font-family: var(--serif);
  font-size: 15px;
}

.compose-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  color: var(--muted-soft);
  font-size: 9.5px;
}

.compose-meta .over {
  color: var(--red);
}

.compose-guideline {
  margin: 16px 0 0;
  padding: 10px 12px;
  border-left: 2px solid var(--gold);
  background: rgba(183, 139, 67, 0.07);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 15px 25px 20px;
  border-top: 1px solid var(--line);
}

.modal-foot .btn {
  height: 38px;
  min-width: 90px;
}

.modal-foot .btn[type="submit"] {
  min-width: 118px;
}

.rules-body {
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--ink-soft);
}

.rules-body h3 {
  margin: 18px 0 6px;
  font-family: var(--serif);
  font-size: 15px;
}

.rules-body h3:first-child {
  margin-top: 0;
}

.rules-body p {
  margin: 0 0 8px;
}

.rules-body ul {
  margin: 0;
  padding-left: 18px;
}

.rules-body li {
  margin-bottom: 4px;
}

.toast-stack {
  position: fixed;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(360px, calc(100vw - 40px));
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--ink);
  border-radius: 3px;
  background: var(--surface-strong);
  box-shadow: 0 10px 30px rgba(40, 25, 15, 0.14);
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
  animation: toast-in 0.25s ease both;
}

.toast.is-error {
  border-left-color: var(--red);
  color: var(--red-dark);
}

.toast.is-success {
  border-left-color: #3f6152;
}

.toast.is-leaving {
  animation: toast-out 0.2s ease both;
}

@keyframes toast-in {
  from { transform: translateY(8px); }
  to { transform: translateY(0); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(5px); }
}

/* =========================================================
   响应式
   ========================================================= */

@media (max-width: 1180px) {
  .layout {
    grid-template-columns: 244px minmax(0, 1fr);
    gap: 25px;
  }

  .auth-visual {
    padding-left: 38px;
    padding-right: 38px;
  }

  .topbar-inner {
    gap: 18px;
  }

  .topnav a {
    padding-left: 9px;
    padding-right: 9px;
  }

  .search {
    width: 190px;
  }
}

@media (max-width: 1020px) {
  .topnav {
    display: none;
  }

  .auth {
    grid-template-columns: minmax(0, 1fr) minmax(380px, 0.92fr);
  }

  .visual-main h1 {
    font-size: clamp(2.8rem, 5.2vw, 4.6rem);
  }

  .edition {
    display: none;
  }
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    max-width: 860px;
    padding-top: 24px;
  }

  .sidebar {
    display: none;
  }

  .mobile-categories {
    display: flex;
    gap: 7px;
    margin: 14px 0 2px;
    padding-bottom: 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .mobile-categories::-webkit-scrollbar {
    display: none;
  }

  .mobile-cat {
    flex: 0 0 auto;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 253, 248, 0.55);
    color: var(--muted);
    font-size: 10.5px;
    transition: all 0.16s ease;
  }

  .mobile-cat.is-active {
    border-color: var(--red);
    background: var(--red);
    color: #fff8ec;
  }

  .feed-hero {
    padding: 26px 28px;
  }

  .hero-star {
    width: 130px;
    height: 130px;
    top: -55px;
    right: -38px;
  }
}

@media (max-width: 820px) {
  .auth {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 1fr);
  }

  .auth-visual {
    padding: 30px 30px 24px;
  }

  .visual-main h1 {
    font-size: clamp(2.5rem, 5vw, 3.6rem);
  }

  .visual-quote {
    display: none;
  }

  .visual-foot {
    margin-top: 20px;
  }

  .visual-lead {
    max-width: 360px;
    font-size: 12.5px;
  }
}

@media (max-width: 760px) {
  :root {
    --topbar-h: 64px;
  }

  .auth {
    display: block;
    min-height: 100dvh;
  }

  .auth-visual {
    min-height: 0;
    padding: 22px 22px 30px;
  }

  .visual-main {
    padding: 36px 0 8px;
  }

  .visual-main h1 {
    font-size: clamp(2.3rem, 9vw, 3.4rem);
    line-height: 1.08;
  }

  .visual-main h1 br:nth-of-type(2) {
    display: none;
  }

  .visual-lead {
    margin-top: 16px;
    font-size: 12px;
    line-height: 1.8;
  }

  .visual-pillars,
  .visual-quote,
  .visual-foot,
  .visual-star {
    display: none;
  }

  .visual-head {
    padding-bottom: 0;
  }

  .auth-panel {
    min-height: 0;
    padding: 32px 22px 38px;
    border-top: 3px solid var(--gold);
  }

  .auth-copyright {
    position: static;
    margin-top: 28px;
  }

  .auth-card {
    width: 100%;
    max-width: 430px;
  }

  .auth-heading h2 {
    font-size: 25px;
  }

  .topbar-inner {
    flex-wrap: wrap;
    height: auto;
    gap: 9px 12px;
    padding: 10px 16px 11px;
  }

  .topbar-actions {
    display: contents;
  }

  .btn--compose {
    order: 3;
    margin-left: auto;
  }

  .user-menu {
    order: 4;
  }

  .topbar .brand-mark {
    width: 32px;
    height: 32px;
  }

  .topbar .brand-text strong {
    font-size: 17px;
  }

  .topbar .brand-text small {
    font-size: 7px;
  }

  .search {
    order: 6;
    flex: 1 1 100%;
    width: 100%;
    height: 36px;
  }

  .search kbd {
    display: none;
  }

  .btn--compose {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 3px;
  }

  .btn--compose span {
    display: none;
  }

  .user-name {
    display: none;
  }

  .user-trigger {
    padding-right: 4px;
  }

  .avatar--sm {
    width: 30px;
    height: 30px;
  }

  .layout {
    padding: 18px 16px 55px;
  }

  .feed-hero {
    padding: 23px 21px 21px;
  }

  .feed-hero h1 {
    font-size: 23px;
    line-height: 1.4;
  }

  .hero-lead {
    font-size: 11px;
  }

  .hero-right {
    display: none;
  }

  .feed-hero::after {
    right: 14px;
    bottom: 9px;
  }

  .feed-toolbar {
    min-height: 46px;
  }

  .result-summary {
    max-width: 48%;
  }

  .post-card {
    padding: 18px 17px 14px;
  }

  .post-card h2 {
    font-size: 19px;
  }

  .post-excerpt {
    font-size: 12px;
  }

  .post-index {
    display: none;
  }

  .article {
    padding: 22px 18px 20px;
  }

  .article h1 {
    font-size: 25px;
    line-height: 1.45;
  }

  .article-body {
    font-size: 15px;
    line-height: 1.95;
  }

  .article-meta {
    gap: 10px;
  }

  .article-meta time {
    width: 100%;
    margin-left: 0;
  }

  .article-actions {
    flex-wrap: wrap;
  }

  .article-action-note {
    width: 100%;
    margin-left: 0;
  }

  .comments-section {
    padding: 20px 17px;
  }

  .comment-form-row span {
    max-width: 55%;
  }

  .modal-layer {
    padding: 0;
    align-items: end;
  }

  .modal {
    width: 100%;
    max-height: 93dvh;
    border-radius: 8px 8px 0 0;
    border-bottom: 0;
  }

  .modal-head {
    padding: 20px 18px 15px;
  }

  .modal-body {
    padding: 18px;
  }

  .modal-foot {
    padding: 13px 18px calc(16px + env(safe-area-inset-bottom));
  }

  .post-textarea {
    min-height: 190px;
  }

  .toast-stack {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 560px) {
  .auth-visual {
    padding: 19px 18px 25px;
  }

  .visual-main {
    padding-top: 30px;
  }

  .visual-main h1 {
    font-size: clamp(2.05rem, 10.2vw, 2.9rem);
  }

  .visual-lead {
    display: none;
  }

  .auth-panel {
    padding: 27px 18px 32px;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .form-note {
    display: none;
  }

  .profile-card,
  .side-block {
    display: none;
  }

  .detail-view .article-meta {
    align-items: flex-start;
  }

  .author-block strong {
    font-size: 11px;
  }

  .comment-head {
    flex-wrap: wrap;
    gap: 4px 7px;
  }

  .comment-floor {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =========================================================
   里程碑人物板块
   ========================================================= */

.figures-board {
  margin-top: 15px;
  padding: 27px 27px 22px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 90% 0%, rgba(183, 139, 67, 0.09), transparent 38%),
    var(--surface);
  box-shadow: var(--shadow-sm);
}

.figures-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 26px;
  margin-bottom: 20px;
}

.figures-head .eyebrow {
  margin-bottom: 9px;
}

.figures-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(23px, 2.3vw, 30px);
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.figures-head p:last-child {
  max-width: 680px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.figures-count {
  flex: 0 0 auto;
  padding-top: 4px;
  color: var(--red);
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 700;
  line-height: 0.9;
  text-align: right;
}

.figures-count small {
  display: block;
  margin-top: 5px;
  color: var(--muted-soft);
  font-family: var(--mono);
  font-size: 7.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
}

.figure-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.figure-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-strong);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.figure-card:hover {
  border-color: rgba(158, 27, 27, 0.38);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(51, 29, 17, 0.1);
}

.figure-portrait {
  position: relative;
  aspect-ratio: 1 / 1.04;
  overflow: hidden;
  background: #2a0505;
}

.figure-portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(20, 0, 0, 0.14), transparent 36%, rgba(20, 0, 0, 0.55)),
    radial-gradient(circle at 50% 25%, transparent 35%, rgba(20, 0, 0, 0.2));
}

.figure-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  place-items: center;
  color: rgba(213, 183, 126, 0.34);
  font-family: var(--serif);
  font-size: 44px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.figure-portrait img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  filter: sepia(0.12) contrast(1.03);
  transition: transform 0.55s cubic-bezier(0.22, 0.8, 0.3, 1);
}

.figure-card:hover .figure-portrait img {
  transform: scale(1.035);
}

.figure-years {
  position: absolute;
  left: 10px;
  bottom: 9px;
  z-index: 2;
  color: rgba(249, 239, 223, 0.88);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
}

.figure-level {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 2;
  padding: 2px 7px;
  border: 1px solid rgba(213, 183, 126, 0.5);
  border-radius: 2px;
  background: rgba(25, 5, 5, 0.58);
  color: var(--gold-soft);
  font-size: 8px;
  letter-spacing: 0.06em;
  backdrop-filter: blur(5px);
}

.figure-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 14px 14px 13px;
}

.figure-no {
  color: var(--muted-soft);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.16em;
}

.figure-copy h3 {
  margin: 4px 0 6px;
  font-family: var(--serif);
  font-size: 17.5px;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.figure-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.75;
}

.figure-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 9px;
}

.figure-tags span {
  padding: 2px 6px;
  border-radius: 20px;
  background: rgba(158, 27, 27, 0.06);
  color: var(--red);
  font-size: 8px;
  line-height: 1.6;
}

.figure-enter {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: auto;
  padding-top: 13px;
  color: var(--red);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.figure-enter svg {
  width: 13px;
  height: 13px;
  transition: transform 0.18s ease;
}

.figure-card:hover .figure-enter svg {
  transform: translateX(3px);
}

.figures-note {
  margin: 14px 0 0;
  color: var(--muted-soft);
  font-size: 9.5px;
  line-height: 1.7;
}

/* ---------- 用户理论等级 ---------- */

.profile-level {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  margin-top: 11px;
  padding: 8px 8px;
  border: 1px solid rgba(183, 139, 67, 0.25);
  border-radius: 3px;
  background: rgba(183, 139, 67, 0.06);
  text-align: left;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.profile-level:hover {
  border-color: rgba(183, 139, 67, 0.6);
  background: rgba(183, 139, 67, 0.11);
}

.profile-level-label {
  color: var(--muted-soft);
  font-size: 8px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.level-badge {
  color: #87652c;
  font-family: var(--serif);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.profile-level svg {
  width: 12px;
  height: 12px;
  margin-left: auto;
  color: var(--gold);
}

.popover-level {
  width: 100%;
  margin-top: 8px;
  padding: 7px 9px;
  border: 0;
  border-left: 2px solid var(--gold);
  background: rgba(183, 139, 67, 0.07);
  color: #87652c;
  font-family: inherit;
  font-size: 9.5px;
  letter-spacing: 0.02em;
  text-align: left;
  transition: background 0.18s ease;
}

.popover-level:hover {
  background: rgba(183, 139, 67, 0.14);
}

.author-level,
.comment-level {
  display: inline-block;
  margin-left: 6px;
  padding: 0 5px;
  border: 1px solid rgba(183, 139, 67, 0.28);
  border-radius: 2px;
  background: rgba(183, 139, 67, 0.06);
  color: #87652c;
  font-family: var(--sans);
  font-size: 8px;
  font-weight: 500;
  vertical-align: 1px;
  white-space: nowrap;
}

.comment-level {
  margin-left: 4px;
  font-size: 7.5px;
}

/* ---------- 等级弹窗 ---------- */

.level-current {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 16px;
  border-radius: 3px;
  background:
    radial-gradient(circle at 92% 20%, rgba(213, 183, 126, 0.2), transparent 45%),
    linear-gradient(145deg, #7d1414, #520b0b);
  color: #f9efdf;
}

.level-medallion {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border: 1px solid rgba(213, 183, 126, 0.55);
  border-radius: 50%;
  color: var(--gold-soft);
  font-family: var(--serif);
  font-size: 20px;
}

.level-current-copy {
  min-width: 0;
}

.level-current-copy small {
  display: block;
  color: rgba(249, 239, 223, 0.55);
  font-size: 8.5px;
  letter-spacing: 0.1em;
}

.level-current-copy strong {
  display: block;
  margin-top: 2px;
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.3;
}

.level-current-copy span {
  display: block;
  margin-top: 3px;
  color: rgba(249, 239, 223, 0.65);
  font-size: 9.5px;
}

.level-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 16px 0 8px;
}

.level-form label {
  flex: 1;
}

.level-form select {
  width: 100%;
  height: 39px;
  margin-top: 5px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--surface-strong);
  font-size: 12px;
}

.level-form .btn {
  height: 39px;
  min-width: 100px;
}

.level-note {
  margin: 0 0 17px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.75;
}

.level-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.level-item {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255, 253, 248, 0.55);
}

.level-item[open] {
  border-color: rgba(158, 27, 27, 0.25);
  background: rgba(255, 253, 248, 0.9);
}

.level-item.is-current {
  border-left: 2px solid var(--red);
}

.level-item.is-historical {
  border-left: 2px solid var(--gold);
  background: rgba(183, 139, 67, 0.05);
}

.level-summary {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.level-summary::-webkit-details-marker {
  display: none;
}

.level-num {
  width: 20px;
  flex: 0 0 auto;
  color: var(--muted-soft);
  font-family: var(--mono);
  font-size: 9px;
}

.level-summary strong {
  font-family: var(--serif);
  font-size: 12.5px;
  font-weight: 700;
}

.level-current-mark {
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 2px;
  background: var(--red);
  color: #fff8ec;
  font-size: 7.5px;
  letter-spacing: 0.06em;
}

.level-body {
  padding: 0 13px 13px 41px;
}

.level-body h4 {
  margin: 8px 0 4px;
  color: var(--red);
  font-size: 8.5px;
  letter-spacing: 0.1em;
}

.level-body ul {
  margin: 0 0 7px;
  padding-left: 15px;
  color: var(--ink-soft);
  font-size: 10.5px;
  line-height: 1.75;
}

.level-body li {
  margin-bottom: 3px;
}

.level-body p {
  margin: 0 0 7px;
  color: var(--ink-soft);
  font-size: 10.5px;
  line-height: 1.75;
}

.level-pause {
  margin-top: 7px !important;
  padding: 6px 8px;
  border-left: 2px solid var(--gold);
  background: rgba(183, 139, 67, 0.07);
  color: var(--muted) !important;
  font-size: 9.5px !important;
}

.level-historical-note {
  margin: 12px 0 0;
  padding: 8px 10px;
  border: 1px dashed rgba(183, 139, 67, 0.4);
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.7;
}

@media (max-width: 980px) {
  .figure-grid {
    gap: 11px;
  }

  .figures-board {
    padding: 23px 21px 19px;
  }
}

@media (max-width: 760px) {
  .figures-head {
    gap: 14px;
  }

  .figures-head h2 {
    font-size: 23px;
  }

  .figures-count {
    font-size: 28px;
  }

  .figure-grid {
    grid-template-columns: 1fr;
  }

  .figure-card {
    display: grid;
    grid-template-columns: 122px minmax(0, 1fr);
  }

  .figure-portrait {
    height: 100%;
    aspect-ratio: auto;
    min-height: 168px;
  }

  .figure-copy {
    padding: 13px 13px 12px;
  }

  .figure-copy h3 {
    font-size: 17px;
  }

  .figure-copy p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .figure-tags span:nth-child(3) {
    display: none;
  }

  .level-form {
    flex-wrap: wrap;
  }

  .level-form .btn {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .figures-board {
    padding: 20px 15px 17px;
  }

  .figures-head p:last-child {
    font-size: 10.5px;
  }

  .figure-card {
    grid-template-columns: 105px minmax(0, 1fr);
  }

  .figure-portrait {
    min-height: 155px;
  }

  .figure-copy p {
    -webkit-line-clamp: 2;
  }

  .figure-tags {
    display: none;
  }

  .figure-enter {
    padding-top: 9px;
  }

  .level-body {
    padding-left: 13px;
  }
}

/* ---------- 等级申请与站务审核 ---------- */

.level-apply {
  margin: 14px 0 16px;
  padding: 15px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--gold);
  border-radius: 3px;
  background: rgba(255, 253, 248, 0.6);
}

.level-apply-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.level-apply-head strong {
  color: var(--red);
  font-family: var(--serif);
  font-size: 15px;
}

.level-apply .field + .field {
  margin-top: 11px;
}

.level-apply textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--surface-strong);
  font-size: 11.5px;
  line-height: 1.75;
  resize: vertical;
}

.level-apply textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(158, 27, 27, 0.07);
}

.level-apply-hint {
  margin: 9px 0 11px;
  color: var(--muted-soft);
  font-size: 9.5px;
  line-height: 1.65;
}

.level-pending {
  margin: 14px 0 16px;
  padding: 14px 15px;
  border: 1px dashed rgba(183, 139, 67, 0.55);
  border-radius: 3px;
  background: rgba(183, 139, 67, 0.07);
}

.level-pending-kicker {
  color: var(--gold);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.level-pending strong {
  display: block;
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 17px;
}

.level-pending p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.7;
}

.level-pending--done {
  border-style: solid;
  border-color: rgba(158, 27, 27, 0.25);
  background: var(--red-wash);
}

.level-history {
  margin: 0 0 17px;
}

.level-history h4 {
  margin: 0 0 8px;
  color: var(--muted-soft);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.level-history-item {
  padding: 9px 11px;
  border-left: 2px solid var(--line-strong);
  background: rgba(33, 27, 23, 0.025);
}

.level-history-item + .level-history-item {
  margin-top: 5px;
}

.level-history-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 10.5px;
}

.level-history-main b {
  font-family: var(--serif);
  font-size: 11px;
}

.level-status {
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: 2px;
  background: rgba(33, 27, 23, 0.07);
  color: var(--muted);
  font-size: 8px;
}

.level-status.is-approved {
  background: rgba(63, 97, 82, 0.12);
  color: #3f6152;
}

.level-status.is-rejected {
  background: var(--red-wash);
  color: var(--red);
}

.level-status.is-pending {
  background: rgba(183, 139, 67, 0.12);
  color: #87652c;
}

.level-history-meta {
  margin-top: 3px;
  color: var(--muted-soft);
  font-size: 8.5px;
  line-height: 1.6;
}

.level-review {
  margin: 18px 0 20px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.level-review-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.level-review-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 15px;
}

.level-review-head span {
  color: var(--muted-soft);
  font-size: 9px;
}

.review-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--red);
  border-radius: 3px;
  background: rgba(255, 253, 248, 0.8);
}

.review-card + .review-card {
  margin-top: 8px;
}

.review-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.review-applicant {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.review-applicant .avatar {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.review-applicant div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.review-applicant strong {
  font-size: 11px;
}

.review-applicant span {
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.5;
}

.review-card-head time {
  flex: 0 0 auto;
  color: var(--muted-soft);
  font-size: 8px;
}

.review-material {
  margin: 9px 0;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(33, 27, 23, 0.02);
}

.review-material summary {
  cursor: pointer;
  list-style: none;
  padding: 7px 9px;
  color: var(--red);
  font-size: 9.5px;
}

.review-material summary::-webkit-details-marker {
  display: none;
}

.review-material-body {
  padding: 0 10px 9px;
  border-top: 1px solid var(--line);
}

.review-material-body h4 {
  margin: 8px 0 3px;
  color: var(--muted-soft);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.review-material-body p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.review-self {
  margin: 0 0 7px;
  padding: 5px 7px;
  border-left: 2px solid var(--gold);
  background: rgba(183, 139, 67, 0.07);
  color: #87652c;
  font-size: 8.5px;
  line-height: 1.6;
}

.review-card textarea {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: var(--surface-strong);
  font-size: 10px;
  line-height: 1.6;
  resize: vertical;
}

.review-card textarea:focus {
  outline: none;
  border-color: var(--red);
}

.review-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 8px;
}

.review-actions .btn {
  height: 31px;
  padding: 0 11px;
  font-size: 10px;
}

/* ---------- 邀请密钥 ---------- */

.field-note {
  color: var(--muted-soft);
  font-size: 9.5px;
  line-height: 1.6;
}

.popover-logout.invite-manage {
  margin-top: 3px;
  color: #87652c;
}

.popover-logout.invite-manage:hover {
  background: rgba(183, 139, 67, 0.1);
}

.invite-new {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  padding: 14px 15px;
  border: 1px solid rgba(213, 183, 126, 0.65);
  border-radius: 3px;
  background:
    radial-gradient(circle at 92% 15%, rgba(213, 183, 126, 0.18), transparent 48%),
    linear-gradient(145deg, #7d1414, #520b0b);
  color: #f9efdf;
}

.invite-new-kicker {
  color: rgba(249, 239, 223, 0.55);
  font-size: 8.5px;
  letter-spacing: 0.1em;
}

.invite-new code {
  display: block;
  padding: 8px 0;
  color: var(--gold-soft);
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.1em;
  overflow-wrap: anywhere;
}

.invite-copy {
  align-self: flex-start;
  padding: 4px 9px;
  border: 1px solid rgba(213, 183, 126, 0.55);
  border-radius: 2px;
  background: rgba(255, 248, 234, 0.08);
  color: #f9efdf;
  font-size: 9.5px;
  transition: background 0.18s ease;
}

.invite-copy:hover {
  background: rgba(255, 248, 234, 0.16);
}

.invite-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
  color: var(--muted);
  font-size: 10px;
}

.invite-summary b {
  color: var(--red);
  font-family: var(--serif);
  font-size: 15px;
}

.invite-form {
  margin-bottom: 17px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255, 253, 248, 0.55);
}

.invite-form-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 9px;
  margin-bottom: 10px;
}

.invite-form input,
.invite-form select {
  width: 100%;
  height: 36px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--surface-strong);
  font-size: 11px;
}

.invite-form input:focus,
.invite-form select:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(158, 27, 27, 0.06);
}

.invite-form .btn {
  height: 34px;
  font-size: 10.5px;
}

.invite-list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.invite-list-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 14px;
}

.invite-list-head span {
  color: var(--muted-soft);
  font-size: 8.5px;
}

.invite-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.invite-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(255, 253, 248, 0.65);
}

.invite-row-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.invite-row-main strong {
  font-size: 10.5px;
}

.invite-row-main span {
  color: var(--muted-soft);
  font-size: 8.5px;
}

.invite-status {
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: 2px;
  background: rgba(33, 27, 23, 0.06);
  color: var(--muted);
  font-size: 8px;
}

.invite-status.is-active {
  background: rgba(63, 97, 82, 0.12);
  color: #3f6152;
}

.invite-status.is-used {
  background: rgba(33, 27, 23, 0.08);
  color: var(--muted);
}

.invite-status.is-expired {
  background: rgba(183, 139, 67, 0.12);
  color: #87652c;
}

.invite-status.is-revoked {
  background: var(--red-wash);
  color: var(--red);
}

.invite-revoke {
  flex: 0 0 auto;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  color: var(--muted);
  font-size: 8px;
}

.invite-revoke:hover {
  border-color: var(--red);
  color: var(--red);
}

.invite-empty {
  margin: 0;
  padding: 14px;
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.invite-note {
  margin: 13px 0 0;
  color: var(--muted-soft);
  font-size: 9px;
  line-height: 1.7;
}

@media (max-width: 560px) {
  .invite-form-grid {
    grid-template-columns: 1fr 1fr;
  }

  .invite-form-grid label:first-child {
    grid-column: 1 / -1;
  }

  .invite-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .invite-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .invite-row-main {
    flex-basis: 100%;
  }
}

/* ---------- 主题编辑 / 删除 ---------- */

.field select {
  width: 100%;
  height: 44px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--surface-strong);
  font-size: 13px;
}

.field select:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(158, 27, 27, 0.07);
}

.manage-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11px;
  transition: all 0.18s ease;
}

.manage-btn:hover {
  border-color: var(--red);
  color: var(--red);
  background: rgba(158, 27, 27, 0.035);
}

.manage-btn--danger {
  color: var(--muted);
}

.manage-btn--danger:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-wash);
}

@media (max-width: 560px) {
  .article-actions .manage-btn {
    height: 31px;
    padding: 0 9px;
    font-size: 10px;
  }
}

/* ---------- 回复删除 ---------- */

.comment-delete {
  flex: 0 0 auto;
  margin-left: 2px;
  padding: 1px 5px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--muted-soft);
  font-size: 8.5px;
  line-height: 1.6;
  transition: color 0.16s ease, background 0.16s ease;
}

.comment-delete:hover {
  background: var(--red-wash);
  color: var(--red);
}

.comment-delete:disabled {
  opacity: 0.5;
  cursor: wait;
}

@media (max-width: 560px) {
  .comment-delete {
    margin-left: 0;
  }
}

/* ---------- 回复关联 ---------- */

.comment-head {
  flex-wrap: wrap;
}

.comment-reply-target {
  color: var(--red);
  font-size: 8.5px;
  white-space: nowrap;
}

.comment-reply,
.comment-delete {
  flex: 0 0 auto;
}

.comment-reply {
  padding: 1px 5px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--muted-soft);
  font-size: 8.5px;
  line-height: 1.6;
  transition: color 0.16s ease, background 0.16s ease;
}

.comment-reply:hover {
  background: var(--red-wash);
  color: var(--red);
}

.comment-item.is-reply {
  margin-left: 24px;
  padding-left: 13px;
  border-left: 2px solid rgba(158, 27, 27, 0.18);
}

.reply-target {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  padding: 6px 9px;
  border-left: 2px solid var(--gold);
  background: rgba(183, 139, 67, 0.08);
  color: var(--muted);
  font-size: 10px;
}

.reply-target b {
  color: #87652c;
  font-weight: 600;
}

.reply-target button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--red);
  font-size: 9px;
}

@media (max-width: 560px) {
  .comment-item.is-reply {
    margin-left: 12px;
    padding-left: 9px;
  }

  .comment-reply,
  .comment-delete {
    margin-left: 0;
  }
}
