/* ═══════════════════════════════════════
   乙女氛围主题覆盖层
   保留原 style.css，只叠加柔和、暖金、恋爱感细节
   ═══════════════════════════════════════ */

/* ── 全局：暗底+顶部暖金光晕 ── */
body {
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(212, 168, 83, 0.10) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(139, 90, 130, 0.06) 0%, transparent 50%),
    linear-gradient(180deg, #1a1a22 0%, #23232f 100%);
}

/* ── 首页：浪漫入口 ── */
.landing {
  gap: 18px;
}
.landing h1 {
  font-size: 32px;
  letter-spacing: 6px;
  text-shadow: 0 2px 18px rgba(212, 168, 83, 0.25);
}
.landing-sub {
  color: var(--text-secondary);
  font-size: 14px;
  letter-spacing: 1px;
  margin-bottom: 18px;
  opacity: 0.85;
}

.landing .chars {
  gap: 22px;
}
.landing .char-card {
  background: rgba(34, 34, 46, 0.85);
  border-radius: 18px;
  padding: 18px 20px 14px;
  gap: 12px;
  min-width: 110px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.landing .char-card:hover {
  background-color: rgba(42, 42, 56, 0.95);
  border-color: rgba(212, 168, 83, 0.5);
  color: var(--accent);
  transform: translateY(-6px) scale(1.03);
  box-shadow:
    0 0 28px rgba(212, 168, 83, 0.18),
    0 12px 32px rgba(0, 0, 0, 0.35);
}

.char-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 2px solid rgba(212, 168, 83, 0.25);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  transition: all 0.35s ease;
}
.landing .char-card:hover .char-avatar {
  border-color: rgba(212, 168, 83, 0.7);
  box-shadow: 0 0 22px rgba(212, 168, 83, 0.22);
}

.char-avatar-placeholder {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--surface-hover) 0%, #2e2e3e 100%);
  border: 2px solid rgba(212, 168, 83, 0.15);
}

.landing .hint {
  margin-top: 8px;
  font-size: 12px;
  letter-spacing: 2px;
  opacity: 0.7;
}

/* ── 登录页：玻璃卡片 ── */
.login-box {
  background: rgba(34, 34, 46, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(212, 168, 83, 0.18);
  border-radius: 24px;
  padding: 44px 36px;
  width: 90%;
  max-width: 360px;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  height: auto;
  margin: auto;
}
.login-box h1 {
  font-size: 30px;
  text-shadow: 0 2px 16px rgba(212, 168, 83, 0.22);
}
.login-sub {
  font-size: 13px;
  letter-spacing: 1px;
}

/* ── 聊天页：温柔气泡 ── */
.chat .empty {
  margin-top: 35vh;
  font-size: 14px;
  color: var(--text-secondary);
  letter-spacing: 1px;
  line-height: 1.8;
}
.chat .empty::before {
  content: "✨";
  display: block;
  font-size: 28px;
  margin-bottom: 10px;
  opacity: 0.8;
}

.msg {
  border-radius: 18px;
  line-height: 1.75;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.msg.user {
  background: linear-gradient(135deg, #2d2d40 0%, #252536 100%);
  color: #e8e8f2;
  border-bottom-right-radius: 6px;
}
.msg.assistant {
  background: rgba(34, 34, 44, 0.85);
  border: 1px solid rgba(212, 168, 83, 0.10);
  border-bottom-left-radius: 6px;
}

/* ── 输入区：玻璃药丸 ── */
.input-area {
  background: rgba(34, 34, 46, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(212, 168, 83, 0.10);
  padding: 12px 18px 16px;
}
.input-area textarea {
  border-radius: 20px;
  background: rgba(28, 28, 36, 0.85);
  padding: 11px 16px;
}
.input-area button {
  border-radius: 20px;
  padding: 11px 20px;
  background: linear-gradient(135deg, var(--accent) 0%, #c99a4a 100%);
  box-shadow: 0 4px 14px rgba(212, 168, 83, 0.22);
}
.input-area button:hover {
  background: linear-gradient(135deg, var(--accent-hover) 0%, #d6a85a 100%);
}

/* ── 记忆面板：标题爱心改 SVG 矢量（.heart-ico，见 style.css），不再用 emoji ── */
.memory-panel {
  background: rgba(26, 26, 34, 0.96);
  border-left: 1px solid rgba(212, 168, 83, 0.12);
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.45);
}

/* ── 前世入口徽标 ── */
.char-card {
  position: relative;
}
.past-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--accent);
  background: rgba(212, 168, 83, 0.12);
  border: 1px solid rgba(212, 168, 83, 0.35);
  border-radius: 999px;
  padding: 2px 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.past-badge:hover {
  background: rgba(212, 168, 83, 0.22);
  box-shadow: 0 0 12px rgba(212, 168, 83, 0.25);
}

/* ── 前世回廊 ── */
.past-lives-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.past-lives-header {
  text-align: center;
  margin-bottom: 36px;
}
.past-lives-header h1 {
  font-size: 28px;
  letter-spacing: 4px;
  text-shadow: 0 2px 16px rgba(212, 168, 83, 0.22);
}
.past-lives-header p {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 8px;
  letter-spacing: 1px;
}
.past-lives-track {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding: 10px 24px 30px;
  max-width: 100%;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.past-lives-track::-webkit-scrollbar {
  height: 5px;
}
.past-life-card {
  flex: 0 0 auto;
  width: 240px;
  scroll-snap-align: center;
  background: rgba(34, 34, 46, 0.85);
  border: 1px solid rgba(212, 168, 83, 0.18);
  border-radius: 22px;
  padding: 24px 20px;
  text-align: center;
  text-decoration: none;
  color: var(--text-secondary);
  transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}
.past-life-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: rgba(212, 168, 83, 0.55);
  color: var(--accent);
  box-shadow:
    0 0 30px rgba(212, 168, 83, 0.20),
    0 16px 40px rgba(0, 0, 0, 0.35);
}
.past-life-card .char-avatar {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  margin-bottom: 14px;
  border: 2px solid rgba(212, 168, 83, 0.25);
}
.past-life-card:hover .char-avatar {
  border-color: rgba(212, 168, 83, 0.7);
  box-shadow: 0 0 22px rgba(212, 168, 83, 0.22);
}
.past-life-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 1px;
}
.past-life-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
  line-height: 1.6;
}
.past-lives-back {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: none;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 2px;
}
.past-lives-back:hover { color: var(--accent); border-color: var(--accent); }

/* ── 前世入口浮窗（点卡片弹出）── */
.past-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 300;
  padding: 20px;
}
.past-modal-sheet {
  width: 100%;
  max-width: 420px;
  background: rgba(34, 34, 46, 0.50);  /* 半透明 sheet：背后的他们透上来（08-19 发财试 50%） */
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(212, 168, 83, 0.22);
  border-radius: 22px 22px 0 0;
  padding: 18px 18px 24px;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.4);
  animation: pastSheetUp 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
@keyframes pastSheetUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.past-modal-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 0 4px;
}
#pastModalTitle {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 1px;
}
.past-modal-hint {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1px;
}
.past-modal-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.past-modal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(42, 42, 56, 0.75);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.25s;
}
.past-modal-item:hover {
  border-color: rgba(212, 168, 83, 0.5);
  color: var(--text-primary);
  background: rgba(42, 42, 56, 0.95);
  transform: translateY(-2px);
}
.past-modal-label {
  font-size: 15px;
  letter-spacing: 1px;
}
.past-modal-tag {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--accent);
  background: rgba(212, 168, 83, 0.12);
  border: 1px solid rgba(212, 168, 83, 0.35);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}
