:root {
  --bg-ink: #11100e;
  --bg-paper-dark: #191714;
  --bg-card: rgba(28, 25, 21, 0.86);
  --bg-letter-user: rgba(34, 30, 25, 0.72);
  --bg-letter-sage: rgba(24, 21, 17, 0.94);
  --text-main: #e8e0d2;
  --text-sub: #a39887;
  --text-muted: #6e6559;
  --accent-gold: #c9a66b;
  --accent-gold-dim: rgba(201, 166, 107, 0.24);
  --accent-vermilion: #b83b2b;
  --accent-vermilion-glow: rgba(184, 59, 43, 0.35);
  --border-hairline: rgba(201, 166, 107, 0.16);
  --font-serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --font-display: "ZCOOL XiaoWei", "Noto Serif SC", "STKaiti", serif;
  --font-calligraphy: "Ma Shan Zheng", "KaiTi", "STKaiti", cursive, serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  background-color: var(--bg-ink);
  color: var(--text-main);
  font-family: var(--font-serif);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* 宣纸暗纹与古籍乌丝栏背景 */
.paper-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.38;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(201, 166, 107, 0.05) 0%, transparent 45%),
    radial-gradient(circle at 80% 75%, rgba(184, 59, 43, 0.04) 0%, transparent 50%),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.012) 0px, rgba(255,255,255,0.012) 1px, transparent 1px, transparent 3px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.01) 0px, rgba(255,255,255,0.01) 1px, transparent 1px, transparent 4px);
}

.wusilan-lines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: linear-gradient(90deg, rgba(201, 166, 107, 0.03) 1px, transparent 1px);
  background-size: 64px 100%;
}

/* 摇曳烛火光晕 */
.candle-glow {
  position: fixed;
  top: -120px;
  right: 8%;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(235, 168, 78, 0.14) 0%, rgba(184, 59, 43, 0.04) 42%, transparent 72%);
  pointer-events: none;
  z-index: 0;
  animation: candleFlicker 6s ease-in-out infinite alternate;
  transition: all 0.8s ease;
}

@keyframes candleFlicker {
  0%   { transform: scale(1) translate(0, 0); opacity: 0.85; }
  35%  { transform: scale(1.05) translate(-8px, 6px); opacity: 1; }
  70%  { transform: scale(0.97) translate(5px, -4px); opacity: 0.8; }
  100% { transform: scale(1.03) translate(-3px, 4px); opacity: 0.95; }
}

#dustCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

/* 子夜挑灯沉浸模式 */
body.lantern-mode {
  background-color: #090807;
}
body.lantern-mode .topbar,
body.lantern-mode .sidebar {
  opacity: 0.42;
  transition: opacity 0.5s ease;
}
body.lantern-mode .topbar:hover,
body.lantern-mode .sidebar:hover {
  opacity: 1;
}
body.lantern-mode .candle-glow {
  top: 5%;
  right: 22%;
  width: 720px;
  height: 720px;
  background: radial-gradient(circle, rgba(244, 179, 80, 0.2) 0%, rgba(184, 59, 43, 0.06) 45%, transparent 72%);
}

/* 顶部栏 */
.topbar {
  position: relative;
  z-index: 10;
  height: 68px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-hairline);
  background: rgba(17, 16, 14, 0.88);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.brand-seal {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: var(--accent-vermilion);
  color: #f7efe2;
  font-family: var(--font-calligraphy);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 18px var(--accent-vermilion-glow), inset 0 0 0 1px rgba(255,255,255,0.25);
  letter-spacing: 1px;
}

.brand-text h1 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 3px;
  color: var(--text-main);
}

.brand-text .en-sub {
  font-family: var(--font-serif);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--accent-gold);
  margin-left: 6px;
  vertical-align: middle;
}

.brand-tagline {
  font-size: 11px;
  color: var(--text-sub);
  letter-spacing: 1.5px;
  margin-top: 2px;
}

.nav-modes {
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.02);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--border-hairline);
}

