/* ========== 基础样式 ========== */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700;900&family=Noto+Sans+SC:wght@300;400;500;600&display=swap');

:root {
  /* 深色底 - 带微暖紫调 */
  --bg-primary: #14111c;
  --bg-secondary: #1a1724;
  --bg-card: #211d2c;
  --bg-card-hover: #2a2638;
  --bg-elevated: #322e42;

  /* 文字 - 高对比暖白 */
  --text-primary: #f5f0ea;
  --text-secondary: #cdc3b8;
  --text-muted: #9a8e85;

  /* 主色 - 玫瑰金 */
  --accent: #d4a373;
  --accent-light: #e8c4a0;
  --accent-dark: #b8875a;
  --accent-glow: rgba(212, 163, 115, 0.15);
  --accent-glow-strong: rgba(212, 163, 115, 0.3);

  /* 彩色系 */
  --rose: #e8a0b4;
  --rose-deep: #d4728a;
  --lavender: #b8a0d8;
  --lavender-deep: #9678c4;
  --sage: #8cc0a8;
  --sage-deep: #5fa888;
  --coral: #e89888;
  --coral-deep: #d47060;
  --sky: #88b8d8;
  --sky-deep: #5a98c4;
  --amber: #d8c088;
  --amber-deep: #c4a458;
  --peach: #e8b8a0;
  --lilac: #c8a8e0;

  /* 渐变 */
  --gradient-primary: linear-gradient(135deg, var(--rose), var(--lavender));
  --gradient-warm: linear-gradient(135deg, var(--coral), var(--rose));
  --gradient-cool: linear-gradient(135deg, var(--lavender), var(--sky));
  --gradient-nature: linear-gradient(135deg, var(--sage), var(--sky));
  --gradient-sunset: linear-gradient(135deg, var(--peach), var(--lilac));
  --gradient-iridescent: linear-gradient(135deg, var(--rose), var(--lavender), var(--sky), var(--sage));

  --border: #352f44;
  --border-light: #2a2538;
  --shadow: rgba(0, 0, 0, 0.4);
  --shadow-lg: rgba(0, 0, 0, 0.6);
  --shadow-color: rgba(180, 120, 160, 0.08);
  --danger: #e07070;
  --success: #70c8a0;
  --info: #70a8d0;
  --glass: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.06);

  /* 人生阶段主题色 */
  --stage-glow-1: rgba(232, 160, 180, 0.06);
  --stage-glow-2: rgba(184, 160, 216, 0.06);
  --stage-glow: var(--stage-glow-1);
  --stage-accent: var(--rose);

  --font-serif: 'Noto Serif SC', 'Songti SC', serif;
  --font-sans: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 28px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* 全局噪点纹理 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
  pointer-events: none;
  z-index: -1;
  mix-blend-mode: overlay;
}

/* 全局暗角 - 仅轻微装饰 */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 85% 75% at 50% 50%, transparent 60%, rgba(6,4,8,0.2) 100%);
  pointer-events: none;
  z-index: -1;
}

::selection {
  background: var(--rose);
  color: var(--bg-primary);
}

/* ========== 页面切换 ========== */
.screen {
  display: none;
  min-height: 100vh;
}
.screen.active {
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 5;
}

/* ========== 开始页面 ========== */
.start-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.particle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.start-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 45% at 50% -5%, rgba(232, 160, 180, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 45% at 10% 80%, rgba(140, 120, 200, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse 60% 45% at 90% 75%, rgba(212, 163, 115, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 90% 50% at 50% 100%, rgba(184, 160, 216, 0.06) 0%, transparent 40%);
  animation: gradientShift 15s ease-in-out infinite alternate;
}

@keyframes gradientShift {
  0% { opacity: 1; }
  50% { opacity: 0.8; }
  100% { opacity: 1; }
}

.start-particles {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, rgba(232, 160, 180, 0.3), transparent),
    radial-gradient(1px 1px at 80% 20%, rgba(184, 160, 216, 0.25), transparent),
    radial-gradient(1.5px 1.5px at 40% 70%, rgba(255, 255, 255, 0.12), transparent),
    radial-gradient(1px 1px at 60% 50%, rgba(212, 163, 115, 0.25), transparent),
    radial-gradient(1px 1px at 10% 80%, rgba(140, 192, 168, 0.15), transparent),
    radial-gradient(1.5px 1.5px at 90% 60%, rgba(232, 160, 180, 0.2), transparent),
    radial-gradient(1px 1px at 50% 10%, rgba(136, 184, 216, 0.15), transparent);
  animation: particleDrift 25s linear infinite;
}

