/* ===== 女帝手册 · 帝梦浅纸画风 ===== */
:root {
  --gold: #b8924c;
  --gold-light: #d2b36e;
  --gold-dark: #8a6b38;
  --seal: #9a4038;
  --red: #9a4a42;
  --red-deep: #7a3a36;
  --purple: #8a7a6a;
  --purple-light: #a89888;
  --bg-dark: #e7ddcd;
  --bg-paper: #f2eadc;
  --bg-panel: rgba(247, 239, 224, 0.94);
  --bg-card: #f6eee0;
  --paper: #f5ede0;
  --paper-deep: #ece2d0;
  --text: #4a3f32;
  --text-dim: #8a7c6a;
  --ink: #3c3228;
  --line: #d3c4aa;
  --line-gold: #c4aa72;
  --border-gold: linear-gradient(135deg, #d4b57a, #8a7040, #d4b57a);
  --shadow: 0 14px 36px rgba(72, 52, 30, 0.12);
  --paper-fill: linear-gradient(180deg, rgba(255, 250, 240, 0.55), rgba(236, 226, 208, 0.78));
  --font-title: 'Noto Serif SC', 'STSong', 'SimSun', serif;
  --font-body: 'Noto Serif SC', 'STSong', 'SimSun', serif;
  --font-ui: 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
}

html {
  font-size: 18px;
  height: 100%;
}

@media (min-width: 1440px) {
  html { font-size: 20px; }
}

@media (min-width: 1760px) {
  html { font-size: 22px; }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  max-width: 100%;
}

body {
  font-family: var(--font-body);
  background:
    radial-gradient(ellipse at 50% 8%, rgba(255, 246, 226, 0.4), transparent 52%),
    linear-gradient(180deg, #efe4d2 0%, #e4d8c4 100%);
  color: var(--text);
  min-height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  letter-spacing: 0.03em;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.22;
  background-image:
    repeating-linear-gradient(0deg, rgba(90, 68, 36, 0.035) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(90, 68, 36, 0.02) 0 1px, transparent 1px 4px);
}

#app {
  width: 100%;
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.screen { display: none; width: 100%; height: 100%; }
.screen.active { display: flex; flex-direction: column; }

/* ===== 开场 · 神都春风录 ===== */
#start-screen {
  position: relative;
  align-items: stretch;
  justify-content: stretch;
  overflow: hidden;
}
.start-bg {
  position: absolute;
  inset: 0;
  background: url('../assets/start-bg.jpg') center center / cover no-repeat;
  z-index: 0;
}
.start-vignette {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(43,24,16,0.5) 0%, rgba(43,24,16,0.3) 35%, rgba(43,24,16,0) 60%),
    linear-gradient(270deg, rgba(253,248,240,0.15) 0%, rgba(253,248,240,0) 40%),
    radial-gradient(ellipse at center, rgba(61,43,31,0) 55%, rgba(61,43,31,0.35) 100%);
}
.start-hud-frame {
  position: absolute; inset: 24px; z-index: 2; pointer-events: none;
  opacity: 0.35; border: 1px solid #C4A56A;
}
.start-hud-frame::before {
  content: ''; position: absolute; width: 16px; height: 16px;
  top: -4px; left: -4px; border-top: 2px solid #C4A56A; border-left: 2px solid #C4A56A;
}
.start-hud-frame::after {
  content: ''; position: absolute; width: 16px; height: 16px;
  top: -4px; right: -4px; border-top: 2px solid #C4A56A; border-right: 2px solid #C4A56A;
}
.start-hud-frame .corner { position: absolute; width: 16px; height: 16px; }
.start-hud-frame .corner-bl { bottom: -4px; left: -4px; border-bottom: 2px solid #C4A56A; border-left: 2px solid #C4A56A; }
.start-hud-frame .corner-br { bottom: -4px; right: -4px; border-bottom: 2px solid #C4A56A; border-right: 2px solid #C4A56A; }

.start-hud-top {
  position: absolute; top: 24px; left: 24px; right: 24px; z-index: 3;
  display: flex; justify-content: space-between; pointer-events: none;
}
.hud-left, .hud-right {
  font-family: 'Noto Sans SC', sans-serif; font-weight: 300; font-size: 11px;
  color: #8B7D6B; letter-spacing: 0.06em; opacity: 0.9;
}

.start-hud-top, .start-poetic-bar { display: none !important; }

.start-branding {
  position: absolute; left: calc(70/1280*100%); top: calc(58/720*100%); z-index: 3;
  display: flex; flex-direction: column; gap: 24px; pointer-events: none;
}
.branding-ornament {
  width: 40px; height: 1px; background: #C4A56A; position: relative; opacity: 0.55;
}
.branding-ornament::before, .branding-ornament::after {
  content: ''; position: absolute; top: 50%;
  width: 4px; height: 4px; background: #C4A56A; border-radius: 2px; transform: translateY(-50%);
}
.branding-ornament::before { left: -8px; }
.branding-ornament::after { right: -8px; }

.branding-title {
  font-family: 'Ma Shan Zheng', cursive;
  font-size: clamp(5.5rem, 13vh, 10rem);
  color: #3D2B1F; writing-mode: vertical-rl;
  letter-spacing: 0.08em; line-height: 1.02; margin-top: 4px;
  text-shadow: 0 2px 6px rgba(245,237,228,0.55), 0 4px 12px rgba(61,43,31,0.3);
}

.branding-subtitle {
  font-family: 'Noto Serif SC', serif; font-weight: 300; font-size: 15px;
  color: #3D2B1F; letter-spacing: 0.16em;
  display: flex; align-items: center; gap: 10px; opacity: 0.9;
}
.sub-dot { width: 8px; height: 8px; background: #C4A56A; border-radius: 4px; opacity: 0.6; }

.start-panel {
  position: absolute; left: calc(714/1280*100%); top: calc(120/720*100%); z-index: 4;
  width: calc(446/1280*100%); max-width: 446px;
  background: rgba(245,237,228,0.7);
  border-left: 1px solid #C5B9A8; border-right: 1px solid #C5B9A8;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(43,24,16,0.15), inset 0 1px 0 rgba(255,251,242,0.6);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  padding: 44px 40px 28px;
  display: flex; flex-direction: column; gap: 32px;
}
.panel-ornament { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.panel-fields { display: flex; flex-direction: column; gap: 24px; }
.panel-field { display: flex; flex-direction: column; gap: 8px; }
.panel-field label {
  font-family: 'Noto Sans SC', sans-serif; font-weight: 300; font-size: 14px;
  color: #6B5D50; letter-spacing: 0.12em;
}
.field-underline {
  border-bottom: 1px solid rgba(196,185,168,0.6); padding-bottom: 4px; transition: border-color 0.2s;
}
.field-underline:focus-within { border-bottom-color: #C4A56A; }
.field-underline input {
  width: 100%; background: transparent; border: none; outline: none;
  font-family: 'Noto Serif SC', serif; font-weight: 400; font-size: 18px;
  color: #5A4A3A; padding: 4px 0; letter-spacing: 0.06em;
}
.field-underline input::placeholder { color: rgba(90,74,58,0.45); }

.panel-divider { display: flex; align-items: center; gap: 8px; }
.div-line {
  flex: 1; height: 1px;
  background: linear-gradient(90deg, rgba(196,165,106,0), rgba(196,165,106,0.5) 50%, rgba(196,165,106,0));
}
.div-diamond { width: 6px; height: 6px; background: #C4A56A; transform: rotate(45deg); opacity: 0.5; flex-shrink: 0; }

.panel-actions { display: flex; flex-direction: column; gap: 14px; }
.btn-ascend {
  font-family: 'Noto Serif SC', serif; font-weight: 600; font-size: 18px;
  color: #FFF7F5; letter-spacing: 0.24em;
  background: linear-gradient(180deg, #B8956A 0%, #A67A5C 100%);
  border: 1px solid rgba(196,148,107,0.4); border-radius: 24px;
  padding: 14px 0; cursor: pointer;
  box-shadow: 0 4px 8px rgba(184,149,106,0.2), inset 0 1px 0 rgba(255,255,255,0.2);
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
}
.btn-ascend:hover { filter: brightness(1.05); box-shadow: 0 6px 14px rgba(184,149,106,0.3), inset 0 1px 0 rgba(255,255,255,0.25); }
.btn-ascend:active { transform: translateY(1px); }

.btn-continue {
  font-family: 'Noto Serif SC', serif; font-weight: 500; font-size: 17px;
  color: #B8956A; letter-spacing: 0.2em;
  background: transparent; border: 1px solid #B8956A; border-radius: 24px;
  padding: 13px 0; cursor: pointer; transition: background 0.2s, color 0.2s;
}
.btn-continue:hover { background: rgba(184,149,106,0.08); }

.btn-restore-sub {
  font-family: var(--font-ui); font-size: 12px; letter-spacing: 0.04em;
  color: rgba(139,125,107,0.75); background: transparent; border: none;
  text-align: center; padding: 0; margin-top: -4px; cursor: pointer;
  transition: color 0.2s;
}
.btn-restore-sub:hover { color: #B8956A; text-decoration: underline; }

.start-hint {
  font-family: var(--font-ui); font-size: 11px; line-height: 1.6;
  letter-spacing: 0.06em; color: rgba(139,125,107,0.7); text-align: center; margin-top: -16px;
}

.start-poetic-bar {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 3;
  display: flex; align-items: center; gap: 12px; pointer-events: none; opacity: 0.8;
}
.poetic-deco { width: 6px; height: 1px; background: #C4A56A; opacity: 0.55; position: relative; }
.poetic-deco::after { content: ''; position: absolute; top: -3px; left: -2px; width: 2px; height: 7px; background: #C4A56A; opacity: 0.55; }
.poetic-text { font-family: 'Noto Serif SC', serif; font-weight: 300; font-size: 13px; color: #3D2B1F; letter-spacing: 0.28em; }

/* start-options-modal 保留原样式 */
.start-form .start-opt-label { margin-top: 1.05rem; margin-bottom: 0.35rem; }

.start-options-panel .start-opt-label {
  display: block;
  text-align: left;
  color: var(--gold-dark);
  font-size: 0.95rem;
  margin: 1rem 0 0.35rem;
  letter-spacing: 0.12em;
}

.start-form .start-check,
.start-options-panel .start-check {
  justify-content: flex-start;
  margin-top: 0.15rem;
  text-align: left;
}

.start-radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 0.2rem;
}

.start-radio {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--ink);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.start-radio input {
  width: auto;
  padding: 0;
  accent-color: var(--gold-dark);
}

.start-opt-hint {
  text-align: left;
  color: var(--text-dim);
  font-size: 0.78rem;
  line-height: 1.45;
  margin: 0.45rem 0 1rem;
  letter-spacing: 0.04em;
}

/* ===== 按钮 ===== */
.btn {
  font-family: var(--font-ui);
  padding: 0.82rem 1.9rem;
  border: 1px solid var(--line-gold);
  background: linear-gradient(180deg, #f8f1e2, #efe3cc);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
  font-size: 1.08rem;
  border-radius: 2px;
  letter-spacing: 0.14em;
  box-shadow: inset 0 1px 0 rgba(255, 252, 245, 0.7);
}

.btn:hover {
  border-color: var(--gold);
  background: linear-gradient(180deg, #fbf4e4, #ead9b4);
  box-shadow: 0 3px 12px rgba(70, 52, 36, 0.1);
}

.btn-primary {
  border-color: var(--gold);
  color: #6e5424;
  background: linear-gradient(180deg, #f6edcf, #e6d3a4);
}
.btn-secondary { opacity: 0.94; }
.btn-small { padding: 0.48rem 1.05rem; font-size: 0.95rem; }
.btn-block { width: 100%; margin-bottom: 0.5rem; }
.btn-back {
  background: linear-gradient(180deg, #f8f1e2, #efe3cc);
  border-color: var(--line-gold);
}
.btn-danger { border-color: var(--seal); color: var(--seal); }
.btn-icon {
  background: linear-gradient(180deg, #f8f1e2, #efe3cc);
  border: 1px solid var(--line-gold);
  color: var(--text-dim);
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  font-size: 1.05rem;
  min-width: 2.2rem;
  border-radius: 2px;
  font-family: var(--font-ui);
}

/* ===== 顶栏 ===== */
.status-line {
  position: absolute;
  top: 0.6rem;
  left: 1rem;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.42rem 0.9rem;
  background: rgba(245, 237, 224, 0.88);
  border: 1px solid var(--line-gold);
  box-shadow:
    inset 0 0 0 1px rgba(255, 251, 242, 0.6),
    0 4px 14px rgba(70, 52, 36, 0.1);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  color: var(--text);
  letter-spacing: 0.06em;
  flex-wrap: wrap;
  max-width: calc(100vw - 11rem);
}

.status-sep {
  color: var(--gold-dark);
  opacity: 0.6;
}

.status-line .era-badge,
.status-line .date-badge,
.status-line .time-badge {
  padding: 0;
  background: none;
  border: none;
  font-size: inherit;
  color: inherit;
}

.status-line .stat-item {
  font-size: inherit;
  color: var(--text-dim);
}

.status-line .stat-item b {
  color: var(--ink);
  font-weight: 600;
}

.status-next-btn {
  margin-left: 0.4rem;
  padding: 0.32rem 0.85rem;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
}

.float-buttons {
  position: absolute;
  top: 0.6rem;
  right: 1rem;
  z-index: 200;
  display: flex;
  gap: 0.4rem;
  padding: 0.42rem 0.6rem;
  background: rgba(245, 237, 224, 0.88);
  border: 1px solid var(--line-gold);
  box-shadow:
    inset 0 0 0 1px rgba(255, 251, 242, 0.6),
    0 4px 14px rgba(70, 52, 36, 0.1);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.float-buttons .btn-icon {
  background: linear-gradient(180deg, rgba(255, 251, 242, 0.6), rgba(240, 228, 206, 0.55));
}

@media (max-width: 768px) {
  .status-line {
    font-size: 0.78rem;
    padding: 0.28rem 0.55rem;
    gap: 0.3rem;
    max-width: calc(100vw - 7rem);
    line-height: 1.4;
  }
  .status-line .stat-item { font-size: 0.78rem; }
  .status-sep { font-size: 0.7rem; }
  .float-buttons {
    padding: 0.25rem 0.4rem;
    gap: 0.18rem;
    top: 0.5rem;
    right: 0.55rem;
  }
  .float-buttons .btn-icon {
    padding: 0.42rem 0.55rem;
    min-width: 2.1rem;
    min-height: 2.1rem;
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .float-buttons {
    flex-wrap: wrap;
    max-width: 32vw;
    justify-content: flex-end;
  }
  .float-buttons .btn-icon {
    padding: 0.32rem 0.45rem;
    min-width: 1.85rem;
    min-height: 1.85rem;
    font-size: 0.88rem;
  }
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.62rem 1.6rem;
  background: linear-gradient(180deg, #f7f0e2, #efe4d0);
  border-bottom: 1px solid var(--line-gold);
  box-shadow: inset 0 -1px 0 rgba(255, 250, 240, 0.55);
  flex-shrink: 0;
  flex-wrap: nowrap;
  gap: 1rem;
}

.top-left, .top-right { display: flex; align-items: center; gap: 1.05rem; }

.era-badge, .date-badge, .time-badge {
  padding: 0.12rem 0.35rem;
  background: transparent;
  border: none;
  font-size: 0.98rem;
  color: var(--text-dim);
  font-family: var(--font-ui);
  letter-spacing: 0.06em;
}

.date-badge.month-flash {
  animation: dateFlash 1.2s ease;
}

@keyframes dateFlash {
  0%, 100% { color: inherit; box-shadow: none; border-color: var(--gold-dark); }
  28% { color: var(--gold-light); border-color: var(--gold); box-shadow: 0 0 14px rgba(201, 162, 39, 0.45); }
}

.empress-title {
  font-family: var(--font-title);
  font-size: 1.55rem;
  color: var(--ink);
  letter-spacing: 0.22em;
  white-space: nowrap;
  font-weight: 600;
}

.stat-item { font-size: 0.98rem; color: var(--text-dim); font-family: var(--font-ui); }
.stat-item b { color: var(--ink); font-weight: 600; }

/* ===== 主区域 ===== */
.main-area {
  flex: 1;
  overflow: hidden;
  display: flex;
  position: relative;
}

.view { display: none; width: 100%; height: 100%; }
.view.active { display: flex; }

/* ===== 地点场景 ===== */
#location-view {
  position: relative;
  align-items: stretch;
  justify-content: stretch;
}

.location-scene-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.location-scene-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20,15,10,0.0) 40%, rgba(20,15,10,0.35) 100%);
  pointer-events: none;
}

.location-scene-veil::before {
  content: none;
}

/* 底部按钮容器 */
.location-bottom-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 1.2rem 1.5rem calc(1.2rem + env(safe-area-inset-bottom));
  pointer-events: none;
}

.location-bottom-bar > * {
  pointer-events: auto;
}

/* 浮动按钮通用样式 */
.location-float-btn {
  padding: 0.65rem 1.3rem;
  background: rgba(247, 241, 230, 0.94);
  border: 1px solid #c4aa72;
  color: var(--ink);
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 0.98rem;
  letter-spacing: 0.12em;
  border-radius: 8px;
  box-shadow: 0 3px 12px rgba(70, 52, 36, 0.18);
  transition: all 0.2s;
  white-space: nowrap;
  backdrop-filter: blur(4px);
}

.location-float-btn:hover {
  background: rgba(251, 244, 228, 0.98);
  border-color: var(--gold);
  box-shadow: 0 4px 14px rgba(70, 52, 36, 0.25);
  transform: translateY(-1px);
}

.location-float-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* 左下返回按钮 */
.location-back-btn {
  /* 位置由 location-bottom-bar 的 flex 布局决定 */
}

/* 右下交互按钮组 */
.location-actions-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: flex-end;
  max-width: 75%;
}

.location-actions-group .location-float-btn {
  padding: 0.65rem 1.4rem;
  font-size: 1rem;
}

/* 人物一览弹层 */
.location-roster-popup {
  position: absolute;
  z-index: 50;
  bottom: 5rem;
  right: 1.5rem;
  width: min(560px, 90vw);
  max-height: 70vh;
  max-height: 70dvh;
  background: linear-gradient(180deg, rgba(255,252,247,0.98), rgba(245,237,224,0.98));
  border: 1px solid #c4aa72;
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(72, 52, 30, 0.28);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.location-roster-popup.hidden {
  display: none;
}

.roster-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.1rem;
  background: rgba(196, 170, 114, 0.15);
  border-bottom: 1px solid rgba(196, 170, 114, 0.35);
}

.roster-popup-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-family: var(--font-title);
  color: var(--ink);
  letter-spacing: 0.15em;
}

.btn-close-x {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-dim);
  line-height: 1;
  padding: 0 0.3rem;
}

.btn-close-x:hover {
  color: var(--ink);
}

.location-roster-body {
  padding: 1rem 1.1rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.folk-grid {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: repeat(auto-fill, minmax(6.8rem, 1fr));
  gap: 0.5rem;
  text-align: left;
}

.folk-grid.ward-grid {
  grid-template-columns: repeat(auto-fill, minmax(6.2rem, 1fr));
  gap: 0.45rem;
}

.roster-toggle-wrap {
  width: 100%;
  margin: 0.5rem 0;
}
.roster-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.55rem 0.85rem;
  background: linear-gradient(180deg, #fbf4e4, #f4e8cf);
  border: 1px solid #c9a860;
  border-radius: 4px;
  color: #6b4a1f;
  font: inherit;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(120, 90, 40, 0.12);
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.roster-toggle-btn:hover {
  background: linear-gradient(180deg, #fffaf0, #faf0d8);
  border-color: #a97f38;
  box-shadow: 0 2px 8px rgba(169, 127, 56, 0.28);
}
.roster-toggle-btn .roster-toggle-icon { font-size: 1rem; }
.roster-toggle-btn .roster-toggle-label { flex: 1; text-align: left; }
.roster-toggle-btn .roster-toggle-count { opacity: 0.7; font-size: 0.85rem; }
.roster-toggle-btn .roster-toggle-arrow { font-size: 0.7rem; transition: transform 0.2s; color: #a97f38; }
.roster-toggle-btn.expanded .roster-toggle-arrow { transform: rotate(90deg); }
.roster-panel {
  width: 100%;
  margin-top: 0.4rem;
  padding-top: 0.3rem;
  border-top: 1px dashed rgba(201, 168, 96, 0.55);
}
.roster-panel.roster-hidden { display: none; }

.ward-hint {
  margin: 0 0 0.75rem;
  color: var(--text-dim);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-align: center;
}

.folk-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  padding: 0.3rem;
  background: var(--bg-card);
  border: 1px solid var(--gold-dark);
  color: inherit;
  font: inherit;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.folk-card:hover {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(201, 162, 39, 0.25);
}

.folk-card-img {
  width: 100%;
  min-width: 0;
  height: 7.5rem;
  margin-bottom: 0.3rem;
  border: 1px solid var(--line);
  overflow: hidden;
  background: #efe8dc;
}

.folk-card .portrait-stack,
.folk-card .portrait-fg,
.folk-card .portrait-bg,
.folk-card img {
  min-width: 0;
  max-width: 100%;
}

.folk-card .portrait-fg {
  object-fit: contain;
  object-position: center top;
  filter: drop-shadow(0 2px 6px rgba(70, 52, 36, 0.1));
}

.ward-grid .folk-card-img {
  height: 6.5rem;
}

.folk-card-name {
  color: var(--ink);
  font-family: var(--font-title);
  font-size: 0.96rem;
  letter-spacing: 0.04em;
}

.folk-card-sub {
  color: var(--text-dim);
  font-size: 0.78rem;
  margin-top: 0.1rem;
}

.folk-card-meta {
  color: var(--gold-dark);
  font-size: 0.72rem;
  margin-top: 0.12rem;
  line-height: 1.3;
}

/* ===== 地图 ===== */
#map-view { flex-direction: row; }

.map-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #e6dcc8;
}

/* 参考框：回纹角饰 + 竹山云，中间镂空露出舆图/场景 */
.ui-frame-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  z-index: 5;
  mix-blend-mode: multiply;
  opacity: 0.92;
  -webkit-mask-image: radial-gradient(ellipse 90% 85% at 50% 50%, transparent 90%, rgba(0, 0, 0, 0.4) 96%, #000 100%);
  mask-image: radial-gradient(ellipse 90% 85% at 50% 50%, transparent 90%, rgba(0, 0, 0, 0.4) 96%, #000 100%);
}

#location-view .ui-frame-overlay {
  z-index: 2;
  opacity: 0.88;
}

.map-exit-back {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  z-index: 8;
}

.palace-scene {
  position: absolute;
  inset: 0;
}

.palace-scene-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  pointer-events: none;
  filter: saturate(0.95) brightness(1.04) contrast(1.0);
}

.palace-hotspots {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 4;
}

.map-node {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 5.8rem;
  padding: 0.44rem 0.8rem 0.48rem;
  background: linear-gradient(180deg, rgba(250, 243, 228, 0.94), rgba(240, 228, 206, 0.92));
  border: 1px solid var(--line-gold);
  border-radius: 2px;
  cursor: pointer;
  text-align: center;
  font: inherit;
  color: inherit;
  box-shadow:
    inset 0 0 0 1px rgba(255, 251, 242, 0.7),
    0 2px 8px rgba(70, 52, 36, 0.12);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  z-index: 3;
  line-height: 1.2;
}

.map-node:hover {
  background: linear-gradient(180deg, #fff8ea, #ead9b4);
  border-color: var(--gold);
  box-shadow:
    inset 0 0 0 1px rgba(255, 251, 242, 0.8),
    0 6px 16px rgba(70, 52, 36, 0.16);
  z-index: 9;
}

.map-node.current {
  background: linear-gradient(180deg, #f8efe0, #f0ddd0);
  border-color: var(--seal);
  box-shadow:
    inset 0 0 0 1px rgba(154, 64, 56, 0.18),
    0 0 0 1px var(--seal);
  z-index: 10;
}

.map-node .node-name {
  display: block;
  color: var(--ink);
  font-size: 0.96rem;
  letter-spacing: 0.08em;
  white-space: nowrap;
  font-family: var(--font-title);
  font-weight: 600;
}

.map-node.zone-center { border-width: 1px; }
.map-node.zone-hougong { border-color: #c9b48a; }
.map-node.zone-hougong.current { border-color: var(--seal); }
.map-node.zone-court { border-color: #c9b48a; }
.map-node.zone-court.current { border-color: var(--seal); }
.map-node.zone-city { border-color: #c9b48a; }
.map-node.zone-city.current { border-color: var(--seal); }

.sidebar-hint .hint-text {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-style: italic;
  line-height: 1.6;
  text-align: center;
  padding: 1rem 0;
}

.map-sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--bg-panel);
  border-left: 2px solid var(--gold-dark);
  padding: 1rem;
  overflow-y: auto;
}

.sidebar-panel {
  margin-bottom: 1.2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(201, 162, 39, 0.2);
}

.sidebar-panel h3 {
  font-size: 0.9rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
  letter-spacing: 0.1em;
}

.sidebar-panel p, .desc-text {
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--text-dim);
}

.action-list { display: flex; flex-direction: column; gap: 0.78rem; }

.action-btn {
  padding: 0.92rem 1.25rem;
  background: linear-gradient(180deg, #f8f1e2, #efe3cc);
  border: 1px solid var(--line-gold);
  color: var(--ink);
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 1.12rem;
  text-align: left;
  letter-spacing: 0.12em;
  border-radius: 2px;
  box-shadow: inset 0 1px 0 rgba(255, 252, 245, 0.65);
  transition: all 0.2s;
}

.action-btn:hover {
  background: linear-gradient(180deg, #fbf4e4, #ead9b4);
  border-color: var(--gold);
}

.action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ministry-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

/* 早朝六部在 location-actions-group 中也保持 grid 布局 */
#location-actions-group.ministry-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  max-width: none;
}
#location-actions-group.ministry-grid .location-float-btn {
  /* 早朝时 location-float-btn 不参与 ministry-grid（ministry-card 是独立的） */
}

/* 人物一览弹层分组标题 */
.roster-section {
  margin-bottom: 1rem;
}
.roster-section-title {
  font-family: var(--font-title);
  font-size: 0.98rem;
  color: var(--gold);
  letter-spacing: 0.12em;
  margin-bottom: 0.55rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(196, 170, 114, 0.3);
}

.ministry-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.15rem 0.9rem 1rem;
  background: linear-gradient(180deg, #f8f1e2, #efe3cc);
  border: 1px solid var(--line-gold);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 1.02rem;
  text-align: center;
}

.ministry-card b {
  color: var(--ink);
  letter-spacing: 0.18em;
  font-size: 1.38rem;
  font-family: var(--font-title);
  font-weight: 600;
}

.ministry-card span,
.ministry-card em {
  font-style: normal;
  font-size: 0.98rem;
  color: var(--text-dim);
}

.ministry-card:hover { border-color: var(--gold); background: #fffdf8; }

#court-desk-view {
  flex-direction: column;
  align-items: stretch;
  padding: 1rem 1.4rem 1.4rem;
  overflow-y: auto;
}

#court-desk-view .consort-list-header {
  flex-shrink: 0;
}

#court-desk-view .consort-list-header h2 {
  color: var(--gold-dark);
}

#court-desk-view .select-hint {
  flex-shrink: 0;
  max-width: 52rem;
  color: #6a5a48;
}

#court-desk-body {
  flex: 1 1 auto;
  min-width: 0;
}

.realm-list,
.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.7rem;
}

.realm-card,
.works-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.85rem 0.9rem;
  background: rgba(20, 10, 22, 0.78);
  border: 1px solid var(--gold-dark);
  color: var(--text);
  text-align: left;
  font-family: var(--font-body);
}

.realm-card { cursor: pointer; }
.realm-card:hover,
.works-card:hover { border-color: var(--gold); }

.realm-card b,
.works-card b,
.royal-row b { color: var(--gold-light); letter-spacing: 0.08em; }

.realm-card span,
.realm-card em,
.works-card span,
.royal-row span {
  font-style: normal;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.works-card.built { border-color: var(--gold); opacity: 0.92; }

.audience-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.7rem;
}

/* ===================== 宫中赐宴 · Figma 风格 ===================== */

/* -- 外层 court-desk-view 在 feast 模式下的覆盖 -- */
#court-desk-view.feast-mode {
  background: #F7F1E8;
}
#court-desk-view.feast-mode .consort-list-header {
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #D8C7A8;
}
#court-desk-view.feast-mode .consort-list-header h2 {
  font-size: 2rem;
  font-weight: 600;
  color: #8C3E31;
  letter-spacing: 0.05em;
}
#court-desk-view.feast-mode .select-hint {
  color: #8B7764;
  font-size: 0.95rem;
  padding: 0.3rem 0 0;
  margin: 0;
}

/* -- Body 主体容器 -- */
.feast-desk {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 0.5rem;
}

/* -- 副标题行 -- */
.feast-subtitle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
}
.feast-subtitle-row .feast-subtitle {
  font-size: 0.9rem;
  color: #B79A63;
  font-weight: 400;
}

/* -- Tab 栏（宴席类型切换） -- */
.feast-kinds {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 0.75rem 0;
}
.feast-kinds .btn {
  min-height: 2.1rem;
  padding: 0.35rem 1rem;
  font-size: 1.1rem;
  font-weight: 400;
  background: #FBF8F1;
  color: #6B4A33;
  border: 1px solid #D8C7A8;
  border-radius: 3px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  letter-spacing: 0.02em;
}
.feast-kinds .btn:hover {
  background: #FFFDF6;
  border-color: #B79A63;
}
.feast-kinds .btn.btn-primary {
  background: #FBF8F1;
  border-color: #B79A63;
  border-width: 1px;
  color: #8C3E31;
  box-shadow: inset 0 0 0 1px rgba(183, 154, 99, 0.15);
}
.feast-kinds .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* -- Banner 背景区（宴饮图 + 渐变遮罩） -- */
.feast-banner {
  position: relative;
  height: 8rem;
  min-height: 140px;
  border: 1px solid #D8C7A8;
  border-radius: 3px;
  background-image: url('../assets/portraits/ciyan/02_大殿夜宴高俯视.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
  margin-bottom: 1rem;
}
/* 按宴席类型切换不同宴饮图 */
.feast-banner[data-kind="flower"]   { background-image: url('../assets/portraits/ciyan/07_男妃宴席近景.jpg'); }
.feast-banner[data-kind="opera"]    { background-image: url('../assets/portraits/ciyan/07_殿内乐舞表演.jpg'); }
.feast-banner[data-kind="clan"]     { background-image: url('../assets/portraits/ciyan/08_女臣宴席近景.jpg'); }
.feast-banner[data-kind="grand"]    { background-image: url('../assets/portraits/ciyan/02_大殿夜宴高俯视.jpg'); }
.feast-banner[data-kind="festival"] { background-image: url('../assets/portraits/ciyan/02_大殿夜宴高俯视.jpg'); }
.feast-banner[data-kind="zhuazhou"] { background-image: url('../assets/portraits/ciyan/08_御膳酒器特写.jpg'); }
/* 左深右浅的渐变遮罩，保证右侧白色文字可读 */
.feast-banner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    linear-gradient(90deg,
      rgba(247,241,232,0.78) 0%,
      rgba(247,241,232,0.55) 35%,
      rgba(247,241,232,0.25) 65%,
      rgba(247,241,232,0.12) 100%);
  pointer-events: none;
}
.feast-banner-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1rem 1.4rem;
  height: 100%;
  max-width: 55%;
}
.feast-banner-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #8C3E31;
  margin-bottom: 0.3rem;
  letter-spacing: 0.05em;
}
.feast-banner-desc {
  font-size: 0.9rem;
  color: #6B4A33;
  line-height: 1.6;
  font-weight: 400;
}

/* -- 主体区：两栏布局 -- */
.feast-main {
  display: flex;
  flex-direction: row;
  gap: 1.25rem;
}

/* -- 左栏/信息卡 -- */
.feast-info-card {
  flex: 0 0 20rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.2rem 1.4rem;
  background: #FBF8F1;
  border: 1px solid #D8C7A8;
  border-radius: 3px;
}
.feast-info-card-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: #6B4A33;
  letter-spacing: 0.04em;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #D8C7A8;
  position: relative;
}
.feast-info-card-title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 1rem;
  width: 3rem;
  height: 2px;
  background: #B79A63;
}
.feast-info-card-sub {
  font-size: 0.88rem;
  color: #8B7764;
  line-height: 1.5;
}
.feast-info-card-hint {
  font-size: 0.95rem;
  color: #8C3E31;
  font-weight: 500;
  padding-top: 0.3rem;
}
.feast-info-card-meta {
  font-size: 0.82rem;
  color: #8B7764;
  padding-top: 0.3rem;
  border-top: 1px solid #D8C7A8;
  line-height: 1.5;
}