.mode-btn {
  background: transparent;
  border: none;
  color: var(--text-sub);
  font-family: var(--font-serif);
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 1px;
}

.mode-btn:hover {
  color: var(--text-main);
  background: rgba(201, 166, 107, 0.08);
}

.mode-btn.active {
  background: rgba(201, 166, 107, 0.16);
  color: var(--accent-gold);
  box-shadow: inset 0 0 0 1px rgba(201, 166, 107, 0.3);
}

.ritual-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ritual-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-hairline);
  color: var(--text-sub);
  font-family: var(--font-serif);
  font-size: 12px;
  padding: 7px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ritual-btn:hover, .ritual-btn.active {
  color: var(--accent-gold);
  border-color: rgba(201, 166, 107, 0.45);
  background: rgba(201, 166, 107, 0.1);
}

.ritual-btn.burn-trigger {
  border-color: rgba(184, 59, 43, 0.45);
  color: #e6a89e;
  background: rgba(184, 59, 43, 0.12);
}

.ritual-btn.burn-trigger:hover {
  background: rgba(184, 59, 43, 0.24);
  color: #fff;
}

.dot-ember {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff6b4a;
  box-shadow: 0 0 8px #ff6b4a;
  animation: pulseEmber 2s infinite;
}

@keyframes pulseEmber {
  0%, 100% { opacity: 0.6; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* 工作区布局 */
.workspace {
  position: relative;
  z-index: 5;
  display: flex;
  height: calc(100vh - 68px);
}

/* 左侧先贤殿堂 */
.sidebar {
  width: 280px;
  flex-shrink: 0;
  border-right: 1px solid var(--border-hairline);
  background: rgba(19, 17, 15, 0.78);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}

.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--accent-gold);
  letter-spacing: 2px;
  margin-bottom: 10px;
  padding: 0 4px;
}

.label-hint {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.mini-add-btn {
  background: transparent;
  border: 1px dashed rgba(201, 166, 107, 0.35);
  color: var(--accent-gold);
  font-family: var(--font-serif);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.mini-add-btn:hover {
  background: rgba(201, 166, 107, 0.12);
}

.sage-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sage-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.015);
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: left;
  color: var(--text-main);
}

.sage-item:hover {
  background: rgba(201, 166, 107, 0.07);
  border-color: rgba(201, 166, 107, 0.2);
}

.sage-item.active {
  background: linear-gradient(90deg, rgba(201, 166, 107, 0.14), rgba(201, 166, 107, 0.03));
  border-color: rgba(201, 166, 107, 0.42);
}

.sage-mini-seal {
  width: 34px;
  height: 34px;
  border-radius: 4px;
  border: 1px solid rgba(184, 59, 43, 0.65);
  color: #e89b8e;
  background: rgba(184, 59, 43, 0.12);
  font-family: var(--font-calligraphy);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sage-item.active .sage-mini-seal {
  background: var(--accent-vermilion);
  color: #fbf5eb;
  border-color: transparent;
}

.sage-item-info {
  min-width: 0;
  flex: 1;
}

.sage-item-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sage-item-tag {
  font-size: 10px;
  color: var(--accent-gold);
  opacity: 0.85;
}

.sage-item-sub {
  font-size: 11px;
  color: var(--text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.empty-shelf {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  padding: 10px;
  border: 1px dashed rgba(201, 166, 107, 0.16);
  border-radius: 6px;
}

/* 性格校准滑块 */
.calibration-box {
  margin-top: auto;
  padding: 14px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-hairline);
}

.calibration-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-sub);
  margin-bottom: 10px;
}

.calibration-val {
  color: var(--accent-gold);
  font-weight: 500;
}

.calibration-box input[type="range"] {
  width: 100%;
  accent-color: var(--accent-gold);
  cursor: pointer;
}

.calibration-ends {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* 右侧主视口 */
.main-stage {
  display: none;
  flex: 1;
  flex-direction: column;
  height: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 18px 28px 20px;
  overflow: hidden;
}

.main-stage.active {
  display: flex;
}

/* 顶部先贤铭牌 */
.sage-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-hairline);
  flex-shrink: 0;
}

