:root {
  --bg: #0b0a12;
  --bg-soft: #12101c;
  --card: #181528;
  --card-hi: #1f1b31;
  --line: #2a2440;
  --text: #ece9f5;
  --text-2: #a9a2c7;
  --text-3: #6f6890;
  --accent: #8b6ef0;
  --accent-2: #e07ab8;
  --gold: #e8b96a;
  --green: #4ec9a0;
  --red: #e2647a;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(0, 0, 0, .45);
  --tabbar-h: 58px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  min-height: 100%;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(620px 420px at 12% -6%, rgba(139, 110, 240, .18), transparent 70%),
    radial-gradient(520px 380px at 92% 8%, rgba(224, 122, 184, .10), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
::-webkit-scrollbar { width: 0; height: 0; }

/* ---------- 页面容器：手机宽度居中，桌面看也是 App 形态 ---------- */
.wrap {
  position: relative; z-index: 1;
  max-width: 480px; margin: 0 auto;
  padding: 0 16px calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom));
}
.wrap.no-tab { padding-bottom: 32px; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0 10px;
  margin: 0 -16px 6px; padding-left: 16px; padding-right: 16px;
  background: linear-gradient(180deg, rgba(11, 10, 18, .97), rgba(11, 10, 18, .78));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.logo { display: flex; align-items: center; gap: 8px; font-family: "Songti SC", Georgia, serif; font-size: 20px; letter-spacing: 2.5px; text-decoration: none; color: var(--text); }
.logo-img { width: 27px; height: 27px; border-radius: 50%; flex: none; box-shadow: 0 0 16px rgba(139, 110, 240, .55), 0 0 4px rgba(224, 122, 184, .35); }
.logo-text { background: linear-gradient(120deg, #e6dbff 10%, #f4b6d8 90%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.topbar .spacer { flex: 1; }
.topbar .navlink { color: var(--text-2); font-size: 14px; padding: 8px 10px; border-radius: 10px; }
.coin-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(232, 185, 106, .1); border: 1px solid rgba(232, 185, 106, .3);
  color: var(--gold); font-size: 13px; font-weight: 500;
}
.coin-pill .dot { width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe4ae, #d9a44e); }

/* ---------- 底部 TabBar ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: rgba(13, 11, 21, .94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid rgba(42, 36, 64, .8);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar-in { max-width: 480px; margin: 0 auto; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 0 7px; color: var(--text-3); font-size: 10.5px; letter-spacing: .5px;
  transition: color .15s;
}
.tab svg { width: 23px; height: 23px; }
.tab.on { color: #b9a6ff; }
.tab.on svg { filter: drop-shadow(0 0 6px rgba(139, 110, 240, .7)); }
.tab:active { transform: scale(.94); }

/* ---------- 按钮 / 表单 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 18px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card-hi); color: var(--text); cursor: pointer;
  transition: .18s; white-space: nowrap; font-size: 14px; min-height: 42px;
}
.btn:hover { border-color: #443a68; background: #241f3a; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, #7f5ff0, #a25ce0); border-color: transparent; color: #fff; font-weight: 500; }
.btn.primary:hover { filter: brightness(1.12); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 7px 13px; font-size: 13px; min-height: 34px; border-radius: 9px; }
.btn.danger { color: var(--red); border-color: rgba(226, 100, 122, .4); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.input, textarea.input, select.input {
  width: 100%; padding: 11px 13px; height: 44px;
  background: #14111f; border: 1px solid var(--line); border-radius: 11px;
  outline: none; transition: .18s; font-size: 15px; /* >=16px 防 iOS 聚焦缩放 */
}
@media (min-width: 480px) { .input { font-size: 14px; } }
textarea.input { height: auto; min-height: 96px; resize: vertical; line-height: 1.7; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139, 110, 240, .14); }
.input::placeholder { color: var(--text-3); }
.field { margin-bottom: 15px; }
.field > label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 7px; }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 7px 15px; border-radius: 999px; font-size: 13px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .02);
  color: var(--text-2); cursor: pointer; transition: .16s; white-space: nowrap;
  min-height: 34px;
}
.chip.on { background: rgba(139, 110, 240, .16); border-color: rgba(139, 110, 240, .55); color: #c9b8ff; }
.chip-bar { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.chip-bar::-webkit-scrollbar { display: none; }

.tag { display: inline-block; padding: 2px 9px; margin: 0 5px 5px 0; border-radius: 6px; font-size: 12px; color: var(--text-3); background: rgba(255, 255, 255, .04); }

/* ---------- 角色卡：严格两列，永不溢出 ---------- */
.grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.char-card {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: var(--card); border: 1px solid var(--line);
  transition: .2s; cursor: pointer; display: block;
}
.char-card:active { transform: scale(.97); }
.char-cover { position: relative; aspect-ratio: 3 / 3.8; background: #241f38; overflow: hidden; }
.char-cover img { width: 100%; height: 100%; object-fit: cover; }
.char-cover .fallback {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-family: "Songti SC", Georgia, serif; font-size: 54px; color: rgba(255, 255, 255, .85); letter-spacing: 2px;
}
.char-cover::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 42%, rgba(9, 8, 15, .93) 100%);
}
.char-meta { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 11px; z-index: 2; }
.char-name { font-size: 15px; font-weight: 500; display: flex; align-items: center; gap: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.char-tagline { font-size: 11.5px; color: var(--text-2); margin-top: 3px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.char-heat { position: absolute; top: 9px; right: 9px; z-index: 2; font-size: 10.5px; color: #ffd9a0; background: rgba(0, 0, 0, .55); padding: 2px 8px; border-radius: 999px; backdrop-filter: blur(6px); }
.badge-off { position: absolute; top: 9px; left: 9px; z-index: 2; font-size: 10.5px; color: #1a1024; background: linear-gradient(135deg, #f2d28e, #e8b96a); padding: 2px 8px; border-radius: 5px; font-weight: 500; }

/* ---------- 通用块 ---------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.panel + .panel { margin-top: 14px; }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 500; margin: 24px 0 12px; }
.section-title::before { content: ""; width: 3px; height: 15px; border-radius: 2px; background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.empty { padding: 52px 20px; text-align: center; color: var(--text-3); font-size: 14px; }

table.tb { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tb th { text-align: left; color: var(--text-3); font-weight: 400; padding: 9px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.tb td { padding: 10px 8px; border-bottom: 1px solid rgba(42, 36, 64, .5); }
.tb-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; }
.pill.ok { background: rgba(78, 201, 160, .14); color: var(--green); }
.pill.wait { background: rgba(232, 185, 106, .14); color: var(--gold); }
.pill.no { background: rgba(226, 100, 122, .14); color: var(--red); }
.pill.info { background: rgba(139, 110, 240, .16); color: #b9a6ff; }

/* ---------- 聊天页 ---------- */
.chat-shell {
  position: relative; z-index: 1; max-width: 480px; margin: 0 auto;
  display: flex; flex-direction: column;
  height: 100vh; height: 100dvh;
}
.chat-head {
  display: flex; align-items: center; gap: 11px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  border-bottom: 1px solid rgba(42, 36, 64, .7);
  background: rgba(11, 10, 18, .92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.chat-head .avatar { width: 38px; height: 38px; border-radius: 11px; overflow: hidden; flex: none; }
.chat-back { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; color: var(--text-2); font-size: 19px; flex: none; }
.chat-back:active { background: rgba(255, 255, 255, .07); }
.chat-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px 14px 10px; display: flex; flex-direction: column; gap: 16px; }
.msg { display: flex; gap: 9px; max-width: 94%; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg .bubble {
  padding: 11px 14px; border-radius: 16px; font-size: 15px; line-height: 1.85;
  white-space: pre-wrap; word-break: break-word;
}
.msg.assistant .bubble { background: var(--card); border: 1px solid var(--line); border-top-left-radius: 5px; }
.msg.user .bubble { background: linear-gradient(135deg, rgba(127, 95, 240, .32), rgba(162, 92, 224, .24)); border: 1px solid rgba(139, 110, 240, .35); border-top-right-radius: 5px; }
.msg .avatar { width: 34px; height: 34px; border-radius: 10px; overflow: hidden; flex: none; }
.msg .avatar .fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 15px; background: #2a2444; }

.status-card {
  margin-top: 10px; padding: 11px 13px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(139, 110, 240, .12), rgba(224, 122, 184, .07));
  border: 1px solid rgba(139, 110, 240, .26); font-size: 12.5px; color: var(--text-2);
}
.status-card .st-row { display: flex; gap: 8px; padding: 2px 0; }
.status-card .st-k { color: var(--text-3); min-width: 44px; }
.status-card .bar { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .1); margin-top: 7px; overflow: hidden; }
.status-card .bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .5s; }

.chat-input-bar {
  padding: 10px 14px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(42, 36, 64, .7);
  background: rgba(11, 10, 18, .96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.chat-input-box { display: flex; gap: 9px; align-items: flex-end; }
.chat-input-box textarea {
  flex: 1; min-height: 44px; max-height: 140px; padding: 10px 13px; resize: none;
  background: #14111f; border: 1px solid var(--line); border-radius: 13px; outline: none;
  line-height: 1.55; font-size: 16px;
}
.chat-input-box textarea:focus { border-color: rgba(139, 110, 240, .6); }
.send-btn { width: 44px; height: 44px; border-radius: 13px; border: none; cursor: pointer; background: linear-gradient(135deg, #7f5ff0, #a25ce0); color: #fff; font-size: 19px; flex: none; display: flex; align-items: center; justify-content: center; }
.send-btn:disabled { opacity: .4; }
.chat-hint { font-size: 11.5px; color: var(--text-3); margin-top: 7px; display: flex; gap: 12px; flex-wrap: wrap; }

.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--text-3); animation: blink 1.3s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

/* ---------- 弹层 / 提示 ---------- */
.mask { position: fixed; inset: 0; background: rgba(5, 4, 10, .74); backdrop-filter: blur(4px); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 22px; }
.modal { width: 100%; max-width: 400px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); }
.modal h3 { font-size: 17px; font-weight: 500; margin-bottom: 4px; }
.toast-box { position: fixed; top: calc(20px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 400; display: flex; flex-direction: column; gap: 8px; align-items: center; width: max-content; max-width: 86vw; }
.toast { padding: 10px 18px; border-radius: 10px; background: #221d36; border: 1px solid var(--line); font-size: 13px; box-shadow: var(--shadow); animation: slidein .22s ease; }
.toast.ok { border-color: rgba(78, 201, 160, .45); }
.toast.err { border-color: rgba(226, 100, 122, .5); color: #ffc4cf; }
@keyframes slidein { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- 价格卡 / 统计 ---------- */
.price-grid { display: grid; gap: 11px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.price-card { position: relative; padding: 15px 14px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); cursor: pointer; transition: .18s; }
.price-card:active { transform: scale(.97); }
.price-card.on { border-color: rgba(139, 110, 240, .6); background: var(--card-hi); }
.price-card .pname { font-size: 13.5px; color: var(--text-2); }
.price-card .pval { font-size: 21px; font-weight: 500; margin: 5px 0 2px; color: var(--gold); font-family: Georgia, serif; }
.price-card .pval small { font-size: 12.5px; font-weight: 400; }
.price-card .porig { font-size: 11.5px; color: var(--text-3); text-decoration: line-through; }
.price-card .pbadge { position: absolute; top: -1px; right: 10px; font-size: 10.5px; background: linear-gradient(135deg, #f2d28e, #e8b96a); color: #23180a; padding: 2px 8px; border-radius: 0 0 6px 6px; }

.stat-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat { padding: 13px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.stat .k { font-size: 12px; color: var(--text-3); }
.stat .v { font-size: 20px; font-weight: 500; margin-top: 3px; font-family: Georgia, serif; }

/* ---------- 头像 ---------- */
.avatar-lg { width: 60px; height: 60px; border-radius: 16px; overflow: hidden; flex: none; }
.avatar-lg .fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-family: "Songti SC", serif; font-size: 26px; }
.avatar { width: 44px; height: 44px; border-radius: 12px; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar .fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.av-xs { width: 26px; height: 26px; border-radius: 8px; overflow: hidden; flex: none; }
.av-xs img { width: 100%; height: 100%; object-fit: cover; }
.av-xs .fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 12px; }

/* ---------- 列表项（移动端菜单行） ---------- */
.menu-list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.menu-item { display: flex; align-items: center; gap: 12px; padding: 15px 16px; border-bottom: 1px solid rgba(42, 36, 64, .5); cursor: pointer; }
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: rgba(139, 110, 240, .07); }
.menu-item .mi-label { flex: 1; font-size: 15px; }
.menu-item .mi-arrow { color: var(--text-3); }

/* ---------- 首页 hero ---------- */
.hero { padding: 20px 0 14px; }
.hero h1 { font-family: "Songti SC", Georgia, serif; font-size: 25px; font-weight: 400; letter-spacing: 1.5px; line-height: 1.5; }
.hero p { color: var(--text-2); font-size: 13.5px; margin-top: 8px; letter-spacing: .5px; }

/* ---------- 横滑会话卡 ---------- */
.hscroll { display: flex; gap: 10px; overflow-x: auto; padding: 2px 16px 8px; margin: 0 -16px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.recent-card {
  flex: none; width: 168px; padding: 12px; border-radius: 13px;
  background: var(--card); border: 1px solid var(--line);
}

/* ---------- 角色详情头图 ---------- */
.char-hero { position: relative; margin: 0 -16px 16px; }
.char-hero-img { aspect-ratio: 3 / 2.6; background: #241f38; overflow: hidden; position: relative; }
.char-hero-img img { width: 100%; height: 100%; object-fit: cover; }
.char-hero-img .fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-family: "Songti SC", serif; font-size: 80px; color: rgba(255,255,255,.85); }
.char-hero-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,10,18,.25) 0%, transparent 40%, rgba(11,10,18,.97) 100%); }
.char-hero-meta { position: absolute; left: 16px; right: 16px; bottom: 14px; z-index: 2; }
.char-hero-meta .name { font-family: "Songti SC", serif; font-size: 26px; letter-spacing: 1px; }

/* ---------- 认证页 ---------- */
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 28px 22px; position: relative; z-index: 1; max-width: 480px; margin: 0 auto; }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 30px; }
.auth-logo .logo { font-size: 30px; }

/* ---------- 桌面端轻微增强 ---------- */
@media (min-width: 520px) {
  body { background: #08070e; }
  .wrap, .tabbar-in, .chat-shell, .auth-wrap { border-color: var(--line); }
  .wrap { border-left: 1px solid rgba(42,36,64,.35); border-right: 1px solid rgba(42,36,64,.35); min-height: 100vh; }
}

/* 后台：允许表格区更宽并横向滚动 */
.admin-wrap { max-width: 480px; }
@media (min-width: 760px) {
  .admin-wrap { max-width: 1080px; }
  .admin-wrap .tb-wrap table.tb { min-width: 720px; }
}

/* ================= 广场（彩云小梦式布局） ================= */
.sq-search {
  display: flex; align-items: center; gap: 9px;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 999px; padding: 9px 15px; margin-bottom: 12px;
}
.sq-search svg { width: 17px; height: 17px; color: var(--text-3); flex: none; }
.sq-search input { flex: 1; background: none; border: 0; outline: 0; font-size: 14px; color: var(--text); }
.sq-search input::placeholder { color: var(--text-3); }

/* Banner 轮播 */
.sq-banner { position: relative; border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
.sq-banner-track { display: flex; transition: transform .5s cubic-bezier(.4,0,.2,1); }
.sq-banner-item {
  flex: 0 0 100%; min-height: 118px; padding: 18px 18px 22px;
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
  position: relative; overflow: hidden;
}
.sq-banner-item.b1 {
  background:
    radial-gradient(220px 130px at 85% 20%, rgba(224,122,184,.35), transparent 70%),
    radial-gradient(260px 160px at 15% 90%, rgba(139,110,240,.4), transparent 70%),
    linear-gradient(120deg, #241a44, #171226 60%, #2a1636);
}
.sq-banner-item.b2 {
  background:
    radial-gradient(240px 140px at 80% 80%, rgba(78,201,160,.22), transparent 70%),
    linear-gradient(120deg, #14303a, #101a2c 65%, #1d1436);
}
.sq-banner-item.b3 {
  background:
    radial-gradient(240px 150px at 20% 15%, rgba(232,185,106,.22), transparent 70%),
    linear-gradient(120deg, #2c2038, #14101f 60%, #33192b);
}
.sq-banner-item .bt { font-size: 19px; font-weight: 600; letter-spacing: 1px; font-family: "Songti SC", Georgia, serif; }
.sq-banner-item .bt b { background: linear-gradient(120deg, #cdb6ff, #f0a0cd); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sq-banner-item .bs { font-size: 12px; color: var(--text-2); }
.sq-banner-dots { position: absolute; bottom: 9px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; }
.sq-banner-dots i { width: 5px; height: 5px; border-radius: 999px; background: rgba(255,255,255,.35); transition: .3s; }
.sq-banner-dots i.on { width: 14px; background: #c9b0ff; }

/* 区块标题 */
.sq-sec-head { display: flex; align-items: baseline; justify-content: space-between; margin: 2px 0 10px; }
.sq-sec-title { font-size: 16.5px; font-weight: 600; letter-spacing: .5px; }
.sq-sec-more { font-size: 12px; color: var(--text-3); }

/* 官方模型横滑卡 */
.sq-model {
  flex: 0 0 200px; display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; min-height: 74px;
}
.sq-model:active { transform: scale(.97); }
.sq-model-logo {
  width: 42px; height: 42px; border-radius: 11px; flex: none;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 17px;
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
}
.sq-model-name { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.sq-model-desc { font-size: 11px; color: var(--text-3); margin-top: 2px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sq-badge-new { font-style: normal; font-size: 9.5px; color: #1a1024; background: linear-gradient(135deg,#f2d28e,#e8b96a);
  border-radius: 4px; padding: 1px 5px; font-weight: 600; }

/* 推荐/最新/关注 tabs */
.sq-tabs { display: flex; gap: 22px; margin: 18px 2px 12px; }
.sq-tab { position: relative; font-size: 16px; color: var(--text-3); padding: 4px 2px 9px; }
.sq-tab.on { color: var(--text); font-weight: 600; }
.sq-tab.on::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%);
  bottom: 0; width: 20px; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, #8b6ef0, #e07ab8);
}

/* 故事大卡 */
.sq-story {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 14px 12px; margin-bottom: 14px;
}
.sq-story-head { cursor: pointer; }
.sq-story-title { font-size: 17px; font-weight: 600; line-height: 1.4; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sq-badge-set { font-size: 10px; font-weight: 500; color: #ffd9a0; border: 1px solid rgba(232,185,106,.45);
  border-radius: 4px; padding: 0 5px; line-height: 1.6; }
.sq-stats { font-size: 11.5px; color: var(--text-3); margin-top: 7px; }
.sq-stats i { font-style: normal; margin: 0 6px; opacity: .5; }
.sq-story-intro { font-size: 13px; color: var(--text-2); margin-top: 8px; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 登场角色横滑 */
.sq-roles { margin: 12px 0 2px; }
.sq-role { flex: 0 0 205px; display: flex; gap: 9px; background: var(--card-hi); border: 1px solid var(--line); border-radius: 11px; padding: 8px; }
.sq-role-img { position: relative; width: 74px; min-height: 108px; border-radius: 8px; overflow: hidden; background: #241f38; flex: none; }
.sq-role-img img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.sq-role-img .fallback { width: 100%; height: 100%; min-height: 108px; display: flex; align-items: center; justify-content: center; font-size: 24px; color: #fff; opacity: .85; }
.sq-role-meta { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 7px 6px;
  background: linear-gradient(transparent, rgba(0,0,0,.75)); }
.sq-role-name { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sq-role-tag { font-size: 10px; color: rgba(255,255,255,.75); margin-top: 1px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sq-role-goal { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.sq-role-goal .g-label { font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.sq-role-goal .g-text { flex: 1; font-size: 11px; color: var(--text-3); line-height: 1.5; margin: 4px 0 8px;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.sq-explore { align-self: stretch; margin: 0 2px 2px; }

/* 卡片底部作者行 */
.sq-story-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.sq-author { font-size: 12.5px; color: var(--text-2); }

/* ================= 故事详情页 ================= */
.sd-hero { display: flex; flex-wrap: wrap; gap: 13px; margin-top: 4px; }
.sd-cover {
  width: 96px; height: 128px; border-radius: 12px; overflow: hidden; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-family: "Songti SC", Georgia, serif; font-size: 40px; color: rgba(255,255,255,.85);
  box-shadow: var(--shadow);
}
.sd-cover img { width: 100%; height: 100%; object-fit: cover; }
.sd-head-txt { flex: 1; min-width: 0; }
.sd-title { font-size: 19px; font-weight: 600; line-height: 1.4; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sd-author { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12.5px; color: var(--text-2); }
.sd-intro { width: 100%; font-size: 13.5px; color: var(--text-2); line-height: 1.7; margin-top: 2px; }
.sd-scenes { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 14px; }
.sd-scene { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.sd-scene:last-child { border-bottom: 0; }
.sd-scene-idx { flex: none; color: #c9b8ff; font-size: 12px; }
.sd-scene-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-scene-chars { flex: none; font-size: 11px; color: var(--text-3); }
.sd-roles { display: grid; gap: 10px; }
.sd-role {
  display: flex; gap: 11px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px;
  transition: border-color .2s;
}
.sd-role.on { border-color: rgba(139,110,240,.75); box-shadow: 0 0 0 2px rgba(139,110,240,.18); }
.sd-role-img { position: relative; width: 62px; height: 62px; border-radius: 10px; overflow: hidden; background: #241f38; flex: none; }
.sd-role-img img { width: 100%; height: 100%; object-fit: cover; }
.sd-role-img .fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 22px; color: #fff; }
.sd-role-txt { flex: 1; min-width: 0; }
.sd-role-txt .sq-role-tag { color: var(--text-3); margin-top: 3px; }
.sd-actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(11,10,18,.92); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.sd-actionbar .btn { max-width: 448px; margin: 0 auto; }

/* 探索按钮：彩云小梦式粉色 */
.sq-explore { background: linear-gradient(135deg, #f07a95, #e8577c); border-color: transparent; color: #fff; font-weight: 500; }
.sq-explore:active { filter: brightness(.92); }
.sd-actionbar .btn.primary { background: linear-gradient(135deg, #f07a95, #e8577c); }
.btn.primary.sq-explore { background: linear-gradient(135deg, #f07a95, #e8577c); border-color: transparent; }

/* ================= 「我的」页折叠菜单 ================= */
.acc-head { border-bottom: 1px solid rgba(42,36,64,.5); }
.menu-list .acc:last-child .acc-head { border-bottom: none; }
.acc-hint { flex: none; max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.acc-arrow { transition: transform .26s ease; display: inline-block; }
.acc.open .acc-arrow { transform: rotate(90deg); color: var(--text-2); }
.acc.open .acc-head { background: rgba(139,110,240,.06); }
.acc-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s cubic-bezier(.4,0,.2,1); }
.acc.open .acc-body { grid-template-rows: 1fr; }
.acc-inner { overflow: hidden; min-height: 0; }
.acc-pad {
  padding: 6px 16px 16px;
  background: rgba(139,110,240,.045);
  border-bottom: 1px solid rgba(42,36,64,.5);
}
.menu-list .acc:last-child .acc-pad { border-bottom: none; }
.acc-pad > .price-grid { margin-top: 8px; }
.price-card .pnote { font-size: 11.5px; color: var(--text-3); }

/* 模型介绍弹窗（广场官方模型） */
.mo-head { display: flex; align-items: center; gap: 12px; }
.mo-head .sq-model-logo { width: 48px; height: 48px; font-size: 20px; border-radius: 12px; }
.mo-head-txt { flex: 1; min-width: 0; }
.mo-name { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.mo-tags { display: flex; gap: 7px; margin-top: 6px; }
.mo-tag { font-size: 10.5px; border-radius: 4px; padding: 1.5px 7px; }
.mo-tag.free { color: #ff8f9f; border: 1px solid rgba(255,110,130,.5); }
.mo-tag.vip { color: #f2d28e; border: 1px solid rgba(232,185,106,.45); }
.mo-intro { font-size: 13.5px; line-height: 1.8; color: var(--text-2); margin-top: 14px; }
.mo-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }

/* ================= 情感状态：卡片与常驻条 ================= */
.status-card .st-head { display: flex; align-items: center; gap: 8px; }
.status-card .st-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.status-card .st-love { margin-left: auto; font-family: Georgia, serif; font-weight: 600; font-size: 14px; color: #ff8f9f; }
.status-card .bar { height: 5px; border-radius: 3px; background: rgba(255,255,255,.1); margin: 8px 0 9px; overflow: hidden; }
.status-card .bar > i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #f07a95, #e8577c); transition: width .5s; }
.status-card .st-line { display: flex; gap: 5px; padding: 2.5px 0; line-height: 1.62; }
.status-card .st-line .ico { flex: none; width: 15px; text-align: center; font-size: 11.5px; }
.status-card .st-line .k { flex: none; color: var(--text-3); }
.status-card .st-line .v { flex: 1; min-width: 0; color: var(--text-2); word-break: break-word; }

/* 顶部常驻状态条 */
.chat-live {
  flex: none; display: flex; align-items: center; gap: 9px;
  padding: 7px 16px 8px;
  background: linear-gradient(180deg, rgba(139,110,240,.1), rgba(11,10,18,0));
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.chat-live:active { background: rgba(139,110,240,.12); }
.chat-live .lv-name { font-size: 12.5px; font-weight: 500; color: var(--text); flex: none; max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-live .lv-love { font-size: 12.5px; font-weight: 600; color: #ff8f9f; font-family: Georgia, serif; flex: none; }
.chat-live .lv-bar { flex: 1; min-width: 40px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.12); overflow: hidden; }
.chat-live .lv-bar > i { display: block; height: 100%; border-radius: 2px; background: linear-gradient(90deg, #f07a95, #e8577c); transition: width .45s; }
.chat-live .lv-mood { flex: none; font-size: 11.5px; color: var(--text-2); max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-live .lv-more { flex: none; color: var(--text-3); font-size: 14px; }