@keyframes particleDrift {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-40px) rotate(0.5deg); }
}

.start-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

/* 装饰竖线 */
.start-container::before {
  content: '';
  position: absolute;
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 50px;
  background: linear-gradient(180deg, transparent, var(--rose), transparent);
  opacity: 0.4;
}

.start-badge {
  display: inline-block;
  padding: 0.35rem 1.3rem;
  background: linear-gradient(135deg, rgba(232, 160, 180, 0.08), rgba(184, 160, 216, 0.08));
  border: 1px solid rgba(232, 160, 180, 0.15);
  border-radius: 100px;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--rose);
  margin-bottom: 2.5rem;
  backdrop-filter: blur(12px);
}

.game-title {
  font-family: var(--font-serif);
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: 0.15em;
  margin-bottom: 1.5rem;
  line-height: 1.3;
  text-shadow: 0 4px 40px rgba(232, 160, 180, 0.1);
}

.title-line {
  display: block;
  font-size: 3.4rem;
}

.title-accent {
  background: linear-gradient(135deg, var(--rose), var(--lavender), var(--peach));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 6s ease-in-out infinite;
  filter: drop-shadow(0 2px 15px rgba(232, 160, 180, 0.2));
}

@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.title-divider {
  width: 80px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--rose), var(--lavender), transparent);
  margin-bottom: 1.8rem;
  position: relative;
}
.title-divider::after {
  content: '';
  position: absolute;
  left: 50%;
  top: -2.5px;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  background: var(--rose);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(232, 160, 180, 0.4);
}

.game-subtitle {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  color: var(--text-secondary);
  margin-bottom: 0.8rem;
  letter-spacing: 0.2em;
}

.game-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 2;
  margin-bottom: 3.5rem;
  max-width: 380px;
  letter-spacing: 0.02em;
}

.start-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  width: 100%;
  max-width: 280px;
}

.version-info {
  margin-top: 3.5rem;
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  opacity: 0.5;
}

/* ========== 按钮样式 ========== */
.btn {
  padding: 0.85rem 2rem;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  letter-spacing: 0.08em;
  position: relative;
  overflow: hidden;
}

/* 涟漪 */
.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  transform: scale(0);
  animation: ripple-effect 0.6s ease-out forwards;
  pointer-events: none;
}
@keyframes ripple-effect {
  to { transform: scale(4); opacity: 0; }
}

.btn-primary {
  background: var(--gradient-sunset);
  color: var(--bg-primary);
  border: none;
  font-weight: 600;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(232, 160, 180, 0.25), 0 2px 10px rgba(0,0,0,0.2);
  filter: brightness(1.08);
}
.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(232, 160, 180, 0.15);
}

.btn-glow {
  box-shadow: 0 0 30px rgba(232, 160, 180, 0.12), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-glow:hover {
  box-shadow: 0 8px 50px rgba(232, 160, 180, 0.25), inset 0 1px 0 rgba(255,255,255,0.2);
}

.btn-icon {
  margin-right: 0.5rem;
  font-size: 0.8rem;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 400;
  cursor: pointer;
  padding: 0.85rem 2rem;
  letter-spacing: 0.08em;
  transition: all var(--transition-fast);
}
.btn-ghost:hover {
  border-color: var(--rose);
  color: var(--rose);
  background: rgba(232, 160, 180, 0.06);
  box-shadow: 0 4px 20px rgba(232, 160, 180, 0.08);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  border-color: rgba(232, 160, 180, 0.3);
  color: var(--rose);
  background: var(--bg-card-hover);
}

.btn-large {
  padding: 1.1rem 3rem;
  font-size: 1.05rem;
  margin-top: 2.5rem;
  border-radius: var(--radius-lg);
}

.icon-btn {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.5rem;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  backdrop-filter: blur(8px);
}
.icon-btn:hover {
  background: rgba(232, 160, 180, 0.08);
  border-color: rgba(232, 160, 180, 0.3);
  color: var(--rose);
}

/* ========== 角色创建 ========== */
#screen-create {
  position: relative;
  background:
    radial-gradient(ellipse 50% 25% at 50% 0%, rgba(232, 160, 180, 0.05) 0%, transparent 60%),
    radial-gradient(ellipse 40% 25% at 80% 100%, rgba(184, 160, 216, 0.04) 0%, transparent 50%),
    var(--bg-primary);
}