/* -- 自动参会分组列表 -- */
.feast-auto-summary {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.feast-role-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.feast-role-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.feast-role-label {
  font-size: 1.1rem;
  font-weight: 600;
  color: #6B4A33;
}
.feast-role-count {
  font-size: 1.3rem;
  font-weight: 600;
  color: #8C3E31;
}
.feast-role-desc {
  font-size: 0.82rem;
  color: #8B7764;
}
.feast-role-names {
  font-size: 0.95rem;
  color: #6B4A33;
  line-height: 1.6;
}
.feast-role-more {
  font-size: 0.82rem;
  color: #8B7764;
}

/* -- 右栏/选人卡片区 -- */
.feast-guest-panel {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.2rem 1.4rem;
  background: #FBF8F1;
  border: 1px solid #D8C7A8;
  border-radius: 3px;
}
.feast-guest-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #D8C7A8;
}
.feast-guest-panel-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #6B4A33;
}
.feast-guest-panel-count {
  font-size: 0.95rem;
  font-weight: 600;
  color: #8C3E31;
}

/* -- 选人网格 -- */
.feast-guest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.65rem;
  overflow-y: auto;
  padding-right: 0.2rem;
}

/* -- 选人卡片（含立绘头像） -- */
.feast-guest {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 0.85rem;
  background: #FBF8F1;
  border: 1px solid #D8C7A8;
  border-radius: 3px;
  color: var(--ink);
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
  text-align: left;
}
.feast-guest:hover {
  background: #FFFDF6;
  border-color: #B79A63;
}
.feast-guest .feast-guest-avatar {
  width: 3.2rem;
  height: 3.2rem;
  min-width: 3.2rem;
  border-radius: 50%;
  border: 1px solid #B79A63;
  overflow: hidden;
  position: relative;
  background: #F5EDE0;
}
.feast-guest .feast-guest-avatar .portrait-stack,
.feast-guest .feast-guest-avatar img,
.feast-guest .feast-guest-avatar .portrait-fg {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  position: absolute;
  top: 0; left: 0;
}
.feast-guest .feast-guest-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.feast-guest b {
  font-size: 1rem;
  color: #8C3E31;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.feast-guest span {
  font-size: 0.78rem;
  color: #8B7764;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.feast-guest .feast-guest-check {
  width: 1.3rem;
  height: 1.3rem;
  min-width: 1.3rem;
  border-radius: 2px;
  background: #FBF8F1;
  border: 1px solid #8C3E31;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #8C3E31;
  transition: background 0.18s, color 0.18s;
}
.feast-guest.is-on {
  border-color: #B79A63;
  background: #FBF5E6;
  box-shadow: inset 0 0 0 1px rgba(183, 154, 99, 0.2);
}
.feast-guest.is-on .feast-guest-check {
  background: #8C3E31;
  color: #FFFAED;
}

/* -- 开宴按钮区 -- */
.feast-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem 0 0.5rem;
  border-top: 1px solid #D8C7A8;
  margin-top: 1rem;
}
.feast-footer .feast-go-btn {
  min-width: 14rem;
  height: 3.6rem;
  padding: 0.6rem 2.5rem;
  background: #8C3E31;
  border: 1px solid #B79A63;
  border-radius: 3px;
  color: #FFFAED;
  font-size: 1.3rem;
  font-weight: 400;
  font-family: var(--font-body);
  letter-spacing: 0.3em;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(107, 74, 51, 0.18);
}
.feast-footer .feast-go-btn:hover {
  background: #9E4A3A;
  box-shadow: 0 6px 16px rgba(107, 74, 51, 0.25);
}
.feast-footer .feast-effect-hint {
  font-size: 0.82rem;
  color: #8B7764;
  text-align: center;
  line-height: 1.6;
}

/* -- 抓周宴皇嗣选择卡 -- */
.feast-heir-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 0.5rem 0;
}
.feast-heir-card {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.7rem 0.9rem;
  background: #FBF8F1;
  border: 1px solid #D8C7A8;
  border-radius: 3px;
  color: #6B4A33;
  font-family: var(--font-body);
  cursor: pointer;
  text-align: left;
  min-width: 13rem;
  transition: border-color 0.18s, background 0.18s;
}
.feast-heir-card:hover {
  border-color: #B79A63;
  background: #FFFDF6;
}
.feast-heir-card b {
  font-size: 1rem;
  color: #8C3E31;
  font-weight: 600;
}
.feast-heir-card span {
  font-size: 0.8rem;
  color: #8B7764;
}

/* -- 移动端响应式 -- */
@media (max-width: 640px) {
  .feast-main {
    flex-direction: column;
    gap: 0.8rem;
  }
  .feast-info-card {
    flex: 1 1 auto;
  }
  .feast-banner {
    height: auto;
    min-height: 6rem;
  }
  .feast-banner-content {
    max-width: 100%;
    padding: 0.8rem 1rem;
  }
  .feast-banner-title { font-size: 1.05rem; }
  .feast-banner-desc { font-size: 0.82rem; }
  .feast-kinds {
    gap: 0.4rem;
    padding: 0.5rem 0;
  }
  .feast-kinds .btn {
    min-height: 1.8rem;
    padding: 0.3rem 0.7rem;
    font-size: 0.95rem;
  }
  .feast-guest-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .feast-guest .feast-guest-avatar {
    width: 2.6rem;
    height: 2.6rem;
    min-width: 2.6rem;
  }
  #court-desk-view.feast-mode .consort-list-header h2 {
    font-size: 1.5rem;
  }
  .feast-footer .feast-go-btn {
    min-width: 10rem;
    height: 3rem;
    font-size: 1.1rem;
  }
}

/* ===================== 宴席对话气泡层 ===================== */
#feast-bubble-layer {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 95;
  overflow: hidden;
}
#feast-bubble-layer.is-active { pointer-events: none; }

.feast-bubble {
  position: fixed;
  max-width: 260px;
  padding: 0.5rem 0.7rem 0.55rem;
  background: linear-gradient(180deg, rgba(255,248,232,0.97), rgba(245,235,212,0.97));
  border: 1px solid rgba(184, 146, 76, 0.55);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(80, 55, 20, 0.18), inset 0 0 0 1px rgba(255,255,255,0.35);
  backdrop-filter: blur(2px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  line-height: 1.45;
}
.feast-bubble-speaker {
  font-size: 0.72rem;
  color: var(--gold-dark, #7a571e);
  font-weight: 600;
  margin-bottom: 0.18rem;
  opacity: 0.9;
}
.feast-bubble-text {
  font-size: 0.88rem;
  color: #3a2a12;
  font-family: var(--font-body, serif);
  word-break: break-all;
}

/* 移动端气泡适配 */
@media (max-width: 640px) {
  .feast-bubble {
    max-width: 200px;
    padding: 0.42rem 0.55rem;
  }
  .feast-bubble-speaker { font-size: 0.65rem; }
  .feast-bubble-text { font-size: 0.78rem; }
}

.nation-desk { display: flex; flex-direction: column; gap: 0.85rem; }

.nation-desk-acts { display: flex; flex-wrap: wrap; gap: 0.45rem; }

.nation-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.nation-group,
.nation-fu-wrap {
  background: linear-gradient(180deg, #faf4e6, #efe4cc);
  border: 1px solid #c4aa72;
  box-shadow: inset 0 0 0 1px rgba(255, 251, 242, 0.55);
  padding: 0.75rem 0.9rem 0.85rem;
}

.nation-group h3,
.nation-fu-wrap h3 {
  font-family: var(--font-title);
  font-size: 0.92rem;
  color: var(--gold-dark);
  letter-spacing: 0.12em;
  margin: 0 0 0.45rem;
  font-weight: 600;
}

.nation-group .nation-stat {
  padding: 0.35rem 0;
  background: none;
  border: none;
  border-bottom: 1px dashed rgba(138, 107, 56, 0.18);
}

.nation-group .nation-stat:last-child { border-bottom: none; }

.nation-note {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.6;
}

.nation-sub {
  display: block;
  font-style: normal;
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
}

.nation-fu-scroll { max-height: min(42vh, 420px); }

.nation-fu-table { font-size: 0.88rem; }

.nation-fu-table th,
.nation-fu-table td {
  padding: 0.38rem 0.55rem;
  white-space: nowrap;
}

.nation-fu-table tbody tr { cursor: pointer; }
.nation-fu-table tbody tr:hover { background: #fff8ea; }
.nation-fu-table tr.is-uneasy td { color: var(--seal); }
.nation-fu-table tr.is-rich td:first-child { color: var(--gold-dark); }

.home-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(240px, 28vw);
  gap: 0.85rem;
  align-items: stretch;
  padding: 0.2rem 0 0.8rem;
}

.home-map-stage {
  position: relative;
  min-height: min(640px, 68vh);
  height: min(640px, 68vh);
  background:
    radial-gradient(ellipse at 58% 40%, rgba(201, 162, 39, 0.08), transparent 42%),
    linear-gradient(180deg, #f6efe0, #ebe1cc);
  border: 1px solid var(--line-gold);
  box-shadow: inset 0 0 0 1px rgba(232, 197, 71, 0.16);
  overflow: hidden;
}

.home-map-geo {
  position: absolute;
  inset: 4% 2% 10% 2%;
  width: 96%;
  height: 86%;
  pointer-events: none;
}

.home-land {
  fill: #dcc8a0;
  stroke: #8a6b38;
  stroke-width: 0.7;
}

.home-isle {
  fill: #e4d3b0;
  stroke: #b8924c;
  stroke-width: 0.4;
}

.home-river {
  fill: none;
  stroke: #6a8a96;
  stroke-width: 0.7;
  opacity: 0.7;
}

.home-pins { position: absolute; inset: 0; }

.home-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 0;
  padding: 0.08rem 0.38rem 0.12rem;
  background: rgba(255, 250, 240, 0.94);
  border: 1px solid var(--line-gold);
  color: var(--ink);
  font-family: var(--font-body);
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(138, 107, 56, 0.16);
  z-index: 1;
}

.home-pin b {
  display: block;
  font-size: 0.78rem;
  color: var(--ink);
  letter-spacing: 0.06em;
  font-weight: 600;
}

.home-pin.is-rich { border-color: #b8924c; background: #fff6de; }
.home-pin.is-uneasy { border-color: #9a4038; color: var(--seal); }
.home-pin.is-uneasy b { color: var(--seal); }
.home-pin.is-hot,
.home-pin:hover,
.home-pin:focus {
  z-index: 4;
  border-color: var(--gold);
  outline: none;
  box-shadow: 0 0 0 2px rgba(184, 146, 76, 0.22);
}

.home-tip {
  position: absolute;
  left: 0.7rem;
  right: 0.7rem;
  bottom: 0.55rem;
  padding: 0.28rem 0.55rem;
  background: rgba(255, 250, 240, 0.92);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.78rem;
  z-index: 2;
}

.home-tip b { color: var(--gold-dark); }

.home-legend {
  position: absolute;
  top: 0.55rem;
  right: 0.7rem;
  font-size: 0.72rem;
  color: var(--text-dim);
  z-index: 2;
}

.home-legend i {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin: 0 0.15rem 0 0.05rem;
  border: 1px solid var(--line-gold);
  background: #fffdf8;
  vertical-align: -0.05rem;
}

.home-legend i.is-rich { background: #fff6de; border-color: #b8924c; }
.home-legend i.is-uneasy { background: #fff4f0; border-color: #9a4038; }

.home-fu-rail {
  max-height: min(640px, 68vh);
  overflow-y: auto;
  padding: 0.15rem 0.15rem 0.4rem;
}

.home-fu-prov { margin: 0 0 0.7rem; }

.home-fu-prov b {
  display: block;
  font-size: 0.75rem;
  color: var(--gold-dark);
  letter-spacing: 0.12em;
  margin-bottom: 0.25rem;
}

.home-fu-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  width: 100%;
  gap: 0.4rem;
  padding: 0.22rem 0.3rem;
  margin: 0 0 0.15rem;
  background: linear-gradient(180deg, #f8f1e2, #f0e6d2);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--font-body);
  cursor: pointer;
  text-align: left;
}

.home-fu-item em { font-style: normal; font-size: 0.84rem; }
.home-fu-item span { font-size: 0.7rem; color: var(--text-dim); }
.home-fu-item.is-uneasy em { color: var(--seal); }
.home-fu-item.is-hot,
.home-fu-item:hover,
.home-fu-item:focus {
  border-color: var(--gold);
  background: #fff8ea;
  outline: none;
}

.fu-officers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

@media (max-width: 980px) {
  .nation-groups { grid-template-columns: 1fr; }
  .home-board { grid-template-columns: 1fr; }
  .home-map-stage,
  .home-fu-rail { height: auto; max-height: none; min-height: 420px; }
  .home-fu-rail { max-height: 280px; min-height: 0; }
}

@media (max-width: 768px) {
  .fu-officers { grid-template-columns: 1fr; }
}

.nation-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.55rem;
}

.nation-stat {
  padding: 0.7rem 0.8rem;
  background: linear-gradient(180deg, #f8f1e2, #f0e6d2);
  border: 1px solid var(--line-gold);
}

.nation-stat b {
  display: block;
  color: var(--gold-dark);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  margin-bottom: 0.2rem;
}

.nation-stat span { color: var(--text); font-size: 0.95rem; }

.nation-bar {
  display: block;
  height: 4px;
  margin-top: 0.4rem;
  background: rgba(184, 146, 76, 0.18);
}

.nation-bar em {
  display: block;
  height: 100%;
  background: var(--gold);
}

.royal-list { display: flex; flex-direction: column; gap: 0.65rem; }

.royal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0.9rem;
  background: rgba(20, 10, 22, 0.78);
  border: 1px solid var(--gold-dark);
  cursor: pointer;
}

.royal-face {
  width: 64px;
  height: 86px;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--gold-dark);
  background: rgba(0, 0, 0, 0.35);
}

.royal-face .portrait-stack,
.royal-face .portrait-frame {
  width: 100%;
  height: 100%;
}

.royal-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.royal-meta { flex: 1; min-width: 0; }

.foreign-royal-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
  width: 100%;
}

.royal-row p { margin-top: 0.25rem; font-size: 0.8rem; color: var(--text-dim); }

.royal-acts { display: flex; gap: 0.4rem; flex-shrink: 0; }

.world-wrap { padding: 0.4rem 0 1rem; }

.world-map {
  position: relative;
  width: min(920px, 96%);
  height: min(520px, 62vh);
  margin: 0 auto;
  background:
    radial-gradient(ellipse at 50% 48%, rgba(201, 162, 39, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(18, 28, 36, 0.92), rgba(12, 8, 16, 0.94));
  border: 1px solid var(--gold-dark);
  box-shadow: inset 0 0 0 1px rgba(232, 197, 71, 0.1);
}

.world-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 5.6rem;
  padding: 0.42rem 0.6rem;
  background: rgba(10, 6, 12, 0.82);
  border: 1px solid var(--gold-dark);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  cursor: pointer;
}

.world-pin b { display: block; font-size: 1.02rem; color: var(--gold-light); }
.world-pin span { font-size: 0.88rem; color: var(--text-dim); }
.world-pin:hover { border-color: var(--gold); }

@media (max-width: 768px) {
  .ministry-grid { grid-template-columns: 1fr 1fr; }
  .royal-row { flex-direction: column; align-items: flex-start; }
}

.sidebar-panel.hidden { display: none; }

#location-name {
  font-family: var(--font-title);
  color: var(--gold-light);
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  letter-spacing: 0.15em;
}

/* ===== 男妃名册 ===== */
#consort-view { flex-direction: column; padding: 1rem; overflow-y: auto; -webkit-overflow-scrolling: touch; }

.consort-list-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.consort-list-header h2 {
  font-family: var(--font-title);
  color: var(--gold-light);
  font-size: 1.6rem;
  flex: 1;
}

.consort-count { color: var(--text-dim); font-size: 0.9rem; display: none; }

.consort-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.ai-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.45rem 0 0.35rem;
}

.child-section-title {
  grid-column: 1 / -1;
  margin: 0.4rem 0 0;
  font-size: 0.95rem;
  color: var(--gold-light);
}

.consort-card {
  background: var(--bg-card);
  border: 1px solid var(--gold-dark);
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.consort-card:hover {
  border-color: var(--gold);
  transform: scale(1.02);
}

.consort-card-avatar {
  width: 80px;
  height: 80px;
  margin: 0 auto 0.6rem;
  border-radius: 50%;
  border: 2px solid var(--gold-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-family: var(--font-title);
}

.consort-card-name { color: var(--gold-light); font-size: 0.95rem; letter-spacing: 0.04em; }
.consort-card-rank { color: var(--text-dim); font-size: 0.8rem; margin: 0.2rem 0; }
.consort-card-palace { font-size: 0.75rem; color: var(--text-dim); margin-top: 0.25rem; }

.heir-table {
  font-size: 0.9rem;
  min-width: 920px;
}

.official-table tbody tr.heir-sick td:first-child {
  color: #a65d4a;
}

.official-table tbody tr.heir-pending td:first-child {
  color: var(--gold);
}

#child-view { flex-direction: column; padding: 1rem; overflow-y: auto; -webkit-overflow-scrolling: touch; }

#servant-view { flex-direction: column; padding: 1rem; overflow-y: auto; -webkit-overflow-scrolling: touch; }

#cold-view { flex-direction: column; padding: 1rem; overflow-y: auto; -webkit-overflow-scrolling: touch; }

#ties-view { flex-direction: column; padding: 1rem; overflow-y: auto; -webkit-overflow-scrolling: touch; }

#taihou-view { flex-direction: column; padding: 1rem; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2rem; }

#poetry-view {
  flex-direction: column;
  padding: 1rem;
  min-height: 0;
  padding-bottom: 1.5rem;
}
#poetry-view .consort-list-header {
  flex-shrink: 0;
  margin-bottom: 0.8rem;
}
#poetry-view .consort-list-header h2 {
  font-size: 1.4rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#poetry-view .consort-list-header .btn-back {
  flex-shrink: 0;
}
#poetry-view .poetry-step {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 0.25rem;
}

#poetry-collection-view {
  flex-direction: column;
  padding: 1rem;
  min-height: 0;
  padding-bottom: 1.5rem;
}
#poetry-collection-view .consort-list-header {
  flex-shrink: 0;
  margin-bottom: 0.8rem;
}
#poetry-collection-view .poetry-collection-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 0.25rem;
}

#heir-exam-view {
  flex-direction: column;
  padding: 1rem;
  min-height: 0;
  padding-bottom: 1.5rem;
}
#heir-exam-view .consort-list-header { flex-shrink: 0; margin-bottom: 0.8rem; }
#heir-exam-view .consort-list-header h2 { font-size: 1.4rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#heir-exam-view .consort-list-header .btn-back { flex-shrink: 0; }
#heir-exam-view .poetry-step {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-right: 0.25rem;
}

.table-scroll {
  overflow: auto;
  max-height: 68vh;
  -webkit-overflow-scrolling: touch;
}

#official-view {
  flex-direction: column;
  padding: 1rem;
  overflow: hidden;
  min-height: 0;
}

#official-view .consort-list-header {
  flex-shrink: 0;
}

#official-view .official-table-scroll {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y pan-x;
}

#official-view .official-table {
  min-width: 720px;
}

.servant-table {
  font-size: 0.78rem;
  min-width: 980px;
}

.yeting-servant-table {
  max-height: 38vh;
  margin-top: 0.6rem;
  width: 100%;
}