.past-modal-tag.past {
  color: #c9a0d6;
  background: rgba(139, 90, 130, 0.12);
  border-color: rgba(139, 90, 130, 0.35);
}

/* ── 前世入口浮窗 v2：图标横排 ── */
.past-modal-overlay {
  align-items: flex-end;
}
.past-modal-sheet {
  border-radius: 22px;
  padding: 20px 18px 26px;
}
.past-modal-list {
  flex-direction: row;
  justify-content: center;
  gap: 28px;
}
/* ── 前世入口浮窗 v6：横滑条（同主页角色条手感：手机原生滑/电脑拖拽，卡不挤不缩；09-04 发财定）── */
.past-modal-list {
  flex-direction: row;
  justify-content: flex-start;  /* 显式压过上方旧规则里的 center——center 在溢出时会裁左端 */
  gap: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 2px 12px;
  /* 居中用首尾 auto margin，不用 justify-content:center——
     后者在溢出时会把左端裁掉（safe 关键字老 webview 不认，09-04 实证） */
}
.past-modal-list > :first-child { margin-left: auto; }
.past-modal-list > :last-child { margin-right: auto; }
.past-modal-list::-webkit-scrollbar { display: none; }
.past-modal-poster-item {
  flex: 0 0 auto;  /* 横滑条里不缩不挤 */
  -webkit-user-drag: none;  /* 拖拽滑动时不触发链接原生拖拽 */
  user-select: none;
}
.past-modal-poster-item {
  position: relative;
  width: min(128px, 29vw);
  aspect-ratio: 2 / 3;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(212, 168, 83, 0.25);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.past-modal-poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.35s ease;  /* 图源定了再淡入，不闪 */
}
.past-modal-poster-placeholder {
  width: 100%;
  height: 100%;
  background: var(--surface-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  color: var(--text-muted);
}
.past-modal-poster-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 20px 6px 9px;
  font-size: 12px;
  letter-spacing: 1px;
  text-align: center;
  color: #f3e9d2;
  background: linear-gradient(transparent, rgba(10, 10, 14, 0.75));
  pointer-events: none;
}
.past-modal-poster-item:hover {
  border-color: rgba(212, 168, 83, 0.75);
  box-shadow: 0 0 22px rgba(212, 168, 83, 0.28);
  transform: translateY(-4px);
}

