/* ===========================================
   来自 1998 · 90 年代风格
   配色：午夜深紫 + 霓虹粉 + 琥珀路灯 + 老 LCD 绿
   =========================================== */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  height: 100%;
  height: 100dvh;
  background: #0a0814;
  color: #f5e8d0;
  font-family: "Courier New", "Songti SC", "STSong", "宋体", monospace;
  overflow: hidden;
  letter-spacing: 0.02em;
}
/* 沉浸式：保留系统状态栏；顶区同色 + safe-area，避免盖住时间电量与颜色断层 */
html.immersive-root,
body.immersive {
  padding: 0;
  background: #1a1530 !important;
}
body.immersive.light {
  background: #e8e0d0 !important;
}
body.immersive .screen {
  padding-top: 0;
  padding-bottom: 0;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  background: transparent;
}
body.immersive .crt {
  background: transparent;
  max-height: 100%;
}
body.immersive .phone-frame.no-chrome {
  background: #1a1530;
}
body.immersive.light .phone-frame.no-chrome {
  background: #e8e0d0;
}
/* 首页：顶栏多留空，避免 App 刘海/状态栏裁切标题 */
body.immersive .phone-screen.home-screen {
  /* 标题统一下移：安全区 + 额外顶距，避免被状态栏裁切 */
  padding-top: calc(72px + env(safe-area-inset-top, 28px)) !important;
  background-color: #1a1530;
  background-image:
    linear-gradient(#1a1530, #1a1530),
    radial-gradient(ellipse at top, #2a1f4a 0%, #1a1530 60%, #100a1f 100%);
  background-size:
    100% env(safe-area-inset-top, 0px),
    100% 100%;
  background-position: top left, top left;
  background-repeat: no-repeat;
}
body.immersive.light .phone-screen.home-screen {
  padding-top: calc(72px + env(safe-area-inset-top, 28px)) !important;
  background-color: #e8e0d0;
  background-image:
    linear-gradient(#e8e0d0, #e8e0d0),
    radial-gradient(ellipse at top, #fffdf6 0%, #f2ead8 60%, #e8dfc8 100%);
  background-size:
    100% env(safe-area-inset-top, 0px),
    100% 100%;
  background-position: top left, top left;
  background-repeat: no-repeat;
}
body.immersive .chat-frame.no-chrome {
  /* 仅顶出状态栏高度；工具栏在这一层之下，不会顶进状态栏 */
  padding-top: env(safe-area-inset-top, 0px);
  background: #1a1530;
  box-sizing: border-box;
}
body.immersive.light .chat-frame.no-chrome {
  background: #e8e0d0;
}

/* 聊天顶栏：在 safe-area 下方，左右按钮 + 中间世界名 */
.chat-toolbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 8px;
  min-height: 44px;
  background: transparent;
  border-bottom: 1px solid rgba(90, 74, 122, 0.45);
}
.chat-tool-btn {
  flex-shrink: 0;
  width: 40px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 1px solid #6a5a8a;
  border-radius: 10px;
  background: linear-gradient(180deg, #2a2240 0%, #1a1530 100%);
  color: #ffd9a8;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.chat-tool-btn:active { opacity: 0.75; }
.chat-tool-reset {
  width: auto;
  min-width: 52px;
  padding: 0 10px;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: #ff9a9a;
  border-color: #803050;
}
.chat-tool-title {
  flex: 1;
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.12em;
  color: #e8dcff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: "STSong", "宋体", "PingFang SC", sans-serif;
}
body.light .chat-toolbar {
  border-bottom-color: rgba(200, 184, 148, 0.55);
}
body.light .chat-tool-btn {
  border-color: #c8b894;
  background: linear-gradient(180deg, #fffdf6 0%, #f0e8d6 100%);
  color: #9a5a1a;
}
body.light .chat-tool-reset {
  color: #c04040;
  border-color: #d08080;
}
body.light .chat-tool-title { color: #5a4a3a; }
body.immersive .chat-frame.no-chrome .msg-list {
  background:
    radial-gradient(ellipse at top, #1f1838 0%, #100a1f 80%);
}
body.immersive.light .chat-frame.no-chrome .msg-list {
  background: radial-gradient(ellipse at top, #fffdf6 0%, #f2ebd9 80%);
}

/* 老式纸纹 + 噪点 + 暗角 */
body::before {
  content: ""; position: fixed; inset: 0;
  background:
    radial-gradient(ellipse at center, #1a1530 0%, #0a0814 70%, #000 100%);
  z-index: -2;
}
/* 状态栏后方同色垫片（防透明叠色断层）；非沉浸式关闭 */
body:not(.immersive)::after {
  display: none;
  content: none;
}
body.immersive::after {
  content: "";
  display: block !important;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: env(safe-area-inset-top, 0px);
  background: #1a1530;
  z-index: 100000;
  pointer-events: none;
}
body.immersive.light::after {
  background: #e8e0d0;
}

.hidden { display: none !important; }

/* CRT 扫描线：已关闭（细线底纹） */
.scanlines {
  display: none !important;
}
.vignette {
  position: fixed; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 200px 60px rgba(0,0,0,0.7);
  z-index: 9997;
}

/* ============ 启动封面（全屏 cover，同聊天背景铺法）============ */
.boot-screen {
  position: fixed; inset: 0;
  z-index: 99999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: opacity 0.55s ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.boot-screen.splash-cover {
  /* 与聊天背景一致：等比例放大铺满；优先 webp 加速开屏 */
  background-color: #1a0a12;
  background-image: url('splash/cover.webp');
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-attachment: scroll !important;
}
.boot-screen.gone { opacity: 0; pointer-events: none; }
.splash-skip {
  margin-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.28em;
  color: rgba(255, 245, 235, 0.92);
  background: rgba(20, 8, 12, 0.42);
  border: 1px solid rgba(255, 200, 160, 0.35);
  text-shadow: 0 1px 4px rgba(0,0,0,0.55);
  animation: splash-pulse 2.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes splash-pulse {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}
/* 兼容旧 boot-line 类名（若残留） */
.boot-inner { display: none; }
.boot-line { display: none; }
.boot-line .hot { color: #ff5577; text-shadow: 0 0 6px #ff5577; }
@keyframes boot-in { to { opacity: 1; } }

/* ============ 屏幕容器 ============ */
.screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}

/* CRT 弯曲外壳 */
.crt {
  width: 100%; max-width: 420px;
  height: 100%;
  max-height: 820px;
  position: relative;
}

/* ============ 手机外壳（仿 90 年代直板机）============ */
.phone-frame {
  width: 100%; height: 100%;
  background:
    linear-gradient(180deg, #2c2740 0%, #1a162a 100%);
  border-radius: 28px;
  border: 2px solid #4a3f6a;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.08),
    inset 0 -2px 0 rgba(0,0,0,0.6),
    0 0 30px rgba(180, 80, 200, 0.15),
    0 18px 40px rgba(0,0,0,0.6);
  padding: 14px 12px 10px;
  display: flex; flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* 顶部听筒 */
.phone-frame::before {
  content: "";
  position: absolute;
  top: 6px; left: 50%;
  transform: translateX(-50%);
  width: 60px; height: 5px;
  background: #0a0814;
  border-radius: 3px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.8);
}

.phone-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 4px 6px;
  font-size: 11px;
  color: #c8b88a;
  letter-spacing: 0.1em;
}
.signal-bar {
  display: inline-flex; align-items: flex-end; gap: 2px; height: 12px;
}
.signal-bar span {
  display: inline-block;
  width: 3px;
  background: #ffb84a;
  box-shadow: 0 0 4px #ffb84a;
}
.signal-bar span:nth-child(1) { height: 4px; }
.signal-bar span:nth-child(2) { height: 7px; }
.signal-bar span:nth-child(3) { height: 10px; }
.signal-bar span:nth-child(4) { height: 12px; }
.signal-bar span.off { background: #443a55; box-shadow: none; }
.clock {
  font-family: "Courier New", monospace;
  font-weight: bold;
  color: #ffb84a;
  text-shadow: 0 0 3px #ffb84a;
}
.battery {
  width: 22px; height: 10px;
  border: 1px solid #c8b88a;
  border-radius: 2px;
  position: relative;
  padding: 1px;
}
.battery::after {
  content: ""; position: absolute;
  right: -3px; top: 2px; width: 2px; height: 4px;
  background: #c8b88a;
}
.battery i {
  display: block; height: 100%;
  width: 75%;
  background: #ffb84a;
  box-shadow: 0 0 3px #ffb84a;
}

/* 屏幕区 */
.phone-screen {
  flex: 1;
  background:
    radial-gradient(ellipse at top, #2a1f4a 0%, #1a1530 60%, #100a1f 100%);
  border-radius: 6px;
  border: 1px solid #5a4a7a;
  padding: 16px 14px;
  margin-top: 4px;
  overflow-y: auto;
  position: relative;
  box-shadow: inset 0 0 30px rgba(0,0,0,0.6);
}

.phone-bottom {
  display: flex; justify-content: center; align-items: center; gap: 14px;
  padding-top: 10px;
}
.hw-btn {
  background: linear-gradient(180deg, #3a3050 0%, #1c1730 100%);
  border: 1px solid #5a4a7a;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 -1px 0 rgba(0,0,0,0.5);
}
.hw-btn.round { width: 28px; height: 28px; border-radius: 50%; }
.hw-btn.long { width: 90px; height: 20px; border-radius: 10px; }

/* ============ 首页标题 ============ */
.title-block {
  text-align: center;
  padding: 28px 0 24px;
  margin-top: 16px;
}
.title-zh {
  font-family: "STSong", "宋体", serif;
  font-size: 26px;
  color: #ffd9a8;
  letter-spacing: 0.4em;
  text-shadow: 0 0 8px rgba(255, 180, 100, 0.4);
  margin-bottom: 4px;
}
.world-section-title {
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.35em;
  color: #c8b8e8;
  margin: 8px 0 12px;
  font-family: "STSong", "宋体", serif;
}
body.light .world-section-title { color: #8a7a5a; }
.title-en {
  font-size: 9px;
  color: #c8b8e8;
  letter-spacing: 0.3em;
  margin-bottom: 8px;
}
.title-dash {
  color: #6a5a8a;
  font-size: 10px;
  letter-spacing: 0.2em;
}
.title-sub {
  margin-top: 10px;
  font-size: 11px;
  color: #b8a8d8;
  line-height: 1.7;
  letter-spacing: 0.15em;
  font-family: "STSong", "宋体", serif;
}

.tab-row {
  display: flex;
  margin: 8px 0 14px;
  border-bottom: 1px dashed #5a4a7a;
}
.tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: #8a7aaa;
  padding: 8px 4px;
  font-size: 13px;
  letter-spacing: 0.3em;
  font-family: inherit;
  cursor: pointer;
}
.tab-btn.active {
  color: #ffd9a8;
  text-shadow: 0 0 6px rgba(255, 180, 100, 0.5);
  border-bottom: 2px solid #ffb84a;
  margin-bottom: -1px;
}

.form-block {
  display: flex; flex-direction: column;
  gap: 4px;
  padding: 4px 2px;
}
.form-block label {
  font-size: 10px;
  color: #b8a8d8;
  letter-spacing: 0.25em;
  margin-top: 6px;
  margin-bottom: 2px;
}
.form-block input,
.settings-panel input,
.settings-panel textarea,
.input-row textarea {
  background: #0a0814;
  border: 1px solid #5a4a7a;
  color: #ffd9a8;
  padding: 8px 10px;
  font-family: "Courier New", "宋体", monospace;
  font-size: 13px;
  letter-spacing: 0.05em;
  border-radius: 2px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.6);
  outline: none;
  -webkit-appearance: none;
}
.form-block input:focus,
.settings-panel input:focus,
.settings-panel textarea:focus,
.input-row textarea:focus {
  border-color: #ffb84a;
  box-shadow:
    inset 0 1px 3px rgba(0,0,0,0.6),
    0 0 6px rgba(255, 180, 100, 0.3);
}

.btn-primary, .btn-secondary, .btn-danger, .btn-send {
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.3em;
  padding: 10px 14px;
  border: 1px solid;
  border-radius: 2px;
  cursor: pointer;
  margin-top: 14px;
}
.btn-primary {
  background: linear-gradient(180deg, #ff7a9a 0%, #c83a6a 100%);
  border-color: #ff8aa8;
  color: #fff;
  text-shadow: 0 0 4px rgba(255,255,255,0.4);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.3),
    0 0 8px rgba(255, 100, 140, 0.4);
}
.btn-primary:active { transform: translateY(1px); }
.btn-secondary {
  background: #2a2240;
  border-color: #5a4a7a;
  color: #c8b8e8;
}
.btn-danger {
  background: #3a1020;
  border-color: #aa3050;
  color: #ff9aaa;
}

.form-msg {
  margin-top: 8px;
  font-size: 11px;
  color: #ff7a9a;
  min-height: 14px;
  letter-spacing: 0.1em;
  text-align: center;
}

.footer-tip {
  text-align: center;
  margin-top: 20px;
  font-size: 10px;
  color: #8a7aaa;
  letter-spacing: 0.2em;
  line-height: 1.8;
}
.footer-tip .dim { color: #5a4a7a; }
.footer-link {
  display: inline-block;
  margin-top: 4px;
  color: #ffb84a;
  text-decoration: none;
  letter-spacing: 0.2em;
  font-size: 10px;
  border-bottom: 1px dashed #5a4a7a;
  padding-bottom: 1px;
}
.footer-link:hover { color: #ffd9a8; }

/* 赞赏弹窗 */
.sponsor-img {
  max-width: 86vw;
  max-height: 80vh;
  border: 2px solid #ffb84a;
  border-radius: 6px;
  box-shadow: 0 0 30px rgba(255, 184, 74, 0.4);
}

/* ============ 聊天界面 ============ */
.chat-frame .phone-top {
  background: #0a0814;
  border-radius: 4px;
  padding: 6px 10px;
  margin-bottom: 4px;
}
.convo-name {
  flex: 1;
  text-align: center;
  font-size: 13px;
  color: #ffd9a8;
  letter-spacing: 0.2em;
  text-shadow: 0 0 4px rgba(255, 180, 100, 0.4);
}
.convo-name .from {
  color: #8a7aaa;
  font-size: 10px;
  margin-right: 4px;
}
.convo-name .online {
  color: #66ff99;
  font-size: 8px;
  margin-left: 6px;
  animation: blink-soft 2s infinite;
  text-shadow: 0 0 4px #66ff99;
}
@keyframes blink-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.icon-btn {
  background: none;
  border: 1px solid #5a4a7a;
  color: #c8b8e8;
  width: 28px; height: 24px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
}

.msg-list {
  flex: 1;
  background:
    radial-gradient(ellipse at top, #1f1838 0%, #100a1f 80%);
  border-radius: 4px;
  border: 1px solid #4a3f6a;
  margin: 4px 0;
  padding: 14px 12px;
  overflow-y: auto;
  scroll-behavior: smooth;
  position: relative;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}
.msg-list::-webkit-scrollbar { width: 6px; }
.msg-list::-webkit-scrollbar-thumb { background: #4a3f6a; border-radius: 3px; }
.msg-list::-webkit-scrollbar-track { background: transparent; }

/* 用户自选聊天背景图
   等比例放大铺满容器（类似 object-fit: cover）：
   - 优先保证高度/宽度都盖住可视区域
   - 多出来的部分裁切，绝不按原图像素「撑爆」 */
.msg-list.has-chat-bg {
  /* 清掉默认径向渐变，避免和 background 简写互相覆盖 */
  background-color: #100a1f !important;
  background-image: var(--chat-bg-image) !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-attachment: scroll !important;
}
.msg-list.has-chat-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,8,20,0.32) 0%, rgba(10,8,20,0.58) 100%);
  pointer-events: none;
  z-index: 0;
  border-radius: inherit;
}
.msg-list.has-chat-bg > * {
  position: relative;
  z-index: 1;
}
body.light .msg-list.has-chat-bg {
  background-color: #f2ebd9 !important;
  background-image: var(--chat-bg-image) !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
}
body.light .msg-list.has-chat-bg::before {
  background: linear-gradient(180deg, rgba(255,252,245,0.28) 0%, rgba(242,235,217,0.5) 100%);
}

/* 背景选择弹层 */
.bg-panel { max-width: 340px; width: 92%; }
.bg-tip { font-size: 12px; color: #9a8ac8; margin: 0 0 12px; line-height: 1.5; }
.bg-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-height: 50vh;
  overflow-y: auto;
  margin-bottom: 12px;
}
.bg-item {
  border: 2px solid #3a3050;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: #1a1430;
  padding: 0;
  aspect-ratio: 3 / 4;
  position: relative;
  font-family: inherit;
  color: inherit;
}
.bg-item:hover { border-color: #8a7aff; }
.bg-item.active { border-color: #66ff99; box-shadow: 0 0 0 1px #66ff99; }
.bg-item img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.bg-item .bg-label {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.55); color: #f0e8ff;
  font-size: 10px; padding: 3px 4px; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bg-item.bg-default {
  display: flex; align-items: center; justify-content: center;
  color: #c8b8e8; font-size: 12px; letter-spacing: 0.1em;
  background: linear-gradient(160deg, #2a2040, #1a1530);
}

.msg-day {
  text-align: center;
  font-size: 10px;
  color: #6a5a8a;
  margin: 12px 0 8px;
  letter-spacing: 0.3em;
}

.msg-item {
  margin: 8px 0;
  max-width: 80%;
  display: flex;
  flex-direction: column;
  animation: msg-in 0.3s ease-out;
  -webkit-touch-callout: none;
}
.msg-item[data-msg-id] { cursor: context-menu; }
.msg-item.user { margin-left: auto; align-items: flex-end; }
.msg-item.assistant { margin-right: auto; align-items: flex-start; }

@keyframes msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg-bubble {
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.65;
  font-family: "STSong", "宋体", "Songti SC", serif;
  word-wrap: break-word;
  white-space: pre-wrap;
  position: relative;
  letter-spacing: 0.04em;
}
.msg-item.user .msg-bubble {
  background: linear-gradient(180deg, rgba(255, 133, 165, 0.75) 0%, rgba(208, 74, 114, 0.75) 100%);
  color: #fff;
  border-bottom-right-radius: 3px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    0 2px 6px rgba(200, 60, 100, 0.3);
}
.msg-item.assistant .msg-bubble {
  background: rgba(243, 229, 195, 0.75);
  color: #2a1a0a;
  border-bottom-left-radius: 3px;
  border: 1px solid #d4be8a;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.4),
    0 2px 6px rgba(0,0,0,0.3);
  font-family: "STKaiti", "Kaiti SC", "楷体", "STSong", serif;
}

/* ===== 叙事分层：角色卡 / 正文 / 动作 / 对话 ===== */
.msg-item.assistant {
  max-width: 92%;
}
.msg-bubble-story {
  padding: 10px 12px 12px;
  white-space: normal; /* 由内部块控制换行 */
}

.story-meta-strip {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 9px;
  margin-bottom: 9px;
  padding: 8px 10px;
  border: 1px solid rgba(232, 160, 200, 0.45);
  border-radius: 6px;
  background: rgba(24, 16, 35, 0.92);
  color: #f2e9ff;
  font-family: "PingFang SC", sans-serif;
  font-size: 11px;
  line-height: 1.5;
}
.story-meta-key {
  color: #e8a0c8;
  font-weight: 700;
}
.world-hud {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 9px;
  font-family: "PingFang SC", sans-serif;
}
.world-hud-row {
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid #51446c;
  border-radius: 5px;
  background: #171225;
}
.world-hud-row span {
  display: block;
  color: #9f91bc;
  font-size: 9px;
  margin-bottom: 2px;
}
.world-hud-row b {
  display: block;
  color: #f2e9ff;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.world-ui-07 { border-color: rgba(199, 148, 54, 0.58); }
.world-ui-07 .world-hud-row { border-color: #7c602c; background: #241b0d; }
.world-ui-07 .world-hud-row span, .world-ui-07 .story-meta-key { color: #efc66b; }
.world-ui-08 { border-color: rgba(73, 167, 151, 0.58); }
.world-ui-08 .world-hud-row { border-color: #356f67; background: #102523; }
.world-ui-08 .world-hud-row span, .world-ui-08 .story-meta-key { color: #73d8c5; }
.world-ui-09 { border-color: rgba(229, 112, 45, 0.62); }
.world-ui-09 .world-hud-row { border-color: #854720; background: #29170c; }
.world-ui-09 .world-hud-row span, .world-ui-09 .story-meta-key { color: #ff9f4f; }
.world-ui-10 .world-hud-row { border-color: #1f6b58; background: #0d2420; }
.world-ui-10 .world-hud-row span, .world-ui-10 .story-meta-key { color: #5ee0b8; }
.world-ui-10 .story-meta-strip {
  border-color: rgba(62, 199, 160, 0.45);
  background: linear-gradient(135deg, rgba(20, 60, 50, 0.55), rgba(30, 40, 20, 0.4));
}
.npc-card.world-card-10 {
  border-color: rgba(62, 199, 160, 0.4);
  background: linear-gradient(180deg, #142820 0%, #101818 100%);
}
.npc-card.world-card-10 .npc-card-title,
.npc-card.world-card-10 .npc-k { color: #5ee0b8; }
.npc-card.world-card-10 .npc-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.novel-card-face {
  width: 36px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(94, 224, 184, 0.45);
  flex-shrink: 0;
}
.npc-card.world-card-10 .npc-card-row[data-key="心动"] .npc-v {
  color: #ff8fb8;
  font-weight: 600;
}

/* ===== 小说频道 · 羊皮纸 HUD + 深褐字（黄底高对比）===== */
body.novel-mode .chat-frame {
  background:
    radial-gradient(ellipse at top, rgba(180, 120, 40, 0.12), transparent 50%),
    linear-gradient(180deg, #1a1410 0%, #12100e 45%, #0e0c0a 100%);
}
body.novel-mode .chat-toolbar {
  background: linear-gradient(180deg, #2a2218 0%, #1a1510 100%);
  border-bottom: 1px solid rgba(212, 168, 80, 0.35);
}
body.novel-mode .chat-tool-title {
  color: #f0d9a0;
  letter-spacing: 0.14em;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
body.novel-mode .msg-bubble-story {
  background: linear-gradient(180deg, #2a241c 0%, #1e1a14 100%);
  border: 1px solid rgba(200, 160, 90, 0.28);
  color: #f2e6d0;
}
body.novel-mode .story-body {
  color: #f0e4cc;
  font-size: 14.5px;
  line-height: 1.8;
}
body.novel-mode .story-dialog { color: #ffd0a8; }
body.novel-mode .story-action { color: #c4b498; }
body.novel-mode .input-row {
  background: rgba(28, 22, 16, 0.96);
  border-top-color: rgba(200, 160, 80, 0.3);
}

/* 系统标签：独特标牌，绝非普通段落 */
.story-sys-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(80, 200, 255, 0.45);
  background:
    linear-gradient(135deg, rgba(20, 40, 60, 0.95) 0%, rgba(12, 24, 40, 0.98) 100%);
  box-shadow:
    0 0 0 1px rgba(100, 220, 255, 0.12),
    0 0 16px rgba(40, 160, 255, 0.18),
    inset 0 1px 0 rgba(180, 230, 255, 0.12);
  color: #b8ecff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.4;
  font-family: "SF Mono", "Menlo", "PingFang SC", monospace;
}
.story-sys-tag-ico {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(60, 180, 255, 0.18);
  color: #7ad8ff;
  font-size: 12px;
}
.story-sys-tag-txt {
  min-width: 0;
  flex: 1;
  text-shadow: 0 0 8px rgba(80, 200, 255, 0.35);
}

.novel-panel {
  flex-shrink: 0;
  margin: 4px 8px 6px;
  border-radius: 14px;
  border: 1px solid rgba(140, 100, 40, 0.45);
  /* 琥珀羊皮纸底，配合深褐字 */
  background:
    linear-gradient(165deg, #f0dca8 0%, #e2c478 48%, #d4b060 100%);
  box-shadow:
    0 4px 18px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 245, 210, 0.55);
  overflow: hidden;
}
.novel-panel.hidden { display: none !important; }
.novel-panel.collapsed .novel-hud-body { display: none; }
.novel-panel.collapsed .novel-hud-chevron { transform: rotate(-90deg); }

.novel-hud-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: none;
  background: linear-gradient(180deg, rgba(255, 250, 230, 0.35), transparent);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  color: #3d2814;
}
.novel-hud-toggle:active { background: rgba(90, 50, 10, 0.08); }
.novel-hud-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.novel-sum-day {
  font-size: 13px;
  font-weight: 800;
  color: #3d2814;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 248, 220, 0.75);
  border: 1px solid rgba(90, 55, 20, 0.35);
  border-radius: 8px;
  padding: 4px 9px;
}
.novel-sum-stage {
  font-size: 12px;
  color: #3d2814;
  font-weight: 700;
  opacity: 0.95;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.novel-hud-action {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(80, 45, 15, 0.4);
  background: rgba(255, 248, 220, 0.7);
  color: #3d2814;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.novel-hud-chevron {
  color: #5a3818;
  font-size: 12px;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
.novel-panel.collapsed .novel-hud-action {
  border-color: rgba(80, 45, 15, 0.5);
  background: rgba(255, 250, 230, 0.85);
}

.novel-hud-body {
  padding: 0 10px 8px;
  border-top: 1px solid rgba(90, 55, 20, 0.18);
}

.novel-bars-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  margin-top: 8px;
}
.novel-bar-cell {
  min-width: 0;
}
.novel-bar-cell-top {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #3d2814;
  font-weight: 700;
  margin-bottom: 3px;
  letter-spacing: 0.04em;
}
.novel-bar-cell-top .ico { font-size: 11px; opacity: 0.9; }
.novel-bar-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(60, 35, 10, 0.2);
  border: 1px solid rgba(80, 45, 15, 0.25);
  overflow: hidden;
  position: relative;
}
.novel-bar-fill {
  height: 100%;
  border-radius: 999px;
  min-width: 2px;
  transition: width 0.35s ease;
  box-shadow: 0 0 6px rgba(120, 70, 20, 0.2);
}
.novel-bar-fill.con { background: linear-gradient(90deg, #a06018, #d4a020); }
.novel-bar-fill.sur { background: linear-gradient(90deg, #1e6a40, #3aaa68); }
.novel-bar-fill.ren { background: linear-gradient(90deg, #6a4a18, #b88830); }
.novel-bar-fill.sta { background: linear-gradient(90deg, #2a5a8a, #4a90c8); }

.novel-meta-line {
  margin-top: 7px;
  font-size: 11px;
  color: #3d2814;
  line-height: 1.4;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-weight: 600;
}
.novel-meta-line span { opacity: 0.95; }
.novel-meta-line b { color: #2a1808; font-weight: 800; }

.novel-hearts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}
.novel-heart-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  padding: 3px 8px 3px 4px;
  border-radius: 999px;
  border: 1px solid rgba(120, 50, 60, 0.35);
  background: rgba(255, 240, 245, 0.75);
  color: #5a2030;
  font-weight: 700;
}
.novel-heart-chip .hp {
  width: 36px;
  height: 5px;
  border-radius: 99px;
  background: rgba(60, 20, 30, 0.15);
  overflow: hidden;
}
.novel-heart-chip .hp i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #a03050, #e06080);
  border-radius: 99px;
}
.novel-situation {
  margin-top: 6px;
  font-size: 11px;
  color: #3d2814;
  font-weight: 600;
  line-height: 1.45;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 248, 220, 0.65);
  border-left: 3px solid #6a4018;
}
.novel-cast-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-top: 8px;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}
.novel-cast-row:empty { display: none; }
.novel-cast-card { flex: 0 0 auto; width: 56px; text-align: center; }
.novel-cast-card img {
  width: 48px; height: 62px; object-fit: cover;
  border-radius: 10px;
  border: 1.5px solid rgba(90, 55, 20, 0.45);
  background: #c8a868;
  display: block; margin: 0 auto 3px;
  box-shadow: 0 2px 8px rgba(60, 35, 10, 0.25);
}
.novel-cast-card .ph {
  width: 48px; height: 62px; border-radius: 10px;
  border: 1.5px dashed rgba(90, 55, 20, 0.4);
  background: #e8d4a0;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 3px; font-size: 16px; color: #3d2814;
}
.novel-cast-card .nm {
  font-size: 10px; color: #3d2814; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 56px;
}

/* 选项：默认只露折叠条，不挡剧情 */
.novel-choices {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border-top: 1px solid rgba(200, 160, 80, 0.3);
  background: linear-gradient(180deg, rgba(30, 24, 16, 0.98), rgba(18, 14, 10, 0.98));
}
.novel-choices.hidden { display: none !important; }
.novel-choices-head {
  display: flex;
  justify-content: flex-end;
  padding: 6px 10px;
}
.novel-choices-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(220, 180, 100, 0.5);
  background: linear-gradient(180deg, #3a3020 0%, #261e14 100%);
  color: #ffe4a8;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
}
.novel-choices-toggle:active { transform: translateY(1px); }
.novel-choice-chevron {
  color: #ffd978;
  font-size: 12px;
}
.novel-choices-body {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 0 10px 8px;
}
.novel-choices.is-open .novel-choices-body {
  display: flex;
}
.novel-choice-hint {
  font-size: 10px;
  color: #c8b898;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
  text-align: right;
}
.novel-choice-btn {
  display: flex;
  align-items: flex-start;
  text-align: left;
  width: 100%;
  padding: 7px 10px;
  border-radius: 9px;
  border: 1px solid rgba(220, 180, 100, 0.38);
  background: linear-gradient(180deg, #342c20 0%, #261e16 100%);
  color: #fff4dc;
  font-size: 12px;
  line-height: 1.35;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(0,0,0,0.3);
}
.novel-choice-btn:active { transform: translateY(1px); box-shadow: none; }
.novel-choice-btn .idx {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-right: 7px;
  margin-top: 0;
  border-radius: 5px;
  background: rgba(255, 200, 80, 0.18);
  color: #ffd978;
  font-weight: 800;
  font-size: 11px;
  flex-shrink: 0;
}
.novel-choice-btn .txt { flex: 1; min-width: 0; }

/* 小说人物卡 · 深色（参考约会吧/皇朝） */
.novel-char-card {
  border-radius: 12px !important;
  border: 1px solid rgba(212, 168, 80, 0.38) !important;
  background: linear-gradient(165deg, #2a2218 0%, #16120e 100%) !important;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
  padding: 10px 12px !important;
  margin-bottom: 8px;
}
.novel-char-card .npc-card-title {
  color: #ffd978 !important;
  font-size: 14px;
  margin-bottom: 6px;
  gap: 10px;
}
.novel-char-card .npc-k { color: #c9a86a !important; font-size: 11px; min-width: 2.5em; }
.novel-char-card .npc-v { color: #f2e6d0 !important; font-size: 12.5px; line-height: 1.45; }
.novel-char-card .npc-card-row { padding: 3px 0; border-bottom: 1px solid rgba(255, 200, 120, 0.08); }
.novel-char-card .npc-card-row[data-key="身材"] .npc-v { color: #ffd0b0 !important; }
.novel-card-quote {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  border-left: 3px solid #e0a040;
  color: #ffe0b0;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 600;
}
.novel-face-ph {
  width: 42px; height: 54px; border-radius: 8px;
  background: #2a2018; display: flex; align-items: center; justify-content: center;
  color: #e0c080; border: 1px solid rgba(220,180,100,.4); font-size: 16px;
}

/* 开篇 system · 系统标牌（非普通聊天气泡） */
.msg-item.novel-system-msg {
  align-items: stretch;
}
.msg-item.novel-intro-msg .msg-bubble,
.msg-bubble-novel-sys {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  max-width: 100% !important;
}
.novel-sys-banner {
  width: 100%;
  padding: 14px 14px 12px;
  border-radius: 14px;
  border: 1px solid rgba(80, 200, 255, 0.4);
  background:
    linear-gradient(145deg, #1a2838 0%, #0e1824 50%, #12100e 100%);
  box-shadow:
    0 0 0 1px rgba(100, 220, 255, 0.08),
    0 8px 28px rgba(0, 40, 80, 0.35),
    inset 0 1px 0 rgba(160, 220, 255, 0.12);
  color: #d8f0ff;
}
.novel-sys-banner-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.28em;
  color: #7ad8ff;
  border: 1px solid rgba(100, 200, 255, 0.4);
  border-radius: 4px;
  padding: 2px 8px;
  margin-bottom: 10px;
  background: rgba(40, 120, 180, 0.2);
  font-family: "SF Mono", Menlo, monospace;
}
.novel-sys-slogan {
  font-size: 14px;
  font-weight: 700;
  color: #ffe4a8;
  letter-spacing: 0.06em;
  margin: 6px 0 10px;
  line-height: 1.55;
}
.novel-sys-line {
  font-size: 13px;
  color: #c8dce8;
  line-height: 1.65;
  margin: 4px 0;
}
.novel-sys-banner .story-sys-tag {
  margin: 6px 0;
}

/* 序幕门控 */
.novel-prologue-gate {
  position: absolute;
  inset: 0;
  z-index: 35;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at center, rgba(40, 28, 12, 0.55), rgba(8, 6, 4, 0.88));
  backdrop-filter: blur(5px);
}
.novel-prologue-gate.hidden { display: none !important; }
.novel-prologue-card {
  width: min(100%, 320px);
  padding: 28px 22px 22px;
  border-radius: 18px;
  border: 1px solid rgba(212, 168, 80, 0.5);
  background: linear-gradient(165deg, #3a2c18 0%, #1a140e 100%);
  text-align: center;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}
.novel-prologue-badge {
  font-size: 11px;
  letter-spacing: 0.22em;
  color: #ffd978;
  margin-bottom: 12px;
  opacity: 0.9;
}
.novel-prologue-title {
  font-size: 26px;
  font-weight: 800;
  color: #fff4dc;
  letter-spacing: 0.12em;
  margin-bottom: 10px;
}
.novel-prologue-desc {
  font-size: 13px;
  color: #c8b898;
  line-height: 1.7;
  margin-bottom: 20px;
}
.novel-prologue-ready {
  width: 100%;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 200, 100, 0.55);
  background: linear-gradient(180deg, #c9a227, #8a6a18);
  color: #1a1208;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.1em;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(180, 120, 30, 0.35);
}
.novel-prologue-ready:active { transform: translateY(1px); }

/* 序幕分段露出 */
#msg-list.novel-prologue-hide .msg-item {
  visibility: hidden;
  height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
  opacity: 0;
}
.msg-item.novel-seg-pending {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}
.msg-item.novel-seg-show {
  opacity: 1;
  transform: none;
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.novel-block-pending {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  margin: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
.novel-block-show {
  opacity: 1;
  max-height: none;
  transition: opacity 0.4s ease;
}
.novel-body-seg {
  opacity: 0;
  transform: translateY(6px);
  max-height: 0;
  overflow: hidden;
  margin: 0;
}
.novel-body-seg.show {
  opacity: 1;
  transform: none;
  max-height: 2000px;
  margin: 0 0 0.6em;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* 大图预览 */
.novel-lightbox {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(6px);
}
.novel-lightbox.hidden { display: none !important; }
.novel-lightbox img {
  max-width: min(92vw, 420px);
  max-height: 70vh;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid rgba(255, 200, 120, 0.35);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.novel-lightbox-cap {
  color: #f0e0c0;
  font-size: 14px;
  letter-spacing: 0.12em;
}
.novel-lightbox-close {
  margin-top: 4px;
  padding: 8px 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 200, 120, 0.4);
  background: rgba(40, 30, 20, 0.9);
  color: #ffe4a8;
  font-size: 13px;
  cursor: pointer;
}

.novel-inline-cast {
  display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 10px;
}
.novel-inline-cast .item {
  display: flex; align-items: center; gap: 8px;
  background: rgba(40, 30, 18, 0.85);
  border: 1px solid rgba(220, 180, 100, 0.35);
  border-radius: 12px;
  padding: 5px 10px 5px 5px;
}
.novel-inline-cast img {
  width: 42px; height: 54px; object-fit: cover; border-radius: 8px;
  border: 1px solid rgba(255, 200, 120, 0.4);
}
.novel-inline-cast .t { font-size: 12px; color: #f0e4cc; line-height: 1.35; }
.novel-inline-cast .t b { color: #ffe4a8; }

.npc-card.world-card-10 {
  border-color: rgba(212, 168, 80, 0.4) !important;
  background: linear-gradient(180deg, #2c2418 0%, #1c1610 100%) !important;
}
.npc-card.world-card-10 .npc-card-title,
.npc-card.world-card-10 .npc-k { color: #ffd978 !important; }
.npc-card.world-card-10 .npc-v { color: #f0e4cc !important; }
.world-ui-10 .world-hud-row {
  border-color: #6a5020 !important;
  background: #241c10 !important;
}
.world-ui-10 .world-hud-row span, .world-ui-10 .story-meta-key { color: #ffd978 !important; }
.world-ui-10 .world-hud-row b { color: #fff4dc !important; }

/* 死亡结算 */
.novel-dead-mask {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 4, 2, 0.82);
  backdrop-filter: blur(6px);
}
.novel-dead-mask.hidden { display: none !important; }
.novel-dead-card {
  width: min(100%, 320px);
  padding: 22px 18px;
  border-radius: 16px;
  border: 1px solid rgba(220, 100, 80, 0.5);
  background: linear-gradient(165deg, #3a2018, #1a100c);
  text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.novel-dead-title {
  font-size: 26px;
  font-weight: 800;
  color: #ff8a70;
  letter-spacing: 0.3em;
  margin-bottom: 12px;
}
.novel-dead-reason {
  font-size: 14px;
  color: #f0d8c0;
  line-height: 1.6;
  margin-bottom: 8px;
}
.novel-dead-tip {
  font-size: 11px;
  color: #b0a090;
  margin-bottom: 16px;
  line-height: 1.5;
}
.novel-dead-btn {
  width: 100%;
  margin-top: 8px;
  padding: 11px;
  border-radius: 10px;
  border: 1px solid rgba(255, 180, 100, 0.45);
  background: linear-gradient(180deg, #8a5030, #5a3018);
  color: #fff4e0;
  font-size: 14px;
  cursor: pointer;
}
.novel-dead-btn.ghost {
  background: transparent;
  border-color: rgba(180, 160, 140, 0.4);
  color: #d0c0b0;
}

body.novel-mode .msg-list { padding-top: 2px; }
body.light.novel-mode .chat-frame {
  background: linear-gradient(180deg, #f6f0e4 0%, #ebe4d6 100%);
}
body.light.novel-mode .msg-bubble-story {
  background: #fffaf0;
  border-color: #d8c8a0;
  color: #3a2e20;
}
body.light.novel-mode .story-body { color: #3a2e20; }
body.light .novel-panel {
  background: linear-gradient(165deg, #f5e4b8, #e8d090);
  border-color: rgba(120, 80, 30, 0.4);
}
body.light .novel-sum-day,
body.light .novel-sum-stage,
body.light .novel-bar-cell-top,
body.light .novel-meta-line,
body.light .novel-situation,
body.light .novel-hud-action,
body.light .novel-cast-card .nm {
  color: #3d2814 !important;
}
body.light .novel-sum-day { background: #fff8e8; }
body.light .novel-situation { background: rgba(255, 250, 230, 0.8); }
body.light .novel-choice-btn {
  background: #fff8ec;
  color: #3a2a18;
  border-color: #d0b070;
}
body.light .novel-choices-toggle {
  background: linear-gradient(180deg, #fff4dc, #ecd8a0);
  color: #3d2814;
  border-color: rgba(120, 80, 30, 0.4);
}
body.light .novel-choice-chevron { color: #5a3818; }
.qingya-chat-lines {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding-top: 2px;
}
.qingya-chat-line {
  max-width: 94%;
  padding: 7px 10px;
  border-radius: 4px 10px 10px 10px;
  background: #e5fff8;
  border: 1px solid #a9d9ce;
  color: #153b35;
  font-family: "PingFang SC", sans-serif;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.qingya-chat-line .story-dialog {
  color: inherit;
  font-weight: inherit;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}

/* 角色信息卡：像角色面板 */
.npc-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.npc-card {
  background: linear-gradient(165deg, #2a2038 0%, #1a1428 100%);
  border: 1px solid #6a4a7a;
  border-radius: 10px;
  padding: 8px 10px 6px;
  box-shadow:
    inset 0 1px 0 rgba(255,200,255,0.08),
    0 2px 8px rgba(40, 10, 40, 0.35);
  font-family: "Courier New", "PingFang SC", "Helvetica Neue", sans-serif;
  letter-spacing: 0.02em;
}
.npc-card.world-card-07 {
  background: linear-gradient(165deg, #312713 0%, #17120b 100%);
  border-color: #9a7430;
}
.npc-card.world-card-07 .npc-card-title,
.npc-card.world-card-07 .npc-k { color: #efc66b; }
.npc-card.world-card-08 {
  background: linear-gradient(165deg, #12312e 0%, #0c1d1c 100%);
  border-color: #3f8f82;
}
.npc-card.world-card-08 .npc-card-title,
.npc-card.world-card-08 .npc-k { color: #73d8c5; }
.npc-card.world-card-09 {
  background: linear-gradient(165deg, #35200e 0%, #1b1110 100%);
  border-color: #b35d2c;
}
.npc-card.world-card-09 .npc-card-title,
.npc-card.world-card-09 .npc-k { color: #ff9f4f; }

@media (max-width: 380px) {
  .world-hud { grid-template-columns: 1fr; }
}
.npc-card-title {
  font-size: 10px;
  color: #e8a0c8;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  margin-bottom: 6px;
  opacity: 0.9;
  border-bottom: 1px dashed rgba(232, 160, 200, 0.25);
  padding-bottom: 4px;
}
.npc-card-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 3px 0;
  font-size: 12px;
  line-height: 1.45;
}
.npc-k {
  flex: 0 0 auto;
  min-width: 4.2em;
  color: #b89ad0;
  font-size: 11px;
  letter-spacing: 0.08em;
}
.npc-k::after {
  content: "·";
  margin-left: 4px;
  opacity: 0.5;
}
.npc-v {
  flex: 1;
  color: #f5e8f0;
  word-break: break-word;
}
.npc-card-row[data-key="身份"] .npc-v,
.npc-card-row[data-key="任职"] .npc-v {
  color: #ffe3ad;
  font-weight: 600;
}
.npc-card-row[data-key="状态"] {
  margin-top: 3px;
  padding: 6px 7px;
  border-radius: 4px;
  background: rgba(255,255,255,0.055);
}

/* 正文叙事区 */
.story-body {
  font-family: "STKaiti", "Kaiti SC", "楷体", "STSong", "Songti SC", serif;
  font-size: 14.5px;
  line-height: 1.85;
  color: #2a1a0a;
  white-space: pre-wrap;
  word-wrap: break-word;
  letter-spacing: 0.03em;
}

/* 环境 / 动作 / 神态：（……）灰斜，稍小 */
.story-action {
  color: #6a5a4a;
  font-style: italic;
  font-size: 0.92em;
  opacity: 0.88;
  font-family: "STSong", "Songti SC", "宋体", serif;
}
.story-speaker {
  display: inline-block;
  margin-right: 3px;
  color: #7f3565;
  font-family: "PingFang SC", sans-serif;
  font-size: 0.9em;
  font-weight: 700;
  letter-spacing: 0.06em;
}

/* 微信式语音条（挂在气泡下方，保证可见） */
.msg-item.assistant .msg-attachment.voice-bar,
.msg-attachment.voice-bar {
  margin-top: 8px;
  margin-bottom: 2px;
  max-width: 240px;
  display: block;
}
.voice-bar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 140px;
  padding: 11px 14px;
  border: 1px solid rgba(180, 120, 60, 0.45);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff8ec, #f0d4a8);
  color: #5a3a18;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(80, 40, 10, 0.12);
  -webkit-tap-highlight-color: transparent;
}
.voice-bar-btn:active { transform: scale(0.98); opacity: 0.92; }
.voice-bar-icon {
  font-size: 11px;
  width: 16px;
  text-align: center;
  opacity: 0.85;
}
.voice-bar-waves {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}
.voice-bar-waves i {
  display: block;
  width: 3px;
  border-radius: 2px;
  background: #b07a30;
  height: 6px;
}
.voice-bar-waves i:nth-child(2) { height: 11px; }
.voice-bar-waves i:nth-child(3) { height: 8px; }
.voice-bar.playing .voice-bar-waves i {
  animation: voice-wave 0.7s ease-in-out infinite alternate;
}
.voice-bar.playing .voice-bar-waves i:nth-child(2) { animation-delay: 0.12s; }
.voice-bar.playing .voice-bar-waves i:nth-child(3) { animation-delay: 0.24s; }
@keyframes voice-wave {
  from { transform: scaleY(0.55); opacity: 0.7; }
  to { transform: scaleY(1.15); opacity: 1; }
}
.voice-bar-label {
  margin-left: auto;
  font-size: 12px;
  letter-spacing: 0.08em;
  opacity: 0.75;
}
.voice-bar-audio { display: none; }
.msg-item.assistant .voice-bar-btn {
  border-color: rgba(160, 100, 50, 0.3);
}

/* 场景 / 突发事件标签：[场景:…] [事件:…] */
.story-scene {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 0.35em 0 0.65em;
  padding: 5px 10px 5px 9px;
  font-family: "STSong", "Songti SC", "宋体", "PingFang SC", sans-serif;
  font-size: 12px;
  font-style: normal;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0.04em;
  color: #5c3d12;
  background: linear-gradient(135deg, rgba(255, 214, 150, 0.55), rgba(255, 236, 200, 0.35));
  border: 1px solid rgba(180, 120, 40, 0.35);
  border-left: 3px solid #c4892a;
  border-radius: 6px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset;
}

/* 角色对白：“……” 略加重 + 左边一点强调色 */
.story-dialog {
  color: #8a2048;
  font-weight: 600;
  font-style: normal;
  background: linear-gradient(180deg, rgba(255, 166, 194, 0.34), rgba(255, 190, 210, 0.16));
  border-bottom: 1px solid rgba(190, 55, 100, 0.25);
  border-radius: 4px;
  padding: 1px 4px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.msg-time {
  font-size: 9px;
  color: #8a7aaa;
  margin-top: 3px;
  letter-spacing: 0.15em;
  padding: 0 4px;
}

/* 打字中 */
.msg-typing .msg-bubble {
  background: #f3e5c3;
  color: #6a5a4a;
  font-style: italic;
}
.msg-typing .dots span {
  display: inline-block;
  animation: dot 1.2s infinite;
}
.msg-typing .dots span:nth-child(2) { animation-delay: 0.2s; }
.msg-typing .dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot {
  0%, 60%, 100% { opacity: 0.3; }
  30% { opacity: 1; }
}

.msg-empty {
  text-align: center;
  color: #8a7aaa;
  font-size: 12px;
  padding: 40px 20px;
  line-height: 2;
  letter-spacing: 0.15em;
  font-family: "STSong", "宋体", serif;
}
.msg-empty .big {
  font-size: 16px;
  color: #ffd9a8;
  display: block;
  margin-bottom: 8px;
  text-shadow: 0 0 6px rgba(255,180,100,0.4);
}

/* 输入区 */
.input-row {
  display: flex;
  gap: 6px;
  padding: 4px 0 0;
  align-items: flex-end;
}
.input-row textarea {
  flex: 1;
  resize: none;
  font-family: "STSong", "宋体", "Courier New", monospace;
  font-size: 14px;
  line-height: 1.5;
  max-height: 100px;
  padding: 8px 10px;
}
.btn-send {
  flex-shrink: 0;
  margin-top: 0;
  padding: 8px 14px;
  height: 40px;
  box-sizing: border-box;
  background: linear-gradient(180deg, #ff7a9a 0%, #c83a6a 100%);
  border-color: #ff8aa8;
  color: #fff;
  letter-spacing: 0.2em;
  font-size: 12px;
  min-width: 56px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.3),
    0 0 8px rgba(255, 100, 140, 0.4);
}
.btn-send:disabled {
  opacity: 0.5; cursor: not-allowed;
  background: #3a2a4a;
  border-color: #5a4a7a;
}
/* 动作【】：与发送同高、更窄 */
.btn-action-bracket {
  flex-shrink: 0;
  height: 40px;
  min-height: 40px;
  width: auto;
  min-width: 40px;
  padding: 0 8px;
  margin: 0;
  box-sizing: border-box;
  border: 1px solid #6a5a8a;
  border-radius: 8px;
  background: linear-gradient(180deg, #2a2240 0%, #1a1530 100%);
  color: #ffd9a8;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.btn-action-bracket:active { opacity: 0.75; }
body.light .btn-action-bracket {
  border-color: #c8b894;
  background: linear-gradient(180deg, #fffdf6 0%, #f0e8d6 100%);
  color: #9a5a1a;
}
.guide-panel { max-width: 420px; }
.guide-body {
  font-size: 13px;
  line-height: 1.75;
  color: #d4c8ff;
  max-height: 60vh;
  overflow-y: auto;
}
.guide-body p { margin: 0 0 12px; }
.guide-lead { color: #ffd9a8; }
.guide-sec {
  margin: 14px 0 8px;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: #e8a0c8;
  border-bottom: 1px dashed rgba(232, 160, 200, 0.3);
  padding-bottom: 4px;
}
.guide-list {
  margin: 0 0 12px;
  padding-left: 1.2em;
  color: #c8b8e8;
}
.guide-list li { margin-bottom: 6px; }
body.light .guide-body { color: #4a3f35; }
body.light .guide-lead { color: #9a5a1a; }
body.light .guide-sec { color: #a05070; border-bottom-color: #e0c0d0; }
body.light .guide-list { color: #5a4a3a; }

/* ============ 设置抽屉 ============ */
.mask {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  /* 必须高于首页 dock / 状态栏垫片，否则点「更新」像没反应 */
  z-index: 100001;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
}
.settings-panel {
  background: linear-gradient(180deg, #1f1838 0%, #14102a 100%);
  border: 2px solid #5a4a7a;
  border-radius: 6px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 18px 16px;
  color: #c8b8e8;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 10px 40px rgba(0,0,0,0.6);
}
.settings-title {
  text-align: center;
  font-size: 16px;
  color: #ffd9a8;
  letter-spacing: 0.4em;
  padding-bottom: 12px;
  border-bottom: 1px dashed #5a4a7a;
  margin-bottom: 14px;
  text-shadow: 0 0 6px rgba(255,180,100,0.4);
}
.settings-block {
  margin-bottom: 12px;
}
.block-label {
  font-size: 11px;
  color: #b8a8d8;
  letter-spacing: 0.2em;
  margin-bottom: 4px;
}
.block-value {
  background: #0a0814;
  border: 1px solid #5a4a7a;
  padding: 8px 10px;
  border-radius: 2px;
  color: #ffd9a8;
  font-size: 13px;
}
.settings-panel input,
.settings-panel textarea {
  width: 100%;
  font-size: 12px;
}
.hint {
  font-size: 10px;
  color: #8a7aaa;
  letter-spacing: 0.1em;
  margin-top: 4px;
  line-height: 1.6;
}

.settings-actions {
  display: flex; flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.settings-actions button { margin-top: 0; }
.settings-close { margin-top: 16px; }
.settings-close button { width: 100%; }

/* ============ 无假状态栏 / 底部实体键 ============ */
.phone-frame.no-chrome {
  border-radius: 0;
  border: none;
  padding: 0;
  max-width: 100%;
  height: 100%;
  background: transparent;
  box-shadow: none;
}
.phone-frame.no-chrome::before { display: none; }
.phone-frame.no-chrome .phone-screen.home-screen {
  margin: 0;
  border-radius: 0;
  border: none;
  flex: 1;
  min-height: 0;
  /* 左右下内边距；顶部由 immersive 规则专门加大，勿在此写死 padding 冲掉 */
  padding-left: 14px;
  padding-right: 14px;
  padding-bottom: 8px;
}
.auth-frame.no-chrome {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.chat-frame.no-chrome {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
  background: transparent;
}
.chat-frame.no-chrome .msg-list {
  flex: 1;
  min-height: 0;
  margin: 0;
  border-radius: 0;
  border: none;
}
.chat-frame.no-chrome .input-row {
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(10, 8, 20, 0.92);
  border-top: 1px solid #3a3050;
}

/* ============ 首页底部 Dock（统一图标尺寸）============ */
.home-dock {
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  gap: 0;
  padding: 6px 8px calc(8px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, #1a1430 0%, #100a1f 100%);
  border-top: 1px solid #3a3050;
}
.dock-btn {
  flex: 1;
  max-width: 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 0;
  padding: 8px 4px;
  background: transparent;
  border: none;
  color: #d4c8ff;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.dock-btn:active { opacity: 0.7; }
.dock-ico {
  width: 40px;
  height: 40px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #6a5a8a;
  border-radius: 12px;
  background: linear-gradient(180deg, #2a2240 0%, #1a1530 100%);
  font-size: 16px;
  line-height: 1;
  letter-spacing: 0;
  color: #ffd9a8;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
.dock-lab {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: #9a8ac8;
  line-height: 1;
}
.dock-btn.dock-on .dock-ico {
  border-color: rgba(102, 255, 153, 0.55);
  color: #9bff7a;
  box-shadow: 0 0 10px rgba(102, 255, 153, 0.25);
}
.dock-btn.dock-on .dock-lab { color: #9bff7a; }

/* 本地 API 配置面板 */
.local-api-panel {
  max-width: 360px;
  width: min(92vw, 360px);
  max-height: min(86vh, 640px);
  overflow-y: auto;
  text-align: left;
}
.local-api-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 14px;
  font-size: 14px;
  color: #e8d8ff;
  cursor: pointer;
}
.local-api-switch input { width: auto; accent-color: #9b7aff; }
.la-fields label {
  display: block;
  font-size: 11px;
  color: #9a8ac8;
  margin: 8px 0 4px;
}
.la-fields input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid #4a3f6a;
  background: #120e22;
  color: #f0e8ff;
  font-size: 13px;
}
.la-fields.la-disabled { opacity: 0.45; pointer-events: none; }
.la-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 8px;
}
.la-actions button { flex: 1; min-width: 72px; font-size: 12px; padding: 8px 6px; }
.la-models {
  margin-top: 8px;
  border: 1px solid #3a3050;
  border-radius: 8px;
  background: #0c0816;
  padding: 8px;
  max-height: 160px;
  overflow: auto;
}
.la-models-head { font-size: 11px; color: #8e7ec8; margin-bottom: 6px; }
.la-model-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.la-chip {
  border: 1px solid #4a3f6a;
  background: #1a1430;
  color: #d4c8ff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.la-chip:hover { border-color: #8a7aff; color: #fff; }
.la-chip.on { border-color: #66ff99; color: #9bff7a; background: #1a3a2a; }
#la-status.ok { color: #9bff7a; }
#la-status.err { color: #ff9a9a; }
body.light .local-api-panel .la-fields input {
  background: #fffaf0;
  border-color: #d0c0a0;
  color: #3a2a1a;
}
body.light .local-api-switch { color: #4a3a2a; }
body.light .la-chip { background: #f5ebe0; color: #5a4a3a; border-color: #d0c0a0; }
body.light .la-models { background: #f8f0e4; border-color: #d0c0a0; }

body.light .home-dock {
  background: linear-gradient(180deg, #f5efe2 0%, #e8e0d0 100%);
  border-top-color: #c8b894;
}
body.light .dock-btn { color: #5a4a3a; }
body.light .dock-ico {
  border-color: #c8b894;
  background: linear-gradient(180deg, #fffdf6 0%, #f0e8d6 100%);
  color: #9a5a1a;
  box-shadow: none;
}
body.light .dock-lab { color: #8a7a5a; }
body.light .chat-frame.no-chrome .input-row {
  background: rgba(255, 253, 246, 0.96);
  border-top-color: #d0c0a0;
}

/* ============ 移动端适配 ============ */
@media (max-width: 480px) {
  .screen { padding: 0; }
  .crt { max-width: 100%; max-height: 100%; }
  .phone-frame {
    border-radius: 0;
    border: none;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 12px)) 8px;
  }
  .phone-frame.no-chrome {
    padding: 0;
  }
  .phone-frame::before { display: none; }
  .phone-bottom { display: none; }
  .title-zh { font-size: 22px; }
  .title-block { padding: 24px 0 20px; margin-top: 18px; }
  body.immersive .phone-screen.home-screen,
  body.immersive.light .phone-screen.home-screen {
    padding-top: calc(80px + env(safe-area-inset-top, 32px)) !important;
  }

  /* 防 iOS 输入时自动缩放（font-size < 16px 时会触发） */
  .form-block input,
  .input-row textarea,
  .settings-panel input {
    font-size: 16px;
  }

  /* 加大触控区域 */
  .tab-btn { padding: 12px 4px; font-size: 14px; }
  .btn-primary { padding: 14px 14px; font-size: 14px; }
  .icon-btn { width: 38px; height: 34px; font-size: 18px; }
  .dock-ico { width: 40px; height: 40px; font-size: 16px; }

  /* 输入行加高，发送按钮更容易点 */
  .input-row { gap: 8px; padding: 6px 0 0; }
  .chat-frame.no-chrome .input-row { padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)); }
  .input-row textarea { font-size: 16px; padding: 10px 12px; }
  .btn-action-bracket {
    height: 42px;
    min-height: 42px;
    padding: 0 10px;
    font-size: 13px;
  }
  .btn-send {
    padding: 10px 16px;
    font-size: 14px;
    min-width: 64px;
    height: 42px;
    min-height: 44px;
  }
}

@media (max-height: 700px) {
  .title-block { padding: 6px 0 10px; }
  .footer-tip { margin-top: 10px; }
}

/* 支持动态视口高度（解决移动端地址栏显示/隐藏导致页面跳动） */
@supports (height: 100dvh) {
  html, body { height: 100dvh; }
}

/* ============ 信号选择面板 ============ */
/* 世界列表可滚动（世界多时） */
.signal-grid-scroll,
.signal-grid {
  max-height: min(48vh, 420px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
}

/* 已登录的频道选择页：标题固定，频道列表独立滚动。 */
body.immersive .phone-screen.home-screen.world-mode,
body.immersive.light .phone-screen.home-screen.world-mode,
.phone-screen.home-screen.world-mode {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-top: calc(28px + env(safe-area-inset-top, 28px)) !important;
}
.home-screen.world-mode .title-block {
  flex: 0 0 auto;
  margin-top: 0;
  padding: 8px 0 10px;
}
.home-screen.world-mode .logged-in-banner,
.home-screen.world-mode .world-section-title,
.home-screen.world-mode .footer-tip {
  flex: 0 0 auto;
}
.home-screen.world-mode .signal-grid {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin-top: 6px;
  padding-bottom: 8px;
}
.signal-btn-add {
  border-style: dashed !important;
  opacity: 0.95;
}
.signal-btn-custom .sig-label {
  font-size: 12px;
}

.signal-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 4px;
}
.signal-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #15102a;
  border: 1px solid #3a3050;
  color: #6a5a8a;
  padding: 12px 14px;
  border-radius: 4px;
  font-family: inherit;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: all 0.25s;
  text-align: left;
  font-size: 13px;
}
.signal-btn .sig-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #3a3050;
  box-shadow: 0 0 0 rgba(0,0,0,0);
  transition: all 0.25s;
  flex-shrink: 0;
}
.signal-btn .sig-num {
  font-family: "Courier New", monospace;
  font-weight: bold;
  color: #6a5a8a;
  transition: color 0.25s;
}
.signal-btn .sig-label {
  color: #6a5a8a;
  transition: color 0.25s;
  flex: 1;
}
.signal-btn .sig-desc {
  font-size: 10px;
  color: #4a3f6a;
  letter-spacing: 0.1em;
  transition: color 0.25s;
}
/* 已激活 / 已点过：变亮 */
.signal-btn.active {
  background: #1a1530;
  border-color: var(--sig-color, #ffb84a);
  box-shadow:
    inset 0 0 0 1px var(--sig-color, #ffb84a),
    0 0 12px color-mix(in srgb, var(--sig-color, #ffb84a) 35%, transparent);
  color: #ffd9a8;
}
.signal-btn.active .sig-dot {
  background: var(--sig-color, #ffb84a);
  box-shadow: 0 0 8px var(--sig-color, #ffb84a);
  animation: sig-blink 2s infinite;
}
.signal-btn.active .sig-num,
.signal-btn.active .sig-label {
  color: #ffd9a8;
  text-shadow: 0 0 6px color-mix(in srgb, var(--sig-color, #ffb84a) 50%, transparent);
}
.signal-btn.active .sig-desc {
  color: #b8a8d8;
}
.signal-btn:active { transform: scale(0.98); }

/* 锁定：永远不可点 */
.signal-btn.locked {
  background: #0a0814;
  border-color: #2a2040;
  cursor: not-allowed;
  opacity: 0.4;
}
.signal-btn.locked .sig-dot {
  background: #2a2040;
  box-shadow: none;
  animation: none;
}
.signal-btn.locked .sig-label::after {
  content: " · 信号已切断";
  font-size: 10px;
  color: #aa3050;
  letter-spacing: 0.1em;
}

/* 04 错误信号 · 噪点闪烁 */
.signal-btn.glitch .sig-num,
.signal-btn.glitch .sig-label {
  animation: glitch-text 3s infinite;
}
@keyframes sig-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
@keyframes glitch-text {
  0%, 90%, 100% { opacity: 1; transform: translateX(0); }
  92% { opacity: 0.6; transform: translateX(-1px); }
  94% { opacity: 1; transform: translateX(1px); }
  96% { opacity: 0.5; transform: translateX(0); }
}

.form-hint {
  text-align: center;
  font-size: 11px;
  color: #b8a8d8;
  letter-spacing: 0.15em;
  margin-top: 10px;
  margin-bottom: 0;
}

.logged-in-banner {
  background: #15102a;
  border: 1px dashed #5a4a7a;
  border-radius: 3px;
  padding: 6px 10px;
  font-size: 11px;
  color: #b8a8d8;
  letter-spacing: 0.1em;
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.link-btn {
  background: none;
  border: none;
  color: #ffb84a;
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  letter-spacing: 0.1em;
  padding: 0;
}

/* ============ 聊天顶栏 · 多信号 ============ */
.chat-top { gap: 6px; }
#btn-back { font-size: 22px; line-height: 1; padding-bottom: 4px; }
.convo-name .from {
  font-family: "Courier New", monospace;
  font-size: 9px;
}
#chat-channel-num {
  font-family: "Courier New", monospace;
  font-weight: bold;
  color: var(--cur-color, #ffb84a);
  text-shadow: 0 0 6px var(--cur-color, #ffb84a);
}
#chat-channel-name { color: var(--cur-color, #ffd9a8); }

/* ============ 00 配额条（统一占位头像 + 三项配额）============ */
.avatar-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #15102a;
  border: 1px solid #3a3050;
  border-radius: 4px;
  padding: 8px 12px;
  margin: 4px 0 0;
}
.avatar-thumb {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid #5a4a7a;
  flex-shrink: 0;
  object-fit: cover;
  background: #2a2040;
  cursor: pointer;
}
.avatar-thumb:active { transform: scale(0.94); }

/* 朋友圈浮层 */
.moments-overlay {
  position: fixed; inset: 0; z-index: 99998;
  background: #000;
  display: flex; flex-direction: column;
}
.moments-overlay.hidden { display: none; }
.moments-back {
  flex-shrink: 0;
  height: 44px;
  background: #111;
  color: #fff;
  border: none;
  text-align: left;
  padding: 0 16px;
  font-size: 16px;
  letter-spacing: 0.05em;
  cursor: pointer;
}
.moments-frame {
  flex: 1; width: 100%; border: none; background: #fff;
}
.avatar-meta {
  flex: 1; min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.quota-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
  letter-spacing: 0.15em;
}
.quota-line .ql-key {
  color: #8a7aaa;
}
.quota-line .ql-val {
  color: #ffd9a8;
  font-family: "Courier New", monospace;
}

/* 一次性照片弹窗 */
#popup-photo-mask { flex-direction: column; }
.popup-photo-img {
  max-width: 92vw;
  max-height: 70vh;
  border: 2px solid #ff9a7a;
  border-radius: 6px;
  box-shadow: 0 0 30px rgba(255, 154, 122, 0.55);
}
.popup-photo-tip {
  margin-top: 14px;
  color: #ff9a7a;
  font-size: 11px;
  letter-spacing: 0.25em;
}
.avatar-close {
  margin-top: 18px;
  background: #2a2240;
  border: 1px solid #5a4a7a;
  color: #c8b8e8;
  padding: 10px 28px;
  font-family: inherit;
  letter-spacing: 0.3em;
  border-radius: 3px;
  cursor: pointer;
}

/* ============ 系统消息（04 / 拦截 / 03 farewell）============ */
.msg-item.system {
  margin: 12px auto;
  max-width: 90%;
  align-items: center;
}
.msg-item.system .msg-bubble {
  background: transparent;
  border: 1px dashed #5a4a7a;
  color: #8a7aaa;
  font-family: "Courier New", monospace;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-align: center;
  padding: 8px 14px;
  font-style: normal;
}

/* 附件渲染 */
.msg-attachment {
  margin-top: 6px;
  max-width: 200px;
}
.msg-attachment img {
  max-width: 100%;
  max-height: 240px;
  border-radius: 8px;
  border: 1px solid #d4be8a;
  display: block;
}
.msg-attachment audio {
  width: 200px;
  height: 36px;
}

/* ============ 03 坐标按钮 ============ */
.coord-btn-wrap {
  margin: 6px 0;
  padding: 10px;
  border: 1px solid #cc4a5a;
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(204,74,90,0.08), rgba(204,74,90,0.02));
  text-align: center;
}
.coord-btn {
  background: linear-gradient(180deg, #d63a4a 0%, #8a1525 100%);
  border: 1px solid #ff5a6a;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.3em;
  padding: 12px 20px;
  border-radius: 3px;
  cursor: pointer;
  width: 100%;
  text-shadow: 0 0 6px rgba(255,255,255,0.4);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.2),
    0 0 20px rgba(214, 58, 74, 0.6);
  animation: red-pulse 2.4s infinite;
}
.coord-btn:active { transform: scale(0.98); }
.coord-hint {
  font-size: 10px;
  color: #cc4a5a;
  margin-top: 6px;
  letter-spacing: 0.15em;
}
@keyframes red-pulse {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 0 14px rgba(214,58,74,0.4); }
  50% { box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 0 28px rgba(214,58,74,0.8); }
}

.coord-warn {
  text-align: center;
  color: #ff9aaa;
  font-size: 13px;
  line-height: 1.8;
  letter-spacing: 0.1em;
  margin: 16px 0;
}

/* ============ 锁定提示 ============ */
.locked-bar {
  background: #1a0a14;
  border: 1px dashed #aa3050;
  color: #ff9aaa;
  padding: 14px;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.3em;
  margin: 6px 0;
  border-radius: 3px;
}

/* ============ 媒体按钮 ============ */
.media-btns {
  display: flex;
  gap: 4px;
  align-self: flex-end;
}
.media-btn {
  background: #2a2240;
  border: 1px solid #5a4a7a;
  color: #ffd9a8;
  width: 36px; height: 36px;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.media-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============ 语音录制面板 ============ */
.voice-panel {
  background: linear-gradient(180deg, #1f1838 0%, #14102a 100%);
  border: 2px solid #ff9a7a;
  border-radius: 6px;
  width: 100%;
  max-width: 320px;
  padding: 20px;
  color: #c8b8e8;
  text-align: center;
}
.voice-title {
  font-size: 14px;
  color: #ffd9a8;
  letter-spacing: 0.3em;
  margin-bottom: 16px;
}
.voice-timer {
  font-family: "Courier New", monospace;
  font-size: 28px;
  color: #ff9a7a;
  text-shadow: 0 0 8px rgba(255,154,122,0.5);
  margin: 14px 0;
}
.voice-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.voice-actions button { margin-top: 0; }
.voice-hint {
  margin-top: 10px;
  font-size: 11px;
  color: #ff9aaa;
  letter-spacing: 0.1em;
  min-height: 14px;
}

/* ============ 语音消息气泡 ============ */
.msg-attachment {
  margin-top: 4px;
}
.msg-attachment audio {
  width: 220px;
  max-width: 100%;
  height: 36px;
  border-radius: 18px;
  outline: none;
  filter: sepia(0.2) saturate(0.85) hue-rotate(-10deg);
}
.msg-attachment audio::-webkit-media-controls-panel {
  background: linear-gradient(180deg, #ffd1b0 0%, #ffae8a 100%);
}
.msg-item.assistant .msg-attachment audio {
  background: #f3e5c3;
}
.msg-item.user .msg-attachment audio {
  background: #ff85a5;
}
.msg-attachment img {
  max-width: 200px;
  border-radius: 8px;
  display: block;
}

/* ============ 02 通话界面 ============ */
#call {
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse at top, #1c2a4a 0%, #0a0d20 80%, #000 100%);
  z-index: 50;
  display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.call-bg {
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.018) 0, rgba(255,255,255,0.018) 1px, transparent 1px, transparent 4px);
  pointer-events: none;
}
.call-inner {
  position: relative;
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center;
  padding: 40px 20px 30px;
  color: #c8d4e8;
}
.call-top {
  display: flex; flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
}
.call-warn {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: #ff9080;
  background: rgba(180, 60, 60, 0.12);
  border: 1px solid rgba(255, 120, 100, 0.35);
  padding: 6px 14px;
  border-radius: 14px;
  text-shadow: 0 0 4px rgba(255, 120, 100, 0.5);
  animation: warn-pulse 2.6s infinite;
}
@keyframes warn-pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}
.call-avatar {
  width: 110px; height: 110px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3a4a7a 0%, #1a2040 100%);
  border: 2px solid #7aaaff;
  box-shadow:
    0 0 30px rgba(122, 170, 255, 0.4),
    inset 0 0 20px rgba(122, 170, 255, 0.15);
  margin-top: 12px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  animation: avatar-pulse 3s infinite;
}
.call-avatar img {
  width: 70%; height: 70%; opacity: 0.7;
}
@keyframes avatar-pulse {
  0%, 100% { box-shadow: 0 0 30px rgba(122, 170, 255, 0.4), inset 0 0 20px rgba(122, 170, 255, 0.15); }
  50% { box-shadow: 0 0 50px rgba(122, 170, 255, 0.7), inset 0 0 28px rgba(122, 170, 255, 0.3); }
}
.call-name {
  font-family: "STSong", "宋体", serif;
  font-size: 22px;
  letter-spacing: 0.4em;
  color: #d4e0ff;
  text-shadow: 0 0 8px rgba(122, 170, 255, 0.5);
  margin-top: 6px;
}
.call-status {
  font-size: 12px;
  letter-spacing: 0.3em;
  color: #8aa0c8;
  min-height: 16px;
}
.call-timer {
  font-family: "Courier New", monospace;
  font-size: 18px;
  color: #7aaaff;
  letter-spacing: 0.2em;
  text-shadow: 0 0 6px rgba(122, 170, 255, 0.4);
  margin-top: 4px;
}

.call-transcript {
  flex: 1;
  width: 100%;
  max-width: 380px;
  margin: 18px auto 0;
  padding: 14px 16px;
  overflow-y: auto;
  font-size: 12px;
  color: #8aa0c8;
  letter-spacing: 0.1em;
  line-height: 1.85;
  font-family: "STSong", serif;
  scrollbar-width: thin;
}
.call-transcript::-webkit-scrollbar { width: 4px; }
.call-transcript::-webkit-scrollbar-thumb { background: #3a4a6a; border-radius: 2px; }
.call-transcript .tx-line {
  margin-bottom: 8px;
  opacity: 0;
  animation: tx-in 0.4s forwards;
}
.call-transcript .tx-me { text-align: right; color: #aaccff; }
.call-transcript .tx-her { text-align: left; color: #ffd9a8; }
.call-transcript .tx-sys { text-align: center; color: #ff9080; font-size: 10px; letter-spacing: 0.3em; }
@keyframes tx-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.call-bottom {
  width: 100%;
  display: flex; flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 18px 20px 24px;
}
.call-record-btn {
  width: 130px; height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff9aaa 0%, #c83a6a 70%, #5a1030 100%);
  border: 3px solid #ff9080;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 0.3em;
  cursor: pointer;
  box-shadow:
    0 0 30px rgba(200, 60, 100, 0.5),
    inset 0 4px 12px rgba(255,255,255,0.2),
    inset 0 -6px 12px rgba(0,0,0,0.4);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px;
  transition: transform 0.1s, box-shadow 0.15s;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.call-record-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.call-record-btn.recording {
  transform: scale(1.08);
  box-shadow:
    0 0 50px rgba(255, 100, 130, 0.8),
    inset 0 4px 12px rgba(255,255,255,0.3),
    inset 0 -6px 12px rgba(0,0,0,0.5);
  animation: rec-pulse 0.8s infinite;
}
@keyframes rec-pulse {
  0%, 100% { box-shadow: 0 0 50px rgba(255, 100, 130, 0.8), inset 0 4px 12px rgba(255,255,255,0.3), inset 0 -6px 12px rgba(0,0,0,0.5); }
  50% { box-shadow: 0 0 70px rgba(255, 150, 180, 1.0), inset 0 4px 12px rgba(255,255,255,0.4), inset 0 -6px 12px rgba(0,0,0,0.5); }
}
.rec-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px rgba(255,255,255,0.8);
}
.recording .rec-dot { background: #ff0040; box-shadow: 0 0 12px #ff0040; }
.rec-label { font-size: 13px; }

.call-hangup-btn {
  width: 100%; max-width: 240px;
  padding: 12px;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.4em;
  background: #2a1020;
  color: #ff7a9a;
  border: 1px solid #aa3050;
  border-radius: 24px;
  cursor: pointer;
}

@media (max-width: 480px) {
  .call-record-btn { width: 110px; height: 110px; }
}

/* ============ 微信接入按钮 + 弹窗 ============ */
.icon-btn.icon-wx {
  font-family: "STSong", "宋体", serif;
  color: #66ff99;
  border-color: #2a7050;
  background: rgba(40, 90, 60, 0.18);
  text-shadow: 0 0 6px rgba(102, 255, 153, 0.4);
  margin-right: 4px;
}
.icon-btn.icon-wx:hover {
  background: rgba(40, 90, 60, 0.35);
}
.wx-panel { max-width: 380px; }
.wx-stage { text-align: center; }
.wx-tip {
  font-size: 13px;
  color: #c8b8e8;
  letter-spacing: 0.1em;
  line-height: 1.7;
  margin: 8px 0;
}
.wx-tip.ok { color: #9bff7a; text-shadow: 0 0 6px rgba(155, 255, 122, 0.4); }
.wx-tip.err { color: #ff7a9a; }
.wx-tip-dim {
  font-size: 11px;
  color: #8a7aaa;
  letter-spacing: 0.1em;
  line-height: 1.7;
  margin: 6px 0;
}
.wx-qr-wrap {
  margin: 18px auto;
  padding: 12px;
  background: #fff;
  border-radius: 6px;
  display: inline-block;
  box-shadow: 0 0 20px rgba(102, 255, 153, 0.25);
}
.wx-qr-wrap img {
  display: block;
  width: 220px; height: 220px;
}

/* ============ Toast 提示 ============ */
.toast {
  position: fixed;
  left: 50%; bottom: 80px;
  transform: translateX(-50%);
  background: rgba(20, 10, 30, 0.92);
  border: 1px solid #aa3050;
  color: #ff9aaa;
  padding: 10px 18px;
  font-size: 12px;
  letter-spacing: 0.2em;
  border-radius: 4px;
  z-index: 99999;
  pointer-events: none;
  box-shadow: 0 0 20px rgba(170, 48, 80, 0.4);
}

/* 移动端：信号面板 / 头像 调整 */
@media (max-width: 480px) {
  .signal-btn { padding: 14px 12px; font-size: 14px; }
  .signal-btn .sig-num { font-size: 14px; }
  .signal-btn .sig-desc { font-size: 11px; }
  .avatar-thumb { width: 40px; height: 40px; }
  .avatar-name { font-size: 14px; }
  .avatar-sub, .avatar-quota { font-size: 10px; }
  .media-btn { width: 40px; height: 40px; font-size: 18px; }
}

/* =========================================================
   明亮模式（默认）· body.light 覆盖
   暖纸色调，保留 90 年代复古感但整体明亮
   ========================================================= */
body.light { background: #e8e0d0; color: #3a2f25; }
body.light body::before, body.light::before {
  background: radial-gradient(ellipse at center, #f5efe2 0%, #e3d8c4 70%, #d4c8b0 100%);
}
/* 暗场效果在明亮模式下减弱 */
body.light .scanlines { display: none !important; }
body.light .vignette { box-shadow: inset 0 0 200px 40px rgba(120,100,70,0.15); }

/* 手机外壳：浅金属灰 */
body.light .phone-frame {
  background: linear-gradient(180deg, #fdfaf3 0%, #e8e0cf 100%);
  border-color: #c8b894;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.7),
    inset 0 -2px 0 rgba(0,0,0,0.08),
    0 0 30px rgba(180,150,100,0.15),
    0 18px 40px rgba(120,100,70,0.25);
}
body.light .phone-frame::before { background: #c8b894; }
body.light .phone-top { color: #7a6a4a; }
body.light .clock { color: #b8742a; text-shadow: none; }
body.light .battery { border-color: #7a6a4a; }
body.light .battery i { background: #b8742a; box-shadow: none; }
body.light .signal-bar span { background: #b8742a; box-shadow: none; }
body.light .signal-bar span.off { background: #c8bca0; }

/* 屏幕区 */
body.light .phone-screen {
  background: radial-gradient(ellipse at top, #fffdf6 0%, #f2ead8 60%, #e8dfc8 100%);
  border-color: #d0c0a0;
  box-shadow: inset 0 0 30px rgba(150,120,80,0.1);
}
body.light .hw-btn {
  background: linear-gradient(180deg, #f0e8d6 0%, #d8ccb0 100%);
  border-color: #c0b090;
}

/* 标题 / 文字 */
body.light .title-zh { color: #9a5a1a; text-shadow: 0 0 8px rgba(200,150,80,0.25); }
body.light .title-en { color: #8a7a9a; }
body.light .title-dash { color: #b0a088; }
body.light .title-sub { color: #6a5a4a; }
body.light .footer-tip { color: #8a7a5a; }
body.light .footer-tip .dim { color: #b0a088; }
body.light .footer-link { color: #b8742a; border-bottom-color: #c8b894; }

/* tab */
body.light .tab-row { border-bottom-color: #c8b894; }
body.light .tab-btn { color: #9a8a6a; }
body.light .tab-btn.active { color: #9a5a1a; border-bottom-color: #b8742a; text-shadow: none; }

/* 输入框 */
body.light .form-block input,
body.light .settings-panel input,
body.light .settings-panel textarea,
body.light .input-row textarea {
  background: #fffdf6; border-color: #c8b894; color: #3a2f25;
  box-shadow: inset 0 1px 3px rgba(120,100,70,0.12);
}
body.light .form-block label { color: #7a6a4a; }
body.light .form-hint { color: #9a8a6a; }
body.light .form-block input:focus,
body.light .settings-panel input:focus,
body.light .settings-panel textarea:focus,
body.light .input-row textarea:focus {
  border-color: #b8742a; box-shadow: inset 0 1px 3px rgba(120,100,70,0.1), 0 0 6px rgba(184,116,42,0.25);
}

/* 聊天头部 */
body.light .chat-frame .phone-top { background: #f2ead8; }
body.light .convo-name { color: #9a5a1a; text-shadow: none; }
body.light .convo-name .from { color: #9a8a6a; }
body.light .icon-btn { border-color: #c8b894; color: #7a6a4a; }
body.light .icon-btn.icon-wx { color: #2a8a4a; border-color: #8ac8a0; background: rgba(120,200,150,0.15); text-shadow: none; }

/* 消息列表 */
body.light .msg-list {
  background: radial-gradient(ellipse at top, #fffdf6 0%, #f2ebd9 80%);
  border-color: #d0c0a0;
  box-shadow: inset 0 0 20px rgba(150,120,80,0.08);
}
body.light .msg-list::-webkit-scrollbar-thumb { background: #c8b894; }
body.light .msg-day { color: #a09070; }
body.light .msg-time { color: #a09070; }
body.light .msg-empty { color: #8a7a5a; }
body.light .msg-empty .big { color: #9a5a1a; text-shadow: none; }

/* 用户气泡：暖橘粉 */
body.light .msg-item.user .msg-bubble {
  background: linear-gradient(180deg, rgba(255, 154, 122, 0.75) 0%, rgba(232, 112, 74, 0.75) 100%);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), 0 2px 6px rgba(200,100,60,0.25);
}
/* AI 气泡：纸白 */
body.light .msg-item.assistant .msg-bubble {
  background: rgba(255, 253, 243, 0.75);
  color: #3a2f25;
  border-color: #e0d4ba;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 2px 6px rgba(150,120,80,0.15);
}
body.light .msg-item.system .msg-bubble { background: #f0e8d6; color: #7a6a4a; }
body.light .msg-typing .msg-bubble { background: #f5eede; color: #8a7a5a; }

/* 浅色主题下的叙事分层 */
body.light .npc-card {
  background: linear-gradient(165deg, #3a2a48 0%, #2a1e38 100%);
  border-color: #8a6a9a;
}
body.light .npc-card-title { color: #f0b0d0; }
body.light .npc-k { color: #c8a8e0; }
body.light .npc-v { color: #fff8fc; }
body.light .story-body { color: #3a2f25; }
body.light .story-action { color: #7a6a58; opacity: 0.9; }
body.light .story-scene {
  color: #5a3a10;
  background: linear-gradient(135deg, rgba(255, 220, 160, 0.7), rgba(255, 245, 220, 0.5));
  border-color: rgba(160, 100, 30, 0.4);
  border-left-color: #b87920;
}
body.light .story-dialog {
  color: #a01848;
  background: linear-gradient(180deg, rgba(255, 160, 180, 0.28), rgba(255, 160, 180, 0.1));
}

/* 清雅微信已有独立气泡，不再叠加全局对白红底；放在主题规则之后确保不被覆盖。 */
.qingya-chat-line .story-dialog,
body.light .qingya-chat-line .story-dialog {
  color: inherit;
  font-weight: inherit;
  background: transparent !important;
  border: none !important;
  border-radius: 0;
  padding: 0;
  box-shadow: none !important;
}

/* 发送按钮 */
body.light .btn-send {
  background: linear-gradient(180deg, #ff9a7a 0%, #e8704a 100%);
  border-color: #ffaa8a; color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), 0 0 8px rgba(200,100,60,0.25);
}
body.light .btn-send:disabled { background: #d8ccb0; border-color: #c8b894; }
body.light .btn-primary {
  background: linear-gradient(180deg, #ff9a7a 0%, #d8603a 100%);
  border-color: #ffaa8a; color: #fff;
}

/* 信号选择按钮 */
body.light .signal-btn {
  background: linear-gradient(180deg, #fffdf6 0%, #f0e8d6 100%);
  border-color: #d0c0a0;
}
body.light .signal-btn .sig-num { color: #9a8a6a; }
body.light .signal-btn .sig-label { color: #5a4a3a; }
body.light .signal-btn .sig-desc { color: #9a8a6a; }
body.light .signal-btn .sig-dot { background: #c8b894; }
body.light .signal-btn.active { border-color: var(--sig-color, #b8742a); }
body.light .signal-btn.active .sig-num,
body.light .signal-btn.active .sig-label { color: #9a5a1a; }

/* 设置面板 / 弹窗 */
body.light .mask { background: rgba(120,100,70,0.4); }
body.light .settings-panel {
  background: linear-gradient(180deg, #fffdf6 0%, #f2ead8 100%);
  border-color: #c8b894; color: #5a4a3a;
}
body.light .settings-title { color: #9a5a1a; text-shadow: none; border-bottom-color: #c8b894; }
body.light .block-label { color: #7a6a4a; }
body.light .block-value { background: #fffdf6; border-color: #c8b894; color: #3a2f25; }
body.light .btn-secondary { background: #f0e8d6; border-color: #c8b894; color: #6a5a4a; }

/* 00 头像条 */
body.light .avatar-bar { background: #f2ead8; border-color: #d0c0a0; }
body.light .quota-line .ql-key { color: #9a8a6a; }
body.light .quota-line .ql-val { color: #9a5a1a; }
body.light .media-btn { background: #f0e8d6; border-color: #c8b894; color: #7a6a4a; }

/* 主题切换按钮 */
.theme-toggle {
  background: none;
  border: 1px solid #5a4a7a;
  color: #c8b8e8;
  width: 28px; height: 24px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 0;
  margin-right: 4px;
}
body.light .theme-toggle { border-color: #c8b894; color: #7a6a4a; }
