:root {
  --bg-ink: #0d0c0a;
  --bg-panel: #161310;
  --bg-card: #1d1914;
  --border-dim: rgba(217, 182, 107, 0.22);
  --border-gold: rgba(232, 189, 86, 0.48);
  --gold-soft: #d9b66b;
  --gold-bright: #f6dc95;
  --gold-muted: #9b8e7a;
  --text-main: #efe7d8;
  --text-sub: #c6b9a3;
  --serif: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at 50% 0%, rgba(217, 182, 107, 0.08), transparent 45%), var(--bg-ink);
  color: var(--text-main);
  font-family: var(--sans);
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* 顶部工作台条 */
.shell-topbar {
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 24px;
  background: rgba(16, 14, 11, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-dim);
}

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

.brand-seal {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1.5px solid var(--gold-soft);
  background: linear-gradient(145deg, #2a2114, #14110c);
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 18px rgba(232, 189, 86, 0.22);
}

.brand-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--gold-bright);
}

.brand-sub {
  font-size: 12px;
  color: var(--gold-muted);
  margin-top: 2px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.global-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #181511;
  border: 1px solid var(--border-dim);
  border-radius: 10px;
  padding: 7px 12px;
  min-width: 240px;
}

.global-search-box .icon {
  color: var(--gold-soft);
}

.global-search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 13px;
  width: 100%;
}

.clear-btn {
  background: none;
  border: none;
  color: var(--gold-muted);
  cursor: pointer;
  padding: 0 4px;
}

.mode-btn, .gold-btn, .ghost-btn {
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-btn, .ghost-btn {
  padding: 8px 14px;
  background: rgba(217, 182, 107, 0.08);
  border: 1px solid rgba(217, 182, 107, 0.36);
  color: var(--gold-bright);
}

.mode-btn:hover, .ghost-btn:hover {
  background: rgba(217, 182, 107, 0.18);
}

.gold-btn {
  padding: 8px 16px;
  border: 1px solid #f0cf7e;
  background: linear-gradient(135deg, #f0cf7e, #be913e);
  color: #16130e;
  font-weight: 600;
}

.gold-btn:hover {
  filter: brightness(1.06);
}

.gold-btn:disabled, .ghost-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

/* 视窗容器：支持宽屏与手机仿真双形态 */
.stage-root {
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 20px 56px;
}

.stage-root.phone-mode {
  max-width: 440px;
  padding-top: 22px;
}

.stage-root.phone-mode .app-frame {
  border-radius: 30px;
  border: 2px solid rgba(232, 189, 86, 0.38);
  background: #0f0d0a;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.72);
  overflow: hidden;
  min-height: 760px;
}

/* 五大核心 Tab */
.codex-nav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 10px;
  background: #14120f;
  border: 1px solid var(--border-dim);
  border-radius: 16px;
  margin-bottom: 18px;
}

.stage-root.phone-mode .codex-nav {
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
  margin-bottom: 12px;
  gap: 4px;
  padding: 8px 6px;
}

.nav-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 8px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--gold-muted);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.stage-root.phone-mode .nav-tab {
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  padding: 7px 4px;
}

.nav-tab .tab-glyph {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid rgba(217, 182, 107, 0.24);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 13px;
}

.nav-tab.active {
  color: #16130e;
  background: linear-gradient(135deg, #f3d68d, #c69a47);
  font-weight: 700;
}

.nav-tab.active .tab-glyph {
  border-color: rgba(22, 19, 14, 0.38);
  background: rgba(22, 19, 14, 0.14);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.stage-root.phone-mode .tab-panel {
  padding: 0 12px 24px;
}

/* 筛选条与统计头 */
.section-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--gold-bright);
  letter-spacing: 2px;
}

.section-desc {
  font-size: 13px;
  color: var(--gold-muted);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.pill-row.scroll-row {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 4px;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-sub);
  background: #171410;
  border: 1px solid rgba(217, 182, 107, 0.18);
  cursor: pointer;
  white-space: nowrap;
}

