/* DeepSuol · 设计系统 v2 —— 午夜书房 × 玫瑰信笺（乙女向） */
:root {
  --bg: #1a1423;
  --panel: #241a30;
  --panel2: #2d2140;
  --line: #3d2d52;
  --line-soft: #332747;
  --text: #f5e6ee;
  --muted: #a67fa8;
  --accent: #e8b4c8;
  --accent-deep: #c98aa6;
  --accent2: #d4a852;
  --danger: #e88a8a;
  --radius: 16px;
  --font-display: "Noto Serif SC", "Songti SC", "SimSun", serif;
  --font-body: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 900px 500px at 85% -10%, rgba(232, 180, 200, .07), transparent),
    radial-gradient(ellipse 700px 400px at 0% 100%, rgba(166, 127, 168, .06), transparent);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.8;
}
a { color: var(--accent); text-decoration: none; }
::selection { background: rgba(232, 180, 200, .35); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #4a3860; border-radius: 4px; }

.muted { color: var(--muted); }
.gold { color: var(--accent2); }
.danger { color: var(--danger); }
.small { font-size: 12.5px; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr; } .grid-2 { grid-template-columns: 1fr; } }

/* ---------- 容器与布局 ---------- */
.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.topbar {
  height: 62px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; border-bottom: 1px solid var(--line-soft);
  background: rgba(26, 20, 35, .82); backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 50;
}
.logo {
  font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: 2px;
  display: flex; align-items: center; gap: 9px;
}
.logo em { font-style: normal; color: var(--accent); }
.shell { display: flex; height: calc(100vh - 62px); }
.sidebar {
  width: 212px; border-right: 1px solid var(--line-soft); padding: 20px 14px;
  display: flex; flex-direction: column; gap: 6px; flex-shrink: 0;
}
.side-item {
  padding: 12px 16px; border-radius: 12px; color: var(--muted); cursor: pointer;
  display: flex; align-items: center; gap: 11px; font-size: 14.5px; transition: .2s;
  border: 1px solid transparent; background: none; width: 100%; text-align: left; font-family: inherit;
}
.side-item:hover { color: var(--text); background: rgba(232, 180, 200, .07); }
.side-item.active {
  color: var(--text); background: rgba(232, 180, 200, .12);
  border-color: rgba(232, 180, 200, .3);
}
.side-item .ico { font-size: 17px; }
.main { flex: 1; overflow-y: auto; padding: 28px 32px; }
.view { display: none; animation: fade .3s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 22px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel2); color: var(--text); font-size: 14px; cursor: pointer;
  transition: .2s; font-family: inherit;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary {
  background: linear-gradient(135deg, #e8b4c8, #c98aa6);
  border: none; color: #3d1f30; font-weight: 600;
}
.btn-primary:hover { filter: brightness(1.08); color: #3d1f30; }
.btn-ghost { background: transparent; }
.btn-danger { background: transparent; border-color: rgba(232, 138, 138, .4); color: var(--danger); }
.btn-danger:hover { background: rgba(232, 138, 138, .1); color: var(--danger); }
.btn-sm { padding: 6px 14px; font-size: 12.5px; border-radius: 9px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; pointer-events: none; }

/* ---------- 表单 ---------- */
.input, .select, textarea.input {
  width: 100%; background: rgba(45, 33, 64, .6); border: 1px solid var(--line);
  border-radius: 12px; padding: 11px 15px; color: var(--text); font-size: 14px;
  font-family: inherit; outline: none; transition: .2s;
}
.input:focus, .select:focus, textarea.input:focus { border-color: var(--accent); }
.input::placeholder { color: #7a6288; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 7px; letter-spacing: .5px; }

/* ---------- 卡片 / 徽章 / 标签 ---------- */
.card {
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 22px; transition: .2s;
}
.card.hover:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0, 0, 0, .3); }
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 14px;
  border-radius: 999px; border: 1px solid var(--line); color: var(--muted);
  font-size: 12.5px; cursor: pointer; background: transparent; transition: .2s; font-family: inherit;
}
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.active { background: rgba(232, 180, 200, .15); border-color: var(--accent); color: var(--accent); }
.badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 12px; }
.badge-green { background: rgba(212, 168, 82, .15); color: var(--accent2); }
.badge-red { background: rgba(232, 138, 138, .15); color: var(--danger); }
.badge-gold { background: rgba(232, 180, 200, .15); color: var(--accent); }
.badge-gray { background: rgba(166, 127, 168, .15); color: var(--muted); }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; color: var(--muted); font-weight: 500; font-size: 12.5px;
  padding: 11px 12px; border-bottom: 1px solid var(--line); letter-spacing: .5px;
}
.table td { padding: 13px 12px; border-bottom: 1px solid rgba(61, 45, 82, .5); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(45, 33, 64, .5); }