.sage-banner-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sage-avatar-seal {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  background: var(--accent-vermilion);
  color: #faf2e6;
  font-family: var(--font-calligraphy);
  font-size: 21px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(184, 59, 43, 0.35);
  flex-shrink: 0;
}

.sage-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sage-title-row h2 {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 2px;
}

.sage-era-badge {
  font-size: 11px;
  color: var(--accent-gold);
  border: 1px solid rgba(201, 166, 107, 0.32);
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 1px;
}

.sage-desc {
  font-size: 12.5px;
  color: var(--text-sub);
  margin-top: 4px;
}

.sage-banner-actions {
  display: flex;
  gap: 8px;
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-hairline);
  color: var(--text-main);
  font-family: var(--font-serif);
  font-size: 12px;
  padding: 7px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ghost-btn:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  background: rgba(201, 166, 107, 0.08);
}

/* 去气泡化：古籍尺素书信长卷 */
.epistle-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 22px 10px 24px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  scroll-behavior: smooth;
}

.epistle-scroll::-webkit-scrollbar,
.sidebar::-webkit-scrollbar,
.roundtable-arena::-webkit-scrollbar {
  width: 5px;
}

.epistle-scroll::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb,
.roundtable-arena::-webkit-scrollbar-thumb {
  background: rgba(201, 166, 107, 0.22);
  border-radius: 4px;
}