.filter-pill.active {
  color: #16130e;
  background: linear-gradient(135deg, #f3d68d, #c69a47);
  border-color: #f3d68d;
  font-weight: 600;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* 3D 翻转藏卡网格 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(226px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.stage-root.phone-mode .card-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.flip-card {
  height: 356px;
  perspective: 1200px;
  cursor: pointer;
}

.stage-root.phone-mode .flip-card {
  height: 316px;
}

.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.56s cubic-bezier(0.22, 0.61, 0.36, 1);
  transform-style: preserve-3d;
}

.flip-card.is-flipped .flip-inner {
  transform: rotateY(180deg);
}

.flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 16px;
  border: 1.5px solid #575046;
  background: linear-gradient(165deg, #221d17 0%, #15120e 58%, #100e0b 100%);
  padding: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.48);
  transition: box-shadow 0.25s ease;
}

.flip-card:hover .flip-face {
  box-shadow: 0 14px 32px rgba(232, 189, 86, 0.16);
}

.flip-card.tier-venerable .flip-face {
  background: linear-gradient(165deg, #2e2415 0%, #19140e 58%, #110e0a 100%);
}

.flip-back {
  transform: rotateY(180deg);
  justify-content: space-between;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.seal-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid;
  background: rgba(13, 12, 10, 0.72);
  white-space: nowrap;
}

.sigil-box {
  height: 92px;
  margin: 8px 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.stage-root.phone-mode .sigil-box {
  height: 74px;
}

.sigil-box svg {
  width: 72px;
  height: 72px;
}

.stage-root.phone-mode .sigil-box svg {
  width: 58px;
  height: 58px;
}

.card-art-frame {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 12px;
  border: 1.5px solid #87653a;
  overflow: hidden;
  background: #100e0b;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.58), inset 0 0 0 1px rgba(246, 220, 149, 0.24);
}

.stage-root.phone-mode .card-art-frame {
  width: 72px;
  height: 72px;
  border-radius: 10px;
}

.card-art-frame::after,
.dossier-art-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(246, 220, 149, 0.22);
  box-shadow: inset 0 0 14px rgba(13, 12, 10, 0.42);
  pointer-events: none;
}

.card-art-frame img,
.dossier-art-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.art-zoom-btn {
  position: absolute;
  right: 4px;
  bottom: 4px;
  z-index: 4;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(13, 12, 10, 0.82);
  border: 1px solid rgba(232, 189, 86, 0.56);
  color: var(--gold-bright);
  font-size: 10px;
  line-height: 1.3;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.art-zoom-btn:hover {
  background: rgba(232, 189, 86, 0.92);
  border-color: #f6dc95;
  color: #14110c;
  transform: scale(1.04);
}

.stage-root.phone-mode .art-zoom-btn {
  padding: 1.5px 5px;
  font-size: 9px;
}

.card-title {
  text-align: center;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  color: #f6edd9;
  letter-spacing: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stage-root.phone-mode .card-title {
  font-size: 15px;
}

.card-sub {
  margin-top: 5px;
  text-align: center;
  font-size: 12px;
  color: var(--gold-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-sub-gu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 5px;
  overflow: visible;
}

.sub-path {
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-pill,
.origin-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.25;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid;
  letter-spacing: 0.4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.cat-pill-sm {
  font-size: 10px;
  padding: 1.5px 7px;
}

.origin-pill-xs {
  font-size: 9.5px;
  padding: 1px 6px;
  border-radius: 5px;
}

.cat-pill-lg,
.origin-pill-lg {
  font-size: 12px;
  padding: 3px 11px;
}

.stage-root.phone-mode .cat-pill,
.stage-root.phone-mode .origin-pill {
  font-size: 9.5px;
  padding: 1.5px 6px;
}

.back-cat-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
}

.card-epithet {
  margin-top: 10px;
  font-size: 12px;
  color: #bfb29d;
  line-height: 1.5;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.card-hint {
  text-align: center;
  font-size: 11px;
  color: rgba(217, 182, 107, 0.56);
  margin-top: 6px;
}

.back-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid rgba(217, 182, 107, 0.2);
  padding-bottom: 8px;
}

.back-title {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--gold-bright);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.back-sec {
  margin-top: 6px;
}

.back-recipe-sec {
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(217, 182, 107, 0.06);
  border: 1px solid rgba(217, 182, 107, 0.16);
}

.back-k-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.back-k {
  font-size: 10.5px;
  color: var(--gold-soft);
}

.back-v {
  margin-top: 2px;
  font-size: 11.5px;
  color: #ded4c2;
  line-height: 1.42;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.back-v.clamp3 {
  -webkit-line-clamp: 3;
}

.back-v.clamp2 {
  -webkit-line-clamp: 2;
}

.back-v.clamp1 {
  -webkit-line-clamp: 1;
}

.stage-root.phone-mode .back-v.clamp3 {
  -webkit-line-clamp: 2;
}

.stage-root.phone-mode .back-v {
  font-size: 11px;
  line-height: 1.38;
}

.back-btns {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.back-btns .gold-btn {
  flex: 1;
  padding: 6px 10px;
  font-size: 12px;
}

.back-btns .ghost-btn {
  padding: 6px 10px;
  font-size: 12px;
}

/* 编年纪事时间轴 */
.timeline {
  position: relative;
  padding-left: 26px;
  margin-top: 14px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: linear-gradient(180deg, rgba(232, 189, 86, 0.52), rgba(232, 189, 86, 0.08));
}

.event-item {
  position: relative;
  margin-bottom: 18px;
  padding: 18px 20px;
  border-radius: 16px;
  background: linear-gradient(165deg, #1f1b16 0%, #15120e 100%);
  border: 1px solid var(--border-dim);
}

.event-item::before {
  content: "";
  position: absolute;
  left: -23px;
  top: 22px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 12px rgba(232, 189, 86, 0.65);
  border: 2px solid #241e15;
}

.event-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--gold-soft);
}

.impact-pill {
  padding: 2px 10px;
  border-radius: 6px;
  background: rgba(201, 64, 74, 0.16);
  border: 1px solid rgba(201, 64, 74, 0.45);
  color: #f3b5b9;
}

.event-name {
  margin-top: 8px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--gold-bright);
  cursor: pointer;
}

.event-name:hover {
  text-decoration: underline;
}

.quote-box {
  margin: 10px 0;
  padding: 10px 14px;
  border-left: 3px solid var(--gold-soft);
  background: rgba(217, 182, 107, 0.06);
  color: #ebd08a;
  font-size: 13px;
}

.event-summary {
  font-size: 13.5px;
  color: #d8cebc;
  line-height: 1.65;
}

.chip-group {
  margin-top: 12px;
}

.chip-label {
  font-size: 11px;
  color: var(--gold-muted);
  margin-bottom: 6px;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.entity-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.entity-chip:hover {
  transform: translateY(-1px);
  filter: brightness(1.14);
}

.chip-gu {
  background: rgba(91, 169, 214, 0.12);
  border-color: rgba(130, 194, 232, 0.36);
  color: #d6ebf7;
  gap: 6px;
}

.chip-cat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chip-cat-tag {
  font-size: 10.5px;
  opacity: 0.92;
  padding-left: 4px;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
}

.chip-character {
  background: rgba(232, 189, 86, 0.12);
  border-color: rgba(232, 189, 86, 0.38);
  color: #f5df9f;
}

.chip-event {
  background: rgba(201, 64, 74, 0.14);
  border-color: rgba(214, 102, 110, 0.36);
  color: #f3c4c7;
}

/* 宿命星图面板 */
.graph-shell {
  border-radius: 18px;
  border: 1px solid var(--border-dim);
  background: #12100d;
  overflow: hidden;
}

.graph-toolbar {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border-dim);
  background: #16130f;
}

.graph-canvas-wrap {
  position: relative;
  height: 580px;
  width: 100%;
}

.stage-root.phone-mode .graph-canvas-wrap {
  height: 460px;
}

#previewGraphCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

#previewGraphCanvas:active {
  cursor: grabbing;
}

.graph-controls {
  position: absolute;
  right: 14px;
  top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.graph-ctrl-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(24, 20, 16, 0.9);
  border: 1px solid rgba(232, 189, 86, 0.38);
  color: var(--gold-bright);
  font-size: 16px;
  cursor: pointer;
}

.graph-ctrl-btn.small {
  font-size: 12px;
}

.graph-overlay-card {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  max-width: 520px;
  border-radius: 16px;
  background: rgba(22, 18, 14, 0.96);
  border: 1px solid var(--border-gold);
  padding: 14px 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}

/* 《人祖传》双栏/阅读器 */
.renzu-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
  align-items: start;
}

.stage-root.phone-mode .renzu-layout {
  grid-template-columns: 1fr;
}

.renzu-sidebar {
  border-radius: 16px;
  border: 1px solid var(--border-dim);
  background: #15120f;
  overflow: hidden;
  max-height: 760px;
  display: flex;
  flex-direction: column;
}

.stage-root.phone-mode .renzu-sidebar {
  max-height: 260px;
}

.renzu-side-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-dim);
  font-family: var(--serif);
  font-size: 15px;
  color: var(--gold-bright);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.renzu-toc-list {
  overflow-y: auto;
  flex: 1;
}

.renzu-toc-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(217, 182, 107, 0.08);
  padding: 10px 14px;
  color: #cfc3ae;
  font-size: 12.5px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.renzu-toc-item:hover {
  background: rgba(217, 182, 107, 0.07);
}

.renzu-toc-item.active {
  background: rgba(232, 189, 86, 0.16);
  color: var(--gold-bright);
  font-weight: 600;
}

.renzu-reader {
  border-radius: 16px;
  border: 1px solid var(--border-dim);
  background: #15130f;
  padding: 22px 26px;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.renzu-reader.theme-paper {
  background: #f3ecdd;
  color: #2c241b;
  border-color: rgba(145, 114, 62, 0.35);
}

.reader-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(217, 182, 107, 0.2);
}

.reader-title {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--gold-bright);
  margin: 8px 0 12px;
}

.renzu-reader.theme-paper .reader-title {
  color: #4a3110;
}

.reader-para {
  text-indent: 2em;
  line-height: 1.9;
  margin: 0 0 14px;
}

.inline-hit {
  border-bottom: 1.5px dashed;
  cursor: pointer;
  font-weight: 600;
  padding: 0 2px;
}

.inline-hit.type-gu {
  color: #8fd0f2;
  border-bottom-color: rgba(143, 208, 242, 0.65);
}

.inline-hit.type-character {
  color: #f4d685;
  border-bottom-color: rgba(244, 214, 133, 0.65);
}

.renzu-reader.theme-paper .inline-hit.type-gu {
  color: #19648d;
}

.renzu-reader.theme-paper .inline-hit.type-character {
  color: #8f570d;
}

.renzu-reader.theme-paper .entity-chip {
  color: #3a2b17;
  background: rgba(168, 128, 56, 0.14);
  border-color: rgba(168, 128, 56, 0.42);
}

/* 深度卷宗模态框 */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.74);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal-dialog {
  width: 100%;
  max-width: 660px;
  max-height: 86vh;
  border-radius: 22px;
  background: linear-gradient(180deg, #211c16 0%, #13110d 100%);
  border: 1.5px solid var(--border-gold);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.75);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-dim);
}