/* ---------- 进度条 ---------- */
.progress { height: 6px; background: var(--panel2); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 99px; }
.progress.warn > i { background: linear-gradient(90deg, #e8a24a, var(--danger)); }

/* ---------- 弹窗 / 提示 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(16, 10, 24, .78); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; z-index: 100; animation: fade .2s;
}
.modal {
  width: min(480px, 92vw); background: var(--panel); border: 1px solid var(--line);
  border-radius: 20px; padding: 30px; animation: pop .25s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal h3 { font-family: var(--font-display); font-size: 18px; margin-bottom: 16px; letter-spacing: 1px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.toast-wrap { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  padding: 11px 22px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line);
  font-size: 13.5px; animation: fade .2s; box-shadow: 0 8px 30px rgba(0, 0, 0, .45);
}
.toast.success { border-color: rgba(212, 168, 82, .5); }
.toast.error { border-color: rgba(232, 138, 138, .5); }

/* ---------- 标签页 / 统计卡 / 图表 ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.tab {
  padding: 11px 20px; cursor: pointer; color: var(--muted); font-size: 14px;
  border-bottom: 2px solid transparent; background: none; border-top: none; border-left: none; border-right: none; font-family: inherit;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.stat-card { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 20px 22px; }
.stat-card .num { font-family: var(--font-display); font-size: 28px; font-weight: 600; margin: 4px 0 2px; }
.stat-card .lbl { font-size: 12.5px; color: var(--muted); }
.bars { display: flex; align-items: flex-end; gap: 12px; height: 160px; padding-top: 10px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar > i {
  width: 100%; max-width: 46px;
  background: linear-gradient(180deg, var(--accent), rgba(201, 138, 166, .2));
  border-radius: 8px 8px 0 0;
}
.bar > span { font-size: 11.5px; color: var(--muted); }

/* ---------- 聊天 / 阅读器 ---------- */
/* 双栏布局：左封面卡 + 右聊天区 */
.reader-layout { display: flex; gap: 28px; align-items: flex-start; }
.reader-side {
  width: 260px; flex-shrink: 0; position: sticky; top: 20px;
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: 16px;
  overflow: hidden; padding-bottom: 16px;
}
.reader-cover { width: 100%; aspect-ratio: 3 / 2; display: flex; align-items: center; justify-content: center; font-size: 56px; }
.reader-cover.has-img { display: block; }
.reader-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.reader-cover-title {
  font-family: var(--font-display); font-size: 19px; letter-spacing: 1px;
  padding: 14px 16px 0;
}
.reader-cover-synopsis {
  font-size: 12.5px; color: var(--muted); line-height: 1.9; padding: 8px 16px 0;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.reader-chat { flex: 1; min-width: 0; }
@media (max-width: 900px) {
  .reader-layout { flex-direction: column; }
  .reader-side { width: 100%; position: static; }
  .reader-cover { aspect-ratio: 16 / 6; }
}
.chat-wrap { max-width: 760px; margin: 0 auto; padding-bottom: 20px; }
.msg { margin-bottom: 22px; animation: fade .35s; }
.msg-user { display: flex; justify-content: flex-end; }
.msg-user .bubble {
  background: linear-gradient(135deg, rgba(232, 180, 200, .22), rgba(201, 138, 166, .14));
  border: 1px solid rgba(232, 180, 200, .35); padding: 13px 18px; border-radius: 16px 16px 4px 16px;
  max-width: 78%;
}
.msg-ai .bubble {
  background: var(--panel); border: 1px solid var(--line-soft); padding: 18px 24px;
  border-radius: 4px 16px 16px 16px; max-width: 92%;
  font-family: var(--font-display); font-size: 16.5px; line-height: 2.05;
  white-space: pre-wrap;
}
.msg-meta { font-size: 11.5px; color: #7a6288; margin-top: 7px; padding: 0 4px; }
.choices { display: flex; flex-direction: column; gap: 9px; max-width: 760px; margin: 8px auto 24px; }
.choice-btn {
  text-align: left; padding: 14px 20px; border-radius: 14px; cursor: pointer;
  background: rgba(232, 180, 200, .06); border: 1px solid rgba(232, 180, 200, .22);
  color: var(--text); font-size: 14.5px; transition: .2s; font-family: inherit;
}
.choice-btn:hover { background: rgba(232, 180, 200, .15); border-color: var(--accent); transform: translateX(5px); }
.choice-btn::before { content: "❯ "; color: var(--accent); }
.input-bar {
  position: sticky; bottom: 0; max-width: 760px; margin: 0 auto;
  display: flex; gap: 10px; padding: 14px 0 4px;
  background: linear-gradient(transparent, var(--bg) 30%);
}
.price-chip {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px;
  background: rgba(212, 168, 82, .12); color: var(--accent2); padding: 3px 11px; border-radius: 999px;
}
.balance-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 15px;
  background: rgba(212, 168, 82, .1); border: 1px solid rgba(212, 168, 82, .3);
  border-radius: 999px; color: var(--accent2); font-weight: 600; font-size: 13.5px; cursor: pointer;
}

/* ---------- 故事卡 ---------- */
.story-card { cursor: pointer; overflow: hidden; display: flex; flex-direction: column; }
.story-cover {
  height: 132px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 48px; margin-bottom: 15px; position: relative; overflow: hidden;
}
.story-cover::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(245, 230, 238, .16), transparent 60%);
}
.story-card h4 { font-family: var(--font-display); font-size: 17px; margin-bottom: 5px; letter-spacing: .5px; }
.story-card p { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; color: #3d1f30; font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.avatar-img { overflow: hidden; background: var(--panel2); }
.avatar-img img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 个人中心 ---------- */
.profile-hero { display: flex; align-items: center; gap: 18px; padding: 26px 22px; }
.profile-hero .avatar { width: 72px; height: 72px; font-size: 26px; }
.profile-hero .nick { font-family: var(--font-display); font-size: 20px; letter-spacing: 1px; }
.profile-hero .acc { color: var(--muted); font-size: 13px; }
.profile-section { margin-top: 18px; }
.profile-section h3 { font-size: 14px; color: var(--accent2); margin-bottom: 10px; letter-spacing: 1px; }
.disclaimer { font-size: 12.5px; color: var(--muted); line-height: 1.9; padding: 16px 18px; }

/* ---------- 封面选择器 ---------- */
.cover-picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
@media (max-width: 900px) { .cover-picker { grid-template-columns: repeat(3, 1fr); } }
.cover-option {
  aspect-ratio: 3 / 2; border-radius: 10px; overflow: hidden; cursor: pointer; position: relative;
  border: 2px solid transparent; background: var(--panel2); display: flex; align-items: center; justify-content: center;
  font-size: 34px; transition: .2s;
}
.cover-option img { width: 100%; height: 100%; object-fit: cover; }
.cover-option:hover { border-color: var(--accent-deep); transform: translateY(-2px); }
.cover-option.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232, 180, 200, .25); }
.cover-option.selected::after {
  content: '✓'; position: absolute; right: 6px; top: 4px; color: #fff; font-size: 13px; font-weight: 700;
  background: var(--accent-deep); width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.cover-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.cover-upload { border: 2px dashed var(--line); border-radius: 10px; padding: 14px; text-align: center; color: var(--muted); cursor: pointer; font-size: 13px; margin-top: 10px; }
.cover-upload:hover { border-color: var(--accent); color: var(--text); }

/* 封面图版故事卡 */
.story-cover.has-img { padding: 0; }
.story-cover.has-img img { width: 100%; height: 100%; object-fit: cover; }
.story-cover.has-img::after { background: linear-gradient(180deg, transparent 55%, rgba(26, 20, 35, .55)); }

/* ---------- 上传 / 充值档位 ---------- */
.upload-zone {
  border: 2px dashed var(--line); border-radius: var(--radius); padding: 46px 20px;
  text-align: center; color: var(--muted); cursor: pointer; transition: .25s; background: rgba(36, 26, 48, .5);
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--accent); color: var(--text); background: rgba(232, 180, 200, .06); }
.tier-card { text-align: center; cursor: pointer; position: relative; }
.tier-card:hover { border-color: var(--accent); }
.tier-card .price { font-family: var(--font-display); font-size: 26px; font-weight: 600; margin: 6px 0; }
.tier-card .pts { color: var(--accent2); font-size: 13.5px; }
.tier-card .tag {
  position: absolute; top: -10px; right: 14px; font-size: 11px;
  background: linear-gradient(135deg, #e8b4c8, #d4a852); color: #3d1f30; padding: 2px 11px; border-radius: 999px; font-weight: 700;
}

/* ---------- 落地页 ---------- */
.hero { padding: 96px 0 72px; text-align: center; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; top: -220px; left: 50%; transform: translateX(-50%);
  width: 760px; height: 540px; background: radial-gradient(closest-side, rgba(232, 180, 200, .16), transparent);
  pointer-events: none;
}
.hero h1 {
  font-family: var(--font-display); font-size: 48px; line-height: 1.35; letter-spacing: 2px; font-weight: 600;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(120deg, #e8b4c8, #d4a852);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .sub { color: var(--muted); font-size: 17px; margin: 20px 0 36px; line-height: 2; }
.feature-ico { font-size: 30px; margin-bottom: 13px; }
.steps { display: flex; gap: 0; align-items: stretch; }
.step { flex: 1; text-align: center; padding: 10px; position: relative; }
.step .n {
  width: 40px; height: 40px; border-radius: 50%; margin: 0 auto 13px;
  background: rgba(232, 180, 200, .1); border: 1px solid var(--accent);
  display: flex; align-items: center; justify-content: center; color: var(--accent);
  font-family: var(--font-display); font-weight: 600;
}
.section-title {
  font-family: var(--font-display); font-size: 28px; text-align: center; margin: 74px 0 10px; letter-spacing: 2px;
}
.section-sub { text-align: center; color: var(--muted); margin-bottom: 38px; }
footer { border-top: 1px solid var(--line-soft); margin-top: 84px; padding: 32px 0 42px; color: var(--muted); font-size: 13px; text-align: center; }

/* ---------- 点缀：SVG 角花 / 分隔 ---------- */
.orn-divider { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 10px 0; }
.orn-divider::before, .orn-divider::after {
  content: ""; height: 1px; width: 90px; background: linear-gradient(90deg, transparent, var(--line));
}
.orn-divider::after { background: linear-gradient(90deg, var(--line), transparent); }