.create-container {
  max-width: 580px;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
  position: relative;
  z-index: 1;
}

.create-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  letter-spacing: 0.08em;
}

.create-container::before {
  content: '';
  display: block;
  width: 50px;
  height: 1px;
  background: var(--gradient-primary);
  margin: 0 auto 3rem;
}

.create-section {
  margin-bottom: 2.2rem;
}

.create-label {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.create-input {
  width: 100%;
  padding: 0.9rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 1rem;
  background: var(--bg-card);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}
.create-input:focus {
  outline: none;
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(232, 160, 180, 0.12);
  background: var(--bg-card-hover);
}
.create-input::placeholder {
  color: var(--text-muted);
}

.create-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 0.6rem;
}

.create-textarea {
  width: 100%;
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.8;
  background: var(--bg-card);
  color: var(--text-primary);
  resize: vertical;
  min-height: 100px;
  max-height: 240px;
  transition: all var(--transition-fast);
}
.create-textarea:focus {
  outline: none;
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(232, 160, 180, 0.12);
  background: var(--bg-card-hover);
}
.create-textarea::placeholder {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.7;
}

.textarea-counter {
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.create-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.create-options.column {
  flex-direction: column;
}

.option-btn {
  padding: 0.7rem 1.3rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  text-align: left;
  position: relative;
  overflow: hidden;
}
.option-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(232, 160, 180, 0.05), rgba(184, 160, 216, 0.05));
  opacity: 0;
  transition: opacity var(--transition-fast);
}
.option-btn:hover {
  border-color: rgba(232, 160, 180, 0.25);
  background: var(--bg-card-hover);
  color: var(--text-primary);
}
.option-btn:hover::before {
  opacity: 1;
}
.option-btn.selected {
  border-color: var(--rose);
  background: var(--bg-card-hover);
  color: var(--rose);
  box-shadow: 0 0 0 1px rgba(232, 160, 180, 0.1), inset 0 0 25px rgba(232, 160, 180, 0.06);
}

.opt-title {
  display: block;
  font-weight: 500;
  position: relative;
  z-index: 1;
}
.opt-desc {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  position: relative;
  z-index: 1;
}
.option-btn.selected .opt-desc {
  color: rgba(232, 160, 180, 0.7);
}

/* 出生年份滑块 */
.birthyear-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.birthyear-slider {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  margin-top: 0.5rem;
}
.birthyear-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gradient-primary);
  border: none;
  box-shadow: 0 0 18px rgba(232, 160, 180, 0.3), 0 2px 8px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: transform 0.15s ease;
}
.birthyear-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}
.birthyear-display {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}
.birthyear-number {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 900;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  min-width: 4ch;
}
.birthyear-era {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* 出生地选择 */
.location-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.create-select {
  width: 100%;
  padding: 0.9rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 1rem;
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%237a6f68' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}
.create-select:focus {
  outline: none;
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(232, 160, 180, 0.12);
}
.create-select option {
  background: var(--bg-card);
  color: var(--text-primary);
}
.create-select optgroup {
  color: var(--rose);
  font-weight: 600;
}
.location-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 0.65rem 1rem;
  background: rgba(232, 160, 180, 0.04);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--rose);
  line-height: 1.6;
}