/* 书信条目：告别左右聊天气泡，改用纵深古籍信笺排版 */
.epistle-sheet {
  position: relative;
  padding: 22px 26px;
  border-radius: 4px;
  transition: all 0.4s ease;
  animation: inkSpread 0.75s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes inkSpread {
  0% {
    opacity: 0;
    transform: translateY(10px);
    filter: blur(3px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* 今人自省 · 素笺 */
.epistle-sheet.user-sheet {
  background: var(--bg-letter-user);
  border-left: 2px solid rgba(201, 166, 107, 0.42);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  margin-left: 36px;
}

/* 先贤回笺 · 尺素 */
.epistle-sheet.sage-sheet {
  background: var(--bg-letter-sage);
  border: 1px solid rgba(201, 166, 107, 0.22);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  background-image: linear-gradient(90deg, rgba(201, 166, 107, 0.03) 1px, transparent 1px);
  background-size: 42px 100%;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 1px dashed rgba(201, 166, 107, 0.2);
  font-size: 11.5px;
  color: var(--text-sub);
  letter-spacing: 1.5px;
}

.sheet-role-tag {
  color: var(--accent-gold);
  font-weight: 500;
}

.sheet-spatiotemporal {
  font-size: 11px;
  color: var(--text-muted);
}

.sheet-body {
  font-size: 15.5px;
  line-height: 1.95;
  color: var(--text-main);
  letter-spacing: 0.6px;
  white-space: pre-wrap;
}

.user-sheet .sheet-body {
  color: #d6cec0;
  font-size: 14.5px;
}

/* 可点击原典出处标签 */
.citation-inline-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 14px;
  padding: 5px 12px;
  background: rgba(201, 166, 107, 0.09);
  border: 1px solid rgba(201, 166, 107, 0.35);
  border-radius: 3px;
  color: var(--accent-gold);
  font-family: var(--font-serif);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.citation-inline-btn:hover {
  background: rgba(201, 166, 107, 0.2);
  transform: translateY(-1px);
}

/* 先贤落款与朱砂篆印 */
.sheet-colophon {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}

.colophon-time {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.colophon-sign {
  font-family: var(--font-calligraphy);
  font-size: 20px;
  color: var(--text-sub);
  letter-spacing: 2px;
}

.colophon-seal {
  padding: 2px 6px;
  border: 1.5px solid var(--accent-vermilion);
  color: var(--accent-vermilion);
  font-family: var(--font-calligraphy);
  font-size: 13px;
  border-radius: 2px;
  line-height: 1.1;
  transform: rotate(-2deg);
}

/* 一炷清香等待态 */
.incense-waiting {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  margin: 6px 0;
  border-left: 2px solid var(--accent-gold);
  background: rgba(201, 166, 107, 0.05);
}

.incense-waiting.hidden {
  display: none;
}

.incense-stick {
  position: relative;
  width: 3px;
  height: 26px;
  background: #6d5843;
  border-radius: 2px;
}

.ember-tip {
  position: absolute;
  top: -2px;
  left: -1px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ff5722;
  box-shadow: 0 0 10px #ff7043;
}

.smoke-plume {
  position: absolute;
  bottom: 26px;
  left: 0;
  width: 2px;
  height: 22px;
  background: linear-gradient(to top, rgba(220, 215, 205, 0.6), transparent);
  animation: smokeRise 1.6s ease-in-out infinite;
}

@keyframes smokeRise {
  0% { transform: translateY(0) scaleX(1); opacity: 0.7; }
  50% { transform: translateY(-6px) translateX(3px) scaleX(1.8); opacity: 0.4; }
  100% { transform: translateY(-12px) translateX(-2px) scaleX(1); opacity: 0; }
}

.waiting-text {
  font-size: 13px;
  color: var(--accent-gold);
  letter-spacing: 1.5px;
}

/* 快捷灵感签 */
.prompt-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 0 10px;
  flex-shrink: 0;
}

.pill-btn {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(201, 166, 107, 0.2);
  color: var(--text-sub);
  font-family: var(--font-serif);
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pill-btn:hover {
  color: var(--accent-gold);
  border-color: var(--accent-gold);
  background: rgba(201, 166, 107, 0.08);
}

/* 素笺写信框 */
.letter-composer {
  background: rgba(24, 21, 18, 0.94);
  border: 1px solid rgba(201, 166, 107, 0.28);
  border-radius: 6px;
  padding: 12px 16px;
  flex-shrink: 0;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.35);
}

.composer-top-rule {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  padding-bottom: 6px;
  border-bottom: 1px dashed rgba(201, 166, 107, 0.14);
  margin-bottom: 8px;
}

.letter-composer textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  color: var(--text-main);
  font-family: var(--font-serif);
  font-size: 14.5px;
  line-height: 1.7;
}

.letter-composer textarea::placeholder {
  color: var(--text-muted);
}

.composer-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.composer-tip {
  font-size: 11px;
  color: var(--text-muted);
}

.seal-send-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #9e2f21, #b83b2b);
  color: #fbf5eb;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 8px 18px;
  border-radius: 5px;
  font-family: var(--font-serif);
  font-size: 13.5px;
  letter-spacing: 1.5px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(184, 59, 43, 0.35);
  transition: all 0.2s ease;
}

.seal-send-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(184, 59, 43, 0.5);
}

.seal-send-btn.full-width {
  width: 100%;
  justify-content: center;
  margin-top: 14px;
}

.btn-seal-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(251, 245, 235, 0.65);
  font-family: var(--font-calligraphy);
  font-size: 13px;
  border-radius: 2px;
}

/* 诸神圆桌派 */
.stage-header-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-hairline);
  margin-bottom: 14px;
  flex-shrink: 0;
}

.stage-header-card h2 {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 2px;
  color: var(--accent-gold);
}

.stage-header-card p {
  font-size: 12.5px;
  color: var(--text-sub);
  margin-top: 4px;
}

.roundtable-picker {
  margin-bottom: 12px;
  flex-shrink: 0;
}

.picker-label {
  font-size: 12px;
  color: var(--text-sub);
  margin-bottom: 8px;
}

.picker-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rt-chip {
  padding: 5px 12px;
  border-radius: 5px;
  border: 1px solid var(--border-hairline);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-sub);
  font-family: var(--font-serif);
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rt-chip.selected {
  border-color: var(--accent-gold);
  background: rgba(201, 166, 107, 0.16);
  color: var(--accent-gold);
}

.roundtable-arena {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 10px 4px 18px;
}

.arena-intro {
  margin: auto;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  letter-spacing: 1px;
  padding: 36px;
  border: 1px dashed var(--border-hairline);
  border-radius: 6px;
}