.official-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.02rem;
}

.official-table th,
.official-table td {
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid rgba(201, 162, 39, 0.18);
  text-align: left;
}

.official-table th {
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.08em;
}

.official-table tbody tr {
  cursor: pointer;
}

.official-table tbody tr:hover {
  background: rgba(176, 137, 72, 0.08);
}

.official-table tbody tr.row-idle td {
  opacity: 0.72;
  font-style: italic;
}
.official-table tbody tr.row-idle td:first-child {
  border-left: 3px solid var(--line-gold);
}

.official-table .kin-link {
  color: var(--ink);
}

#house-view {
  flex-direction: column;
  padding: 1rem;
  overflow-y: auto;
}

/* ========== 世家派系面板（浅底深字 + 行楷） ========== */
.house-faction-board {
  margin: 0 0 0.85rem;
  padding: 0.9rem 1rem 1rem;
  border: 1px solid #c8b48a;
  border-radius: 4px;
  background:
    linear-gradient(180deg, #fbf5e7, #f3ead4);
  box-shadow: 0 1px 3px rgba(100, 70, 30, 0.12), inset 0 0 0 1px rgba(200,180,138,0.2);
}

.house-faction-board-title {
  font-family: 'STKaiti', 'KaiTi', 'Kaiti SC', '楷体', 'Noto Serif SC', serif;
  color: #4a3418;
  font-size: 1.08rem;
  margin-bottom: 0.65rem;
  letter-spacing: 0.1em;
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  flex-wrap: wrap;
  border-bottom: 1px dashed #c8b48a;
  padding-bottom: 0.45rem;
}

.house-faction-board-tip {
  font-family: 'STKaiti', 'KaiTi', 'Kaiti SC', '楷体', serif;
  font-size: 0.78rem;
  color: #8a7348;
  letter-spacing: 0;
  font-weight: 400;
}

.house-faction-board-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
}

@media (max-width: 720px) {
  .house-faction-board-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.house-faction-card {
  display: block;
  width: 100%;
  text-align: left;
  cursor: pointer;
  padding: 0.65rem 0.7rem 0.6rem;
  border: 1px solid #c8b48a;
  border-left: 3px solid #b8925a;
  border-radius: 3px;
  background: #fefaf0;
  color: #3a2810;
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.house-faction-card:hover,
.house-faction-card.is-active {
  border-color: #a8823e;
  border-left-width: 4px;
  background: #fff7e2;
  box-shadow: 0 2px 6px rgba(150, 110, 40, 0.15);
}

.house-faction-qingliu { border-left-color: #4a7aa8; }
.house-faction-nengli { border-left-color: #b08948; }
.house-faction-wuxun { border-left-color: #a85a4a; }
.house-faction-fajia { border-left-color: #5a7a5a; }

.house-faction-name {
  font-family: 'STKaiti', 'KaiTi', 'Kaiti SC', '楷体', serif;
  font-size: 1rem;
  color: #3a2810;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.house-faction-power {
  font-family: 'STKaiti', 'KaiTi', 'Kaiti SC', '楷体', serif;
  font-size: 1.6rem;
  color: #6b4a1a;
  line-height: 1.2;
  margin: 0.15rem 0 0.1rem;
  font-weight: 700;
}

.house-faction-meta {
  font-size: 0.78rem;
  color: #8a7348;
  margin-bottom: 0.4rem;
  letter-spacing: 0.03em;
}

.house-faction-bar {
  height: 5px;
  background: #e8ddc2;
  border-radius: 2px;
  overflow: hidden;
}

.house-faction-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #c8a65c, #a87e2e);
  border-radius: 2px;
}

.house-faction-open {
  margin-top: 0.45rem;
  font-family: 'STKaiti', 'KaiTi', 'Kaiti SC', '楷体', serif;
  font-size: 0.78rem;
  color: #a87e2e;
  opacity: 0.9;
}

/* ===== 派系详情列表 ===== */
.house-faction-detail {
  margin: 0 0 0.9rem;
  padding: 0.75rem 0.9rem 0.9rem;
  border: 1px solid #c8b48a;
  border-radius: 4px;
  background: linear-gradient(180deg, #fefaf0, #f6ecd2);
  box-shadow: inset 0 0 0 1px rgba(200,180,138,0.3);
}

.house-faction-detail.hidden {
  display: none;
}

.house-faction-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
  border-bottom: 1px dashed #c8b48a;
  padding-bottom: 0.35rem;
}

.house-faction-detail-head h3 {
  margin: 0;
  font-family: 'STKaiti', 'KaiTi', 'Kaiti SC', '楷体', serif;
  color: #4a3418;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.house-faction-detail-hint {
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
  color: #6b4a1a;
  letter-spacing: 0.02em;
}

.house-faction-detail-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 16rem;
  overflow-y: auto;
}

.house-faction-row {
  display: grid;
  grid-template-columns: minmax(5rem, 0.9fr) minmax(0, 1.4fr) minmax(4rem, 0.8fr);
  gap: 0.5rem;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.6rem;
  border: 1px solid #d8c99a;
  border-radius: 3px;
  background: #fff8e6;
  color: #3a2810;
  font: inherit;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.house-faction-row:hover {
  border-color: #a8823e;
  background: #ffefc2;
}

.house-faction-row-name {
  font-family: 'STKaiti', 'KaiTi', 'Kaiti SC', '楷体', serif;
  color: #3a2810;
  letter-spacing: 0.06em;
  font-weight: 600;
  font-size: 0.95rem;
}

.house-faction-row-meta,
.house-faction-row-head {
  font-size: 0.82rem;
  color: #6b4a1a;
  letter-spacing: 0.02em;
}

.house-faction-row-head {
  font-family: 'STKaiti', 'KaiTi', 'Kaiti SC', '楷体', serif;
  color: #4a3418;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: right;
}

.house-actions {
  margin: 0.35rem 0 0.7rem;
}

@media (max-width: 640px) {
  .house-faction-row {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
  .house-faction-row-head {
    text-align: left;
  }
}

.house-sheet-panel {
  max-width: 42rem;
  max-height: 88vh;
  overflow-y: auto;
}

.house-section-title {
  margin: 1rem 0 0.4rem;
  font-family: var(--font-title);
  color: var(--gold-light);
  font-size: 1.05rem;
  font-weight: 600;
}

.house-members,
.house-kin-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}

.house-member-btn {
  text-align: left;
}

.house-kin-depend {
  opacity: 0.95;
  font-weight: 400;
}

#house-table tbody tr.house-declined td {
  color: var(--text-dim);
}

#house-table tbody tr.house-fallen td {
  color: var(--text-dim);
  opacity: 0.72;
  text-decoration: line-through;
  text-decoration-color: rgba(120, 90, 70, 0.45);
}

.official-panel {
  width: min(560px, 94vw);
  padding: 1.7rem 1.8rem 1.5rem;
  max-height: 86vh;
  overflow-y: auto;
}

.official-sheet-panel:not(.char-sheet) {
  width: min(900px, 96vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 1rem;
}

.char-sheet.official-sheet-panel {
  width: 100% !important;
  max-width: none;
  max-height: none;
  height: 100%;
  overflow: hidden;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
}

.official-sheet {
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.char-sheet .official-sheet.folk-layout {
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  padding-right: 0;
}

.official-sheet .folk-portrait {
  width: 168px;
  flex-shrink: 0;
}

.official-sheet .folk-portrait .portrait-frame {
  width: 168px;
  height: 236px;
  border: 1px solid var(--line-gold);
  box-shadow: inset 0 0 0 1px rgba(255, 251, 242, 0.55);
}

.char-sheet .official-sheet .folk-portrait {
  width: auto;
}

.char-sheet .official-sheet .folk-portrait .portrait-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  border: none;
  box-shadow: none;
  background: transparent;
}

.official-info {
  flex: 1;
  min-width: 0;
}

.char-sheet .official-info.folk-info {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.official-household {
  margin-top: 1rem;
  padding-top: 0.65rem;
  border-top: 1px dashed rgba(184, 146, 76, 0.35);
}

.house-block {
  margin-top: 0.75rem;
}

.house-block h4 {
  font-family: var(--font-title);
  font-size: 0.95rem;
  color: var(--ink);
  letter-spacing: 0.22em;
  margin: 0 0 0.45rem;
  font-weight: 600;
}

.house-mini-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.house-mini-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 108px;
  padding: 0.4rem 0.35rem 0.45rem;
  background: linear-gradient(180deg, #fbf6ea, #f0e6d2);
  border: 1px solid var(--line-gold);
  box-shadow: inset 0 0 0 1px rgba(255, 251, 242, 0.65);
  color: var(--text);
  cursor: pointer;
}

.house-mini-card:hover {
  border-color: var(--gold);
}

.house-mini-card em {
  font-style: normal;
  font-size: 0.72rem;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.25;
}

.house-mini-img,
.house-mini-card .portrait-stack {
  width: 72px;
  height: 96px;
  object-fit: cover;
}

.house-empty,
.house-kids {
  color: var(--text-dim);
  font-size: 0.88rem;
  margin: 0;
}

/* 府中恩爱总览 */
.love-mini-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 108px;
  padding: 0.4rem 0.35rem 0.45rem;
  background: linear-gradient(180deg, #fbf0f2, #f5e0e4);
  border: 1px solid rgba(200, 90, 120, 0.25);
  border-radius: 4px;
  color: var(--text);
}

.love-mini-card strong {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.25rem;
  text-align: center;
}

.love-mini-card em {
  font-style: normal;
  font-size: 0.72rem;
  text-align: center;
  margin-top: 0.15rem;
}

.love-bar {
  width: 92%;
  height: 6px;
  background: rgba(120, 80, 90, 0.15);
  border-radius: 3px;
  overflow: hidden;
}

.love-bar span {
  display: block;
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.house-mini-card small {
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
  text-align: center;
}

.folk-panel {
  width: min(920px, 96vw);
}

.folk-layout {
  display: flex;
  gap: 1.1rem;
  align-items: flex-start;
}

.folk-portrait {
  flex-shrink: 0;
  width: 220px;
}

.folk-portrait .portrait-frame {
  width: 220px;
  height: 310px;
}

.folk-info {
  flex: 1;
  min-width: 0;
}

.official-panel h3 {
  font-family: var(--font-title);
  color: var(--ink);
  font-size: 1.6rem;
  margin-bottom: 0.3rem;
  padding-right: 3.6rem;
}

.official-post {
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.official-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.9rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(184, 146, 76, 0.28);
  flex-shrink: 0;
}

.char-sheet .official-modal-actions {
  margin-top: 0.75rem;
}

.char-sheet .official-talk {
  margin-top: 0.75rem;
  flex-shrink: 0;
}

.char-sheet .official-talk .talk-log {
  height: 160px;
  max-height: 28vh;
}

/* ===== 模态框 · 浅纸折子 ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(0.6rem, env(safe-area-inset-top)) 0.75rem max(0.6rem, env(safe-area-inset-bottom));
  box-sizing: border-box;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal.hidden { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(62, 48, 32, 0.42);
  /* 不用 blur：部分 PC/核显会整层点不透或白屏 */
}

.modal-panel {
  position: relative;
  background:
    radial-gradient(ellipse at 18% 0%, rgba(255, 248, 232, 0.55), transparent 46%),
    var(--paper-fill),
    var(--paper);
  border: 1px solid var(--line-gold);
  box-shadow:
    inset 0 0 0 1px rgba(255, 251, 242, 0.7),
    inset 0 0 0 7px rgba(176, 137, 72, 0.11),
    var(--shadow);
  max-height: min(90vh, 90dvh);
  overflow-y: auto;
  margin: auto;
  flex-shrink: 0;
}

.modal-panel:not(.char-sheet)::before {
  content: '';
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(184, 146, 76, 0.3);
  pointer-events: none;
}

.modal-close {
  position: absolute;
  top: 0.85rem;
  right: 1rem;
  z-index: 3;
  padding: 0.18rem 0.8rem;
  border: 1px solid var(--gold);
  background: linear-gradient(180deg, #f8f1e2, #efe3cc);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--ink);
  background: rgba(201, 162, 39, 0.18);
}

/* ===== 橙光人物页：左立绘右折子，占满屏幕 ===== */
.char-modal {
  align-items: stretch;
  justify-content: stretch;
}

.char-modal .modal-backdrop {
  background:
    linear-gradient(90deg, rgba(243, 238, 230, 0.35) 0%, rgba(247, 243, 235, 0.55) 46%, rgba(255, 252, 247, 0.92) 100%),
    #efe8dc;
}

.char-sheet {
  width: 100% !important;
  height: 100%;
  max-height: none;
  overflow: hidden;
  padding: 0 !important;
  background: transparent;
  border: none;
  box-shadow: none;
}

.char-sheet .modal-close {
  top: 0.9rem;
  right: 1.2rem;
  z-index: 100;
  padding: 0.22rem 0.85rem;
  border: 1px solid var(--gold);
  background: linear-gradient(180deg, #f8f1e2, #efe3cc);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.86rem;
  letter-spacing: 0.18em;
}

.char-sheet .modal-close:hover {
  background: rgba(201, 162, 39, 0.18);
}

/* ===== 男妃详情面板 ===== */
.consort-panel { width: min(980px, 96vw); padding: 1.1rem 1.3rem; }

.consort-layout { display: flex; gap: 1.2rem; align-items: stretch; }

.char-sheet .consort-layout,
.char-sheet .folk-layout {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  height: 100%;
  min-height: 100%;
  gap: 0;
  align-items: stretch;
}

.consort-portrait { flex-shrink: 0; width: 300px; text-align: center; }

.char-sheet .consort-portrait,
.char-sheet .folk-portrait {
  position: relative;
  flex: 1 1 58%;
  width: auto;
  min-width: 0;
  height: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 1rem 1.4rem 1.6rem;
}

/* 底部渐变遮罩：让左下角姓名在任意立绘底色上都可读 */
.char-sheet .consort-portrait::after,
.char-sheet .folk-portrait::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 36%;
  background: linear-gradient(to top, rgba(20, 14, 10, 0.78) 0%, rgba(20, 14, 10, 0.42) 45%, rgba(20, 14, 10, 0.12) 75%, transparent 100%);
  z-index: 1;
  pointer-events: none;
  border-radius: inherit;
}

.char-sheet .folk-portrait.hidden { display: none; }

.portrait-frame {
  width: 280px;
  height: 400px;
  margin: 0 auto;
  border: 1px solid var(--line);
  background: #efe8dc;
  overflow: hidden;
}

.char-sheet .consort-portrait .portrait-frame,
.char-sheet .folk-portrait .portrait-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  border: none;
  border-image: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 0;
  /* 大屏不把立绘硬拉满半屏，避免超过原图像素发糊 */
  padding: 1.2rem 1rem 5.2rem;
  box-sizing: border-box;
}

.portrait-stack {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.portrait-bg {
  /* 已废弃：背景图 assets/bgs/ 目录不存在 */
  display: none;
}

.portrait-bg-fallback {
  /* 已废弃：用户反馈渐变底比裂图更丑，直接删掉背景层 */
  display: none;
}

.portrait-fg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  filter: drop-shadow(0 8px 18px rgba(70, 52, 36, 0.18));
}

.char-sheet .portrait-stack {
  /* 原图约 1328×1776：按比例塞进左栏，超过原图像素不再放大 */
  position: relative;
  flex: 0 1 auto;
  width: min(100%, 1328px);
  max-height: min(100%, 1776px);
  aspect-ratio: 1328 / 1776;
  height: auto;
  margin: 0 auto;
  display: block;
  overflow: hidden;
}

.char-sheet .portrait-bg {
  /* 背景素材偏小，略压对比，突出人物层锐度 */
  filter: brightness(1.04) saturate(0.86);
}

.char-sheet .portrait-fg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  /* 去掉重投影滤镜，大屏更干净锐利 */
  filter: none;
  image-rendering: auto;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

@media (min-width: 1600px) {
  .char-sheet .consort-portrait,
  .char-sheet .folk-portrait {
    flex: 1 1 62%;
  }
  .char-sheet .consort-portrait .portrait-frame,
  .char-sheet .folk-portrait .portrait-frame {
    padding: 1.4rem 1.6rem 5.6rem;
  }
}

.consort-card-img {
  width: 100%;
  height: 300px;
  border: 1px solid var(--gold-dark);
  margin-bottom: 0.5rem;
}

#select-view { flex-direction: column; padding: 1rem; overflow-y: auto; }

.select-hint {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: -0.6rem 0 1rem;
}

.select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.5rem;
}

/* ========== 选秀新布局 ========== */
.select-main {
  display: grid;
  grid-template-columns: 180px 1fr 360px;
  gap: 1rem;
  margin-top: 0.5rem;
  flex: 1;
  min-height: 0;
}

/* 左侧名册 */
.select-roster {
  background: var(--bg-card);
  border: 1px solid var(--gold-dark);
  padding: 0.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 70vh;
}

.select-roster-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.select-roster-item:hover {
  border-color: var(--gold-dark);
  background: rgba(138, 107, 56, 0.06);
}

.select-roster-item.active {
  border-color: var(--gold-dark);
  background: rgba(138, 107, 56, 0.12);
}

.select-roster-portrait {
  width: 48px;
  height: 64px;
  flex-shrink: 0;
  border: 1px solid var(--gold-dark);
  overflow: hidden;
}

.select-roster-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.select-roster-name {
  font-size: 0.88rem;
  color: var(--ink);
  font-weight: 500;
}

.select-roster-meta {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* 中间立绘区域 */
.select-portrait-area {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--gold-dark);
  overflow: hidden;
  min-height: 0;
}

.select-portrait-big {
  flex: 1;
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ece3d2;
  overflow: hidden;
  position: relative;
}

.select-portrait-big .portrait-stack {
  width: auto;
  height: 100%;
  max-height: 100%;
}

.select-portrait-big .portrait-fg {
  height: 100%;
  width: auto;
  object-fit: contain;
}

.select-portrait-area .portrait-fallback {
  display: none;
}

.select-portrait-area .portrait-bg-fallback {
  display: none;
}

.select-candidate-info {
  padding: 0.7rem 1rem;
  border-top: 1px solid var(--gold-dark);
  background: rgba(138, 107, 56, 0.06);
}

.select-candidate-name {
  font-size: 1.1rem;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.select-candidate-meta {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.6;
}

/* 右侧详情面板 */
.select-detail-panel {
  background: var(--bg-card);
  border: 1px solid var(--gold-dark);
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  overflow-y: auto;
  max-height: 75vh;
}

.select-detail-section {
  border-bottom: 1px dashed rgba(138, 107, 56, 0.3);
  padding-bottom: 0.5rem;
}

.select-detail-section:last-of-type {
  border-bottom: none;
}

.select-detail-title {
  font-size: 0.85rem;
  color: var(--gold-dark);
  font-weight: 600;
  margin: 0 0 0.35rem;
  letter-spacing: 0.08em;
}

.select-detail-content {
  font-size: 0.82rem;
  color: var(--ink);
  line-height: 1.75;
  white-space: pre-wrap;
}

/* 询问栏 */
.select-inquiry {
  border-top: 1px solid rgba(138, 107, 56, 0.4);
  padding-top: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.select-inquiry-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.select-inquiry-label {
  color: var(--text-dim);
}

.select-inquiry-target {
  color: var(--ink);
  font-weight: 500;
}

.select-inquiry-log {
  background: rgba(255, 252, 245, 0.7);
  border: 1px solid rgba(138, 107, 56, 0.25);
  border-radius: 4px;
  padding: 0.55rem;
  min-height: 100px;
  max-height: 180px;
  overflow-y: auto;
  font-size: 0.82rem;
  line-height: 1.65;
}

.select-inquiry-log .talk-line {
  margin-bottom: 0.35rem;
  padding: 0.25rem 0.4rem;
  border-radius: 3px;
}

.select-inquiry-log .talk-line.user {
  background: rgba(138, 107, 56, 0.1);
  color: var(--ink);
  text-align: right;
}

.select-inquiry-log .talk-line.npc {
  background: rgba(60, 50, 40, 0.04);
  color: var(--ink);
}

.select-inquiry-log .talk-line.sys {
  color: var(--text-dim);
  font-size: 0.75rem;
  font-style: italic;
}

.select-inquiry-row {
  display: flex;
  gap: 0.4rem;
}

.select-inquiry-row input {
  flex: 1;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--gold-dark);
  background: #fffdf7;
  color: var(--ink);
  font-size: 0.85rem;
  border-radius: 4px;
}

.select-inquiry-row input:disabled,
.select-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* 操作按钮 */
.select-actions {
  display: flex;
  gap: 0.5rem;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(138, 107, 56, 0.3);
}

.select-actions .btn {
  flex: 1;
}

/* 立绘小尺寸优化 */
.select-roster-portrait .portrait-stack {
  width: 48px;
  height: 64px;
}

.select-roster-portrait .portrait-fg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 响应式：窄屏改为上下布局 */
@media (max-width: 1100px) {
  .select-main {
    grid-template-columns: 140px 1fr 300px;
    gap: 0.6rem;
  }
}

@media (max-width: 900px) {
  .select-main {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    max-height: none;
    overflow-y: auto;
  }
  .select-roster {
    flex-direction: row;
    flex-wrap: wrap;
    max-height: none;
    overflow-x: auto;
  }
  .select-portrait-big {
    min-height: 280px;
  }
  .select-detail-panel {
    max-height: none;
  }
}

.select-card {
  background: var(--bg-card);
  border: 1px solid var(--gold-dark);
  padding: 0.7rem;
}

.select-card-body {
  display: block;
}

.select-card-img {
  width: 100%;
  height: 168px;
  margin-bottom: 0.45rem;
  border: 1px solid var(--gold-dark);
  overflow: hidden;
}

.manage-kin {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.8rem;
}

.hidden { display: none !important; }

.select-card-text {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 0.25rem 0;
}

.exam-pick {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.55rem;
  font-size: 0.84rem;
  color: var(--ink);
  cursor: pointer;
  letter-spacing: 0.06em;
}

.exam-pick input {
  width: 1rem;
  height: 1rem;
}

.exam-post {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--ink);
  letter-spacing: 0.04em;
}

.exam-post select {
  flex: 1;
  padding: 0.28rem 0.4rem;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  max-height: 120px;
}

.select-hl {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  margin: 0.4rem 0 0.55rem;
}

.select-hl-item {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.select-hl-item b {
  flex-shrink: 0;
  color: var(--gold);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
}

.select-hl-item em {
  font-style: normal;
  color: var(--gold-light);
  font-size: 0.95rem;
  font-weight: 600;
}

.select-preview .tab-bar .tab:not([data-tab="attrs"]) { display: none; }

.portrait-name {
  margin-top: 0.55rem;
  font-family: var(--font-title);
  font-size: 1.25rem;
  color: var(--ink);
  line-height: 1.35;
}

.portrait-rank { color: var(--text-dim); font-size: 0.8rem; margin-top: 0.15rem; }

.char-sheet .portrait-name,
.char-sheet .portrait-rank {
  position: relative;
  z-index: 2;
  margin-top: 0;
  /* 清晰无模糊描边：深色硬描边 + 白色细描边，双层保障可读性 */
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.65),
    0 -1px 0 rgba(0, 0, 0, 0.4),
    1px 0 0 rgba(0, 0, 0, 0.4),
    -1px 0 0 rgba(0, 0, 0, 0.4),
    0 0 1px rgba(255, 252, 247, 0.9);
}

.char-sheet .portrait-name {
  font-size: 2.15rem;
  letter-spacing: 0.12em;
  color: #f5ecd9;
}

.char-sheet .portrait-rank {
  font-size: 0.9rem;
  color: var(--gold-light);
  margin-top: 0.2rem;
}

.consort-info { flex: 1; min-width: 0; }

.char-sheet .consort-info,
.char-sheet .folk-info {
  position: relative;
  z-index: 1;
  flex: 0 0 min(440px, 38vw);
  display: flex;
  flex-direction: column;
  min-width: 280px;
  min-height: 0;
  max-width: 42vw;
  height: auto;
  align-self: stretch;
  margin: 2.4rem 1.5rem 1.15rem 0;
  padding: 0 1.25rem 1.15rem;
  background: rgba(255, 252, 247, 0.96);
  border: 1px solid var(--line);
  border-top: none;
  box-shadow: var(--shadow);
  overflow-y: auto;
  overflow-x: hidden;
}

/* 去掉 consort-info::before 内边框 — 与 tab-bar 叠在一起会看起来像双栏 */
.char-sheet .consort-info::before,
.char-sheet .folk-info::before {
  display: none;
}

.char-sheet .folk-info h3,
.char-sheet .consort-info > h3 {
  position: relative;
  z-index: 1;
  margin-top: 0.7rem;
  margin-bottom: 0.2rem;
}

.char-sheet .tab-bar,
.char-sheet .official-modal-actions,
.char-sheet .servant-edict,
.char-sheet .heir-actions {
  position: relative;
  z-index: 1;
}

/* tab 栏吸顶：滑动内容时不跑出视野 */
.char-sheet .tab-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(255, 252, 247, 0.97);
}

/* NPC 面板滚动保险：明确允许垂直触摸平移，并阻止滚动穿透到外层 .modal
   （移动端/微信里外层 .modal 也可滚，不加 contain 会吞掉内层滑动） */
.char-sheet .consort-info,
.char-sheet .folk-info,
.char-sheet .official-info,
.char-sheet .tab-content,
.char-sheet .journal-scroll {
  touch-action: pan-y;
  overscroll-behavior: contain;
}
.char-sheet .consort-info,
.char-sheet .folk-info,
.char-sheet .official-info {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

/* 存档码弹窗：textarea 承载超长串，等宽小字 + 强制断行 */
.save-code-panel {
  width: min(560px, 94vw);
}
.save-code-panel textarea {
  width: 100%;
  box-sizing: border-box;
  font: 12px/1.5 Consolas, monospace;
  word-break: break-all;
  white-space: pre-wrap;
  resize: none;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  padding: 0.5rem;
  margin: 0.5rem 0 0.7rem;
  color: var(--ink);
}
.save-code-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.save-code-actions .btn {
  flex: 1;
}

/* 皇嗣无页签：折子可滚，交互钮置顶不被属性裁切 */
#heir-modal .consort-info {
  overflow-y: auto;
}

#heir-modal .heir-actions {
  flex-shrink: 0;
  margin: 0.35rem 0 0.65rem;
}

.tab-bar {
  display: flex;
  gap: 0;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--gold-dark);
}

.tab {
  padding: 0.55rem 1.05rem;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 1rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab.active { color: var(--gold-light); border-bottom-color: var(--gold); }
.tab:hover { color: var(--text); }

.tab-content { display: none; }
.tab-content.active { display: block; }

.char-sheet .talk-log {
  flex: 1;
  height: auto;
  min-height: 140px;
}

.char-sheet #tab-journal.active,
.char-sheet #folk-tab-journal.active {
  display: flex;
  flex-direction: column;
}

.char-sheet #tab-journal .journal-scroll,
.char-sheet #folk-tab-journal .journal-scroll {
  flex: 1;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.char-sheet #tab-ties { max-height: none; }

/* 皇嗣弹窗四页签 */
#heir-modal #heir-pane-act .select-hint { margin: 0.1rem 0 0.5rem; }
#heir-modal #heir-pane-act .heir-actions {
  margin: 0;
  gap: 0.45rem;
}
#heir-modal #heir-pane-journal.active {
  display: flex;
  flex-direction: column;
}
#heir-modal #heir-pane-journal .journal-scroll {
  flex: 1;
  max-height: 58vh;
}
#heir-modal #heir-pane-talk.active {
  display: flex;
  flex-direction: column;
}
#heir-modal #heir-pane-talk .talk-log {
  flex: 1;
  height: 300px;
  max-height: 46vh;
}
#heir-modal .heir-actions .hidden { display: none; }