/* 兄弟姐妹 */
.sibling-wrap {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.sibling-count-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.sibling-count-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.sibling-count-btns {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.sibling-count-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}
.sibling-count-btn:hover {
  border-color: rgba(232, 160, 180, 0.25);
  color: var(--text-primary);
}
.sibling-count-btn.selected {
  border-color: var(--rose);
  color: var(--rose);
  background: var(--bg-card-hover);
  box-shadow: 0 0 0 1px rgba(232, 160, 180, 0.08);
}
.siblings-detail {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.siblings-detail.hidden {
  display: none;
}
.sibling-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.sibling-row-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  min-width: 4em;
  flex-shrink: 0;
}
.sibling-row select,
.sibling-row input[type="number"] {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
}
.sibling-row select { min-width: 5em; }
.sibling-row input[type="number"] { width: 4.5em; }
.sibling-age-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ========== 游戏主界面 ========== */
/* 氛围背景 */
#screen-game {
  position: relative;
}
#screen-game::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 40% at 50% -5%, var(--stage-glow-1) 0%, transparent 70%),
    radial-gradient(ellipse 50% 35% at 0% 60%, var(--stage-glow-2) 0%, transparent 50%),
    radial-gradient(ellipse 50% 35% at 100% 70%, rgba(212, 163, 115, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
  transition: all 2s ease;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: rgba(20, 17, 28, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.time-display {
  font-family: var(--font-serif);
  font-size: 0.92rem;
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
}

.stage-badge {
  display: inline-block;
  padding: 0.2rem 0.8rem;
  background: var(--gradient-sunset);
  color: var(--bg-primary);
  border-radius: 100px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  box-shadow: 0 2px 10px rgba(232, 160, 180, 0.2);
}

.header-right {
  display: flex;
  gap: 0.4rem;
}

/* 游戏主体 */
.game-body {
  flex: 1;
  max-width: 680px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  width: 100%;
}

/* 叙事区域 */
.narrative-area {
  margin-bottom: 2rem;
  position: relative;
}

.scene-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.8rem;
  padding-bottom: 1.2rem;
  border-bottom: none;
  letter-spacing: 0.08em;
  position: relative;
  text-shadow: 0 1px 20px rgba(232, 160, 180, 0.06);
}
.scene-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--rose), var(--lavender) 40%, transparent 100%);
  opacity: 0.5;
}

.narrative-text {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 2.2;
  color: var(--text-primary);
  padding: 1.6rem 1.8rem;
  background: linear-gradient(160deg, rgba(33, 29, 44, 0.85), rgba(26, 23, 36, 0.7));
  border-radius: var(--radius-lg);
  border: 1px solid rgba(232, 160, 180, 0.06);
  position: relative;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.02),
    0 4px 25px rgba(0,0,0,0.15),
    0 0 40px rgba(232, 160, 180, 0.02);
}
/* 装饰折角 */
.narrative-text::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 22px;
  height: 22px;
  background: linear-gradient(225deg, var(--bg-primary) 50%, rgba(232, 160, 180, 0.06) 50%);
  border-radius: 0 var(--radius-lg) 0 0;
}

.narrative-text .narrative-paragraph {
  margin-bottom: 1rem;
  text-indent: 2em;
}
.narrative-text .narrative-paragraph:last-child {
  margin-bottom: 0;
}

/* 选择区域 */
.choices-area {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 2.5rem;
  position: relative;
}
.choices-area::before {
  content: '你的选择';
  display: block;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
  opacity: 0.5;
}

.choice-btn {
  display: block;
  width: 100%;
  padding: 1.1rem 1.4rem 1.1rem 1.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--bg-card), var(--bg-secondary));
  cursor: pointer;
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--text-secondary);
  text-align: left;
  line-height: 1.7;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(8px);
}
.choice-btn::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  height: 100%;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.25s ease, width 0.25s ease;
}
.choice-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(232, 160, 180, 0.04), rgba(184, 160, 216, 0.03), transparent 50%);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.choice-btn:hover {
  border-color: rgba(232, 160, 180, 0.3);
  background: var(--bg-card-hover);
  color: var(--text-primary);
  transform: translateX(6px);
  box-shadow: 0 4px 25px rgba(0,0,0,0.2), -4px 0 20px rgba(232, 160, 180, 0.04);
}
.choice-btn:hover::before {
  opacity: 1;
  width: 3px;
}
.choice-btn:hover::after {
  opacity: 1;
}
.choice-btn:active {
  transform: translateX(3px);
  transition-duration: 0.1s;
}
.choice-btn.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.choice-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-family: var(--font-sans);
  color: var(--rose);
  margin-right: 0.7rem;
  font-weight: 600;
  position: relative;
  z-index: 1;
  background: rgba(232, 160, 180, 0.08);
  border: 1px solid rgba(232, 160, 180, 0.15);
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  min-width: 1.5em;
}