.debate-turn {
  background: var(--bg-letter-sage);
  border: 1px solid var(--border-hairline);
  border-left: 3px solid var(--accent-vermilion);
  padding: 16px 20px;
  border-radius: 4px;
  animation: inkSpread 0.6s ease forwards;
}

.debate-turn-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.debate-speaker {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--accent-gold);
  font-size: 14.5px;
}

.debate-stance {
  font-size: 11px;
  color: #e6a89e;
  background: rgba(184, 59, 43, 0.16);
  padding: 2px 8px;
  border-radius: 3px;
}

.debate-content {
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--text-main);
}

.quick-dilemmas {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.mini-pill {
  background: transparent;
  border: 1px solid var(--border-hairline);
  color: var(--text-sub);
  font-family: var(--font-serif);
  font-size: 11.5px;
  padding: 4px 9px;
  border-radius: 4px;
  cursor: pointer;
}

.mini-pill:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

/* 灵魂铸造炉 */
.forge-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  flex: 1;
  overflow-y: auto;
  padding-bottom: 12px;
}

.drop-zone {
  border: 1.5px dashed rgba(201, 166, 107, 0.38);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.015);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent-gold);
  background: rgba(201, 166, 107, 0.07);
}

.forge-emblem {
  font-size: 40px;
  margin-bottom: 12px;
}

.drop-zone h3 {
  font-family: var(--font-display);
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--text-main);
}

.drop-zone p {
  font-size: 12.5px;
  color: var(--text-sub);
  line-height: 1.6;
}

.forge-presets {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px dashed var(--border-hairline);
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  font-size: 12px;
  color: var(--text-muted);
}

.preset-book-btn {
  background: rgba(201, 166, 107, 0.08);
  border: 1px solid rgba(201, 166, 107, 0.28);
  color: var(--accent-gold);
  font-family: var(--font-serif);
  font-size: 12.5px;
  padding: 8px 12px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-book-btn:hover {
  background: rgba(201, 166, 107, 0.18);
}

.forge-ritual-panel {
  border: 1px solid var(--border-hairline);
  border-radius: 8px;
  background: var(--bg-letter-sage);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ritual-placeholder {
  text-align: center;
  color: var(--text-sub);
}

.seal-watermark {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border: 2px solid rgba(201, 166, 107, 0.25);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-calligraphy);
  font-size: 30px;
  color: rgba(201, 166, 107, 0.45);
}

.ritual-placeholder p {
  font-size: 13px;
  line-height: 1.8;
}

.ritual-anim {
  text-align: center;
}

.ritual-anim.hidden, .forged-card.hidden, .ritual-placeholder.hidden, .modal-backdrop.hidden {
  display: none !important;
}

.ink-vortex {
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 2px solid var(--accent-gold);
  border-top-color: var(--accent-vermilion);
  animation: spinVortex 1.2s linear infinite;
}

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

.forged-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.forged-seal {
  width: 44px;
  height: 44px;
  background: var(--accent-vermilion);
  color: #fbf5eb;
  font-family: var(--font-calligraphy);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
}

.forged-persona {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.7;
  margin-bottom: 12px;
}

.forged-quotes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.forged-quote-item {
  font-size: 12.5px;
  color: var(--accent-gold);
  padding: 8px 10px;
  background: rgba(201, 166, 107, 0.06);
  border-left: 2px solid var(--accent-gold);
}

/* 弹窗基础样式 */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(7, 6, 5, 0.86);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: transparent;
  border: none;
  color: var(--text-sub);
  font-size: 18px;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text-main);
}

/* 焚忧炉仪式 */
.burn-ritual-stage {
  position: relative;
  width: 100%;
  max-width: 580px;
  background: radial-gradient(circle at center, #221b16 0%, #120f0d 100%);
  border: 1px solid rgba(184, 59, 43, 0.45);
  border-radius: 10px;
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.75);
}

.ritual-tag {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 2px;
  color: #e6a89e;
  border: 1px solid rgba(184, 59, 43, 0.45);
  padding: 3px 10px;
  border-radius: 99px;
  margin-bottom: 10px;
}