.modal-kind {
  font-size: 13px;
  color: var(--gold-soft);
  letter-spacing: 2px;
}

.modal-back, .modal-close {
  background: transparent;
  border: 1px solid rgba(217, 182, 107, 0.3);
  color: var(--gold-bright);
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 12px;
}

.modal-body {
  padding: 20px 22px 26px;
  overflow-y: auto;
}

.dossier-head-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dossier-visual {
  flex-shrink: 0;
}

.dossier-art-trigger {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: zoom-in;
  outline: none;
}

.dossier-art-frame {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 14px;
  border: 2px solid #87653a;
  overflow: hidden;
  background: #100e0b;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.62), inset 0 0 0 1px rgba(246, 220, 149, 0.24);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dossier-art-trigger:hover .dossier-art-frame,
.dossier-art-trigger:focus-visible .dossier-art-frame {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 28px rgba(232, 189, 86, 0.28), inset 0 0 0 1px rgba(246, 220, 149, 0.45);
}

.dossier-zoom-corner {
  position: absolute;
  right: 5px;
  bottom: 5px;
  z-index: 3;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 12, 10, 0.8);
  border: 1px solid rgba(232, 189, 86, 0.56);
  color: var(--gold-bright);
  font-size: 12px;
}

.dossier-zoom-hint {
  font-size: 11px;
  color: rgba(235, 208, 138, 0.82);
  letter-spacing: 0.5px;
  transition: color 0.18s ease;
}