/* 结果区域 */
.result-area {
  margin-top: 2rem;
  padding: 2rem;
  background: linear-gradient(160deg, rgba(24, 21, 31, 0.8), rgba(18, 15, 24, 0.6));
  border: 1px solid rgba(232, 160, 180, 0.08);
  border-radius: var(--radius-lg);
  position: relative;
  box-shadow: 0 6px 35px rgba(0,0,0,0.2), 0 0 50px rgba(232, 160, 180, 0.02);
  backdrop-filter: blur(12px);
}
.result-area::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--rose), var(--lavender) 40%, transparent 70%);
  opacity: 0.6;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.result-text {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 2.1;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.effect-display {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}

.effect-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.85rem;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 500;
  backdrop-filter: blur(8px);
  letter-spacing: 0.02em;
}
.effect-tag.positive {
  background: rgba(112, 200, 160, 0.1);
  color: var(--sage);
  border: 1px solid rgba(112, 200, 160, 0.15);
  box-shadow: 0 0 12px rgba(112, 200, 160, 0.06);
}
.effect-tag.positive::before { content: '\2191'; font-size: 0.7rem; }
.effect-tag.negative {
  background: rgba(224, 112, 112, 0.1);
  color: var(--coral);
  border: 1px solid rgba(224, 112, 112, 0.15);
  box-shadow: 0 0 12px rgba(224, 112, 112, 0.06);
}
.effect-tag.negative::before { content: '\2193'; font-size: 0.7rem; }
.effect-tag.neutral {
  background: rgba(184, 160, 216, 0.1);
  color: var(--lavender);
  border: 1px solid rgba(184, 160, 216, 0.15);
  box-shadow: 0 0 12px rgba(184, 160, 216, 0.06);
}

/* ========== 状态面板 ========== */
.status-panel,
.save-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 360px;
  height: 100vh;
  background: #1a1724;
  border-left: 1px solid var(--border);
  box-shadow: -12px 0 50px var(--shadow-lg);
  z-index: 10000;
  overflow-y: auto;
  transition: transform var(--transition-normal);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