/* 属性网格（官员弹窗仍用） */
.attr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem 1.2rem;
}

.attr-dense {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}

.attr-row {
  display: grid;
  grid-template-columns: 3em 1fr 3em 1fr;
  gap: 0.28rem 0.75rem;
  align-items: baseline;
  padding: 0.42rem 0.1rem;
  border-bottom: 1px dashed rgba(201, 162, 39, 0.16);
  font-size: 0.9rem;
}

.attr-row.wide { grid-template-columns: 3em 1fr; }

.attr-row b {
  color: var(--gold);
  font-weight: 600;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
}

.attr-row span {
  color: var(--text);
  line-height: 1.6;
}

.attr-row span.private { color: #c9a0b0; font-style: italic; }
.attr-row span.dim { color: var(--text-dim); }

.like-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.22rem;
}

.like-tag, .hate-tag {
  font-size: 0.7rem;
  font-style: normal;
  padding: 0.02rem 0.35rem;
  border: 1px solid var(--gold-dark);
  color: var(--gold-light);
}

.hate-tag {
  border-color: #6a3040;
  color: #c9a0b0;
}

.folk-person-attrs {
  display: block;
  max-height: 38vh;
  overflow-y: auto;
  margin-bottom: 0.55rem;
}

.char-sheet .folk-person-attrs {
  max-height: none;
  overflow: visible;
  flex: 0 0 auto;
}

.char-sheet .folk-info {
  overflow-y: auto;
}

.char-sheet .folk-layout:has(.folk-portrait.hidden) {
  justify-content: center;
}

.char-sheet .folk-layout:has(.folk-portrait.hidden) .folk-info {
  flex: 0 1 560px;
  margin-left: auto;
  margin-right: auto;
}

.char-sheet .folk-ties {
  max-height: none;
  overflow: visible;
  margin-bottom: 0;
  padding-top: 0;
  border-top: none;
}

#folk-modal:not(.folk-simple) .folk-info {
  overflow: hidden;
}

#folk-modal.folk-simple #folk-tab-bar,
#folk-modal.folk-simple #folk-tab-ties,
#folk-modal.folk-simple #folk-tab-journal {
  display: none !important;
}

#folk-modal.folk-simple #folk-tab-attrs,
#folk-modal.folk-simple #folk-tab-act {
  display: block;
  flex: none;
  overflow: visible;
  padding-right: 0;
}

.folk-ties {
  max-height: 22vh;
  overflow-y: auto;
  margin: 0 0 0.7rem;
  padding-top: 0.35rem;
  border-top: 1px dashed rgba(201, 162, 39, 0.22);
}

.servant-edict {
  margin: 0 0 0.7rem;
  padding-top: 0.55rem;
  border-top: 1px dashed rgba(201, 162, 39, 0.22);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.servant-edict-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.servant-edict-row label {
  color: var(--gold);
  font-size: 0.75rem;
  width: 2.4em;
  flex-shrink: 0;
}

.servant-edict-row select {
  flex: 1;
  min-width: 9em;
  padding: 0.35rem 0.45rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--gold-dark);
  color: var(--text);
  font-family: var(--font-body);
}

button.servant-open {
  cursor: pointer;
  font-family: inherit;
  background: transparent;
}

button.servant-open:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.talk-log {
  height: 280px;
  overflow-y: auto;
  padding: 0.55rem 0.7rem;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--gold-dark);
}

.official-talk .talk-log,
#heir-talk-log,
#folk-talk-log {
  height: 200px;
  margin-top: 0.35rem;
}

.official-talk {
  margin-top: 0.85rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(201, 162, 39, 0.25);
}

.talk-line {
  font-size: 0.82rem;
  line-height: 1.55;
  margin: 0.4rem 0;
}

.talk-line.user {
  color: var(--gold-light);
  text-align: right;
}

.talk-line.npc { color: var(--text); }
.talk-line.sys { color: var(--gold); font-size: 0.75rem; letter-spacing: 0.06em; }

.talk-row {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.talk-row input {
  flex: 1;
  padding: 0.45rem 0.55rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--gold-dark);
  color: var(--text);
  font-family: var(--font-body);
}

.talk-hint {
  margin-top: 0.4rem;
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.45;
}

.ai-config {
  text-align: left;
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(201, 162, 39, 0.2);
}

.ai-config label {
  display: block;
  color: var(--gold);
  font-size: 0.75rem;
  margin: 0.45rem 0 0.2rem;
}

.ai-config input {
  width: 100%;
  padding: 0.4rem 0.5rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--gold-dark);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.8rem;
}

.attr-item {
  display: flex;
  flex-direction: column;
  padding: 0.4rem 0;
  border-bottom: 1px dashed rgba(201, 162, 39, 0.15);
}

.attr-item.full { grid-column: 1 / -1; }

.attr-label {
  font-size: 0.75rem;
  color: var(--gold);
  margin-bottom: 0.15rem;
}

.attr-value {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.5;
}

.attr-value.private {
  color: #c9a0b0;
  font-style: italic;
}

.attr-section-title {
  grid-column: 1 / -1;
  font-size: 0.8rem;
  color: var(--gold-dark);
  letter-spacing: 0.2em;
  margin-top: 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid rgba(201, 162, 39, 0.2);
}

/* 交互 */
.mood-bar-wrap, .favor-bar-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.mood-bar-wrap label, .favor-bar-wrap label {
  width: 40px;
  font-size: 0.85rem;
  color: var(--gold);
}

.progress-bar {
  flex: 1;
  height: 10px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--gold-dark);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--red));
  transition: width 0.4s;
}

.progress-bar.favor .progress-fill {
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
}

.interact-desc {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 1rem 0;
  padding: 0.6rem;
  background: rgba(0, 0, 0, 0.2);
  border-left: 3px solid var(--gold-dark);
}

/* ======== 立储（太子）相关样式 ======== */

.badge {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  margin-left: 0.3rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  line-height: 1.3;
  font-weight: 600;
  vertical-align: middle;
}

.badge-crown {
  background: linear-gradient(90deg, #b8924c, #e6c877);
  color: #2a1c00;
  border: 1px solid #8a6a1a;
  box-shadow: 0 0 8px rgba(230, 200, 119, 0.35);
}

/* 皇嗣支持者名单卡片 */
.sup-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  max-width: 100%;
}
.sup-card {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(140,122,94,0.35);
  border-radius: 4px;
  padding: 2px 6px 2px 2px;
  background: rgba(212,175,55,0.05);
  cursor: pointer;
  transition: background .15s;
}
.sup-card:hover { background: rgba(212,175,55,0.15); }
.sup-card .sup-card-avatar {
  width: 24px; height: 24px; overflow: hidden;
  border-radius: 3px; background: #e8e0cf;
  flex-shrink: 0;
}
.sup-card .sup-card-avatar .portrait-stack,
.sup-card .sup-card-avatar .portrait-fg { width: 100%; height: 100%; }
.sup-card .sup-card-name {
  font-size: 12px; color: #3a2c10; font-weight: 500;
}
.sup-card .sup-card-post {
  font-size: 11px; color: #887;
}
.sup-house {
  display: inline-block;
  font-size: 12px; color: #8a6a1a;
  border-bottom: 1px dotted #c9a96b;
}

/* makePersonLink 带立绘 */
.person-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: #3a2c10;
  border-bottom: 1px dotted #c9a96b;
  padding: 0 1px;
  transition: background .15s;
}
/* mini-portrait 通用尺寸：所有用 mini-portrait 当"小头像"的地方默认 20x20 */
.mini-portrait {
  width: 20px; height: 20px;
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
  background: #e8e0cf;
  display: inline-block;
  vertical-align: middle;
}
.mini-portrait .portrait-stack,
.mini-portrait .portrait-fg {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}
.person-link:hover { background: rgba(212,175,55,0.12); }
.person-link .mini-portrait {
  width: 20px; height: 20px;
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
  background: #e8e0cf;
  display: inline-block;
}
.person-link .mini-portrait .portrait-stack,
.person-link .mini-portrait .portrait-fg {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}

.support-bar {
  flex: 1;
  height: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--gold-dark);
  border-radius: 2px;
  overflow: hidden;
}

.support-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #8a6a8a, #d4b56a, #e8a87a);
  transition: width 0.6s;
}

/* ========== 立储专属条（永远可见，不受 tab 切换影响） ========== */
.heir-loom-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.65rem;
  margin: 0.35rem 0 0.55rem;
  border: 1px solid #c8a65c;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(200,166,92,0.18), rgba(180,140,60,0.08));
}

.heir-loom-bar.hidden { display: none; }

.heir-loom-bar-label {
  font-family: 'STKaiti', 'KaiTi', 'Kaiti SC', '楷体', serif;
  color: #4a3418;
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  font-weight: 600;
  padding: 0 0.3rem;
  border-right: 1px dashed #c8a65c;
}

.heir-loom-bar-tip {
  font-family: 'STKaiti', 'KaiTi', 'Kaiti SC', '楷体', serif;
  font-size: 0.8rem;
  color: #8a5a18;
  letter-spacing: 0.04em;
}

.btn-heirloom {
  background: linear-gradient(90deg, #7a6b9e, #b8924c);
  border-color: #b8924c;
  color: #fff3d6;
  font-weight: 600;
  font-family: 'STKaiti', 'KaiTi', 'Kaiti SC', '楷体', serif;
  letter-spacing: 0.12em;
}

.btn-heirloom.btn-danger {
  background: linear-gradient(90deg, #8c2a2a, #c44a3a);
  border-color: #c44a3a;
  color: #fff0e8;
}

.btn-heirloom:disabled,
.btn-heirloom.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: rgba(150,140,120,0.35);
  border-color: #a89672;
  color: #6a5a38;
}

.interact-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.interact-btn {
  padding: 0.72rem 0.85rem;
  background: rgba(74, 44, 106, 0.4);
  border: 1px solid var(--gold-dark);
  color: var(--text);
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 1rem;
  letter-spacing: 0.06em;
  transition: all 0.2s;
}

.interact-btn:hover { border-color: var(--gold); background: rgba(139, 41, 66, 0.4); }
.interact-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* 册封 */
.manage-form label {
  display: block;
  color: var(--gold);
  font-size: 0.85rem;
  margin: 0.8rem 0 0.3rem;
}

.manage-form optgroup {
  color: var(--gold);
  font-style: normal;
  font-weight: 600;
}

.manage-form select, .manage-form input, .manage-form textarea {
  width: 100%;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--gold-dark);
  color: var(--text);
  font-family: var(--font-body);
}

.manage-form textarea {
  min-height: 3.1rem;
  resize: vertical;
  line-height: 1.55;
  margin-top: 0.35rem;
}

.manage-form .btn { margin-top: 1.2rem; width: 100%; }

#confer-modal { z-index: 140; }
#custom-attr-modal { z-index: 150; }

.custom-attr-panel {
  width: min(720px, 94vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.custom-attr-form {
  overflow-y: auto;
  max-height: calc(88vh - 6.5rem);
  padding-right: 0.35rem;
}

.custom-attr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}

.custom-attr-grid .span-2 { grid-column: 1 / -1; }

#custom-adult-fields { display: contents; }

.custom-attr-grid label { margin-top: 0.55rem; }

.portrait-pick {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.35rem;
  margin-top: 0.35rem;
  max-height: 42vh;
  overflow-y: auto;
}

.portrait-pick-btn {
  aspect-ratio: 3 / 4;
  border: 1px solid var(--gold-dark);
  background: #1a0f1e;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
}

.portrait-pick-btn.selected {
  border-color: var(--gold-light);
  box-shadow: 0 0 0 1px var(--gold);
}

.portrait-pick-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}

.bg-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.35rem;
}

.bg-pick-btn {
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--gold-dark);
  background: rgba(0, 0, 0, 0.4);
  color: var(--text);
  cursor: pointer;
  font-size: 0.8rem;
  font-family: var(--font-body);
}

.bg-pick-btn.selected {
  border-color: var(--gold-light);
  color: var(--gold-light);
}

.attr-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.2rem;
}

.palace-wing-section {
  margin-top: 0.45rem;
}

.palace-wing-title {
  margin: 0 0 0.2rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.06em;
}

.palace-wing-empty {
  margin: 0 0 0.15rem;
  opacity: 0.65;
}

.palace-consort-roster {
  margin-top: 0.55rem;
}

.heir-palace-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.heir-roster-btn {
  text-align: left;
}

.start-rank-panel {
  width: min(720px, 94vw);
  max-height: min(88vh, 88dvh);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}

.start-rank-head {
  flex-shrink: 0;
  padding: 0 0 0.2rem;
}

.start-rank-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 0.55rem 0 0;
  padding-right: 0.15rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  min-height: 0;
}

.start-rank-actions {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin-top: 0.75rem;
  padding: 0.85rem 0 0.15rem;
  background: linear-gradient(180deg, rgba(247, 243, 235, 0) 0%, var(--paper) 28%);
  border-top: 1px solid rgba(184, 146, 76, 0.28);
}

.start-rank-actions .btn {
  width: 100%;
  min-height: 2.75rem;
  font-size: 1.05rem;
}

.start-rank-tip {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}

.start-rank-row.start-rank-dismiss {
  opacity: 0.72;
}

.start-rank-row.start-rank-dismiss .start-rank-palace,
.start-rank-row.start-rank-dismiss .start-rank-title {
  opacity: 0.55;
}

.start-rank-row {
  display: flex;
  gap: 0.8rem;
  padding: 0.7rem 0.75rem;
  background: rgba(20, 10, 22, 0.72);
  border: 1px solid var(--gold-dark);
}

.start-rank-face {
  flex-shrink: 0;
  width: 72px;
  height: 96px;
  overflow: hidden;
  border: 1px solid var(--gold-dark);
  background: #120a12;
}

.start-rank-face img,
.start-rank-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.start-rank-meta { flex: 1; min-width: 0; }
.start-rank-meta b { display: block; color: var(--gold-light); margin-bottom: 0.2rem; }
.start-rank-meta > span {
  display: block;
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.45;
}

.start-rank-fields {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 0.55rem;
  margin-top: 0.55rem;
  align-items: center;
}

.start-rank-fields label { font-size: 0.78rem; color: var(--text-dim); }
.start-rank-fields .start-rank-title {
  width: 100%;
  min-width: 0;
  padding: 0.28rem 0.45rem;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: rgba(12, 6, 14, 0.55);
  border: 1px solid var(--gold-dark);
}
.start-rank-fields .start-rank-title:disabled {
  opacity: 0.55;
}

.confer-panel {
  width: min(440px, 92vw);
}

.confer-form .btn { margin-top: 0.55rem; }
.confer-form .btn-primary { margin-top: 1.1rem; }

/* ===== 转月 ===== */
.month-turn {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.month-turn.hidden { display: none; }

.month-turn-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(26, 15, 30, 0.28) 0%, rgba(8, 4, 10, 0.82) 100%);
  opacity: 0;
}

.month-turn-mark {
  position: relative;
  z-index: 1;
  text-align: center;
  opacity: 0;
  transform: translateY(16px);
}

.month-turn-kicker,
.month-turn-era {
  color: var(--text-dim);
  letter-spacing: 0.42em;
  font-size: 0.82rem;
}

.month-turn-kicker { margin-bottom: 0.35rem; }

.month-turn-name {
  font-family: var(--font-title);
  font-size: 4.2rem;
  font-weight: 400;
  color: var(--gold-light);
  letter-spacing: 0.38em;
  text-indent: 0.38em;
  line-height: 1.05;
  text-shadow: 0 0 28px rgba(201, 162, 39, 0.42);
}

.month-turn-line {
  display: block;
  width: 0;
  height: 1px;
  margin: 0.65rem auto 0.55rem;
  background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
  opacity: 0.25;
}

.month-turn.play .month-turn-veil {
  animation: monthTurnVeil 2s ease forwards;
}

.month-turn.play .month-turn-mark {
  animation: monthTurnMark 2s ease forwards;
}

.month-turn.play .month-turn-line {
  animation: monthTurnLine 0.7s 0.22s ease forwards;
}

@keyframes monthTurnVeil {
  0% { opacity: 0; }
  16% { opacity: 1; }
  70% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes monthTurnMark {
  0% { opacity: 0; transform: translateY(16px); }
  16% { opacity: 1; transform: translateY(0); }
  70% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-10px); }
}

@keyframes monthTurnLine {
  from { width: 0; opacity: 0.2; }
  to { width: 8.6rem; opacity: 1; }
}

/* ===== 留宿后女帝心声（贴在对白框上沿） ===== */
.empress-aside {
  margin: 0 0 0.85rem;
  padding: 0 0.1rem 0.7rem;
  border-bottom: 1px solid rgba(184, 146, 76, 0.28);
}

.empress-aside.hidden { display: none; }

.empress-aside-tag {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--gold-dark);
  font-family: var(--font-title);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
}

.empress-aside-text {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.98rem;
  line-height: 1.7;
  letter-spacing: 0.04em;
}

/* ===== 对话框 ===== */
.dialog-box {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  width: min(920px, 88vw);
  max-height: min(76vh, 640px);
  display: flex;
  flex-direction: column;
  background: rgba(250, 245, 232, 0.94);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(156, 118, 62, 0.55);
  padding: 1.1rem 1.3rem 1.4rem;
  z-index: 120;
  box-shadow:
    inset 0 0 0 1px rgba(184, 146, 76, 0.22),
    0 10px 30px rgba(70, 52, 36, 0.14);
}

.dialog-box::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(156, 118, 62, 0.22);
  pointer-events: none;
}

.dialog-box.hidden { display: none; }

/* 飘落花瓣动画 */
.dialog-petal {
  position: absolute;
  top: -20px;
  left: var(--l, 50%);
  width: 12px;
  height: 12px;
  pointer-events: none;
  z-index: 121;
  opacity: 0;
  animation: dialogPetalFall linear infinite;
  animation-duration: 7s;
  animation-delay: var(--d, 0s);
  transform: scale(var(--s, 0.7));
}
.dialog-petal::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at 30% 30%, #f5c5d5 0%, #e89aaa 45%, #d97a8e 100%);
  border-radius: 50% 10% 50% 10%;
  filter: drop-shadow(0 0 2px rgba(232, 154, 170, 0.4));
}
@keyframes dialogPetalFall {
  0%   { transform: translateY(0) translateX(0) rotate(0deg)   scale(var(--s, 0.7)); opacity: 0; }
  10%  { opacity: 0.85; }
  50%  { transform: translateY(45%) translateX(18px) rotate(180deg)  scale(var(--s, 0.7)); opacity: 0.7; }
  90%  { opacity: 0.4; }
  100% { transform: translateY(120%) translateX(-10px) rotate(360deg) scale(var(--s, 0.7)); opacity: 0; }
}