.dossier-art-trigger:hover .dossier-zoom-hint {
  color: var(--gold-bright);
}

.dossier-sec {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(217, 182, 107, 0.16);
}

.dossier-recipe-sec {
  background: linear-gradient(180deg, rgba(217, 182, 107, 0.09), rgba(255, 255, 255, 0.02));
  border-color: rgba(217, 182, 107, 0.34);
}

.dossier-sec-h-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.dossier-sec-h {
  font-size: 12px;
  color: var(--gold-soft);
  margin-bottom: 6px;
  letter-spacing: 1px;
}

.dossier-sec-p {
  font-size: 13.5px;
  color: #e4dac8;
  line-height: 1.7;
}

.rel-row-card {
  padding: 10px 12px;
  margin-top: 8px;
  border-radius: 10px;
  background: rgba(217, 182, 107, 0.05);
  border: 1px solid rgba(217, 182, 107, 0.14);
  cursor: pointer;
}

.rel-row-card:hover {
  border-color: var(--border-gold);
}

.empty-box {
  padding: 56px 20px;
  text-align: center;
  color: var(--gold-muted);
}

/* 全屏原画查看大图灯箱 */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 320;
  background: rgba(8, 7, 5, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: min(92vw, 760px);
  max-height: 94vh;
  animation: lightboxReveal 0.22s cubic-bezier(0.22, 0.61, 0.36, 1);
}

