/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.25rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--bone);
  letter-spacing: 0.06em;
  transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.15s;
}

.btn:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--gold);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-seal {
  position: relative;
  border-color: rgba(194, 58, 34, 0.55);
  background: linear-gradient(165deg, rgba(194, 58, 34, 0.35), rgba(122, 31, 20, 0.55));
  color: var(--bone);
  font-family: var(--font-title);
  font-size: 1.05rem;
  letter-spacing: 0.18em;
  padding: 0.85rem 1.6rem;
}

.btn-seal:hover:not(:disabled) {
  border-color: var(--cinnabar);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 0 24px rgba(194, 58, 34, 0.35);
}

.btn-jade {
  border-color: rgba(47, 143, 124, 0.5);
  background: rgba(47, 143, 124, 0.18);
  color: #b8ebe0;
}

.btn-ghost {
  background: transparent;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

/* ===== 表单 ===== */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.field label {
  font-size: 0.8rem;
  color: var(--bone-dim);
  letter-spacing: 0.08em;
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 164, 91, 0.15);
}

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

/* ===== Shell ===== */
.shell {
  display: grid;
  grid-template-columns: var(--nav-w) 1fr;
  min-height: 100vh;
}

.shell-nav {
  border-right: 1px solid var(--line);
  background: rgba(8, 7, 12, 0.72);
  backdrop-filter: blur(12px);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.brand-mark {
  font-family: var(--font-display);
  font-size: 2.4rem;
  line-height: 1;
  color: var(--bone);
  letter-spacing: 0.12em;
  margin-bottom: 0.25rem;
  background: linear-gradient(135deg, #f0e6d2, var(--gold), var(--cinnabar));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--bone-dim);
  letter-spacing: 0.2em;
  margin-bottom: 1.75rem;
}

.nav-link {
  display: block;
  padding: 0.7rem 0.85rem;
  color: var(--bone-dim);
  border-left: 2px solid transparent;
  transition: 0.2s;
  letter-spacing: 0.1em;
}

.nav-link:hover,
.nav-link.active {
  color: var(--bone);
  border-left-color: var(--cinnabar);
  background: rgba(194, 58, 34, 0.08);
}

.nav-user {
  margin-top: auto;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.nav-user .name {
  font-family: var(--font-title);
  font-size: 1.05rem;
}

.nav-user .handle {
  font-size: 0.78rem;
  color: var(--bone-dim);
}

.nav-settings {
  margin-top: 0.85rem;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.nav-token-line {
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--bone-dim);
  word-break: break-all;
}

.bubble-usage,
.turn-usage {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--bone-dim);
  opacity: 0.85;
}

.bubble.mine .turn-usage {
  text-align: right;
}

.shell-main {
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  animation: page-in 0.35s ease;
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.page-pad {
  padding: 1.75rem 2rem 2.5rem;
}

.page-kicker {
  font-size: 0.75rem;
  letter-spacing: 0.28em;
  color: var(--jade);
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.page-title {
  font-family: var(--font-title);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
}

.page-lead {
  color: var(--bone-dim);
  max-width: 36rem;
  margin-bottom: 1.5rem;
}

/* ===== Gate：中国风玄幻落地 ===== */
.gate {
  --gate-ink: #0b100f;
  --gate-ink-soft: #15201c;
  --gate-paper: #f2e6d0;
  --gate-paper-ink: #2a2418;
  --gate-paper-muted: #6e6352;
  --gate-vermilion: #a61b1b;
  --gate-vermilion-bright: #c62828;
  --gate-bronze: #b08948;
  --gate-celadon: #6a9a86;
  --gate-mist: rgba(210, 220, 210, 0.08);
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: var(--gate-ink);
  color: var(--gate-paper);
}

.gate-scene {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 50% 40% at 72% 18%, rgba(242, 230, 208, 0.12), transparent 55%),
    radial-gradient(ellipse 70% 55% at 20% 85%, rgba(166, 27, 27, 0.18), transparent 50%),
    radial-gradient(ellipse 55% 45% at 85% 70%, rgba(106, 154, 134, 0.12), transparent 55%),
    linear-gradient(180deg, #0e1614 0%, #0b100f 42%, #080c0b 100%);
}

.gate-moon {
  position: absolute;
  top: 9%;
  right: 18%;
  width: min(14vw, 120px);
  height: min(14vw, 120px);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, #f7efd8, #d8c49a 55%, #9a8860 100%);
  box-shadow:
    0 0 60px rgba(242, 230, 208, 0.25),
    0 0 120px rgba(242, 230, 208, 0.12);
  opacity: 0.85;
  animation: gate-moon-pulse 8s ease-in-out infinite;
}

@keyframes gate-moon-pulse {
  0%,
  100% {
    opacity: 0.75;
    transform: scale(1);
  }
  50% {
    opacity: 0.95;
    transform: scale(1.03);
  }
}

.gate-ridges {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 58%;
  background:
    linear-gradient(180deg, transparent 0%, rgba(8, 12, 11, 0.55) 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 520' preserveAspectRatio='none'%3E%3Cpath d='M0 360 C120 300 220 280 340 320 C460 360 520 250 680 270 C840 290 900 380 1040 340 C1180 300 1280 220 1440 260 L1440 520 L0 520 Z' fill='%2315201c'/%3E%3Cpath d='M0 400 C180 350 300 370 420 390 C560 415 640 330 780 350 C920 370 1020 430 1180 400 C1300 380 1380 360 1440 380 L1440 520 L0 520 Z' fill='%230e1614'/%3E%3Cpath d='M0 450 C200 430 360 460 520 470 C700 482 860 440 1020 455 C1180 470 1320 445 1440 460 L1440 520 L0 520 Z' fill='%23080c0b'/%3E%3C/svg%3E")
      bottom / 100% 100% no-repeat;
  opacity: 0.95;
}

.gate-fog {
  position: absolute;
  left: -10%;
  right: -10%;
  height: 35%;
  bottom: 8%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(210, 220, 210, 0.07),
    transparent
  );
  filter: blur(20px);
  animation: gate-fog-drift 22s linear infinite;
}

.gate-fog-b {
  bottom: 22%;
  height: 22%;
  opacity: 0.6;
  animation-duration: 32s;
  animation-direction: reverse;
}

@keyframes gate-fog-drift {
  from {
    transform: translateX(-8%);
  }
  to {
    transform: translateX(8%);
  }
}

.gate-pine {
  position: absolute;
  left: 4%;
  bottom: 0;
  width: min(28vw, 280px);
  height: 55%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 400'%3E%3Cpath d='M100 380 L95 280 L70 300 L95 250 L55 260 L95 200 L40 210 L100 140 L60 150 L100 80 L85 95 L100 40 L115 95 L100 80 L140 150 L100 140 L160 210 L105 200 L145 260 L105 250 L130 300 L105 280 L100 380 Z' fill='%2308100e' opacity='0.85'/%3E%3C/svg%3E")
    bottom left / contain no-repeat;
  opacity: 0.7;
}

.gate-cloud-mark {
  position: absolute;
  top: 12%;
  left: 8%;
  width: 160px;
  height: 60px;
  opacity: 0.18;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 80'%3E%3Cpath d='M20 50 C30 30 50 25 70 35 C80 20 110 18 125 35 C145 28 170 40 175 55 C160 70 40 70 20 50 Z' fill='none' stroke='%23f2e6d0' stroke-width='2'/%3E%3C/svg%3E")
    center / contain no-repeat;
  animation: gate-cloud-float 14s ease-in-out infinite;
}

@keyframes gate-cloud-float {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(18px);
  }
}

.gate-stage {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.2fr minmax(300px, 400px);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
  padding: clamp(1.5rem, 5vw, 4rem) clamp(1.25rem, 5vw, 4.5rem);
}

.gate-brand-block {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 1.25rem;
  max-width: 36rem;
  animation: gate-rise 0.9s ease both;
}

@keyframes gate-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.gate-vert {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  writing-mode: horizontal-tb;
  font-family: var(--font-title);
  font-size: 0.95rem;
  letter-spacing: 0.35em;
  color: var(--gate-bronze);
  border-left: 2px solid rgba(166, 27, 27, 0.65);
  padding: 0.35rem 0 0.35rem 0.75rem;
  line-height: 1.2;
}

.gate-vert span {
  display: block;
}

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

.gate-epoch {
  font-size: 0.78rem;
  letter-spacing: 0.45em;
  color: var(--gate-celadon);
  margin-bottom: 0.65rem;
}

.gate-brand {
  font-family: var(--font-display);
  font-size: clamp(5rem, 14vw, 8.5rem);
  line-height: 0.9;
  letter-spacing: 0.12em;
  margin-bottom: 1.1rem;
  color: var(--gate-paper);
  text-shadow:
    0 0 40px rgba(242, 230, 208, 0.15),
    0 2px 0 rgba(0, 0, 0, 0.35);
  animation: brand-breathe 6s ease-in-out infinite;
}

@keyframes brand-breathe {
  0%,
  100% {
    text-shadow:
      0 0 30px rgba(242, 230, 208, 0.1),
      0 2px 0 rgba(0, 0, 0, 0.35);
  }
  50% {
    text-shadow:
      0 0 48px rgba(176, 137, 72, 0.35),
      0 2px 0 rgba(0, 0, 0, 0.35);
  }
}

.gate-line {
  font-family: var(--font-title);
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  color: var(--gate-paper);
  letter-spacing: 0.14em;
  margin-bottom: 0.7rem;
}

.gate-hint {
  max-width: 26rem;
  color: rgba(242, 230, 208, 0.62);
  font-size: 0.95rem;
  line-height: 1.75;
}



.gate-scroll {
  position: relative;
  justify-self: end;
  width: 100%;
  padding: 1.6rem 1.4rem 1.35rem;
  background:
    linear-gradient(180deg, rgba(247, 239, 220, 0.97), rgba(236, 222, 192, 0.95));
  color: var(--gate-paper-ink);
  border: 1px solid rgba(176, 137, 72, 0.45);
  box-shadow:
    0 24px 50px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  animation: gate-rise 0.9s 0.12s ease both;
}

.gate-scroll::before,
.gate-scroll::after {
  content: "";
  position: absolute;
  left: 0.55rem;
  right: 0.55rem;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(166, 27, 27, 0.45),
    transparent
  );
}

.gate-scroll::before {
  top: 0.55rem;
}
.gate-scroll::after {
  bottom: 0.55rem;
}

.gate-scroll-edge {
  position: absolute;
  top: -6px;
  left: 8%;
  right: 8%;
  height: 10px;
  border-radius: 2px;
  background: linear-gradient(90deg, #5c4030, #8b6914, #5c4030);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.gate-scroll .auth-box {
  width: 100%;
}

.gate-scroll .field label {
  color: var(--gate-paper-muted);
  letter-spacing: 0.2em;
}

.gate-scroll .field input {
  background: rgba(42, 36, 24, 0.06);
  border: 1px solid rgba(106, 90, 60, 0.35);
  color: var(--gate-paper-ink);
  border-radius: 2px;
}

.gate-scroll .field input:focus {
  border-color: var(--gate-vermilion);
  box-shadow: 0 0 0 3px rgba(166, 27, 27, 0.12);
}

.gate-scroll .field input::placeholder {
  color: rgba(110, 99, 82, 0.7);
}

.gate-scroll .btn-seal {
  width: 100%;
  margin-top: 0.25rem;
  border-color: rgba(166, 27, 27, 0.7);
  background: linear-gradient(165deg, #c0392b, #8e1a1a);
  color: #f7efd8;
  letter-spacing: 0.28em;
  font-family: var(--font-title);
  box-shadow: 0 8px 20px rgba(142, 26, 26, 0.35);
}

.gate-scroll .btn-seal:hover:not(:disabled) {
  border-color: var(--gate-vermilion-bright);
  color: #fff;
  transform: translateY(-1px);
}

.gate-scroll .btn-jade {
  border-color: rgba(106, 154, 134, 0.55);
  background: rgba(106, 154, 134, 0.18);
  color: #2f5c4c;
}

.gate-scroll .btn-sm {
  white-space: nowrap;
}

.field-row {
  display: flex;
  gap: 0.5rem;
}

.field-row input {
  flex: 1;
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid rgba(106, 90, 60, 0.28);
}

.auth-tab {
  flex: 1;
  padding: 0.7rem 0.5rem;
  color: var(--gate-paper-muted);
  letter-spacing: 0.28em;
  font-family: var(--font-title);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.auth-tab.active {
  color: var(--gate-vermilion);
  border-bottom-color: var(--gate-vermilion);
}

.auth-switch {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--gate-paper-muted);
  text-align: center;
}

.auth-switch button {
  color: #8a5a20;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0.85rem 0 1rem;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--gate-paper-muted, #6e6352);
}

.legal-consent input[type="checkbox"] {
  margin-top: 0.2rem;
  flex-shrink: 0;
  width: 0.95rem;
  height: 0.95rem;
  accent-color: var(--gate-vermilion, #a61b1b);
  cursor: pointer;
}

.legal-consent-text {
  flex: 1;
}

.legal-consent-text label {
  cursor: pointer;
  color: inherit;
  letter-spacing: 0;
  font-size: inherit;
}

.legal-consent-text a {
  color: #8a5a20;
  text-decoration: underline;
  text-underline-offset: 2px;
  margin: 0 0.1rem;
}

.legal-consent-text a:hover {
  color: var(--gate-vermilion, #a61b1b);
}

#form-sms {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px dashed rgba(106, 90, 60, 0.3);
}

/* ===== 剧本卡片 ===== */
.realm-hero {
  margin-bottom: 2rem;
  padding: 1.75rem 1.5rem;
  border: 1px solid var(--line);
  background:
    linear-gradient(120deg, rgba(194, 58, 34, 0.12), transparent 55%),
    rgba(18, 16, 26, 0.55);
  position: relative;
  overflow: hidden;
}

.realm-hero::after {
  content: "入世";
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%) rotate(-12deg);
  font-family: var(--font-display);
  font-size: 4.5rem;
  color: rgba(194, 58, 34, 0.12);
  pointer-events: none;
}

.realm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.realm-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.15rem 1.2rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  min-height: 150px;
}

.realm-card:hover {
  border-color: rgba(201, 164, 91, 0.55);
  background: rgba(201, 164, 91, 0.06);
  transform: translateY(-2px);
}

.realm-card .title {
  font-family: var(--font-title);
  font-size: 1.2rem;
  letter-spacing: 0.05em;
}

.realm-card .prompt {
  font-size: 0.88rem;
  color: var(--bone-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.seal {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  padding: 0.2rem 0.5rem;
  border: 1px solid currentColor;
  width: fit-content;
}

.seal-ready {
  color: var(--jade);
}
.seal-wait {
  color: var(--gold);
}
.seal-fail {
  color: var(--danger);
}

.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
  font-size: 0.78rem;
  color: var(--bone-dim);
}

.empty-omen {
  padding: 2.5rem 1.5rem;
  text-align: center;
  border: 1px dashed var(--line);
  color: var(--bone-dim);
}

.empty-omen strong {
  display: block;
  font-family: var(--font-title);
  font-size: 1.3rem;
  color: var(--bone);
  margin-bottom: 0.5rem;
  font-weight: 400;
}

/* ===== Modal ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  backdrop-filter: blur(4px);
}

.modal {
  width: min(520px, 100%);
  border: 1px solid var(--line);
  background: linear-gradient(165deg, #1a1624, #0e0c14);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.modal h3 {
  font-family: var(--font-title);
  font-size: 1.45rem;
  letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
}

.modal p {
  color: var(--bone-dim);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1rem;
}

/* ===== Room ===== */
.room {
  display: grid;
  grid-template-columns: 200px 1fr 220px;
  height: 100vh;
  min-height: 0;
}

.room-rail,
.room-cast {
  border-color: var(--line);
  background: rgba(8, 7, 12, 0.65);
  padding: 1rem 0.85rem;
  overflow-y: auto;
}

.room-rail {
  border-right: 1px solid var(--line);
}
.room-cast {
  border-left: 1px solid var(--line);
}

.room-center {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: rgba(7, 6, 10, 0.35);
}

.room-head {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.room-head h1 {
  font-family: var(--font-title);
  font-size: 1.35rem;
  letter-spacing: 0.06em;
}

.room-prompt {
  color: var(--bone-dim);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.room-progress {
  margin-top: 0.35rem;
  font-family: var(--font-title);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--gold, #c9a45b);
}

.chat-status {
  padding: 0.55rem 1.25rem;
  font-size: 0.85rem;
  color: var(--gold);
  border-bottom: 1px solid var(--line);
  background: rgba(201, 164, 91, 0.06);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-stream {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.bubble {
  max-width: min(640px, 92%);
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.bubble.mine {
  align-self: flex-end;
  border-color: rgba(194, 58, 34, 0.4);
  background: rgba(194, 58, 34, 0.12);
}

.bubble.npc {
  align-self: flex-start;
  border-color: rgba(47, 143, 124, 0.35);
}

.bubble-meta {
  display: flex;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--bone-dim);
  margin-bottom: 0.3rem;
}

.bubble-body {
  white-space: pre-wrap;
  line-height: 1.55;
}

.composer {
  position: relative;
  display: flex;
  gap: 0.75rem;
  padding: 0.9rem 1.25rem 1.1rem;
  border-top: 1px solid var(--line);
  background: rgba(10, 8, 16, 0.85);
}

.composer textarea {
  flex: 1;
  min-height: 56px;
  max-height: 140px;
  resize: none;
  padding: 0.7rem 0.9rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  outline: none;
}

.composer textarea:focus {
  border-color: var(--gold);
}

.composer-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.hint-anchor {
  position: relative;
}

.hint-pop {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  width: min(320px, 78vw);
  z-index: 30;
  padding: 0.7rem;
  border: 1px solid var(--line);
  background: linear-gradient(165deg, #1f1a2a, #0f0d16);
  box-shadow: var(--shadow);
  animation: page-in 0.18s ease;
}

.hint-pop::after {
  content: "";
  position: absolute;
  right: 1.2rem;
  bottom: -6px;
  width: 10px;
  height: 10px;
  background: #121018;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transform: rotate(45deg);
}

.hint-pop-hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.78rem;
  color: var(--bone-dim);
}

.hint-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.65rem;
  margin-bottom: 0.35rem;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.88rem;
}

.hint-item:hover {
  border-color: rgba(201, 164, 91, 0.45);
  background: rgba(201, 164, 91, 0.1);
}

.hint-why {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.7rem;
  color: var(--bone-dim);
}

.hint-risk {
  display: inline-block;
  margin-right: 0.4rem;
  padding: 0.05rem 0.35rem;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  border: 1px solid rgba(201, 164, 91, 0.35);
  color: var(--gold, #c9a45b);
}

.hint-risk-edge {
  border-color: rgba(196, 72, 54, 0.5);
  color: var(--cinnabar);
}

.member {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  padding: 0.55rem 0.25rem;
  border-bottom: 1px solid rgba(201, 164, 91, 0.1);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 2px;
  display: grid;
  place-items: center;
  background: rgba(194, 58, 34, 0.25);
  border: 1px solid rgba(194, 58, 34, 0.4);
  font-family: var(--font-title);
  flex-shrink: 0;
}

.avatar.jade {
  background: rgba(47, 143, 124, 0.2);
  border-color: rgba(47, 143, 124, 0.45);
}

.member .role {
  font-size: 0.7rem;
  color: var(--bone-dim);
}

.member.dead {
  opacity: 0.55;
}

.member.dead .member-name {
  text-decoration: line-through;
  text-decoration-color: rgba(194, 58, 34, 0.55);
}

.avatar.dead {
  filter: grayscale(0.85);
  border-color: rgba(120, 120, 130, 0.45);
  background: rgba(60, 60, 70, 0.35);
}

.member-dead-tag {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.35rem;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: #d7c6b0;
  border: 1px solid rgba(194, 58, 34, 0.45);
  background: rgba(194, 58, 34, 0.18);
  vertical-align: middle;
}

.rail-link {
  display: block;
  padding: 0.55rem 0.5rem;
  color: var(--bone-dim);
  font-size: 0.88rem;
  border-left: 2px solid transparent;
}

.rail-link:hover,
.rail-link.active {
  color: var(--bone);
  border-left-color: var(--gold);
}

.panel-label {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--bone-dim);
  margin: 0.5rem 0 0.75rem;
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(201, 164, 91, 0.25);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== 社群 ===== */
.feed {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 720px;
}

.post {
  padding: 1.15rem 1.2rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.post h3 {
  font-family: var(--font-title);
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
}

.post .body {
  color: var(--bone-dim);
  white-space: pre-wrap;
  margin-bottom: 0.75rem;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.8rem;
  color: var(--bone-dim);
}

.mention {
  color: var(--jade);
}

.script-link {
  display: inline;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  color: var(--gold, #c9a45b);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.script-link:hover {
  color: var(--cinnabar);
}

.script-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.65rem;
}

.script-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border: 1px solid rgba(201, 164, 91, 0.35);
  background: rgba(201, 164, 91, 0.08);
  color: var(--gold, #c9a45b);
  font-size: 0.78rem;
  cursor: pointer;
  text-decoration: none;
}

.compose-field {
  position: relative;
}

.compose-hint {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--bone-dim);
}

.slash-picker {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 0.25rem);
  z-index: 20;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--line);
  background: rgba(12, 10, 18, 0.98);
  padding: 0.35rem 0;
}

.slash-title {
  padding: 0.35rem 0.75rem;
  font-size: 0.72rem;
  color: var(--bone-dim);
  letter-spacing: 0.08em;
}

.slash-item {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: none;
  background: transparent;
  color: var(--bone);
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.slash-item:hover {
  background: rgba(201, 164, 91, 0.12);
}

.slash-item span {
  color: var(--bone-dim);
  font-size: 0.75rem;
}

.slash-empty {
  padding: 0.75rem;
  font-size: 0.85rem;
  color: var(--bone-dim);
}

.reply-row {
  padding: 0.65rem 0;
  border-top: 1px solid rgba(201, 164, 91, 0.12);
  font-size: 0.9rem;
}

.reply-hd {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
}

.reply-time {
  color: var(--bone-dim);
  font-size: 0.75rem;
}

.reply-body {
  margin-top: 0.25rem;
  white-space: pre-wrap;
}

.reply-actions {
  margin-top: 0.35rem;
  display: flex;
  gap: 0.65rem;
}

.reply-empty {
  color: var(--bone-dim);
  padding: 0.5rem 0;
}

.framework-modal {
  max-width: min(560px, 92vw);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.framework-owner {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  color: var(--bone-dim);
}

.framework-body {
  overflow-y: auto;
  flex: 1;
  padding: 0.35rem 0 0.75rem;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--bone-dim);
}

.framework-body h2,
.framework-body h3,
.framework-body h4 {
  font-family: var(--font-title);
  color: var(--bone);
  letter-spacing: 0.06em;
  margin: 1.15rem 0 0.55rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(201, 164, 91, 0.22);
}

.framework-body h2:first-child,
.framework-body h3:first-child,
.framework-body h4:first-child,
.framework-body .fw-quote:first-child {
  margin-top: 0;
}

.framework-body h3 {
  font-size: 1.05rem;
}

.framework-body h4 {
  font-size: 0.95rem;
  border-bottom: none;
  padding-bottom: 0;
}

.framework-body p {
  margin: 0.45rem 0;
  color: var(--bone-dim);
}

.framework-body strong {
  color: var(--bone);
  font-weight: 600;
}

.framework-body .fw-quote {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border-left: 3px solid var(--cinnabar);
  background: rgba(201, 164, 91, 0.07);
  color: var(--bone);
  font-size: 0.9rem;
  line-height: 1.6;
}

.framework-body dl,
.framework-body ul,
.framework-body ol {
  margin: 0.25rem 0 0.85rem;
  padding: 0;
  list-style: none;
}

.framework-body ul > li,
.framework-body ol > li {
  position: relative;
  margin: 0.4rem 0;
  padding: 0.35rem 0.55rem 0.35rem 1.15rem;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(201, 164, 91, 0.1);
}

.framework-body ul > li::before {
  content: "";
  position: absolute;
  left: 0.45rem;
  top: 0.85rem;
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: var(--gold, #c9a45b);
}

.framework-body ol {
  counter-reset: fw-act;
}

.framework-body ol > li {
  counter-increment: fw-act;
  padding-left: 2.1rem;
}

.framework-body ol > li::before {
  content: counter(fw-act);
  position: absolute;
  left: 0.45rem;
  top: 0.4rem;
  min-width: 1.2rem;
  height: 1.2rem;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-family: var(--font-title);
  color: var(--ink, #0e0c14);
  background: var(--gold, #c9a45b);
}

.framework-body .fw-def {
  display: grid;
  grid-template-columns: 5.5em 1fr;
  gap: 0.35rem 0.75rem;
  margin: 0.35rem 0;
  padding: 0.45rem 0.65rem;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(201, 164, 91, 0.1);
}

.framework-body .fw-def dt {
  font-family: var(--font-title);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--gold, #c9a45b);
  padding-top: 0.1rem;
}

.framework-body .fw-def dd {
  margin: 0;
  color: var(--bone-dim);
}

.react-btn.active-like {
  color: var(--cinnabar);
}
.react-btn.active-dislike {
  color: var(--bone-dim);
}

.compose-bar {
  max-width: 720px;
  margin-bottom: 1.5rem;
  padding: 1rem;
  border: 1px solid var(--line);
  background: rgba(18, 16, 26, 0.5);
}

.dm-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1rem;
  min-height: 60vh;
}

.dm-list,
.dm-thread {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  min-height: 420px;
}

.dm-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(201, 164, 91, 0.12);
}

.dm-item:hover,
.dm-item.active {
  background: rgba(201, 164, 91, 0.08);
}

.dm-thread {
  display: flex;
  flex-direction: column;
}

.dm-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.dm-compose {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--line);
}

.dm-compose input {
  flex: 1;
  padding: 0.6rem 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
  outline: none;
}

.badge {
  display: inline-grid;
  place-items: center;
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 0.3rem;
  font-size: 0.7rem;
  background: var(--cinnabar);
  color: #fff;
  border-radius: 99px;
}

.framework-box {
  margin: 0.75rem 1.25rem 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  max-height: 280px;
  overflow-y: auto;
  font-size: 0.88rem;
  color: var(--bone-dim);
}

.framework-box .fw-title {
  font-family: var(--font-title);
  font-size: 1.05rem;
  color: var(--bone);
  margin-bottom: 0.55rem;
}

.framework-box .fw-section {
  font-size: 0.92rem;
  color: var(--gold);
  margin: 0.85rem 0 0.35rem;
}

.framework-box p,
.framework-box li {
  margin-bottom: 0.25rem;
  line-height: 1.65;
}

.framework-box ul,
.framework-box ol {
  padding-left: 1.15rem;
}

.framework-box .fw-quote {
  border-left: 3px solid var(--gold);
  padding: 0.35rem 0.75rem;
  margin: 0.45rem 0 0.75rem;
  color: var(--bone-dim);
  background: rgba(0, 0, 0, 0.2);
}

.framework-box .fw-empty {
  color: var(--bone-dim);
}

@media (max-width: 960px) {
  .gate-stage {
    grid-template-columns: 1fr;
    align-content: end;
    padding-top: 18vh;
    padding-bottom: 1.5rem;
  }
  .gate-brand-block {
    max-width: none;
  }
  .gate-scroll {
    justify-self: stretch;
  }
  .gate-pine {
    opacity: 0.35;
  }
  .shell {
    grid-template-columns: 1fr;
  }
  .shell-nav {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.5rem;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .brand-sub,
  .nav-user .handle {
    display: none;
  }
  .nav-user {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    margin-left: auto;
  }
  .room {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
  }
  .room-rail,
  .room-cast {
    display: none;
  }
  .dm-layout {
    grid-template-columns: 1fr;
  }
  .page-pad {
    padding: 1.25rem 1rem 2rem;
  }
}