/* 关闭按钮 */
.dialog-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: #9a7a50;
  font-size: 22px;
  line-height: 26px;
  cursor: pointer;
  z-index: 122;
  border-radius: 50%;
  transition: background 0.15s;
}
.dialog-close:hover { background: rgba(156, 118, 62, 0.12); color: #6a4a2a; }

/* 底部菱形装饰 */
.dialog-diamond {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  color: #b8924c;
  font-size: 16px;
  z-index: 121;
}

.dialog-layout {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* 立绘框：正方形双层装饰框 */
.dialog-portrait {
  flex-shrink: 0;
  width: 100px;
  height: 100px;
  border: 1px solid var(--line-gold);
  background: rgba(239, 232, 220, 0.6);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dialog-portrait::after {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(156, 118, 62, 0.35);
  pointer-events: none;
}
.dialog-portrait.hidden { display: none; }
.dialog-portrait.has-face { background: transparent; }
/* 可点击提示 */
.dialog-portrait[style*="cursor: pointer"] {
  transition: filter 0.15s ease, transform 0.15s ease;
}
.dialog-portrait[style*="cursor: pointer"]:hover {
  filter: brightness(1.08) drop-shadow(0 0 6px rgba(156, 118, 62, 0.45));
  transform: translateY(-1px);
}

.dialog-portrait-img,
.dialog-portrait .portrait-stack {
  width: 100%;
  height: 100%;
}
.dialog-portrait .portrait-fg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

/* 立绘占位（无字图时显示） */
.dialog-portrait:empty::before {
  content: '人';
  font-family: var(--font-title);
  font-size: 2.2rem;
  color: rgba(156, 118, 62, 0.55);
}

.dialog-main { flex: 1; min-width: 0; position: relative; padding-top: 2px; }

/* 说话人名字 */
.dialog-speaker {
  font-family: var(--font-title);
  font-size: 1.15rem;
  color: #8b5a2b;
  letter-spacing: 0.12em;
  margin-bottom: 0.55rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px dotted rgba(156, 118, 62, 0.35);
}
.dialog-speaker.hidden { display: none; }

.dialog-text {
  font-size: 1.08rem;
  line-height: 1.9;
  color: var(--text);
  min-height: 2.5em;
}

/* NPC名字高亮样式 */
.npc-highlight {
  display: inline-block;
  padding: 0.05em 0.4em;
  margin: 0 0.15em;
  background: linear-gradient(135deg, rgba(183, 154, 99, 0.18), rgba(183, 154, 99, 0.06));
  border: 1px solid rgba(183, 154, 99, 0.45);
  border-radius: 3px;
  color: #7a5c2e;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}
.dialog-text .npc-highlight {
  display: inline-block;
  padding: 0.05em 0.4em;
  margin: 0 0.15em;
  background: linear-gradient(135deg, rgba(183, 154, 99, 0.18), rgba(183, 154, 99, 0.06));
  border: 1px solid rgba(183, 154, 99, 0.45);
  border-radius: 3px;
  color: #7a5c2e;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}
.dialog-box.is-memorial .dialog-text .npc-highlight {
  background: linear-gradient(135deg, rgba(183, 154, 99, 0.22), rgba(183, 154, 99, 0.08));
  border-color: rgba(156, 118, 62, 0.5);
  color: #5d4420;
}
.dialog-box.is-verdict .dialog-text .npc-highlight {
  background: linear-gradient(135deg, rgba(141, 55, 44, 0.18), rgba(141, 55, 44, 0.04));
  border-color: rgba(141, 55, 44, 0.4);
  color: #7a2a22;
}

/* 家长/官职/爵位/关系人高亮（与 NPC名字 金色区分：靛青色） */
.dialog-text .role-highlight {
  display: inline-block;
  padding: 0.05em 0.4em;
  margin: 0 0.15em;
  background: linear-gradient(135deg, rgba(44, 74, 110, 0.16), rgba(44, 74, 110, 0.05));
  border: 1px solid rgba(44, 74, 110, 0.42);
  border-radius: 3px;
  color: #2c4a6e;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}
.dialog-box.is-memorial .dialog-text .role-highlight {
  background: linear-gradient(135deg, rgba(44, 74, 110, 0.2), rgba(44, 74, 110, 0.06));
  border-color: rgba(35, 58, 88, 0.5);
  color: #223652;
}
.dialog-box.is-verdict .dialog-text .role-highlight {
  background: linear-gradient(135deg, rgba(100, 70, 40, 0.18), rgba(100, 70, 40, 0.04));
  border-color: rgba(100, 70, 40, 0.4);
  color: #5a3e1f;
}

.dialog-choices { margin-top: 0.9rem; display: flex; flex-direction: column; gap: 0.55rem; }

/* 选项按钮：双层边框编号样式 */
.dialog-choice {
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--font-ui);
  text-align: left;
  transition: all 0.18s;
  position: relative;
  display: flex;
  align-items: stretch;
}
.dialog-choice-inner {
  flex: 1;
  padding: 0.65rem 1rem;
  background: linear-gradient(180deg, #fbf5e6, #f3ead3);
  border: 1px solid rgba(156, 118, 62, 0.45);
  color: #7a5a3a;
  font-size: 0.98rem;
  letter-spacing: 0.04em;
  position: relative;
}
.dialog-choice-inner::before {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(156, 118, 62, 0.18);
  pointer-events: none;
}
.dialog-choice-num {
  flex-shrink: 0;
  width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8dcc0;
  border: 1px solid rgba(156, 118, 62, 0.45);
  border-right: none;
  color: #9a6a32;
  font-family: var(--font-title);
  font-size: 1rem;
}
.dialog-choice:hover .dialog-choice-inner {
  background: linear-gradient(180deg, #fff7e4, #f8eed4);
  border-color: var(--gold);
}
.dialog-choice:hover .dialog-choice-num {
  background: #f0e0b8;
  border-color: var(--gold);
  color: var(--gold);
}

.dialog-next { margin-top: 0.8rem; }

/* ===== 折子（批阅奏章）视觉 ===== */
.dialog-box.is-memorial {
  width: min(700px, 90vw);
  padding: 1.25rem 1.5rem 1.5rem;
  background-color: #f2e6cb;
  background-image:
    /* 竖折痕：每四分之一一道软折 */
    linear-gradient(90deg,
      rgba(122, 88, 44, 0) 0%,
      rgba(122, 88, 44, 0.10) 24.7%,
      rgba(255, 253, 246, 0.75) 25.1%,
      rgba(122, 88, 44, 0) 25.6%,
      rgba(122, 88, 44, 0) 49.7%,
      rgba(122, 88, 44, 0.10) 50%,
      rgba(255, 253, 246, 0.75) 50.4%,
      rgba(122, 88, 44, 0) 51%,
      rgba(122, 88, 44, 0) 74.7%,
      rgba(122, 88, 44, 0.10) 75%,
      rgba(255, 253, 246, 0.75) 75.4%,
      rgba(122, 88, 44, 0) 76%),
    /* 纸色旧痕 */
    radial-gradient(ellipse at 14% 8%, rgba(255, 252, 240, 0.92), rgba(255, 252, 240, 0) 58%),
    radial-gradient(ellipse at 86% 94%, rgba(196, 168, 120, 0.30), rgba(196, 168, 120, 0) 62%);
  border: 1px solid rgba(122, 88, 44, 0.62);
  box-shadow:
    inset 0 0 30px rgba(150, 118, 66, 0.20),
    inset 0 0 0 1px rgba(184, 146, 76, 0.30),
    0 12px 30px rgba(70, 52, 36, 0.18);
}
.dialog-box.is-memorial::before {
  inset: 7px;
  border: 1px solid rgba(150, 112, 54, 0.34);
}
/* 左右绫边（封面硬边） */
.dialog-box.is-memorial::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg,
      rgba(96, 70, 34, 0.16) 0, rgba(96, 70, 34, 0.16) 5px, rgba(96, 70, 34, 0) 5px,
      rgba(96, 70, 34, 0) calc(100% - 5px), rgba(96, 70, 34, 0.16) calc(100% - 5px), rgba(96, 70, 34, 0.16) 100%);
}
.dialog-box.is-memorial .dialog-portrait { display: none; }
.dialog-box.is-memorial .dialog-diamond { display: none; }

.memorial-head {
  margin: 0 0 0.7rem;
  padding: 0 0 0.5rem;
  border-bottom: 1px solid rgba(150, 112, 54, 0.35);
}
.memorial-head.hidden { display: none; }
.memorial-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
}
.memorial-title {
  font-family: var(--font-title);
  font-size: 1.12rem;
  color: #5c3b1e;
  letter-spacing: 0.16em;
  padding-left: 0.5rem;
  border-left: 3px solid var(--seal);
}
.memorial-date {
  font-size: 0.78rem;
  color: #97794e;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.memorial-from {
  margin-top: 0.3rem;
  font-size: 0.86rem;
  color: #7d6440;
  letter-spacing: 0.06em;
}

.dialog-box.is-memorial .dialog-text {
  color: #3e3527;
  font-family: var(--font-title);
  letter-spacing: 0.05em;
}
.dialog-box.is-verdict .dialog-text { color: #8d372c; }

.memorial-seal {
  position: absolute;
  right: 20px;
  bottom: 18px;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(158, 60, 52, 0.88);
  color: #fdf3e2;
  font-family: var(--font-title);
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  writing-mode: vertical-rl;
  text-orientation: upright;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(255, 240, 220, 0.6), 0 2px 6px rgba(122, 44, 36, 0.25);
  transform: rotate(-6deg);
  opacity: 0.92;
  pointer-events: none;
  z-index: 2;
}
.memorial-seal.hidden { display: none; }
.dialog-box.is-verdict .memorial-seal {
  background: rgba(150, 46, 40, 0.92);
  transform: rotate(6deg);
}

.dialog-box.is-memorial .dialog-choice-inner {
  background: linear-gradient(180deg, #faf1dc, #f0e3c6);
  border-color: rgba(140, 102, 50, 0.5);
  color: #6f4f2c;
}
.dialog-box.is-memorial .dialog-choice-num {
  background: #ecdcb8;
  border-color: rgba(140, 102, 50, 0.5);
  color: #9a4a2e;
}

@media (max-width: 768px) {
  .dialog-box.is-memorial { padding: 0.9rem 1rem 1.1rem; }
  .memorial-title { font-size: 1rem; }
  .memorial-seal { width: 38px; height: 38px; font-size: 0.78rem; right: 14px; bottom: 12px; }
}

/* ===== 菜单 ===== */
.menu-panel {
  width: 360px;
  padding: 1.5rem;
  text-align: center;
}

.menu-panel h3 {
  font-family: var(--font-title);
  color: var(--ink);
  margin-bottom: 1.2rem;
  font-size: 1.3rem;
}

.adult-content-panel .select-hint {
  margin-bottom: 1rem;
  text-align: left;
}

.adult-content-panel .btn-block {
  margin-bottom: 0.45rem;
}

.journal-panel {
  width: min(640px, 94vw);
  max-height: 86vh;
  padding: 1.55rem 1.55rem 1.5rem;
}

.confer-panel,
.journal-panel,
.custom-attr-panel,
.menu-panel {
  padding-top: 1.85rem;
}
.start-rank-panel {
  padding: 1.55rem 1.55rem 1.05rem;
}
.journal-panel h3 {
  font-family: var(--font-title);
  color: #8b3a3a;
  margin: 0 0 0.2rem;
  font-size: 1.35rem;
}
.journal-role {
  margin: 0 0 0.35rem;
  color: #8a6a3a;
  font-size: 0.82rem;
}
.journal-panel .select-hint { color: #6a5a48; }

.temple-dead-panel {
  width: min(720px, 94vw);
}
.temple-dead-grid .folk-card-meta {
  font-size: 0.75rem;
  color: #7a6a58;
  margin-top: 0.15rem;
}
.temple-dead-card {
  opacity: 0.92;
}
.journal-toolbar { display: flex; gap: 0.4rem; margin: 0.55rem 0 0.6rem; }
.journal-toolbar .journal-filter.active {
  border-color: #8b3a3a;
  color: #8b3a3a;
}
.journal-scroll {
  max-height: 52vh;
  overflow-y: auto;
  padding: 0.4rem 0.2rem 0.6rem;
  background: #fffdf7;
  border: 1px solid #e0d2b4;
}
#tab-journal .journal-scroll { max-height: 340px; }
.journal-line {
  margin: 0;
  padding: 0.42rem 0.55rem;
  font-size: 0.8rem;
  line-height: 1.65;
  color: #3a2a22;
  border-bottom: 1px dashed rgba(139, 90, 40, 0.18);
}
.journal-line .journal-date { color: #8a6a2a; font-weight: 600; }
.journal-aim { background: rgba(201, 162, 39, 0.08); }
.journal-mark {
  border: 1px solid #b44a4a;
  background: #fff8f4;
  margin: 0.25rem 0.15rem;
}
#journal-modal { z-index: 140; }

.sfx-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.7rem;
  font-size: 0.82rem;
  color: var(--text-dim);
}

/* ===== 人际 ===== */
#tab-ties { max-height: 420px; overflow-y: auto; }
#ties-board { display: flex; flex-direction: column; gap: 1.1rem; padding: 0.4rem 0 1.2rem; }
.tie-block h3 {
  font-size: 0.92rem;
  color: var(--gold-light);
  margin: 0 0 0.45rem;
  font-weight: 600;
}
.tie-row {
  padding: 0.5rem 0.15rem 0.55rem;
  border-bottom: 1px dashed rgba(201, 162, 39, 0.16);
}
.tie-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
}
.tie-name {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.88rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.tie-name:hover { color: var(--gold-light); }
.tie-vs { color: var(--text-dim); font-size: 0.75rem; }
.tie-rank { color: var(--text-dim); font-size: 0.75rem; }
.tie-label {
  font-size: 0.72rem;
  padding: 0.05rem 0.4rem;
  border: 1px solid rgba(201, 162, 39, 0.35);
  color: var(--gold);
}
.tie-hate .tie-label, .tie-feud .tie-label { color: #c45a5a; border-color: #8a3a3a; }
.tie-rift .tie-label { color: #c98a4a; border-color: #8a5a2a; }
.tie-close .tie-label, .tie-warm .tie-label { color: #8cbf7a; border-color: #4a7a3a; }
.tie-bar {
  height: 4px;
  margin: 0.35rem 0 0.25rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}
.tie-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #8a3a3a, #c9a227, #5a8a4a);
}
.tie-hate .tie-bar i, .tie-feud .tie-bar i { background: #a84848; }
.tie-close .tie-bar i, .tie-warm .tie-bar i { background: #6a9a58; }
.tie-note {
  margin: 0;
  font-size: 0.76rem;
  color: var(--text-dim);
  line-height: 1.45;
}
.ties-subtabs {
  display: flex;
  gap: 0.4rem;
  margin: 0 0 0.5rem;
  border-bottom: 1px solid rgba(201, 162, 39, 0.25);
}
.ties-subtab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.2rem 0.55rem 0.3rem;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 0.8rem;
  cursor: pointer;
}
.ties-subtab:hover { color: var(--text); }
.ties-subtab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

@media (min-width: 1600px) {
  .location-float-btn {
    padding: 0.75rem 1.5rem;
    font-size: 1.05rem;
  }
  .location-actions-group .location-float-btn {
    padding: 0.75rem 1.55rem;
    font-size: 1.08rem;
  }
  .location-roster-popup {
    width: min(640px, 60vw);
  }
  .map-node {
    min-width: 6.4rem;
    padding: 0.46rem 0.85rem 0.5rem;
  }
  .map-node .node-name { font-size: 1.02rem; letter-spacing: 0.08em; }
}

/* ===== 响应式：手机 + 平板（含 iPad 竖/横） ===== */
@media (max-width: 1180px) {
  .start-branding {
    left: 3%;
    top: 10%;
    gap: 16px;
  }
  .branding-ornament { display: none; }
  .branding-subtitle { display: none; }
  .branding-title { font-size: clamp(3.8rem, 11vh, 6rem); letter-spacing: 0.1em; }
  .start-panel {
    left: auto;
    right: 4%;
    top: 14%;
    width: min(420px, 48vw);
    padding: 36px 32px 24px;
    gap: 26px;
  }
  .start-poetic-bar { font-size: 11px; gap: 8px; }
  .poetic-text { letter-spacing: 0.2em; }
  .adult-content-panel {
    width: min(420px, 94vw);
    max-height: 88vh;
    padding: 1.2rem 1.1rem;
  }
  .adult-content-panel .btn-block {
    min-height: 2.85rem;
    touch-action: manipulation;
  }
  .modal:not(.char-modal) .modal-backdrop {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (max-width: 768px) {
  /* 移动端开场：竖排书法变横排，卷轴面板居中堆叠 */
  .start-branding {
    position: relative;
    left: auto; top: auto;
    width: 100%; height: auto;
    flex-direction: row;
    justify-content: center;
    padding-top: max(60px, env(safe-area-inset-top) + 12px);
    gap: 14px;
    opacity: 1;
  }
  .branding-title {
    writing-mode: horizontal-tb;
    font-size: clamp(2.8rem, 10vw, 4.5rem);
    letter-spacing: 0.12em;
    line-height: 1.2;
    margin: 0;
  }
  .start-panel {
    position: relative;
    left: auto; right: auto; top: auto;
    width: calc(100% - 32px);
    max-width: 420px;
    margin: 12px auto 20px;
    padding: 28px 24px 20px;
    gap: 22px;
    background: rgba(245, 237, 228, 0.85);
    border-radius: 16px;
    border: 1px solid rgba(197, 185, 168, 0.6);
  }
  .start-hud-frame, .start-hud-top, .start-poetic-bar { display: none; }
  .start-vignette {
    background:
      linear-gradient(180deg, rgba(245, 237, 228, 0.45) 0%, rgba(43, 24, 16, 0.55) 55%, rgba(43, 24, 16, 0.65) 100%),
      radial-gradient(ellipse at top, rgba(253, 248, 240, 0.3), transparent 60%);
  }
  .panel-fields { gap: 18px; }
  .field-underline input { font-size: 16px; }
  .panel-field label { font-size: 13px; }
  .btn-ascend { font-size: 16px; padding: 12px 0; letter-spacing: 0.2em; }
  .btn-continue { font-size: 15px; padding: 11px 0; }
  .panel-divider { margin: 4px 0; }
  .btn-restore-sub { font-size: 11px; }
  .start-hint { font-size: 10px; letter-spacing: 0.04em; margin-top: -12px; }

  #map-view { flex-direction: column; }
  .map-sidebar { width: 100%; border-left: none; border-top: 2px solid var(--gold-dark); max-height: 220px; }
  .map-node { min-width: 4.2rem; padding: 0.28rem 0.5rem 0.3rem; }
  .map-node .node-name { font-size: 0.62rem; letter-spacing: 0.06em; }
  /* 移动端地图完整显示不裁剪 */
  .palace-scene { background: #d8cdb5; }
  .palace-scene-img { object-fit: contain; }
  /* 地点视图也完整显示 */
  .location-scene-img { object-fit: contain; }
  /* 移动端地点视图按钮更紧凑 */
  .location-bottom-bar {
    padding: 0.8rem 0.8rem calc(0.8rem + env(safe-area-inset-bottom));
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 0.6rem;
  }
  .location-actions-group {
    max-width: 100%;
    justify-content: flex-start;
    gap: 0.45rem;
  }
  .location-float-btn {
    padding: 0.55rem 0.95rem;
    font-size: 0.88rem;
    border-radius: 6px;
  }
  .location-actions-group .location-float-btn {
    padding: 0.55rem 1rem;
    font-size: 0.92rem;
  }
  .location-back-btn {
    align-self: flex-start;
  }
  /* 移动端人物一览弹层改为底部弹出 */
  .location-roster-popup {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-height: 80vh;
    max-height: 80dvh;
    border-radius: 12px 12px 0 0;
    border-bottom: none;
    z-index: 100;
  }
  .consort-layout { flex-direction: column; }
  .consort-portrait { width: 100%; }
  .folk-layout { flex-direction: column; }
  .folk-portrait { width: 100%; }
  .portrait-frame { width: 220px; height: 310px; }
  /* char-sheet 移动端改为纵向布局，避免立绘横向挤压显示不全 */
  .char-sheet .consort-layout,
  .char-sheet .folk-layout {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0.5rem;
  }
  .char-sheet .consort-portrait,
  .char-sheet .folk-portrait {
    flex: none;
    width: 100%;
    max-height: 40vh;
    padding: 2rem 0 0 0;
    margin-top: 0;
  }
  .char-sheet .consort-portrait .portrait-frame,
  .char-sheet .folk-portrait .portrait-frame {
    padding: 0.5rem 0.5rem 3.6rem;
  }
  .char-sheet .consort-info,
  .char-sheet .folk-info {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin: 2.2rem 0 0 0;
    padding: 0 0.85rem 0.85rem;
    border-top: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: none;
  }
  /* 移动端 tab 栏：横排等分、字号缩小、可横向滑动兜底 */
  .char-sheet .tab-bar,
  #folk-tab-bar,
  #official-tab-bar {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0;
    margin-bottom: 0.6rem;
    flex-shrink: 0;
  }
  .char-sheet .tab-bar .tab,
  #folk-tab-bar .tab,
  #official-tab-bar .tab {
    flex: 1 0 auto;
    padding: 0.42rem 0.4rem;
    font-size: 0.82rem;
    white-space: nowrap;
    text-align: center;
  }
  .char-sheet .portrait-name { font-size: 1.5rem; }
  /* folk-card 网格移动端更小更紧凑 */
  .folk-grid {
    grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
    gap: 0.4rem;
  }
  .folk-grid.ward-grid {
    grid-template-columns: repeat(auto-fill, minmax(5rem, 1fr));
    gap: 0.35rem;
  }
  .folk-card-img {
    height: 6.2rem;
  }
  .ward-grid .folk-card-img {
    height: 5.5rem;
  }
  .folk-card-name {
    font-size: 0.85rem;
  }
  .folk-card-sub {
    font-size: 0.7rem;
  }
  .folk-card-meta {
    font-size: 0.65rem;
  }
  .attr-grid { grid-template-columns: 1fr; }
  .attr-row, .attr-row.wide { grid-template-columns: 3em 1fr; }
  .talk-log { height: 220px; }
  .char-sheet .official-talk .talk-log { height: 140px; }
  .dialog-layout { flex-direction: column; }
  .dialog-portrait { width: 96px; height: 130px; }
  .dialog-box {
    bottom: 12px;
    width: min(920px, 94vw);
    max-height: min(76vh, 640px);
    display: flex;
    flex-direction: column;
    padding: 0.9rem 0.9rem 1.1rem;
  }
  .dialog-layout { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .dialog-text { font-size: 0.95rem; line-height: 1.75; }
  .dialog-choice-inner { font-size: 0.92rem; padding: 0.55rem 0.85rem; }
  #official-view {
    padding: 0.75rem;
  }
  #official-view .consort-list-header {
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.7rem;
  }
  #official-view .consort-list-header h2 {
    font-size: 1.25rem;
  }
  #official-view .official-table {
    min-width: 640px;
    font-size: 0.88rem;
  }
  #official-view .official-table th,
  #official-view .official-table td {
    padding: 0.45rem 0.5rem;
    white-space: nowrap;
  }
  /* 科举/察举名册移动端适配 */
  #exam-view .consort-list-header {
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.7rem;
  }
  #exam-view .consort-list-header h2 {
    font-size: 1.25rem;
  }
  #exam-view {
    padding: 0.75rem;
  }
  #exam-grid,
  .select-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }
  #exam-grid .select-card,
  .select-grid .select-card {
    font-size: 0.75rem;
  }
  #exam-grid .folk-card-name,
  .select-grid .folk-card-name {
    font-size: 0.95rem;
  }
  #exam-grid .folk-card-sub,
  .select-grid .folk-card-sub,
  #exam-grid .folk-card-meta,
  .select-grid .folk-card-meta {
    font-size: 0.7rem;
  }
  #exam-view .consort-list-header .btn {
    font-size: 0.8rem;
    padding: 0.35rem 0.6rem;
  }
  /* 选秀页面移动端：单列或双列卡片，信息完整展示 */
  #select-view {
    padding: 0.75rem;
  }
  #select-view .consort-list-header {
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.5rem;
  }
  #select-view .consort-list-header h2 {
    font-size: 1.25rem;
  }
  #select-view .consort-list-header .btn {
    font-size: 0.78rem;
    padding: 0.32rem 0.5rem;
  }
  #select-view .select-grid {
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 0.5rem;
  }
  #select-view .select-card {
    padding: 0.55rem;
    font-size: 0.75rem;
    line-height: 1.45;
  }
  #select-view .select-card-img {
    height: 140px;
    margin-bottom: 0.35rem;
  }
  #select-view .consort-card-name {
    font-size: 0.9rem;
    text-align: center;
    letter-spacing: 0.08em;
  }
  #select-view .select-hl {
    gap: 0.22rem;
    margin: 0.35rem 0 0.4rem;
  }
  #select-view .select-hl-item {
    font-size: 0.72rem;
    flex-wrap: wrap;
    gap: 0.2rem;
  }
  #select-view .select-hl-item b {
    font-size: 0.65rem;
    letter-spacing: 0.1em;
  }
  #select-view .select-hl-item em {
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.3;
    word-break: break-all;
  }
  #select-view .select-card .btn-block {
    font-size: 0.72rem;
    padding: 0.3rem 0.4rem;
    margin-top: 0.25rem;
  }
  /* 赏花赋诗移动端适配 */
  #poetry-view,
  #poetry-collection-view {
    padding: 0.75rem;
    padding-bottom: 1rem;
  }
  #poetry-view .consort-list-header,
  #poetry-collection-view .consort-list-header {
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
  }
  #poetry-view .consort-list-header h2,
  #poetry-collection-view .consort-list-header h2 {
    font-size: 1.25rem;
  }
  #poetry-view .consort-list-header .btn,
  #poetry-collection-view .consort-list-header .btn {
    font-size: 0.78rem;
    padding: 0.32rem 0.5rem;
  }
  #poetry-view .consort-count,
  #poetry-collection-view .consort-count {
    font-size: 0.75rem;
  }
  .poetry-topic-presets {
    gap: 0.3rem;
  }
  .poetry-topic-chip {
    padding: 0.28rem 0.6rem;
    font-size: 0.82rem;
  }
  .poetry-consort-grid {
    grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
    gap: 0.45rem;
  }
  .poetry-consort-card {
    padding: 0.4rem;
  }
  .poetry-consort-avatar {
    width: 2.2rem;
    height: 2.2rem;
  }
  .poetry-consort-name {
    font-size: 0.85rem;
  }
  .poetry-consort-meta {
    font-size: 0.7rem;
  }
  .poetry-poem-card {
    gap: 0.55rem;
    padding: 0.55rem;
  }
  .poetry-poem-avatar {
    width: 2.6rem;
    height: 2.6rem;
  }
  .poetry-poem-text {
    font-size: 0.92rem;
    line-height: 1.7;
  }
  .poetry-reward-options {
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
  }
  .poetry-reward-card {
    padding: 0.5rem;
  }
  .poetry-reward-title {
    font-size: 0.85rem;
  }
  .poetry-reward-desc {
    font-size: 0.72rem;
    line-height: 1.4;
  }
  .poetry-collection-card {
    padding: 0.6rem 0.7rem;
  }
  .poetry-collection-body {
    font-size: 0.92rem;
    line-height: 1.75;
  }
  .poetry-step-actions {
    gap: 0.4rem;
    margin-top: 0.7rem;
  }
  .poetry-step-actions .btn {
    font-size: 0.82rem;
    padding: 0.4rem 0.7rem;
  }
}

@media (max-width: 480px) {
  /* 更小屏幕开场微调 */
  .start-branding { gap: 10px; padding-top: max(50px, env(safe-area-inset-top) + 8px); }
  .branding-title { font-size: clamp(2.2rem, 11vw, 3.2rem); letter-spacing: 0.1em; }
  .start-panel { width: calc(100% - 24px); padding: 24px 20px 18px; gap: 18px; margin: 8px auto 16px; }
  .btn-ascend { border-radius: 20px; font-size: 15px; padding: 11px 0; letter-spacing: 0.18em; }
  .btn-continue { border-radius: 20px; font-size: 14px; padding: 10px 0; }

  /* 更小屏幕：选秀单列，完整展示信息 */
  #select-view .select-grid {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }
  #select-view .select-card {
    display: flex;
    flex-direction: row;
    gap: 0.55rem;
    padding: 0.55rem;
    align-items: stretch;
  }
  #select-view .select-card-img {
    width: 110px;
    height: 150px;
    margin-bottom: 0;
    flex-shrink: 0;
  }
  #select-view .select-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
  }
  #select-view .consort-card-name {
    text-align: left;
    margin-bottom: 0.15rem;
  }
  #select-view .select-hl {
    flex: 1;
  }
  #select-view .select-card .btn-block {
    display: inline-block;
    width: auto;
    flex: none;
    margin-top: 0.15rem;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
  }
}