@keyframes lightboxReveal {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.lightbox-close {
  position: absolute;
  top: -12px;
  right: -12px;
  z-index: 5;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid rgba(232, 189, 86, 0.62);
  background: rgba(20, 17, 13, 0.96);
  color: var(--gold-bright);
  font-size: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.65);
  transition: background-color 0.18s ease, transform 0.18s ease;
}

.lightbox-close:hover {
  background: linear-gradient(135deg, #f3d68d, #c69a47);
  color: #14110c;
  transform: scale(1.06);
}

.lightbox-art-shell {
  position: relative;
  border-radius: 18px;
  border: 2px solid var(--border-gold);
  background: #0d0c0a;
  overflow: hidden;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.85), 0 0 36px rgba(217, 182, 107, 0.18);
}

.lightbox-art-shell img {
  display: block;
  max-width: 90vw;
  max-height: 76vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox-caption {
  width: 100%;
  margin-top: 14px;
  padding: 14px 18px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(28, 24, 18, 0.96), rgba(16, 14, 11, 0.96));
  border: 1px solid rgba(217, 182, 107, 0.34);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
}

.lightbox-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.lightbox-title {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--gold-bright);
  letter-spacing: 1.5px;
}

.lightbox-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.lightbox-epithet {
  margin-top: 8px;
  font-size: 13px;
  color: #ebd08a;
  line-height: 1.55;
}

.lightbox-appearance {
  margin-top: 6px;
  font-size: 12.5px;
  color: #cfc3ae;
  line-height: 1.6;
}

@media (max-width: 540px) {
  .lightbox-backdrop {
    padding: 14px;
  }
  .lightbox-close {
    top: 8px;
    right: 8px;
  }
  .lightbox-caption {
    padding: 12px 14px;
  }
  .lightbox-title {
    font-size: 17px;
  }
}