/* ── 前世入口浮窗 v4：全端底部弹层（与手机版对齐）── */
.past-modal-overlay {
  padding: 0;
}
.past-modal-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 100%;
  min-height: 40vh;  /* 弹层范围撑到屏高 40%（08-19 发财定） */
  border-radius: 22px 22px 0 0;
  animation: pastSheetUp 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ── 前世入口浮窗：手机端海报卡收紧 ── */
@media (max-width: 600px) {
  .past-modal-list {
    gap: 12px;
    padding: 10px 0 14px;
  }
  .past-modal-poster-label {
    font-size: 12px;
  }
}

/* ═══════════════════════════════════════
   象牙纸张皮肤（skin=ivory）· 乙女氛围层覆写
   暗色毛玻璃全部改纸感：纯色/微透明米白 + 细棕边，
   阴影从黑影换棕影；金光晕语义保留，只降透明度
   ═══════════════════════════════════════ */

/* 全局底：米纸渐变，顶部留一点暖金光晕（档案色，语义不变） */
[data-skin="ivory"] body {
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(184, 146, 62, 0.10) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(139, 90, 130, 0.04) 0%, transparent 50%),
    linear-gradient(180deg, #f2e9d6 0%, #e9dfcb 100%);
}

/* 首页角色卡：纸面卡片 + 棕影 */
[data-skin="ivory"] .landing .char-card {
  background: rgba(255, 252, 244, 0.55);
  box-shadow: 0 4px 16px rgba(120, 90, 40, 0.10);
}
[data-skin="ivory"] .landing .char-card:hover {
  background-color: rgba(255, 252, 244, 0.85);
  box-shadow:
    0 0 28px rgba(184, 146, 62, 0.16),
    0 12px 32px rgba(120, 90, 40, 0.16);
}
[data-skin="ivory"] .char-avatar {
  box-shadow: 0 4px 14px rgba(120, 90, 40, 0.16);
}
[data-skin="ivory"] .char-avatar-placeholder {
  background: linear-gradient(135deg, var(--surface-hover) 0%, #e6d9bc 100%);
}

/* 登录页：纸卡片，不再玻璃 */
[data-skin="ivory"] .login-box {
  background: rgba(250, 244, 230, 0.92);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid rgba(120, 90, 40, 0.20);
  box-shadow:
    0 20px 50px rgba(120, 90, 40, 0.14),
    inset 0 0 46px rgba(120, 90, 40, 0.06);
}

/* 聊天气泡（无角色锚点时的兜底；聊天页会被沉浸层角色色覆写） */
[data-skin="ivory"] .msg {
  box-shadow: 0 2px 8px rgba(120, 90, 40, 0.10);
}
[data-skin="ivory"] .msg.user {
  background: linear-gradient(135deg, #f0e4c6 0%, #e9dbb8 100%);
  color: #4a3f28;
}
[data-skin="ivory"] .msg.assistant {
  background: rgba(250, 244, 230, 0.9);
  border: 1px solid rgba(120, 90, 40, 0.16);
}

/* 输入区：纸面药丸 */
[data-skin="ivory"] .input-area {
  background: rgba(247, 240, 224, 0.94);
  border-top: 1px solid rgba(120, 90, 40, 0.16);
}
[data-skin="ivory"] .input-area textarea {
  background: rgba(255, 252, 244, 0.85);
}
[data-skin="ivory"] .input-area button {
  box-shadow: 0 4px 14px rgba(184, 146, 62, 0.24);
}

/* 记忆面板：整面板纸底 */
[data-skin="ivory"] .memory-panel {
  background: rgba(242, 233, 214, 0.98);
  border-left: 1px solid rgba(120, 90, 40, 0.20);
  box-shadow: -8px 0 40px rgba(120, 90, 40, 0.18);
}

/* 前世回廊：纸卡 */
[data-skin="ivory"] .past-life-card {
  background: rgba(255, 252, 244, 0.6);
  box-shadow: 0 8px 28px rgba(120, 90, 40, 0.12);
}
[data-skin="ivory"] .past-life-card:hover {
  box-shadow:
    0 0 30px rgba(184, 146, 62, 0.18),
    0 16px 40px rgba(120, 90, 40, 0.18);
}

/* 前世入口浮窗 */
[data-skin="ivory"] .past-modal-overlay {
  background: rgba(56, 48, 31, 0.40);
}
[data-skin="ivory"] .past-modal-sheet {
  background: rgba(250, 244, 230, 0.50);  /* 跟夜幕同步 50% 透明（08-19 发财：跟吧）；浅色半透明必须开磨砂，不然底图透上来发脏 */
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(120, 90, 40, 0.22);
  box-shadow: 0 -8px 40px rgba(120, 90, 40, 0.20);
}
[data-skin="ivory"] .past-modal-item {
  background: rgba(255, 252, 244, 0.7);
}
[data-skin="ivory"] .past-modal-item:hover {
  background: rgba(255, 252, 244, 0.95);
}
[data-skin="ivory"] .past-modal-avatar {
  box-shadow: 0 4px 16px rgba(120, 90, 40, 0.18);
}