/* ===== 帝梦浅纸：余下深色面统一盖掉 ===== */
.realm-card,
.works-card,
.start-rank-row,
.select-card,
.folk-card {
  background: linear-gradient(180deg, #f8f1e2, #f0e6d2);
  border-color: var(--line-gold);
}

input, select, textarea,
.talk-row input,
.ai-config input,
.manage-form select,
.manage-form input,
.manage-form textarea {
  background: var(--paper) !important;
  color: var(--ink) !important;
  border-color: var(--line) !important;
}

.talk-log,
.interact-desc,
.progress-bar {
  background: var(--paper-deep);
  border-color: var(--line);
}

.interact-btn {
  background: linear-gradient(180deg, #f8f1e2, #efe3cc);
  border-color: var(--line-gold);
  color: var(--ink);
}

.interact-btn:hover {
  background: linear-gradient(180deg, #fbf4e4, #ead9b4);
  border-color: var(--gold);
}

.progress-fill {
  background: linear-gradient(90deg, #c4a46a, #b08948);
}

.progress-bar.favor .progress-fill {
  background: linear-gradient(90deg, #c9b48a, #b08948);
}

.start-rank-face {
  background: #efe8dc;
}

.portrait-pick-btn {
  background: #efe8dc;
}

.start-rank-meta b {
  color: var(--ink);
}

.stat-item b {
  color: var(--ink);
}

#consort-view,
#official-view,
#select-view,
#exam-view,
#child-view,
#servant-view,
#ties-view,
#taihou-view,
#poetry-view,
#poetry-collection-view,
#court-desk-view {
  background: var(--bg-paper);
}

#exam-view {
  flex-direction: column;
  padding: 1rem;
  overflow-y: auto;
}

.tab.active { color: var(--ink); }

/* ===== 古风UI增强 ===== */

/* 对话框滑入动画 */
@keyframes dialogSlideUp {
  from { transform: translateX(-50%) translateY(40px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0);    opacity: 1; }
}
.dialog-box { animation: dialogSlideUp 0.4s cubic-bezier(0.22,1,0.36,1) both; }

/* 四角角饰已移除（Figma 设计无此元素） */

/* 打字光标 */
.dialog-cursor {
  display: inline-block; width: 2px; height: 1.1em;
  background: var(--gold-dark); margin-left: 2px; vertical-align: middle;
  animation: dialogCursorBlink 0.9s steps(2) infinite;
}
@keyframes dialogCursorBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* 地图暗角层 */
.map-vignette {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(40,30,20,0.45) 100%);
}

/* 右上角植物装饰定位 */
.botanical-decor { position: absolute; top: 0; right: 0; pointer-events: none; z-index: 3; }

/* 对话框文本支持打字时光标内联 */
.dialog-text { white-space: pre-wrap; }

/* 立绘框增强 */
.dialog-portrait {
  box-shadow:
    inset 0 0 0 3px rgba(255,250,240,0.6),
    inset 0 0 0 4px rgba(184,146,76,0.35),
    0 4px 14px rgba(60,40,20,0.15);
}

/* ========== 评花榜表格 ========== */
.flower-rank-table-wrap {
  padding: 8px 4px;
}
.flower-rank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.flower-rank-table thead {
  background: linear-gradient(135deg, #b89a6a, #d4b587);
  color: #fff;
}
.flower-rank-table th {
  padding: 10px 8px;
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.flower-rank-table tbody tr {
  border-bottom: 1px solid rgba(184,154,106,0.25);
  cursor: pointer;
  transition: background 0.15s;
}
.flower-rank-table tbody tr:hover {
  background: rgba(184,154,106,0.12);
}
.flower-rank-table tbody tr:nth-child(-n+3) td.flower-rank {
  color: #b84a4a;
  font-weight: 700;
}
.flower-rank-table td {
  padding: 10px 8px;
  vertical-align: middle;
  color: #3a2e22;
  text-align: center;
}
.flower-rank-table .flower-name {
  font-weight: 500;
  color: #5a3e28;
}
.flower-rank-table .flower-identity {
  font-size: 0.85rem;
  color: #8b6b4a;
}
.flower-rank-table .flower-title {
  font-style: italic;
  color: #b84a4a;
}
.flower-rank-table .flower-price {
  color: #8b4a2a;
  font-weight: 600;
}

/* ========== 青楼男妓属性面板 ========== */
.brothel-reputation {
  color: #b89a6a;
}
.brothel-identity-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(184,154,106,0.2), rgba(184,74,74,0.2));
  color: #8b4a2a;
  font-size: 0.85rem;
  font-weight: 500;
}
.brothel-title-tag {
  color: #b84a4a;
  font-weight: 600;
  font-style: italic;
}
.brothel-price-tag {
  color: #8b4a2a;
  font-weight: 600;
}
.brothel-reviews {
  padding: 8px 0;
}
.brothel-reviews .review-item {
  padding: 6px 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #5a3e28;
  border-bottom: 1px dashed rgba(184,154,106,0.3);
}
.brothel-reviews .review-item:last-child {
  border-bottom: none;
}
.brothel-reviews .review-name {
  color: #b84a4a;
  font-weight: 500;
}
/* 赎身按钮 */
.btn-folk-redeem {
  background: linear-gradient(135deg, #b84a4a, #8b2a2a);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-folk-redeem:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(184,74,74,0.35);
}
.btn-folk-redeem.hidden { display: none; }

/* 外室标记 */
.external-concubine-tag {
  color: #8b6b4a;
  font-size: 0.85rem;
}

/* ========== 六栏存档位 ========== */
.slots-panel {
  width: min(480px, 94vw);
  text-align: left;
}
.slots-panel h3 {
  text-align: center;
}
.slots-panel .select-hint {
  text-align: left;
  margin-bottom: 0.7rem;
}
.slots-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0.3rem 0 1rem;
}
.slot-card {
  border: 1px solid rgba(184, 146, 76, 0.45);
  background: rgba(255, 250, 240, 0.62);
  padding: 0.7rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.slot-card.empty {
  opacity: 0.68;
  border-style: dashed;
}
.slot-card.active {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(201, 162, 39, 0.35);
}
.slot-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.slot-name {
  font-family: var(--font-title);
  color: #8b3a3a;
  font-size: 1.02rem;
  letter-spacing: 0.1em;
}
.slot-badge {
  font-size: 0.7rem;
  color: #6e5424;
  border: 1px solid var(--gold);
  padding: 0.05rem 0.42rem;
  letter-spacing: 0.12em;
}
.slot-info {
  font-size: 0.88rem;
  color: #5c4c3a;
  line-height: 1.6;
}
.slot-progress {
  font-weight: 500;
}
.slot-meta {
  font-size: 0.76rem;
  color: #8a7a62;
  margin-top: 0.1rem;
}
.slot-empty-tip {
  color: #9a8a72;
  font-size: 0.88rem;
}
.slot-actions {
  display: flex;
  gap: 0.5rem;
}
.slot-actions .btn {
  flex: 1;
  padding: 0.5rem 0.8rem;
  font-size: 0.92rem;
  margin-bottom: 0;
}
.slot-actions .slot-del {
  flex: 0 0 auto;
  min-width: 3.6rem;
}
.slot-actions .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .slots-panel {
    width: min(440px, 94vw);
    padding: 1.2rem 1.1rem;
  }
  .slot-card { padding: 0.62rem 0.72rem; }
  .slot-actions .btn { min-height: 2.6rem; }
}

/* ===================== 御花园 · 赏花赋诗 ===================== */

.poetry-step-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  margin-top: 1.2rem;
}

/* 主题选择 */
.poetry-topic-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.poetry-topic-chip {
  padding: 0.35rem 0.85rem;
  background: rgba(139, 90, 43, 0.12);
  border: 1px solid rgba(139, 90, 43, 0.35);
  border-radius: 1.2rem;
  color: #5a3d1f;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.18s ease;
}
.poetry-topic-chip:hover {
  background: rgba(139, 90, 43, 0.2);
}
.poetry-topic-chip.selected {
  background: #8b5a2b;
  color: #fff5e0;
  border-color: #8b5a2b;
  box-shadow: 0 2px 8px rgba(139, 90, 43, 0.3);
}

.poetry-custom-label {
  display: block;
  margin-top: 0.8rem;
}
.poetry-custom-label span {
  display: block;
  font-size: 0.85rem;
  color: #8a7560;
  margin-bottom: 0.3rem;
}
.poetry-custom-label input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid #d4c4a8;
  border-radius: 0.35rem;
  background: #fdf8f0;
  font-size: 0.95rem;
  color: #3d2a15;
}
.poetry-custom-label input:focus {
  outline: none;
  border-color: #8b5a2b;
  box-shadow: 0 0 0 2px rgba(139, 90, 43, 0.15);
}

/* 选人卡片 */
.poetry-consort-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.poetry-consort-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: rgba(253, 248, 240, 0.75);
  border: 2px solid transparent;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.18s ease;
}
.poetry-consort-card:hover {
  background: rgba(253, 248, 240, 0.95);
  transform: translateY(-1px);
}
.poetry-consort-card.selected {
  border-color: #8b5a2b;
  background: rgba(139, 90, 43, 0.08);
  box-shadow: 0 2px 6px rgba(139, 90, 43, 0.2);
}
.poetry-consort-avatar {
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(139, 90, 43, 0.3);
  flex-shrink: 0;
}
.poetry-consort-info {
  flex: 1;
  min-width: 0;
}
.poetry-consort-name {
  font-weight: 600;
  color: #3d2a15;
  font-size: 0.95rem;
}
.poetry-consort-meta {
  font-size: 0.78rem;
  color: #8a7560;
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 移动端更强适配：单列卡片 + 全选按钮行 */
@media (max-width: 560px) {
  .poetry-consort-grid {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
  .poetry-consort-card {
    padding: 0.35rem 0.5rem;
  }
  .poetry-topic-chip {
    font-size: 0.8rem;
    padding: 0.35rem 0.6rem;
    margin: 0.15rem;
  }
  .official-summon-view,
  .poetry-step {
    padding: 0.6rem;
  }
  .poetry-step-actions {
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  .poetry-step-actions .btn {
    flex: 1 1 auto;
    min-width: 45%;
  }
}

/* 加载中 */
.poetry-loading-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.poetry-loading-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.8rem;
  background: rgba(253, 248, 240, 0.6);
  border-radius: 0.35rem;
  font-size: 0.9rem;
}
.poetry-loading-dot {
  color: #8b5a2b;
  animation: poetryPulse 1.4s infinite;
}
@keyframes poetryPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* 诗词展示卡片 */
.poetry-poem-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 0.5rem;
}
.poetry-poem-card {
  display: flex;
  gap: 0.7rem;
  padding: 0.8rem;
  background: rgba(253, 248, 240, 0.8);
  border: 2px solid transparent;
  border-radius: 0.6rem;
  cursor: pointer;
  transition: all 0.18s ease;
}
.poetry-poem-card:hover {
  background: rgba(253, 248, 240, 0.98);
  transform: translateY(-1px);
}
.poetry-poem-card.best {
  border-color: #8b5a2b;
  background: linear-gradient(135deg, rgba(139, 90, 43, 0.1), rgba(139, 90, 43, 0.02));
  box-shadow: 0 3px 10px rgba(139, 90, 43, 0.25);
}
.poetry-poem-avatar {
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(139, 90, 43, 0.3);
  flex-shrink: 0;
}
.poetry-poem-body {
  flex: 1;
  min-width: 0;
}
.poetry-poem-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}
.poetry-poem-name {
  font-weight: 600;
  color: #3d2a15;
}
.poetry-poem-tag {
  font-size: 0.72rem;
  padding: 0.1rem 0.45rem;
  border-radius: 0.7rem;
  background: rgba(139, 90, 43, 0.15);
  color: #8b5a2b;
}
.poetry-poem-text {
  font-family: "KaiTi", "STKaiti", "楷体", serif;
  font-size: 1rem;
  line-height: 1.8;
  color: #3d2a15;
}
.poetry-poem-line {
  text-indent: 0;
}

/* 嘉赏 */
.poetry-reward-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.poetry-reward-card {
  padding: 0.7rem;
  background: rgba(253, 248, 240, 0.8);
  border: 2px solid rgba(139, 90, 43, 0.25);
  border-radius: 0.5rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s ease;
}
.poetry-reward-card:hover:not(.disabled) {
  border-color: #8b5a2b;
  background: rgba(139, 90, 43, 0.08);
}
.poetry-reward-card.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.poetry-reward-title {
  font-weight: 600;
  color: #3d2a15;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}
.poetry-reward-desc {
  font-size: 0.82rem;
  color: #8a7560;
  line-height: 1.5;
}

/* 钦定诗魁概览 */
.poetry-reward-preview {
  grid-column: 1 / -1;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(139, 90, 43, 0.12), rgba(253, 248, 240, 0.9));
  border: 1px solid rgba(139, 90, 43, 0.4);
  border-radius: 0.6rem;
  margin-bottom: 0.3rem;
}
.poetry-reward-preview-title {
  font-family: "KaiTi", "STKaiti", "楷体", serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: #5a3d1f;
  text-align: center;
  margin-bottom: 0.35rem;
}
.poetry-reward-preview-meta {
  text-align: center;
  font-size: 0.82rem;
  color: #8a7560;
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}
.poetry-reward-preview-poem {
  font-family: "KaiTi", "STKaiti", "楷体", serif;
  font-size: 1rem;
  line-height: 1.85;
  color: #3d2a15;
  text-align: center;
}

/* 御园诗集 */
.poetry-collection-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 0.5rem 0;
}
.poetry-collection-empty {
  text-align: center;
  padding: 2rem;
  color: #8a7560;
  font-size: 0.95rem;
  background: rgba(253, 248, 240, 0.5);
  border-radius: 0.5rem;
  border: 1px dashed rgba(139, 90, 43, 0.3);
}
.poetry-collection-card {
  padding: 0.9rem 1rem;
  background: rgba(253, 248, 240, 0.85);
  border-left: 3px solid #8b5a2b;
  border-radius: 0.35rem;
}
.poetry-collection-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}
.poetry-collection-title {
  font-weight: 600;
  color: #3d2a15;
  font-size: 1rem;
}
.poetry-collection-author {
  font-size: 0.82rem;
  color: #8a7560;
}
.poetry-collection-body {
  font-family: "KaiTi", "STKaiti", "楷体", serif;
  font-size: 1rem;
  line-height: 1.9;
  color: #3d2a15;
  margin-bottom: 0.4rem;
}
.poetry-collection-reward {
  font-size: 0.75rem;
  color: #a08060;
  font-style: italic;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .poetry-consort-grid {
    grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  }
  .poetry-reward-options {
    grid-template-columns: 1fr 1fr;
  }
  .poetry-poem-text {
    font-size: 0.95rem;
  }
}


/* ===== 20261003: 任何 modal 打开时隐藏游戏主界面的两个顶部浮栏 ===== */
#game-screen:has(.modal:not(.hidden)) .status-line,
#game-screen:has(.modal:not(.hidden)) .float-buttons {
  display: none !important;
  visibility: hidden !important;
}
body:has(.modal:not(.hidden)) #game-screen .status-line,
body:has(.modal:not(.hidden)) #game-screen .float-buttons {
  display: none !important;
  visibility: hidden !important;
}
/* 兼容旧浏览器不支持 :has() — 用 JS 加 .modal-open class */
body.modal-open #game-screen .status-line,
body.modal-open #game-screen .float-buttons {
  display: none !important;
  visibility: hidden !important;
}

/* ===== 20261003: 列表/立绘/名册页面也隐藏顶栏 ===== */
/* 这些 view 是纯列表展示，不是游戏主界面 */
#game-screen:has(#consort-view.active) .status-line,
#game-screen:has(#consort-view.active) .float-buttons,
#game-screen:has(#official-view.active) .status-line,
#game-screen:has(#official-view.active) .float-buttons,
#game-screen:has(#house-view.active) .status-line,
#game-screen:has(#house-view.active) .float-buttons,
#game-screen:has(#child-view.active) .status-line,
#game-screen:has(#child-view.active) .float-buttons,
#game-screen:has(#servant-view.active) .status-line,
#game-screen:has(#servant-view.active) .float-buttons,
#game-screen:has(#cold-view.active) .status-line,
#game-screen:has(#cold-view.active) .float-buttons,
#game-screen:has(#taihou-view.active) .status-line,
#game-screen:has(#taihou-view.active) .float-buttons,
#game-screen:has(#select-view.active) .status-line,
#game-screen:has(#select-view.active) .float-buttons,
#game-screen:has(#exam-view.active) .status-line,
#game-screen:has(#exam-view.active) .float-buttons,
#game-screen:has(#poetry-view.active) .status-line,
#game-screen:has(#poetry-view.active) .float-buttons,
#game-screen:has(#poetry-collection-view.active) .status-line,
#game-screen:has(#poetry-collection-view.active) .float-buttons,
#game-screen:has(#court-desk-view.active) .status-line,
#game-screen:has(#court-desk-view.active) .float-buttons,
#game-screen:has(#ties-view.active) .status-line,
#game-screen:has(#ties-view.active) .float-buttons {
  display: none !important;
  visibility: hidden !important;
}
/* ===== END ===== */

/* 选秀/科举家世文本中的亲族官员姓名高亮 */
.kin-name-hl { color: #b8860b; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.kin-name-hl[data-kin-official] { cursor: pointer; }
.kin-name-hl[data-kin-official]:hover { color: #d4a017; background: rgba(212,175,55,0.12); border-radius: 3px; }

/* ===== 20261004 NPC 交互 UI · Figma 素笺水墨风格 ===== */
.char-sheet {
  background: #F4F1E8 !important;
  width: min(1180px, 96vw);
  height: min(90vh, 780px);
  max-height: 90vh;
  overflow: hidden !important;
  padding: 0 !important;
  position: relative;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
}
.char-sheet .modal-backdrop { background: rgba(244,241,232,0.85); }

/* 雪景庭院底图 */
.char-sheet .npc-bg-image {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: url('../assets/npc_ui/bg_dong.jpg') center/cover no-repeat;
  opacity: 0.72; z-index: 0; pointer-events: none;
}
.char-sheet .npc-bg-top {
  position: absolute; top: 0; left: 0; right: 0; height: 230px;
  background: linear-gradient(180deg, rgba(247,243,232,0.96) 0%, rgba(247,243,232,0) 100%);
  z-index: 1; pointer-events: none;
}
.char-sheet .npc-bg-bottom {
  position: absolute; bottom: 0; left: 0; right: 0; height: 170px;
  background: linear-gradient(180deg, rgba(244,241,232,0) 0%, rgba(244,241,232,0.96) 100%);
  z-index: 1; pointer-events: none;
}

/* 顶部人物身份 */
.char-sheet .npc-header {
  position: absolute; top: 48px; left: 58px; z-index: 10;
  display: flex; flex-direction: column; gap: 12px;
}
.char-sheet .npc-title {
  font-family: 'Noto Serif SC', var(--font-body);
  font-size: 2.9rem; font-weight: 600; color: #2B241C;
  margin: 0; line-height: 1.25; letter-spacing: 0.02em;
}
.char-sheet .npc-subtitle {
  font-family: 'Noto Serif SC', var(--font-body);
  font-size: 1.125rem; color: #5E5243; line-height: 1.5;
  padding: 0 12px; height: 36px;
  display: flex; align-items: center;
  background: rgba(247,242,232,0.8); border-radius: 3px; align-self: flex-start;
}

/* 返回胶囊按钮 */
.char-sheet .modal-close {
  position: absolute !important;
  top: 58px; right: 98px; z-index: 100;
  width: 118px; height: 48px;
  border-radius: 100px !important;
  border: 1px solid #D6CBBF !important;
  background: rgba(247,242,232,0.8) !important;
  box-shadow: 0 6px 16px rgba(43,36,28,0.1) !important;
  color: #2B241C !important;
  font-family: 'Noto Serif SC', var(--font-body);
  font-size: 1.19rem; letter-spacing: 0.2em;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.char-sheet .modal-close .back-icon { width: 19px; height: 19px; flex-shrink: 0; }

/* 布局：左立绘 + 右侧纸绢 */
.char-sheet .consort-layout,
.char-sheet .folk-layout,
.char-sheet .official-sheet {
  position: relative; z-index: 5; height: 100%;
  display: flex; flex-direction: row; gap: 0; padding: 0;
}
.char-sheet .consort-portrait,
.char-sheet .folk-portrait,
.char-sheet .official-portrait,
.char-sheet #heir-portrait {
  position: relative; flex: 0 0 38%;
  min-width: 360px; max-width: 580px;
  height: 100%; padding: 140px 0 24px 48px;
  display: flex; flex-direction: column; justify-content: flex-start;
}
.char-sheet .consort-portrait .portrait-frame,
.char-sheet .folk-portrait .portrait-frame,
.char-sheet .official-portrait .portrait-frame,
.char-sheet #heir-portrait .portrait-frame { display: none; }
.char-sheet .consort-portrait .npc-frame-inner,
.char-sheet .folk-portrait .npc-frame-inner,
.char-sheet .official-portrait .npc-frame-inner,
.char-sheet #heir-portrait .npc-frame-inner {
  position: relative; width: 100%;
  height: calc(100% - 10px); min-height: 420px;
  padding: 4px;
  background: linear-gradient(90deg, rgba(247,242,232,0.96) 0%, rgba(255,253,251,0.96) 6%, rgba(243,239,234,0.95) 92%, rgba(216,205,190,0.96) 100%);
  border: 1px solid #D6CBBF; border-radius: 3px;
  box-shadow: 0 12px 30px rgba(43,36,28,0.1); overflow: hidden;
}
.char-sheet .consort-portrait .npc-frame-inner::after,
.char-sheet .folk-portrait .npc-frame-inner::after,
.char-sheet .official-portrait .npc-frame-inner::after,
.char-sheet #heir-portrait .npc-frame-inner::after {
  content: ''; position: absolute; top: 9px; left: 9px; right: 9px; bottom: 9px;
  border: 1px solid rgba(140,122,94,0.6); border-radius: 1px;
  pointer-events: none; z-index: 2;
}
.char-sheet .npc-frame-bg {
  position: absolute; top: 4px; left: 4px; right: 4px; bottom: 4px;
  width: calc(100% - 8px); height: calc(100% - 8px);
  object-fit: cover; object-position: center top; display: block;
  z-index: 1; background: #E6DED1;
}
.char-sheet .consort-portrait .portrait-name,
.char-sheet .consort-portrait .portrait-rank,
.char-sheet .folk-portrait .portrait-name,
.char-sheet .folk-portrait .portrait-rank,
.char-sheet .official-portrait .portrait-name,
.char-sheet .official-portrait .portrait-rank,
.char-sheet #heir-portrait .portrait-name,
.char-sheet #heir-portrait .portrait-rank,
.char-sheet .consort-portrait::after { display: none; }
/* 隐藏 info 区旧标题（Figma 用顶部 npc-header） */
.char-sheet .consort-info > h3,
.char-sheet .folk-info > h3,
.char-sheet .official-info > h3,
.char-sheet .consort-info > .official-post,
.char-sheet .folk-info > .official-post,
.char-sheet .official-info > .official-post { display: none !important; }

/* 右侧纸绢 */
.char-sheet .consort-right {
  flex: 1; min-width: 0; height: 100%;
  padding: 183px 146px 24px 0;
  position: relative; display: flex; flex-direction: column;
}
.char-sheet .consort-info,
.char-sheet .folk-info,
.char-sheet .official-info {
  position: relative; width: 100%; flex: 1;
  min-height: 300px; margin: 0; padding: 33px 35px;
  background: linear-gradient(90deg, rgba(247,242,232,0.96) 0%, rgba(255,253,251,0.96) 6%, rgba(243,239,234,0.95) 92%, rgba(216,205,190,0.96) 100%);
  border: 1px solid #D6CBBF; border-radius: 3px;
  box-shadow: 0 12px 30px rgba(43,36,28,0.1);
  overflow-y: auto; overflow-x: hidden;
  z-index: 5; gap: 25px;
  display: flex; flex-direction: column;
}