.status-panel.hidden,
.save-panel.hidden {
  transform: translateX(100%);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: #1a1724;
  z-index: 10001;
}
.panel-header h3 {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.panel-body {
  padding: 1.5rem;
}

/* 玩家信息 */
.player-info {
  margin-bottom: 1.8rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.9;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(232, 160, 180, 0.08), rgba(184, 160, 216, 0.06));
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.player-life-story {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.7;
  font-style: italic;
}
.life-story-label {
  display: inline-block;
  font-size: 0.72rem;
  font-style: normal;
  color: var(--rose);
  font-weight: 500;
  margin-right: 0.4rem;
  letter-spacing: 0.05em;
}

/* 属性条 */
.attributes-display {
  margin-bottom: 1.8rem;
}

.attr-row {
  display: flex;
  align-items: center;
  margin-bottom: 0.9rem;
}
.attr-name {
  width: 48px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
}
.attr-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  margin: 0 0.75rem;
  overflow: hidden;
  position: relative;
}
.attr-bar-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 3px;
  background: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 9.5%,
    rgba(0,0,0,0.25) 9.5%,
    rgba(0,0,0,0.25) 10%
  );
  pointer-events: none;
}
.attr-bar {
  height: 100%;
  border-radius: 3px;
  transition: width var(--transition-normal);
  position: relative;
}
.attr-bar::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  width: 6px;
  height: 100%;
  background: rgba(255,255,255,0.3);
  border-radius: 3px;
}
/* 每个属性用不同色调 */
.attr-bar.学识 { background: linear-gradient(90deg, #6888c8, #88a8e0); }
.attr-bar.社交 { background: linear-gradient(90deg, var(--rose-deep), var(--rose)); }
.attr-bar.健康 { background: linear-gradient(90deg, var(--sage-deep), var(--sage)); }
.attr-bar.财富 { background: linear-gradient(90deg, var(--amber-deep), var(--amber)); }
.attr-bar.心态 { background: linear-gradient(90deg, var(--lavender-deep), var(--lavender)); }
.attr-value {
  width: 28px;
  text-align: right;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* 标签展示 */
.tags-display {
  margin-bottom: 1.8rem;
}
.tags-display h4,
.relationships-display h4 {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.tag-item {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  background: linear-gradient(135deg, rgba(232, 160, 180, 0.06), rgba(184, 160, 216, 0.06));
  border: 1px solid rgba(232, 160, 180, 0.1);
  border-radius: 100px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* 关系展示 */
.rel-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
}
.rel-name {
  color: var(--text-primary);
}
.rel-value {
  color: var(--rose);
  font-weight: 500;
  font-size: 0.82rem;
}

/* ========== 存档面板 ========== */
.save-slots {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.save-slot {
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.save-slot:hover {
  border-color: rgba(232, 160, 180, 0.25);
  background: var(--bg-card-hover);
}
.save-slot.empty {
  text-align: center;
  color: var(--text-muted);
  border-style: dashed;
}
.save-slot-title {
  font-weight: 500;
  margin-bottom: 0.3rem;
  color: var(--text-primary);
}
.save-slot-info {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.save-slot-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.6rem;
}
.save-slot-actions .btn {
  padding: 0.4rem 0.8rem;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}

.save-actions {
  display: flex;
  gap: 0.6rem;
}

/* ========== 结局页面 ========== */
#screen-ending {
  position: relative;
  background: var(--bg-primary);
}
#screen-ending::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 40% at 50% 0%, rgba(232, 160, 180, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 30% 100%, rgba(184, 160, 216, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse 50% 40% at 70% 90%, rgba(140, 192, 168, 0.04) 0%, transparent 50%);
  pointer-events: none;
}

.ending-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 4rem 2rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

.ending-title {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  font-weight: 900;
  margin-bottom: 1.2rem;
  background: linear-gradient(135deg, var(--rose), var(--lavender), var(--peach));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 18px rgba(232, 160, 180, 0.15));
}

.ending-quote {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 3rem;
  line-height: 1.9;
  position: relative;
  padding: 0 2rem;
}
.ending-quote::before {
  content: '\201C';
  position: absolute;
  left: 0;
  top: -0.3rem;
  font-size: 3rem;
  color: var(--rose);
  opacity: 0.3;
  font-family: Georgia, serif;
  line-height: 1;
}

.ending-stats {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.stat-section {
  text-align: center;
}
.stat-section h3 {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 1rem;
}
.stat-section canvas {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

/* 时间线 */
.timeline-display {
  text-align: left;
  margin-bottom: 3rem;
}
.timeline-display h3 {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-align: center;
  margin-bottom: 1.5rem;
}

.timeline-list {
  position: relative;
  padding-left: 2rem;
}
.timeline-list::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, var(--rose), var(--lavender), var(--sage), transparent);
}

.timeline-item {
  position: relative;
  margin-bottom: 1rem;
  padding-left: 1rem;
  font-size: 0.92rem;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.65rem;
  top: 0.6rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 10px rgba(232, 160, 180, 0.3);
}
.timeline-age {
  font-weight: 600;
  color: var(--rose);
  margin-right: 0.5rem;
  font-variant-numeric: tabular-nums;
}
.timeline-event {
  color: var(--text-secondary);
}

/* 最终标签 */
.tags-final {
  margin-bottom: 3rem;
}
.tags-final h3 {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 1rem;
}
.final-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.ending-summary {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 2;
  color: var(--text-primary);
  text-align: left;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(232, 160, 180, 0.08), rgba(184, 160, 216, 0.06));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
}

.ending-buttons {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
}

/* ========== 遮罩 ========== */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(6, 4, 8, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999;
  transition: opacity var(--transition-normal);
}
.overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ========== 自定义选项 ========== */
.custom-choice-wrap {
  margin-top: 1rem;
}

.custom-choice-divider {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
  color: var(--text-muted);
  font-size: 0.78rem;
}
.custom-choice-divider::before,
.custom-choice-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.custom-choice-input-row {
  display: flex;
  gap: 0.6rem;
}

.custom-choice-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  color: var(--text-primary);
  background: var(--bg-card);
  transition: all var(--transition-fast);
  outline: none;
}
.custom-choice-input:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(232, 160, 180, 0.12);
}
.custom-choice-input::placeholder {
  color: var(--text-muted);
}