.burn-header h2 {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 3px;
  color: #f4e8d6;
  margin-bottom: 8px;
}

.burn-header p {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.7;
  margin-bottom: 22px;
}

.burn-paper-wrapper {
  position: relative;
  margin: 0 auto 22px;
  min-height: 190px;
}

.burn-paper {
  position: relative;
  background: linear-gradient(180deg, #dfd3be 0%, #cbbba0 100%);
  color: #2b231a;
  padding: 20px 22px;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: opacity 1.4s ease, transform 1.4s ease, filter 1.4s ease;
}

.burn-paper.burning {
  opacity: 0;
  transform: translateY(-28px) scale(0.95);
  filter: blur(6px) brightness(0.4);
}

.paper-corner-mark {
  text-align: left;
  font-size: 11px;
  color: #7b664f;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.burn-paper textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  color: #231b12;
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.8;
}

.burn-paper textarea::placeholder {
  color: #826e58;
}

.paper-footer-note {
  text-align: right;
  font-size: 11px;
  color: #7b664f;
  margin-top: 8px;
}

#fireCanvas {
  position: absolute;
  inset: -40px -20px;
  width: calc(100% + 40px);
  height: calc(100% + 80px);
  pointer-events: none;
}

.burn-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.burn-execute-btn {
  background: linear-gradient(135deg, #a83222, #d14928);
  color: #fff8ee;
  border: none;
  padding: 10px 22px;
  border-radius: 6px;
  font-family: var(--font-serif);
  font-size: 14px;
  letter-spacing: 1.5px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(209, 73, 40, 0.4);
}

.burn-execute-btn:hover {
  filter: brightness(1.08);
}

/* 原典考据卡片 */
.citation-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: #1c1814;
  border: 1px solid rgba(201, 166, 107, 0.4);
  border-radius: 6px;
  padding: 28px 26px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

.citation-badge {
  font-size: 11px;
  color: var(--accent-gold);
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.citation-card h3 {
  font-family: var(--font-display);
  font-size: 20px;
  margin-bottom: 16px;
}

.citation-body {
  display: flex;
  gap: 14px;
  background: rgba(201, 166, 107, 0.06);
  border: 1px solid rgba(201, 166, 107, 0.2);
  padding: 16px;
  border-radius: 4px;
  margin-bottom: 14px;
}

.vertical-deco {
  writing-mode: vertical-rl;
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--accent-vermilion);
  border-left: 1px solid rgba(201, 166, 107, 0.25);
  padding-left: 8px;
}

.citation-body blockquote {
  font-size: 15px;
  line-height: 1.85;
  color: #f0e6d6;
}

.citation-context {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.7;
}

/* 处方笺生成弹窗 */
.prescription-dialog {
  position: relative;
  width: 100%;
  max-width: 500px;
  background: #1a1714;
  border: 1px solid rgba(201, 166, 107, 0.35);
  border-radius: 8px;
  padding: 22px;
}

.prescription-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 14px;
  padding-right: 24px;
}

.prescription-top h3 {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--accent-gold);
}

.prescription-top p {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 2px;
}

.theme-switcher {
  display: flex;
  gap: 6px;
}

.theme-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-hairline);
  color: var(--text-sub);
  font-family: var(--font-serif);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.theme-pill.active {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  background: rgba(201, 166, 107, 0.14);
}

.prescription-preview-wrap {
  display: flex;
  justify-content: center;
  background: #0e0c0a;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid var(--border-hairline);
}

#prescriptionCanvas {
  width: 100%;
  max-width: 310px;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6);
}

.prescription-footer {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}

@media (max-width: 860px) {
  .workspace {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    max-height: 150px;
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-hairline);
  }
  .calibration-box {
    display: none;
  }
  .forge-grid {
    grid-template-columns: 1fr;
  }
  .topbar {
    padding: 0 12px;
  }
  .brand-tagline, .ritual-btn span.hide-sm {
    display: none;
  }
}