/* 卷轴 */
.char-sheet .npc-scroll-top,
.char-sheet .npc-scroll-bottom {
  position: absolute; height: 14px;
  background: linear-gradient(180deg, #8B6F4F, #D7C7A8, #6A5642);
  border: 1px solid #D6CBBF; border-radius: 7px;
  box-shadow: 0 6px 16px rgba(43,36,28,0.1);
  z-index: 6; pointer-events: none;
}
.char-sheet .consort-right .npc-scroll-top {
  top: calc(183px - 9px); left: -10px; right: -10px;
}
.char-sheet .consort-right .npc-scroll-bottom {
  bottom: calc(24px - 9px); left: -10px; right: -10px;
}

/* 侧边竖向书签 */
.char-sheet .npc-bookmarks {
  position: absolute; right: 76px; top: 219px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 20; background: none; border-bottom: none;
  margin-bottom: 0; padding: 0;
  /* 页签多时（如男妃 6 个）允许竖向滑动，滚动条隐藏 */
  max-height: calc(100% - 244px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.char-sheet .npc-bookmarks::-webkit-scrollbar { display: none; }
.char-sheet .npc-bookmarks .tab {
  position: relative; width: 70px; height: 96px; padding: 0;
  flex: 0 0 auto;
  background: rgba(247,242,232,0.91);
  border: none; border-radius: 3px 3px 18px 18px;
  box-shadow: 0 6px 16px rgba(43,36,28,0.1);
  color: #6B5A4A;
  font-family: 'Noto Serif SC', var(--font-body);
  font-size: 1.3rem; font-weight: 400; line-height: 1.35;
  text-align: center; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; transition: all 0.15s;
}
.char-sheet .npc-bookmarks .tab .bk-dot { width: 4px; height: 4px; border-radius: 50%; background: #8B6F4F; }
.char-sheet .npc-bookmarks .tab:hover { transform: translateX(-2px); }
.char-sheet .npc-bookmarks .tab.active {
  background: #6B5642; color: #FBF7EF; border: 1px solid #D6CBBF;
}
.char-sheet .npc-bookmarks .tab.active .bk-dot { background: #E6DED1; }

/* 隐藏旧的 info 里的 h3 和 tab-bar（我们有新的 npc-bookmarks） */
/* heir-modal 除外，它的 tab-bar 就是 tab-bar 样式，不是 npc-bookmarks */
.char-sheet .consort-info > h3,
.char-sheet .folk-info > h3,
.char-sheet .official-info > h3 { display: none !important; }
.char-sheet .consort-info .tab-bar:not(.npc-bookmarks),
.char-sheet .folk-info .tab-bar:not(.npc-bookmarks),
.char-sheet .official-info .tab-bar:not(.npc-bookmarks) { display: none !important; }
/* 覆盖：heir-modal 的 tab-bar 必须显示 */
#heir-modal.char-modal .char-sheet .consort-info .tab-bar:not(.npc-bookmarks),
#heir-modal .char-sheet .consort-info .tab-bar:not(.npc-bookmarks) { display: flex !important; }

/* 交互徽章网格 */
.char-sheet .npc-badges-grid { display: flex; flex-direction: column; gap: 26px; margin-top: 16px; }
.char-sheet .npc-badge-row { display: flex; flex-direction: row; gap: 26px; justify-content: flex-start; }
.char-sheet .npc-badge {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  cursor: pointer; transition: all 0.15s;
}
.char-sheet .npc-badge:hover { transform: translateY(-2px); }
.char-sheet .npc-badge.disabled { opacity: 0.45; cursor: not-allowed; }
.char-sheet .npc-badge .badge-icon {
  width: 66px; height: 66px; border-radius: 50%;
  background: linear-gradient(135deg, #F7F2E8, #E5D7C0, #B89E73);
  border: 1px solid #D6CBBF;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px rgba(43,36,28,0.12);
  position: relative;
}
.char-sheet .npc-badge .badge-icon::before {
  content: ''; position: absolute;
  width: 54px; height: 54px; border-radius: 50%;
  background: #FBF7EF;
}
.char-sheet .npc-badge .badge-icon img { position: relative; z-index: 1; width: 28px; height: 28px; }
.char-sheet .npc-badge .badge-label {
  width: 145px; height: 58px;
  background: linear-gradient(180deg, rgba(247,242,232,0.96), rgba(243,239,234,0.96));
  border: 1px solid #D6CBBF;
  border-radius: 18px 3px 18px 3px;
  box-shadow: 0 4px 10px rgba(43,36,28,0.08);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Noto Serif SC', var(--font-body);
  font-size: 1.05rem; color: #2B241C;
}

/* 次级按钮区 */
.char-sheet .interact-secondary {
  margin-top: 20px; padding-top: 16px;
  border-top: 1px dashed rgba(184,160,122,0.3);
  display: flex; flex-wrap: wrap; gap: 10px;
}

/* 交互 tab 的进度条/心境/恩宠 */
.char-sheet #tab-interact .mood-bar-wrap,
.char-sheet #tab-interact .favor-bar-wrap {
  display: flex; align-items: center; gap: 10px;
}
.char-sheet #tab-interact .mood-bar-wrap label,
.char-sheet #tab-interact .favor-bar-wrap label { font-size: 1.05rem; color: #6B5A4A; flex-shrink: 0; }
.char-sheet #tab-interact .progress-bar {
  flex: 1; height: 5px;
  border: 1px solid rgba(184,160,122,0.27);
  background: #E6DED1; border-radius: 3px;
}
.char-sheet #tab-interact .progress-fill { background: #8B6F4F; border-radius: 3px; }

/* 其他 modal 的统一宽度 */
.char-sheet.official-panel,
.char-sheet.folk-panel { width: min(1300px, 96vw) !important; padding: 0 !important; }

/* 响应式 — 平板 */
@media (max-width: 1100px) {
  .char-sheet .npc-bookmarks { right: 40px; gap: 8px; max-height: calc(100% - 240px); overflow-y: auto; scrollbar-width: none; }
  .char-sheet .npc-bookmarks::-webkit-scrollbar { display: none; }
  .char-sheet .npc-bookmarks .tab { width: 60px; height: 82px; font-size: 1.1rem; }
  .char-sheet .consort-portrait { flex: 0 0 42%; padding-left: 36px; }
  .char-sheet .consort-right { padding-right: 110px; }
}

/* 响应式 — 手机横屏 + 大手机竖屏 + iPad 竖屏（≤900px） */
@media (max-width: 900px) {
  /* 面板本身成为唯一滚动容器 */
  .char-sheet {
    width: 100vw !important;
    height: 100dvh;
    max-height: none;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    border-radius: 0;
    padding-bottom: 120px !important; /* 给底部书签条留空间 */
  }
  .char-sheet .npc-bg-image,
  .char-sheet .npc-bg-top,
  .char-sheet .npc-bg-bottom {
    position: fixed; /* 背景不随滚动动 */
    inset: 0;
  }

  /* 头部：缩小偏移，避免挤占 */
  .char-sheet .npc-header {
    position: relative; top: 0; left: 0;
    padding: 64px 16px 12px 16px;
    gap: 6px;
  }
  .char-sheet .npc-title { font-size: 1.8rem !important; }
  .char-sheet .npc-subtitle { font-size: 0.95rem; height: 30px; padding: 0 10px; }
  .char-sheet .modal-close {
    position: fixed !important;
    top: 12px; right: 12px; z-index: 200;
    width: auto; height: 36px; padding: 0 14px;
    font-size: 0.95rem; letter-spacing: 0.1em;
    gap: 4px;
  }
  .char-sheet .modal-close .back-icon { width: 16px; height: 16px; }

  /* 布局：纵向堆叠，不再用 height:100% */
  .char-sheet .consort-layout {
    position: relative; z-index: 5;
    height: auto; min-height: auto;
    display: flex; flex-direction: column; gap: 0;
  }
  .char-sheet .consort-portrait {
    position: relative; flex: 0 0 auto; height: auto; max-width: 100%;
    padding: 0 16px 16px 16px;
    min-width: 0;
  }
  .char-sheet .consort-portrait .npc-frame-inner {
    min-height: 280px; max-height: 48vh;
  }
  .char-sheet .consort-right {
    flex: none; height: auto; min-width: 0;
    padding: 16px 16px 0 16px;
  }
  .char-sheet .consort-info,
  .char-sheet .folk-info,
  .char-sheet .official-info {
    position: relative;
    flex: none;
    overflow: visible; /* 让整个面板滚，info 自己不滚 */
    min-height: auto;
    padding: 20px 18px 28px 18px;
    gap: 16px;
  }

  /* 卷轴简化为仅右侧纸绢上下端 */
  .char-sheet .consort-right .npc-scroll-top,
  .char-sheet .consort-right .npc-scroll-bottom {
    position: relative;
  }
  .char-sheet .consort-right .npc-scroll-top {
    top: auto; margin-bottom: -10px; left: 0; right: 0;
  }
  .char-sheet .consort-right .npc-scroll-bottom {
    bottom: auto; margin-top: -10px; left: 0; right: 0;
  }

  /* 书签导航：底部横排固定，页签多时可横向滑动 */
  .char-sheet .npc-bookmarks {
    position: fixed !important;
    left: 50%; bottom: 10px; transform: translateX(-50%);
    right: auto; top: auto;
    z-index: 199;
    flex-direction: row; gap: 6px;
    padding: 6px 8px;
    background: rgba(247,242,232,0.94);
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(43,36,28,0.14);
    max-width: min(94vw, 480px);
    overflow-x: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }
  .char-sheet .npc-bookmarks::-webkit-scrollbar { display: none; }
  .char-sheet .npc-bookmarks .tab {
    position: relative;
    flex: 0 0 auto;
    width: 44px; height: 54px; padding: 2px 0;
    font-size: 0.82rem; line-height: 1.2;
    border-radius: 10px 10px 14px 14px;
  }

  /* 交互徽章网格改单列 */
  .char-sheet .npc-badges-grid { gap: 16px; }
  .char-sheet .npc-badge-row { flex-wrap: wrap; gap: 12px; }
  .char-sheet .npc-badge .badge-icon { width: 52px; height: 52px; }
  .char-sheet .npc-badge .badge-icon::before { width: 42px; height: 42px; }
  .char-sheet .npc-badge .badge-icon img { width: 22px; height: 22px; }
  .char-sheet .npc-badge .badge-label {
    width: auto; height: 40px; padding: 0 12px;
    font-size: 0.92rem;
  }
}

/* 响应式 — 小屏手机（≤480px）进一步压缩 */
@media (max-width: 480px) {
  .char-sheet .npc-title { font-size: 1.5rem !important; }
  .char-sheet .npc-subtitle { font-size: 0.85rem; height: 26px; }
  .char-sheet .consort-portrait .npc-frame-inner {
    min-height: 220px; max-height: 42vh;
  }
  .char-sheet .consort-info,
  .char-sheet .folk-info,
  .char-sheet .official-info {
    padding: 16px 14px 24px 14px;
    gap: 12px;
    font-size: 0.92rem;
  }
  .char-sheet .npc-bookmarks .tab {
    width: 40px; height: 50px; padding: 2px 0;
    font-size: 0.78rem;
  }
  .char-sheet { padding-bottom: 110px !important; }
}

/* ===== 20261004v 全局修复：char-sheet 类与旧规则冲突 =====
   问题：2796行/6189行/.modal-panel(2750)/.consort-panel(2825) 四处打架
   解决方案：用最高优先级选择器统一覆盖（仅限 900px 以下移动端）*/

/* 900px 以下：铺满并允许滚动 */
@media (max-width: 900px) {
  .char-modal {
    align-items: stretch !important;
    justify-content: stretch !important;
  }

  /* modal-panel.char-sheet 组合 — 覆盖 .modal-panel 和 .consort-panel */
  .modal-panel.char-sheet,
  .modal-panel.char-sheet.consort-panel,
  .modal-panel.char-sheet.official-panel,
  .modal-panel.char-sheet.folk-panel {
    width: 100vw !important;
    height: 100dvh !important;
    max-width: none !important;
    max-height: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 120px !important;
  }
  /* 所有 char-sheet 内的子元素都不要设 height:100% 卡死滚动 */
  .modal-panel.char-sheet .consort-layout,
  .modal-panel.char-sheet .folk-layout,
  .modal-panel.char-sheet .official-sheet {
    height: auto !important;
    min-height: auto !important;
    min-width: 0 !important;
  }
  .modal-panel.char-sheet .consort-portrait,
  .modal-panel.char-sheet .folk-portrait,
  .modal-panel.char-sheet .official-portrait {
    height: auto !important;
    min-width: 0 !important;
  }
  .modal-panel.char-sheet .consort-right {
    height: auto !important;
    min-width: 0 !important;
  }
  /* info 区域不要自己滚，让整个面板滚 */
  .modal-panel.char-sheet .consort-info,
  .modal-panel.char-sheet .folk-info,
  .modal-panel.char-sheet .official-info {
    overflow: visible !important;
    flex: none !important;
  }
  /* 卷轴改为 relative 跟随内容流 */
  .modal-panel.char-sheet .consort-right .npc-scroll-top,
  .modal-panel.char-sheet .consort-right .npc-scroll-bottom {
    position: relative !important;
    top: auto !important;
    bottom: auto !important;
    left: 0 !important;
    right: 0 !important;
    margin: -10px 0 !important;
  }
  /* 背景层固定不随滚动走 */
  .modal-panel.char-sheet .npc-bg-image,
  .modal-panel.char-sheet .npc-bg-top,
  .modal-panel.char-sheet .npc-bg-bottom {
    position: fixed !important;
    inset: 0 !important;
  }
  /* 头部改为流式定位 */
  .modal-panel.char-sheet .npc-header {
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    padding: 64px 16px 12px 16px !important;
  }
  .modal-panel.char-sheet .npc-title { font-size: 1.8rem !important; }
  .modal-panel.char-sheet .npc-subtitle { font-size: 0.95rem !important; height: 30px; padding: 0 10px; }
  /* 返回按钮固定右上角 */
  .modal-panel.char-sheet .modal-close {
    position: fixed !important;
    top: 12px !important;
    right: 12px !important;
    width: auto !important; height: 36px !important;
    padding: 0 14px !important;
    font-size: 0.95rem !important;
    letter-spacing: 0.1em !important;
  }
  /* 立绘容器 */
  .modal-panel.char-sheet .consort-portrait {
    padding: 0 16px 16px 16px !important;
    flex: 0 0 auto !important;
    max-width: 100% !important;
  }
  .modal-panel.char-sheet .consort-portrait .npc-frame-inner {
    min-height: 280px !important;
    max-height: 48vh !important;
  }
  /* 右侧纸绢 */
  .modal-panel.char-sheet .consort-right {
    padding: 16px 16px 0 16px !important;
    flex: none !important;
  }
  /* 书签导航固定底部横排，页签多时可横向滑动 */
  .modal-panel.char-sheet .npc-bookmarks {
    position: fixed !important;
    left: 50% !important;
    bottom: 10px !important;
    top: auto !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    flex-direction: row !important;
    gap: 6px !important;
    padding: 6px 8px !important;
    background: rgba(247,242,232,0.94) !important;
    border-radius: 999px !important;
    z-index: 199 !important;
    max-width: min(94vw, 480px) !important;
    overflow-x: auto !important;
    overscroll-behavior: contain !important;
    scrollbar-width: none !important;
  }
  .modal-panel.char-sheet .npc-bookmarks::-webkit-scrollbar { display: none !important; }
  .modal-panel.char-sheet .npc-bookmarks .tab {
    position: relative !important;
    flex: 0 0 auto !important;
    width: 44px !important; height: 54px !important;
    padding: 2px 0 !important;
    font-size: 0.82rem !important;
    line-height: 1.2 !important;
    border-radius: 10px 10px 14px 14px !important;
  }
  /* 徽章网格 */
  .modal-panel.char-sheet .npc-badge-row { flex-wrap: wrap !important; gap: 12px !important; }
  .modal-panel.char-sheet .npc-badge .badge-icon { width: 52px !important; height: 52px !important; }
  .modal-panel.char-sheet .npc-badge .badge-icon::before { width: 42px !important; height: 42px !important; }
  .modal-panel.char-sheet .npc-badge .badge-icon img { width: 22px !important; height: 22px !important; }
  .modal-panel.char-sheet .npc-badge .badge-label {
    width: auto !important; height: 40px !important;
    padding: 0 12px !important;
    font-size: 0.92rem !important;
  }
}

/* ===== 平板横屏专用断点（901px ~ 1400px）===== */
@media (min-width: 901px) and (max-width: 1400px) {
  /* 面板不铺满，保留适当宽度 */
  .modal-panel.char-sheet {
    width: 92vw !important;
    max-width: 1180px !important;
    height: 88vh !important;
    max-height: 88vh !important;
    overflow: hidden !important;
    position: relative !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12) !important;
    margin: 4vh auto !important;
  }

  /* 立绘比例压缩到 38% */
  .modal-panel.char-sheet .consort-portrait,
  .modal-panel.char-sheet .official-portrait {
    flex: 0 0 38% !important;
    max-width: 38% !important;
  }

  /* 右侧纸绢区域 */
  .modal-panel.char-sheet .consort-right {
    flex: 1 !important;
    min-width: 0 !important;
  }

  /* 立绘框自适应 */
  .modal-panel.char-sheet .npc-frame-inner {
    min-height: 0 !important;
    height: 100% !important;
    max-height: 58vh !important;
  }

  /* 头部恢复 absolute 定位 */
  .modal-panel.char-sheet .npc-header {
    position: absolute !important;
    top: 36px !important;
    left: 44px !important;
    padding: 0 !important;
    gap: 8px !important;
  }

  /* 标题缩小 */
  .modal-panel.char-sheet .npc-title {
    font-size: 2.1rem !important;
    font-weight: 600 !important;
  }

  /* 题签缩小 */
  .modal-panel.char-sheet .npc-subtitle {
    font-size: 0.95rem !important;
    height: 30px !important;
    padding: 0 10px !important;
  }

  /* 书签导航恢复竖排，右侧固定，页签多时可竖向滑动 */
  .modal-panel.char-sheet .npc-bookmarks {
    position: absolute !important;
    right: 56px !important;
    top: 52% !important;
    bottom: auto !important;
    left: auto !important;
    transform: translateY(-50%) !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding: 0 !important;
    background: none !important;
    border-radius: 0 !important;
    max-height: calc(100% - 40px) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    scrollbar-width: none !important;
  }
  .modal-panel.char-sheet .npc-bookmarks::-webkit-scrollbar { display: none !important; }

  .modal-panel.char-sheet .npc-bookmarks .tab {
    width: 56px !important;
    height: 72px !important;
    padding: 2px 0 !important;
    font-size: 0.88rem !important;
    flex: 0 0 auto !important;
  }

  /* 交互徽章压缩 */
  .modal-panel.char-sheet .npc-badge .badge-icon {
    width: 48px !important;
    height: 48px !important;
  }

  .modal-panel.char-sheet .npc-badge .badge-label {
    font-size: 0.82rem !important;
    height: 34px !important;
    padding: 0 10px !important;
  }

  /* 背景层恢复 absolute */
  .modal-panel.char-sheet .npc-bg-image,
  .modal-panel.char-sheet .npc-bg-top,
  .modal-panel.char-sheet .npc-bg-bottom {
    position: absolute !important;
  }

  /* 卷轴恢复 absolute */
  .modal-panel.char-sheet .consort-right .npc-scroll-top,
  .modal-panel.char-sheet .consort-right .npc-scroll-bottom {
    position: absolute !important;
  }

  /* 属性区压缩 */
  .modal-panel.char-sheet .consort-info,
  .modal-panel.char-sheet .official-info,
  .modal-panel.char-sheet .folk-info {
    padding: 20px 18px !important;
    gap: 10px !important;
    font-size: 0.92rem !important;
    line-height: 1.5 !important;
  }

  /* 内容区可以滚 */
  .modal-panel.char-sheet .consort-info {
    overflow-y: auto !important;
    flex: 1 !important;
    max-height: none !important;
  }

  /* 返回按钮压缩 */
  .modal-panel.char-sheet .modal-close {
    position: absolute !important;
    top: 20px !important;
    right: 20px !important;
    width: auto !important;
    height: 34px !important;
    padding: 0 12px !important;
    font-size: 0.9rem !important;
  }
}

/* 480px 小屏进一步压缩 */
@media (max-width: 480px) {
  .modal-panel.char-sheet .npc-title { font-size: 1.5rem !important; }
  .modal-panel.char-sheet .consort-portrait .npc-frame-inner {
    min-height: 220px !important; max-height: 42vh !important;
  }
  .modal-panel.char-sheet .consort-info,
  .modal-panel.char-sheet .folk-info,
  .modal-panel.char-sheet .official-info {
    padding: 16px 14px 24px 14px !important;
    gap: 12px !important;
    font-size: 0.92rem !important;
  }
  .modal-panel.char-sheet .npc-bookmarks .tab {
    width: 40px !important; height: 50px !important;
    font-size: 0.78rem !important;
  }
  .modal-panel.char-sheet { padding-bottom: 110px !important; }
}

/* ============ 册封典礼 Coronation ============ */

.coronation-view-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.coronation-view-wrap.active {
  display: flex;
  flex-direction: column;
}

/* ======== 合卺大典（结婚典礼） ======== */
.wedding-view-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.wedding-view-wrap.active {
  display: flex;
  flex-direction: column;
}
/* wedding 复用 coro-bg 类名，覆盖 background-image */
.wedding-view-wrap .coro-bg-hall {
  background-image: url('../assets/scenes/wedding-hall.jpg');
}
.wedding-view-wrap .coro-bg-carriage {
  background-image: url('../assets/scenes/wedding-cup.jpg');
}

/* wedding toast：喜红底而非金色 */
.coro-toast.wed-toast {
  background: linear-gradient(135deg, #8b1a1a 0%, #a82525 50%, #6b0f0f 100%);
  border: 2px solid #d4a574;
  box-shadow: 0 4px 20px rgba(139, 26, 26, 0.6), 0 0 30px rgba(212, 165, 116, 0.3);
}
.wed-toast-title {
  color: #f5d79a;
}

/* ======== 公爵大典（晋封国公） ======== */
.duke-view-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.duke-view-wrap.active {
  display: flex;
  flex-direction: column;
}
.duke-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
  background-image: url('../assets/scenes/noble-hall.jpg');
}
.duke-toast {
  background: linear-gradient(135deg, #2a1a4a 0%, #4a2870 50%, #1a0f3a 100%);
  border: 2px solid #d4a574;
  box-shadow: 0 4px 20px rgba(74, 40, 112, 0.6), 0 0 30px rgba(212, 165, 116, 0.3);
}
.duke-toast-title {
  color: #f5d79a;
}
.coro-reaction-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 165, 116, 0.5), transparent);
  margin: 16px 0 12px;
  width: 80%;
  margin-left: auto;
  margin-right: auto;
}

.coro-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
  transition: opacity 0.6s ease;
}

.coro-bg-hall {
  background-image: url('../assets/scenes/coronation-hall.jpg');
}

.coro-bg-carriage {
  background-image: url('../assets/scenes/coronation-carriage.jpg');
}

.coronation-view-wrap #coro-step-carriage .coro-bg-hall {
  opacity: 0;
}

.coronation-view-wrap #coro-step-carriage .coro-bg-carriage {
  opacity: 1;
}

.coro-overlay {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px 32px 32px 32px;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.55) 0%,
    rgba(0,0,0,0.25) 25%,
    rgba(0,0,0,0.15) 50%,
    rgba(0,0,0,0.35) 85%,
    rgba(0,0,0,0.75) 100%
  );
}

.coronation-view-wrap .consort-list-header h2 {
  color: #fff8e7;
  text-shadow: 0 2px 8px rgba(0,0,0,0.7), 0 0 24px rgba(255,200,120,0.4);
  font-family: '楷体', 'KaiTi', 'STKaiti', serif;
  font-size: 1.6rem;
  letter-spacing: 0.08em;
}

.coro-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px 0;
  gap: 20px;
}

.coro-hint {
  color: #ffe9b0;
  font-family: '楷体', 'KaiTi', 'STKaiti', serif;
  font-size: 1.3rem;
  text-align: center;
  text-shadow: 0 2px 6px rgba(0,0,0,0.8);
  letter-spacing: 0.12em;
  animation: coroPulse 3s ease-in-out infinite;
}

@keyframes coroPulse {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; text-shadow: 0 2px 10px rgba(0,0,0,0.9), 0 0 30px rgba(255,200,120,0.6); }
}

.coro-enter-btn {
  font-family: '楷体', 'KaiTi', 'STKaiti', serif;
  font-size: 1.1rem;
  padding: 12px 36px;
  background: linear-gradient(180deg, #d4a84b 0%, #a67c2e 100%);
  border: 1px solid #8b6420;
  color: #fff8e0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.3);
  letter-spacing: 0.1em;
}

.coro-enter-btn:hover {
  background: linear-gradient(180deg, #e8ba5c 0%, #b88a38 100%);
  transform: translateY(-1px);
}

.coro-text-box,
.coro-reaction-box,
.coro-court-box,
.coro-guidance-box,
.coro-carriage-box {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 36px;
  background: rgba(45, 30, 20, 0.82);
  border: 1px solid rgba(212, 168, 75, 0.55);
  border-radius: 4px;
  backdrop-filter: blur(4px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.6), inset 0 0 40px rgba(212, 168, 75, 0.06);
}

.coro-text-box {
  border-image: linear-gradient(180deg, rgba(212,168,75,0.6), rgba(139,100,32,0.4)) 1;
}

.coro-narration {
  color: #f5e6c8;
  font-family: '楷体', 'KaiTi', 'STKaiti', serif;
  font-size: 1.05rem;
  line-height: 2;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 3px rgba(0,0,0,0.85);
}
.coro-narration p {
  text-indent: 2em;
  margin: 0 0 0.6em 0;
}
.coro-narration p:last-child { margin-bottom: 0; }

.coro-loading {
  color: #d4a84b;
  font-family: '楷体', 'KaiTi', 'STKaiti', serif;
  text-align: center;
  font-size: 1.1rem;
  animation: coroLoadingPulse 1.5s ease-in-out infinite;
}

@keyframes coroLoadingPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.coro-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 8px;
}

.coro-reaction-box,
.coro-court-box,
.coro-guidance-box,
.coro-carriage-box {
  background: rgba(30, 20, 15, 0.88);
}

.coro-reaction-title,
.coro-court-title {
  color: #d4a84b;
  font-family: '楷体', 'KaiTi', 'STKaiti', serif;
  font-size: 1rem;
  letter-spacing: 0.15em;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(212, 168, 75, 0.3);
}

.coro-reaction-text {
  color: #f5e6c8;
  font-family: '楷体', 'KaiTi', 'STKaiti', serif;
  font-size: 1rem;
  line-height: 1.9;
  text-indent: 2em;
}

.coro-court-text {
  color: #e8d8b8;
  font-family: '楷体', 'KaiTi', 'STKaiti', serif;
  font-size: 0.95rem;
  line-height: 1.8;
  font-style: italic;
}

.coro-carriage-box {
  background: rgba(20, 15, 10, 0.72);
  border-color: rgba(180, 120, 60, 0.5);
}

.coro-carriage-text {
  color: #f5e6c8;
  font-family: '楷体', 'KaiTi', 'STKaiti', serif;
  font-size: 1.05rem;
  line-height: 2;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 3px rgba(0,0,0,0.85);
}
.coro-carriage-text p { text-indent: 2em; margin: 0 0 0.6em 0; }
.coro-carriage-text p:last-child { margin-bottom: 0; }

.coro-guidance-title {
  color: #d4a84b;
  font-family: '楷体', 'KaiTi', 'STKaiti', serif;
  font-size: 1.05rem;
  letter-spacing: 0.15em;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(212, 168, 75, 0.4);
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

.coro-guidance-text {
  color: #f5e6c8;
  font-family: '楷体', 'KaiTi', 'STKaiti', serif;
  font-size: 1rem;
  line-height: 1.9;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 3px rgba(0,0,0,0.85);
}
.coro-guidance-text p { margin: 0 0 0.5em 0; }
.coro-guidance-text p:last-child { margin-bottom: 0; }

/* ============ 前置播报 Toast ============ */

.coro-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  z-index: 9999;
  max-width: 560px;
  width: 90%;
  padding: 16px 28px;
  background: linear-gradient(180deg, rgba(80, 50, 20, 0.95), rgba(45, 28, 15, 0.97));
  border: 1px solid rgba(212, 168, 75, 0.7);
  border-radius: 6px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.7), inset 0 0 30px rgba(212, 168, 75, 0.1);
  color: #ffe9b0;
  font-family: '楷体', 'KaiTi', 'STKaiti', serif;
  font-size: 1.05rem;
  text-align: center;
  letter-spacing: 0.06em;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}
.coro-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.coro-toast .coro-toast-title {
  font-size: 1.2rem;
  color: #ffd87a;
  letter-spacing: 0.15em;
  margin-bottom: 6px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.8);
}
.coro-toast .coro-toast-sub {
  font-size: 0.95rem;
  color: #e8d8a8;
}

/* 凤辇步骤需要背景切换 */

/* 简化：直接用 JS 控制 hidden 类 */

@media (max-width: 760px) {
  .coronation-view-wrap .coro-overlay { padding: 12px 16px 24px 16px; }
  .coronation-view-wrap .consort-list-header h2 { font-size: 1.2rem; }
  .coro-hint { font-size: 1.05rem; letter-spacing: 0.06em; }
  .coro-text-box, .coro-reaction-box, .coro-court-box, .coro-carriage-box {
    padding: 18px 20px;
  }
  .coro-narration, .coro-carriage-text { font-size: 0.95rem; line-height: 1.8; }
}

/* ===== 木兰围场 / 祭祀大典 通用 ===== */
#hunt-view, #sacrifice-view {
  flex-direction: column; padding: 1.5rem; overflow-y: auto; -webkit-overflow-scrolling: touch; gap: 1rem;
  background: linear-gradient(180deg, #f9f3e7 0%, #f3ead8 100%);
}

/* 选人 tab 栏 */
.hunt-tabs, .sacrifice-tabs {
  display: flex; gap: 0.6rem; flex-wrap: wrap;
  padding: 0.5rem 0;
}
.hunt-tab, .sacrifice-tab {
  padding: 0.5rem 1rem;
  border: 1px solid #c8b68d;
  background: #fffaf0;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #6b5d48;
  cursor: pointer;
  transition: all 0.15s;
}
.hunt-tab:hover:not(.empty), .sacrifice-tab:hover:not(.empty) {
  background: #f0e4c8;
}
.hunt-tab.selected, .sacrifice-tab.selected {
  background: linear-gradient(180deg, #e8d9a8, #d4c07a);
  border-color: #b79a63;
  color: #5a4520;
  font-weight: 600;
}
.hunt-tab.empty, .sacrifice-tab.empty {
  opacity: 0.4; cursor: not-allowed;
}

/* 选人提示 */
.hunt-people-hint, .sacrifice-hint {
  padding: 0.5rem 0.8rem;
  background: rgba(183, 154, 99, 0.1);
  border-left: 3px solid #b79a63;
  color: #7a6b52;
  font-size: 0.9rem;
  border-radius: 0 4px 4px 0;
}

/* 操作按钮栏 */
.hunt-people-actions, .sacrifice-actions {
  display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center;
}

/* 选人卡片网格 */
.hunt-grid, .sacrifice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  padding: 0.5rem 0 2rem 0;
}