.custom-choice-submit {
  white-space: nowrap;
  padding: 0.75rem 1.2rem;
  font-size: 0.88rem;
}

/* ========== AI 模式 ========== */
#btn-ai-toggle {
  position: relative;
  transition: all var(--transition-fast);
}
#btn-ai-toggle.ai-on {
  background: linear-gradient(135deg, var(--lavender), var(--rose));
  color: #fff;
  border-color: var(--lavender);
  box-shadow: 0 0 25px rgba(184, 160, 216, 0.3);
}

#ai-indicator {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--lavender), var(--rose));
  color: #fff;
  padding: 0.4rem 1.2rem;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 500;
  z-index: 20;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 4px 25px rgba(184, 160, 216, 0.25);
}
#ai-indicator.visible {
  opacity: 1;
}
.ai-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  animation: ai-pulse 1s ease-in-out infinite;
}
@keyframes ai-pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* ========== 工具类 ========== */
.hidden {
  display: none !important;
}

/* 跳过提示 */
.skip-hint {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 1.2rem;
  animation: pulse 2.5s ease-in-out infinite;
  letter-spacing: 0.1em;
}

@keyframes pulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.6; }
}

/* 滚动条 */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(232, 160, 180, 0.12);
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(232, 160, 180, 0.25);
}

/* ========== 人生阶段主题色 ========== */
/* 小学 - 蜜桃粉，天真烂漫 */
.stage-primary-school {
  --stage-glow-1: rgba(232, 184, 160, 0.07);
  --stage-glow-2: rgba(232, 160, 180, 0.05);
  --stage-accent: var(--peach);
}
/* 初中 - 薄荷绿，少年萌动 */
.stage-middle-school {
  --stage-glow-1: rgba(140, 192, 168, 0.07);
  --stage-glow-2: rgba(136, 184, 216, 0.05);
  --stage-accent: var(--sage);
}
/* 高中 - 紫罗兰，紧张梦想 */
.stage-high-school {
  --stage-glow-1: rgba(150, 120, 196, 0.08);
  --stage-glow-2: rgba(136, 184, 216, 0.05);
  --stage-accent: var(--lavender);
}
/* 大学 - 天蓝，自由探索 */
.stage-university {
  --stage-glow-1: rgba(136, 184, 216, 0.07);
  --stage-glow-2: rgba(184, 160, 216, 0.05);
  --stage-accent: var(--sky);
}
/* 青年 - 珊瑚橘，热血拼搏 */
.stage-young-adult {
  --stage-glow-1: rgba(232, 152, 136, 0.07);
  --stage-glow-2: rgba(212, 163, 115, 0.05);
  --stage-accent: var(--coral);
}
/* 中年 - 琥珀金，沉稳温润 */
.stage-middle-age {
  --stage-glow-1: rgba(216, 192, 136, 0.06);
  --stage-glow-2: rgba(212, 163, 115, 0.04);
  --stage-accent: var(--amber);
}
/* 中晚年 - 玫瑰暮色 */
.stage-late-middle {
  --stage-glow-1: rgba(212, 114, 138, 0.05);
  --stage-glow-2: rgba(200, 168, 224, 0.04);
  --stage-accent: var(--rose-deep);
}
/* 晚年 - 淡紫银，平静释然 */
.stage-senior {
  --stage-glow-1: rgba(200, 168, 224, 0.05);
  --stage-glow-2: rgba(200, 200, 210, 0.04);
  --stage-accent: var(--lilac);
}
/* 暮年 - 暖琥珀，夕阳余晖 */
.stage-twilight {
  --stage-glow-1: rgba(212, 163, 115, 0.05);
  --stage-glow-2: rgba(232, 184, 160, 0.04);
  --stage-accent: var(--peach);
}
/* 期颐 - 月白银灰，归于宁静 */
.stage-centennial {
  --stage-glow-1: rgba(210, 210, 220, 0.04);
  --stage-glow-2: rgba(200, 168, 224, 0.03);
  --stage-accent: #c8c0d8;
}