.hunt-person-card, .sacrifice-person-card {
  display: flex; gap: 0.6rem; align-items: center;
  padding: 0.6rem;
  border: 2px solid transparent;
  background: #fffaf0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.hunt-person-card:hover, .sacrifice-person-card:hover {
  border-color: #c8b68d;
  background: #fdf5e0;
}
.hunt-person-card.selected, .sacrifice-person-card.selected {
  border-color: #b79a63;
  background: linear-gradient(180deg, #faf0d4, #f0e0b4);
  box-shadow: 0 2px 8px rgba(183, 154, 99, 0.3);
}

.hunt-person-avatar, .sacrifice-person-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #d4c07a;
  flex-shrink: 0;
}

.hunt-person-info, .sacrifice-person-info {
  flex: 1; min-width: 0;
}
.hunt-person-name, .sacrifice-person-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: #5a4520;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hunt-person-meta, .sacrifice-person-meta {
  font-size: 0.78rem;
  color: #8b7764;
  margin-top: 2px;
}

.hunt-empty, .sacrifice-empty {
  grid-column: 1/-1; text-align: center; padding: 2rem;
  color: #a89578; font-style: italic;
}

/* 加载中 */
.hunt-load {
  text-align: center; padding: 2rem;
}
.hunt-load-title {
  font-size: 1.1rem; color: #5a4520; font-weight: 600; margin-bottom: 0.5rem;
}
.hunt-load-sub {
  font-size: 0.9rem; color: #8b7764;
}

/* 剧情容器 - 双列布局 */
.hunt-event-box, .sacrifice-event-box {
  padding: 0;
}
.hunt-event-layout {
  display: flex; gap: 1.5rem;
  min-height: 200px;
}
.hunt-event-choices {
  display: flex; flex-direction: column; gap: 0.75rem;
  width: 200px; flex-shrink: 0;
}
.hunt-choice-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 0.8rem;
  background: #fffaf0;
  border: 1px solid #c8b68d;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #5a4520;
  transition: all 0.15s;
  text-align: left;
}
.hunt-choice-item:hover {
  background: #f0e4c8;
  border-color: #b79a63;
}
.hunt-choice-diamond {
  color: #b79a63; font-size: 0.75rem;
}
.hunt-event-main {
  flex: 1; background: #fffaf0;
  border: 1px solid #d4c07a;
  border-radius: 8px;
  padding: 1.2rem 1.5rem;
}
.hunt-event-head {
  font-size: 0.95rem;
  color: #8b3e31;
  font-weight: 600;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed #d4c07a;
}
.hunt-event-body-figma {
  font-size: 0.95rem;
  line-height: 1.8;
  color: #3d3020;
  text-indent: 2em;
}

/* 剧情结果 */
.hunt-event-resolve-head {
  background: #fffaf0;
  border: 1px solid #d4c07a;
  border-radius: 8px;
  padding: 1.2rem 1.5rem;
}
.hunt-event-chosen {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  color: #8b3e31;
  margin: 1rem 0;
  padding: 0.6rem;
  background: rgba(139, 62, 49, 0.08);
  border-radius: 4px;
}
.hunt-event-result {
  font-size: 0.95rem;
  line-height: 1.8;
  color: #3d3020;
  padding: 1rem;
  background: #fdf8ec;
  border-left: 3px solid #b79a63;
  border-radius: 0 4px 4px 0;
}

.hunt-event-footer {
  margin-top: 1.2rem; text-align: center;
}
.hunt-btn-primary {
  padding: 0.6rem 1.5rem;
  background: linear-gradient(180deg, #e8d9a8, #d4c07a);
  border: 1px solid #b79a63;
  border-radius: 6px;
  color: #5a4520;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.15s;
}
.hunt-btn-primary:hover {
  background: linear-gradient(180deg, #d4c07a, #c0a860);
}
.hunt-btn {
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
}

/* 祭祀大典 - 典礼固定文案 */
.sacrifice-ritual-box {
  background: #fffaf0;
  border: 1px solid #d4c07a;
  border-radius: 8px;
  padding: 1.5rem 1.8rem;
}
.sacrifice-ritual-header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #b79a63;
}
.sacrifice-ritual-era {
  font-size: 0.85rem; color: #8b7764;
}
.sacrifice-ritual-title {
  font-size: 1.4rem; font-weight: 600;
  color: #8b3e31;
  margin: 0.3rem 0;
}
.sacrifice-ritual-host {
  font-size: 0.95rem; color: #5a4520;
}
.sacrifice-ritual-opening,
.sacrifice-ritual-closing {
  font-size: 0.95rem; line-height: 1.9;
  color: #3d3020; text-indent: 2em;
}
.sacrifice-ritual-prayer {
  margin: 1.2rem 0;
  padding: 1rem 1.5rem;
  background: #fdf8ec;
  border-left: 3px solid #8b3e31;
  border-radius: 0 4px 4px 0;
  font-size: 0.92rem;
  line-height: 2;
  color: #5a4520;
  font-family: "楷体", "KaiTi", serif;
}

/* 礼成 */
.sacrifice-done-box {
  background: #fffaf0;
  border: 2px solid #b79a63;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
}
.sacrifice-done-main {
  font-size: 0.95rem;
  line-height: 1.9;
  color: #3d3020;
  margin: 1rem 0 1.5rem;
  text-indent: 2em;
}
.sacrifice-done-effects {
  font-size: 0.9rem;
  color: #8b3e31;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}
.sacrifice-done-effects b { color: #c04030; }

/* 响应式：移动端单列 */
@media (max-width: 768px) {
  .hunt-event-layout { flex-direction: column; gap: 1rem; }
  .hunt-event-choices { width: 100%; flex-direction: row; flex-wrap: wrap; }
  .hunt-choice-item { flex: 1; min-width: 120px; }
  .hunt-grid, .sacrifice-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  #hunt-view, #sacrifice-view { padding: 1rem; }
}

/* ===== 木兰围场 / 祭祀大典 通用 ===== */
#hunt-view, #sacrifice-view {
  flex-direction: column; padding: 1.5rem; overflow-y: auto; -webkit-overflow-scrolling: touch; gap: 1rem;
  background: linear-gradient(180deg, #f9f3e7 0%, #f3ead8 100%);
}

/* 选人 tab 栏 */
.hunt-tabs, .sacrifice-tabs {
  display: flex; gap: 0.6rem; flex-wrap: wrap;
  padding: 0.5rem 0;
}
.hunt-tab, .sacrifice-tab {
  padding: 0.5rem 1rem;
  border: 1px solid #c8b68d;
  background: #fffaf0;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #6b5d48;
  cursor: pointer;
  transition: all 0.15s;
}
.hunt-tab:hover:not(.empty), .sacrifice-tab:hover:not(.empty) {
  background: #f0e4c8;
}
.hunt-tab.selected, .sacrifice-tab.selected {
  background: linear-gradient(180deg, #e8d9a8, #d4c07a);
  border-color: #b79a63;
  color: #5a4520;
  font-weight: 600;
}
.hunt-tab.empty, .sacrifice-tab.empty {
  opacity: 0.4; cursor: not-allowed;
}

/* 选人提示 */
.hunt-people-hint, .sacrifice-hint {
  padding: 0.5rem 0.8rem;
  background: rgba(183, 154, 99, 0.1);
  border-left: 3px solid #b79a63;
  color: #7a6b52;
  font-size: 0.9rem;
  border-radius: 0 4px 4px 0;
}

/* 操作按钮栏 */
.hunt-people-actions, .sacrifice-actions {
  display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center;
}

/* 选人卡片网格 */
.hunt-grid, .sacrifice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  padding: 0.5rem 0 2rem 0;
}

.hunt-person-card, .sacrifice-person-card {
  display: flex; gap: 0.6rem; align-items: center;
  padding: 0.6rem;
  border: 2px solid transparent;
  background: #fffaf0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.hunt-person-card:hover, .sacrifice-person-card:hover {
  border-color: #c8b68d;
  background: #fdf5e0;
}
.hunt-person-card.selected, .sacrifice-person-card.selected {
  border-color: #b79a63;
  background: linear-gradient(180deg, #faf0d4, #f0e0b4);
  box-shadow: 0 2px 8px rgba(183, 154, 99, 0.3);
}

.hunt-person-avatar, .sacrifice-person-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #d4c07a;
  flex-shrink: 0;
}

.hunt-person-info, .sacrifice-person-info {
  flex: 1; min-width: 0;
}
.hunt-person-name, .sacrifice-person-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: #5a4520;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hunt-person-meta, .sacrifice-person-meta {
  font-size: 0.78rem;
  color: #8b7764;
  margin-top: 2px;
}

.hunt-empty, .sacrifice-empty {
  grid-column: 1/-1; text-align: center; padding: 2rem;
  color: #a89578; font-style: italic;
}

/* 加载中 */
.hunt-load {
  text-align: center; padding: 2rem;
}
.hunt-load-title {
  font-size: 1.1rem; color: #5a4520; font-weight: 600; margin-bottom: 0.5rem;
}
.hunt-load-sub {
  font-size: 0.9rem; color: #8b7764;
}

/* 剧情容器 - 双列布局 */
.hunt-event-box, .sacrifice-event-box {
  padding: 0;
}
.hunt-event-layout {
  display: flex; gap: 1.5rem;
  min-height: 200px;
}
.hunt-event-choices {
  display: flex; flex-direction: column; gap: 0.75rem;
  width: 200px; flex-shrink: 0;
}
.hunt-choice-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 0.8rem;
  background: #fffaf0;
  border: 1px solid #c8b68d;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #5a4520;
  transition: all 0.15s;
  text-align: left;
}
.hunt-choice-item:hover {
  background: #f0e4c8;
  border-color: #b79a63;
}
.hunt-choice-diamond {
  color: #b79a63; font-size: 0.75rem;
}
.hunt-event-main {
  flex: 1; background: #fffaf0;
  border: 1px solid #d4c07a;
  border-radius: 8px;
  padding: 1.2rem 1.5rem;
}
.hunt-event-head {
  font-size: 0.95rem;
  color: #8b3e31;
  font-weight: 600;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed #d4c07a;
}
.hunt-event-body-figma {
  font-size: 0.95rem;
  line-height: 1.8;
  color: #3d3020;
  text-indent: 2em;
}

/* 剧情结果 */
.hunt-event-resolve-head {
  background: #fffaf0;
  border: 1px solid #d4c07a;
  border-radius: 8px;
  padding: 1.2rem 1.5rem;
}
.hunt-event-chosen {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  color: #8b3e31;
  margin: 1rem 0;
  padding: 0.6rem;
  background: rgba(139, 62, 49, 0.08);
  border-radius: 4px;
}
.hunt-event-result {
  font-size: 0.95rem;
  line-height: 1.8;
  color: #3d3020;
  padding: 1rem;
  background: #fdf8ec;
  border-left: 3px solid #b79a63;
  border-radius: 0 4px 4px 0;
}

.hunt-event-footer {
  margin-top: 1.2rem; text-align: center;
}
.hunt-btn-primary {
  padding: 0.6rem 1.5rem;
  background: linear-gradient(180deg, #e8d9a8, #d4c07a);
  border: 1px solid #b79a63;
  border-radius: 6px;
  color: #5a4520;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.15s;
}
.hunt-btn-primary:hover {
  background: linear-gradient(180deg, #d4c07a, #c0a860);
}
.hunt-btn {
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
}

/* 祭祀大典 - 典礼固定文案 */
.sacrifice-ritual-box {
  background: #fffaf0;
  border: 1px solid #d4c07a;
  border-radius: 8px;
  padding: 1.5rem 1.8rem;
}
.sacrifice-ritual-header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #b79a63;
}
.sacrifice-ritual-era {
  font-size: 0.85rem; color: #8b7764;
}
.sacrifice-ritual-title {
  font-size: 1.4rem; font-weight: 600;
  color: #8b3e31;
  margin: 0.3rem 0;
}
.sacrifice-ritual-host {
  font-size: 0.95rem; color: #5a4520;
}
.sacrifice-ritual-opening,
.sacrifice-ritual-closing {
  font-size: 0.95rem; line-height: 1.9;
  color: #3d3020; text-indent: 2em;
}
.sacrifice-ritual-prayer {
  margin: 1.2rem 0;
  padding: 1rem 1.5rem;
  background: #fdf8ec;
  border-left: 3px solid #8b3e31;
  border-radius: 0 4px 4px 0;
  font-size: 0.92rem;
  line-height: 2;
  color: #5a4520;
  font-family: KaiTi, serif;
}

/* 礼成 */
.sacrifice-done-box {
  background: #fffaf0;
  border: 2px solid #b79a63;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
}
.sacrifice-done-main {
  font-size: 0.95rem;
  line-height: 1.9;
  color: #3d3020;
  margin: 1rem 0 1.5rem;
  text-indent: 2em;
}
.sacrifice-done-effects {
  font-size: 0.9rem;
  color: #8b3e31;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}
.sacrifice-done-effects b { color: #c04030; }

/* ===== 祭祀大典 · 背景美术 ===== */
/* 第一步 · 择主祭：圜丘大典做底，淡洗一层，保证名册与文字清晰 */
#sacrifice-step-host {
  border-radius: 10px;
  padding: 1.4rem 1.5rem 1.5rem;
  background-image:
    linear-gradient(180deg, rgba(249, 243, 231, 0.74) 0%, rgba(243, 234, 216, 0.86) 100%),
    url('../assets/scenes/sacrifice-altar.jpg');
  background-size: cover, cover;
  background-position: center, center 32%;
  box-shadow: 0 4px 18px rgba(90, 69, 32, 0.12);
}

/* 第二步 · 典礼仪轨：祭天圜丘整幅做底，压暗后垫一张半透明纸笺 */
#sacrifice-step-ritual {
  border-radius: 10px;
  padding: 1.5rem;
  background-image:
    linear-gradient(180deg, rgba(18, 12, 6, 0.30) 0%, rgba(18, 12, 6, 0.20) 45%, rgba(18, 12, 6, 0.46) 100%),
    url('../assets/scenes/sacrifice-altar.jpg');
  background-size: cover, cover;
  background-position: center, center 34%;
  box-shadow: inset 0 0 70px rgba(0, 0, 0, 0.38), 0 6px 24px rgba(0, 0, 0, 0.22);
}
#sacrifice-step-ritual .sacrifice-ritual-box {
  background: rgba(255, 250, 240, 0.78);
  box-shadow: 0 6px 26px rgba(0, 0, 0, 0.30);
}

/* 第三步 · 大典际遇：同用圜丘做底，淡洗一层保证文案清晰 */
#sacrifice-step-event {
  border-radius: 10px;
  padding: 1.4rem 1.5rem;
  background-image:
    linear-gradient(180deg, rgba(249, 243, 231, 0.76) 0%, rgba(243, 234, 216, 0.88) 100%),
    url('../assets/scenes/sacrifice-altar.jpg');
  background-size: cover, cover;
  background-position: center, center 30%;
  box-shadow: 0 4px 18px rgba(90, 69, 32, 0.12);
}

/* 第四步 · 礼成：太庙祭祖内景做底 */
#sacrifice-step-done {
  border-radius: 10px;
  padding: 1.5rem;
  background-image:
    linear-gradient(180deg, rgba(18, 12, 6, 0.30) 0%, rgba(18, 12, 6, 0.20) 45%, rgba(18, 12, 6, 0.46) 100%),
    url('../assets/scenes/sacrifice-temple.jpg');
  background-size: cover, cover;
  background-position: center, center 42%;
  box-shadow: inset 0 0 70px rgba(0, 0, 0, 0.38), 0 6px 24px rgba(0, 0, 0, 0.22);
}
/* #sacrifice-done-box 外层让位给底图，内层（js 再套的一层）留作纸笺 */
#sacrifice-step-done > .sacrifice-done-box {
  background: transparent;
  border: none;
  padding: 0;
}
#sacrifice-step-done .sacrifice-done-box .sacrifice-done-box {
  background: rgba(255, 250, 240, 0.80);
  box-shadow: 0 6px 26px rgba(0, 0, 0, 0.30);
}

/* 响应式：移动端单列 */
@media (max-width: 768px) {
  .hunt-event-layout { flex-direction: column; gap: 1rem; }
  .hunt-event-choices { width: 100%; flex-direction: row; flex-wrap: wrap; }
  .hunt-choice-item { flex: 1; min-width: 120px; }
  .hunt-grid, .sacrifice-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  #hunt-view, #sacrifice-view { padding: 1rem; }
  #sacrifice-step-host { padding: 1rem 0.9rem; }
  #sacrifice-step-event, #sacrifice-step-ritual, #sacrifice-step-done { padding: 0.9rem; }
  #sacrifice-step-ritual .sacrifice-ritual-box { padding: 1.1rem 1.15rem; }
  #sacrifice-step-done .sacrifice-done-box .sacrifice-done-box { padding: 1.3rem 1.1rem; }
}

/* ===== 通惠河埠 · 微服私访 ===== */
#weifu-view {
  flex-direction: column; padding: 1.5rem; overflow-y: auto; -webkit-overflow-scrolling: touch; gap: 1rem;
  background: linear-gradient(180deg, #f9f3e7 0%, #f3ead8 100%);
}
.weifu-event-box { padding: 0; }
#weifu-step-1, #weifu-step-2 {
  border-radius: 10px;
  padding: 1.4rem 1.5rem;
  background-size: cover, cover;
  background-position: center, center 40%;
  box-shadow: inset 0 0 70px rgba(0, 0, 0, 0.30), 0 6px 24px rgba(0, 0, 0, 0.18);
}
/* 第一段 · 通惠河埠货船泊岸 */
#weifu-step-1 {
  background-image:
    linear-gradient(180deg, rgba(18, 12, 6, 0.28) 0%, rgba(18, 12, 6, 0.18) 45%, rgba(18, 12, 6, 0.42) 100%),
    url('../assets/scenes/hebu.jpg');
}
/* 第二段 · 通惠河埠临河街市 */
#weifu-step-2 {
  background-image:
    linear-gradient(180deg, rgba(18, 12, 6, 0.28) 0%, rgba(18, 12, 6, 0.18) 45%, rgba(18, 12, 6, 0.42) 100%),
    url('../assets/scenes/tonghuihebu.jpg');
}
/* 内层纸笺留白，保证底图之上的文字清晰 */
#weifu-view .hunt-event-main,
#weifu-view .hunt-event-resolve-head {
  background: rgba(255, 250, 240, 0.90);
  box-shadow: 0 6px 26px rgba(0, 0, 0, 0.28);
}
#weifu-view .hunt-choice-item { background: rgba(255, 250, 240, 0.92); }
#weifu-view .hunt-event-result { background: rgba(253, 248, 236, 0.92); }

@media (max-width: 768px) {
  #weifu-view { padding: 1rem; }
  #weifu-step-1, #weifu-step-2 { padding: 0.9rem; }
}

/* ===== 重华宫 · 考校功课（heirexam） ===== */
#heir-exam-view { flex-direction: column; padding: 1rem; min-height: 0; padding-bottom: 1.5rem; }
#heir-exam-view .consort-list-header { flex-shrink: 0; margin-bottom: 0.8rem; }
#heir-exam-view .consort-list-header h2 { font-size: 1.4rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#heir-exam-view .consort-list-header .btn-back { flex-shrink: 0; }
#heir-exam-view .poetry-step { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-right: 0.25rem; }

@media (max-width: 720px) {
  #heir-exam-view { padding: 0.75rem; padding-bottom: 1rem; }
  #heir-exam-view .consort-list-header { flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.5rem; }
  #heir-exam-view .consort-list-header h2 { font-size: 1.25rem; }
}/* ====== 诏狱 modal ====== */
.modal.modal-zhaoyu { max-width: 900px; width: 92vw; max-height: 86vh; }
.zhaoyu-body { display: flex; flex-direction: column; gap: 8px; }
.zhaoyu-tabs { display: flex; gap: 6px; border-bottom: 1px solid #5a3825; padding-bottom: 6px; }
.zhaoyu-tabs .zy-tab { padding: 6px 14px; border-radius: 4px; background: transparent; color: #c8b8a0; cursor: pointer; border: 1px solid transparent; }
.zhaoyu-tabs .zy-tab.active { background: #5a3825; color: #f7e8c9; border-color: #3a2315; }
.zhaoyu-split { display: flex; gap: 14px; min-height: 360px; }
.zhaoyu-roster { flex: 0 0 260px; border-right: 1px solid #5a3825; padding-right: 10px; overflow-y: auto; max-height: 70vh; }
.zhaoyu-detail { flex: 1; padding-left: 10px; }
.zhaoyu-detail-inner { background: #2a1a10; border: 1px solid #5a3825; border-radius: 6px; padding: 14px; }
.zy-name { font-size: 18px; font-weight: bold; color: #f7e8c9; margin-bottom: 6px; }
.zy-meta { color: #c8b8a0; font-size: 13px; margin: 3px 0; }
.zy-meta.zy-stripped { color: #e8a0a0; }
.zy-acts { margin-top: 14px; display: flex; gap: 8px; }
.roster-title { font-size: 14px; font-weight: bold; color: #f7e8c9; padding: 4px 0 6px; border-bottom: 1px solid #5a3825; margin-bottom: 6px; }
.roster-hint { color: #908070; font-size: 12px; padding: 6px 0; }
.roster-entry { padding: 8px 10px; border-radius: 4px; cursor: pointer; margin-bottom: 4px; background: #1f130a; border: 1px solid transparent; }
.roster-entry:hover { background: #2a1a10; }
.roster-entry.sel { background: #3a2315; border-color: #8a6040; }
.roster-entry .roster-name { font-size: 14px; color: #f7e8c9; }
.roster-entry .roster-sub { font-size: 11px; color: #a09080; }
/* ====== 选秀嫡庶标签 ====== */
.select-roster-name { display: flex; align-items: center; gap: 6px; }
.select-birth-tag { font-size: 10px; padding: 1px 6px; border-radius: 3px; font-weight: bold; }
.select-birth-tag.di { background: #c0a050; color: #1a1008; }
.select-birth-tag.shu { background: #6a5a40; color: #c8b8a0; }

/* ===== 指婚选人 Tab ===== */
.confer-pick-tabs {
  display: flex;
  gap: 0.4rem;
  margin: 0 0 0.4rem;
  border-bottom: 1px solid rgba(201, 162, 39, 0.25);
}
.confer-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim, #a89880);
  padding: 0.3rem 0.5rem;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
}
.confer-tab:hover { color: var(--text, #4a3f30); }
.confer-tab.active {
  color: var(--gold, #c9a227);
  border-bottom-color: var(--gold, #c9a227);
}

/* ===== 木兰围场 · 猎物榜 ===== */
.hunt-settle-head { padding: 0.5rem 0 0.8rem; text-align: center; border-bottom: 1px solid rgba(201,162,39,0.25); margin-bottom: 0.8rem; }
.hunt-settle-title { font-size: 1.1rem; font-weight: 600; color: #5a4520; letter-spacing: 0.15em; }
.hunt-settle-sub { font-size: 0.78rem; color: #8b7764; margin-top: 0.3rem; }

.hunt-board-figma { display: flex; flex-direction: column; gap: 0.5rem; }

.hunt-row {
  display: grid;
  grid-template-columns: 32px 48px 1fr auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.55rem 0.7rem;
  background: #fffaf0;
  border: 1px solid #e8dcc0;
  border-radius: 8px;
}
.hunt-row.is-champ {
  background: linear-gradient(90deg, #fff5d8, #fff0c4);
  border-color: #c9a227;
  box-shadow: 0 2px 10px rgba(201,162,39,0.25);
}
.hunt-row.is-empress { border-color: #a83232; }

.hunt-row-no {
  font-size: 1.1rem; font-weight: 700; color: #8b7764; text-align: center;
  font-family: Georgia, 'Times New Roman', serif;
}
.hunt-row.is-champ .hunt-row-no { color: #c9a227; font-size: 1.4rem; }

.hunt-row-avatar {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover;
  border: 2px solid #d4c07a; flex-shrink: 0;
}
.hunt-row-empress { font-size: 1.6rem; display: flex; align-items: center; justify-content: center; background: #f9d9d9; border-color: #a83232; }

.hunt-row-info { min-width: 0; }
.hunt-row-name { font-size: 0.95rem; font-weight: 600; color: #4a3f30; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hunt-row-badge { display: inline-block; font-size: 0.68rem; background: #c9a227; color: #fff; border-radius: 4px; padding: 1px 5px; margin-left: 4px; vertical-align: middle; font-weight: 500; }
.hunt-row-sub { font-size: 0.75rem; color: #8b7764; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hunt-row-prey { font-size: 0.72rem; color: #6b5d48; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.hunt-row-pts { text-align: right; flex-shrink: 0; padding-left: 0.4rem; }
.hunt-row-pts b { font-size: 1.4rem; color: #5a4520; line-height: 1; }
.hunt-row-pts span { font-size: 0.7rem; color: #8b7764; margin-left: 2px; }
.hunt-row.is-champ .hunt-row-pts b { color: #c9a227; font-size: 1.6rem; }

/* 移动端：压成两列（头像+名字在左，分数在右下） */
@media (max-width: 480px) {
  .hunt-row {
    grid-template-columns: 24px 36px 1fr;
    grid-template-rows: auto auto;
    gap: 0.3rem 0.5rem;
    padding: 0.5rem;
  }
  .hunt-row-pts { grid-column: 3; grid-row: 2; text-align: right; }
  .hunt-row-no { font-size: 0.9rem; }
  .hunt-row-avatar { width: 32px; height: 32px; }
  .hunt-row-empress { font-size: 1.2rem; }
  .hunt-row-name { font-size: 0.88rem; }
  .hunt-row-sub, .hunt-row-prey { font-size: 0.7rem; }
  .hunt-row-prey { display: none; }
  .hunt-row-pts b { font-size: 1.1rem; }
}
