/* ═══ Ling PWA · 对齐安卓 LingTokens 设计系统 ═══ */

/* 默认 = Dark 主题（theme.js 会覆写这些变量） */
:root {
  --bg: #1A1A1A;
  --card: #252525;
  --card-border: #3A3A3A;
  --text: #FFFFFF;
  --text-sec: #888888;
  --text-ter: #555555;
  --accent: #5CB882;
  --accent-bg: rgba(92,184,130,0.15);
  --accent-border: rgba(92,184,130,0.50);
  --accent2: #5CB882;
  --accent2-bg: rgba(92,184,130,0.10);
  --accent2-border: rgba(92,184,130,0.40);
  --input-bg: rgba(255,255,255,0.06);
  --input-border: rgba(255,255,255,0.10);
  --ai-bubble: #1A2E1C;
  --user-bubble: #2C2C2C;
  --user-bubble-text: #FFFFFF;
  --tb-bg: rgba(26,26,26,0.94);
  --narrative: #16161C;
  --danger: #E05555;
  --success: #5CB882;

  /* 安卓 ProfileScreen 身份/账号绿（独立于主题 accent 的常量） */
  --green: #5CB882;
  --green-bg: rgba(92,184,130,0.16);
  --green-border: rgba(92,184,130,0.45);
  --red-bg: rgba(224,85,85,0.12);

  /* 兼容旧变量名（部分页面仍在用） */
  --surface: var(--card);
  --surface2: #2E2E2E;
  --border: var(--card-border);
  --text2: var(--text-sec);
  --accent-dim: var(--accent-bg);

  --radius: 20px;      /* cornerRadius */
  --radius-btn: 22px;  /* buttonRadius */
  --radius-sm: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
  font-size: 14px;
  line-height: 1.43;
  -webkit-font-smoothing: antialiased;
}

/* ★ 全绿修复：内容容器层级高于 mesh 背景 canvas(z-index:0)，避免 fixed 全屏绿色渐变盖住页面 */
#app { height: 100%; display: flex; flex-direction: column; overflow: hidden; position: relative; z-index: 1; }

/* ═══ 通用组件 ═══ */

.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-top: var(--safe-top);
  position: relative;
}

.page-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  padding-bottom: calc(16px + var(--safe-bottom));
}

/* 顶栏 */
.navbar {
  display: flex;
  align-items: center;
  height: 52px;
  padding: 0 16px;
  flex-shrink: 0;
  position: relative;
}
.navbar-title {
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  color: var(--text);
}
.navbar-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--accent);
  font-size: 20px;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.3s var(--ease);
}
.navbar-btn:active { background: var(--accent-bg); }
/* ★ AI 语音朗读开关：开启时亮绿底提示 */
.navbar-btn.tts-on { background: var(--accent-bg); }

/* ═══ 底部 Tab 栏（球形 LingTabBar）═══ */
.tabbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-around;
  flex-shrink: 0;
  height: 76px;
  padding-top: 8px;
  padding-bottom: var(--safe-bottom);
  background: var(--tb-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--card-border);
}
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-sec);
}
.tab-ball {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--text-sec);
  background: transparent;
  border: 1.5px solid rgba(136,136,136,0.45);
  transition: all 0.3s var(--ease);
}
.tab-label {
  font-size: 10px;
  font-weight: 400;
  color: var(--text-sec);
  transition: color 0.3s var(--ease);
}
.tab-item.active .tab-ball {
  width: 38px;
  height: 38px;
  font-size: 18px;
  color: #fff;
  background: var(--accent);
  border: none;
  box-shadow: 0 0 7px var(--accent);
}
.tab-item.active .tab-label {
  color: var(--accent);
  font-weight: 700;
}

/* 卡片 */
.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  padding: 16px;
  margin-bottom: 12px;
  transition: background 0.3s var(--ease);
}
.card:active { background: var(--surface2); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.3s var(--ease);
}
.btn:active { opacity: 0.7; }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn-primary { background: var(--accent); color: #fff; width: 100%; }
.btn-ghost { background: var(--accent-bg); color: var(--accent); }

/* 输入框 */
.input-group { margin-bottom: 16px; }
.input-group label {
  display: block;
  font-size: 13px;
  color: var(--text-sec);
  margin-bottom: 6px;
}
.input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.3s var(--ease);
}
.input:focus { border-color: var(--accent-border); }
.input::placeholder { color: var(--text-ter); }

/* ═══ 登录页 ═══ */

.login-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 24px;
  padding-top: calc(32px + var(--safe-top));
  padding-bottom: calc(32px + var(--safe-bottom));
}
.login-logo {
  font-size: 42px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: -1px;
  color: var(--text);
}
.login-tagline {
  text-align: center;
  color: var(--text-sec);
  font-size: 14px;
  margin-bottom: 48px;
}
.login-error {
  color: var(--danger);
  font-size: 13px;
  text-align: center;
  min-height: 20px;
  margin-bottom: 12px;
}
.login-switch {
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-sec);
}
.login-switch a { color: var(--accent); text-decoration: none; }

/* ═══ 首页搜索 ═══ */
.home-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 16px 10px;
  flex-shrink: 0;
}
.home-search-input { flex: 1; min-width: 0; padding: 9px 14px; font-size: 13px; border-radius: 12px; }
.home-search-clear {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 2px;
  flex-shrink: 0;
}
.empty-sub { font-size: 12px; color: var(--text-ter); margin-top: 6px; }

/* ═══ 聊天列表 ═══ */

.conv-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  margin-bottom: 10px;
  cursor: pointer;
  transition: background 0.3s var(--ease);
}
.conv-item:active { background: var(--surface2); }
.conv-avatar {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--accent-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.conv-info { flex: 1; min-width: 0; }
.conv-name { font-size: 15px; font-weight: 600; color: var(--text); }
.conv-preview {
  font-size: 13px;
  color: var(--text-sec);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.conv-time { font-size: 11px; color: var(--text-ter); flex-shrink: 0; }

/* ═══ 聊天页 ═══ */

.chat-page { display: flex; flex-direction: column; height: 100%; position: relative; }
/* 自定义聊天背景图层（铺满、裁切、35% 透明，置于内容之后） */
.chat-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}
.chat-page > .navbar, .chat-page > .chat-searchbar, .chat-page > .vital-bar, .chat-page > .chat-messages, .chat-page > .chat-input-bar { position: relative; z-index: 1; }
/* 聊天内消息搜索栏 */
.chat-searchbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--card-border);
  background: var(--bg);
  flex-shrink: 0;
}
.chat-search-input { flex: 1; min-width: 0; padding: 7px 12px; font-size: 13px; }
.chat-search-count { font-size: 12px; color: var(--text-sec); white-space: nowrap; min-width: 34px; text-align: center; }
.chat-search-nav { font-size: 12px; padding: 4px 8px; }
.chat-search-cancel { font-size: 13px; color: var(--text-sec); padding: 4px 6px; }
/* VitalBar 心跳状态栏（对齐安卓）*/
.vital-bar {
  display: flex;
  align-items: center;
  margin: 6px 16px 2px;
  padding: 6px 10px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  flex-shrink: 0;
}
.vital-cell {
  flex: 1;
  min-width: 0;
  font-size: 10px;
  color: var(--text);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 2px;
}
.vital-heart {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  padding: 0 4px;
}
.vital-heart b { font-size: 11px; font-weight: 700; color: var(--danger); }
/* 搜索高亮 */
.search-hl { background: #FFD60A; color: #1A1A1A; border-radius: 2px; padding: 0 1px; }
.search-current { outline: 2px solid var(--accent); outline-offset: 1px; }
.chat-messages {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 16px;
  padding-top: calc(12px + var(--safe-top));
}
.msg-row { margin-bottom: 16px; display: flex; align-items: flex-start; gap: 8px; }
.msg-row.user { justify-content: flex-end; }
.msg-row.assistant { justify-content: flex-start; }
.msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.msg-bubble {
  max-width: 72%;
  padding: 10px 14px;
  font-size: var(--chat-font, 14px);
  line-height: var(--chat-line, 20px);
  word-break: break-word;
  white-space: pre-wrap;
}
.msg-row.user .msg-bubble {
  background: var(--user-bubble);
  color: #FFFFFF;
  border-radius: 16px 6px 16px 16px;
}
.msg-row.assistant .msg-bubble {
  background: var(--ai-bubble);
  color: var(--text);
  border-radius: 6px 16px 16px 16px;
}
/* 消息版本切换器（重新生成后可左右切换历史版本） */
.msg-bubble-wrap { display: flex; flex-direction: column; align-items: flex-start; max-width: 72%; }
.msg-bubble-wrap .msg-bubble { max-width: 100%; }
.msg-versions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 0 4px;
  user-select: none;
}
.mv-btn {
  background: none;
  border: none;
  color: var(--text-sec);
  font-size: 14px;
  line-height: 1;
  padding: 2px 6px;
  cursor: pointer;
  border-radius: 6px;
}
.mv-btn:active { background: var(--surface2); color: var(--text); }
.mv-count { font-size: 11px; color: var(--text-ter); }
.time-sep {
  text-align: center;
  font-size: 11px;
  color: var(--text-ter);
  margin: 4px 0 14px;
  user-select: none;
}

/* 输入栏 */
.chat-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 10px 16px;
  padding-bottom: calc(10px + var(--safe-bottom));
  border-top: 1px solid var(--card-border);
  background: var(--card);
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  padding: 11px 16px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-btn);
  color: var(--text);
  font-size: 15px;
  line-height: 1.4;
  resize: none;
  outline: none;
  overflow-y: auto;
  transition: border-color 0.3s var(--ease);
}
.chat-input:focus { border-color: rgba(92,184,130,0.6); }
.chat-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.3s var(--ease);
}
.chat-send:disabled { opacity: 0.3; }
.chat-send:active { opacity: 0.7; }

/* 思考中动画（900ms，延迟0/300/600ms） */
.thinking-dots { display: inline-flex; gap: 4px; padding: 4px 0; }
.thinking-dots span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-sec);
  animation: dotPulse 0.9s infinite var(--ease);
}
.thinking-dots span:nth-child(2) { animation-delay: 0.3s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.6s; }
@keyframes dotPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* ═══ 角色列表 ═══ */

.role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
/* 翻转卡（对齐安卓 RoleGridScreen：单面互斥、350ms、90° 阈值换面） */
.role-card3d {
  aspect-ratio: 0.85;
  perspective: 900px;
  cursor: pointer;
}
.role-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.35s var(--ease);
}
.role-card3d.flipped .role-card-inner { transform: rotateY(180deg); }
.role-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 18px;
  border: 1px solid var(--card-border);
  background: var(--card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.3s var(--ease);
}
.role-card3d.flipped .role-face { border-color: rgba(92,184,130,0.4); }
.role-front { align-items: center; justify-content: center; }
.role-front .role-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #fff;
  font-weight: 600;
}
.role-front-name {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 8px 10px;
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-size: 13px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.role-back { transform: rotateY(180deg); padding: 14px; }
.role-back-name { font-size: 14px; font-weight: 600; color: var(--text); }
.role-back-desc {
  font-size: 11px;
  color: var(--text-sec);
  line-height: 1.6;
  margin-top: 6px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.role-back-actions { display: flex; justify-content: space-evenly; padding-top: 6px; }
.role-act {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: var(--surface2);
  color: var(--accent);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.role-act:active { opacity: 0.6; }
.role-act.danger { color: var(--danger); }

/* ═══ 设置页 ═══ */

.settings-section { margin-bottom: 24px; }
.settings-title {
  font-size: 13px;
  color: var(--text-sec);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  padding-left: 4px;
}
.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--card-border);
  margin-bottom: -1px;
}
.settings-item:first-of-type { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.settings-item:last-of-type { border-radius: 0 0 var(--radius-sm) var(--radius-sm); margin-bottom: 0; }
.settings-item:only-of-type { border-radius: var(--radius-sm); }
.settings-label { font-size: 15px; color: var(--text); }
.settings-value { font-size: 14px; color: var(--text-sec); }

/* ═══ 空状态 ═══ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-sec);
}
.empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-text { font-size: 15px; margin-bottom: 20px; }

/* 灵魂星图图例 */
.portrait-legend {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
  background: rgba(0,0,0,0.35);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 12px;
  color: var(--text-sec);
  pointer-events: none;
}
.portrait-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}

/* ═══ 灵魂星图页 ═══ */
.pt-scroll { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.pt-hero { display: flex; align-items: center; gap: 14px; padding: 18px; }
.pt-hero.center { flex-direction: column; text-align: center; padding: 24px; }
.pt-avatar {
  width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0; overflow: hidden;
  background: var(--accent-bg); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700;
}
.pt-hero.center .pt-avatar { width: 72px; height: 72px; font-size: 28px; }
.pt-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pt-hero-name { font-size: 18px; font-weight: 700; color: var(--text); }
.pt-hero-sub {
  font-size: 13px; color: var(--text-sec); margin-top: 2px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pt-hero-count { margin-left: auto; text-align: center; flex-shrink: 0; }
.pt-hero-count b { display: block; font-size: 20px; font-weight: 700; color: var(--accent); }
.pt-hero-count span { font-size: 10px; color: var(--text-sec); }
.pt-section-title { font-size: 14px; font-weight: 700; color: var(--text); margin-top: 4px; }
.pt-branch-scroll { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.pt-branch-card { min-width: 180px; max-width: 180px; padding: 14px; flex-shrink: 0; }
.pt-branch-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.pt-branch-icon {
  width: 32px; height: 32px; border-radius: 10px; background: var(--accent-bg);
  display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0;
}
.pt-branch-title { font-size: 13px; font-weight: 600; color: var(--accent); }
.pt-branch-content {
  font-size: 12px; color: var(--text-sec); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.pt-stats { display: flex; justify-content: space-evenly; padding: 16px; }
.pt-stat { text-align: center; }
.pt-stat b { display: block; font-size: 22px; font-weight: 700; color: var(--accent); }
.pt-stat span { font-size: 11px; color: var(--text-sec); }
.pt-chart-card { padding: 12px; }
.pt-chart-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.pt-chart-box { position: relative; }
.pt-chart-box canvas { width: 100%; height: 100%; display: block; }
.pt-route { display: flex; align-items: center; gap: 12px; padding: 14px; }
.pt-route-badge {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-bg); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
}
.pt-route-title { font-size: 14px; font-weight: 500; color: var(--text); }
.pt-route-sub { font-size: 11px; color: var(--text-sec); margin-top: 2px; }
.pt-chips { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.pt-chip { font-size: 10px; color: var(--accent); background: var(--accent-bg); border-radius: 10px; padding: 2px 8px; }
.pt-route-arrow { margin-left: auto; color: var(--text-sec); font-size: 18px; flex-shrink: 0; }
.pt-world { padding: 12px 14px; }
.pt-world-name { font-size: 13px; color: var(--text); }
.pt-world-sub { font-size: 11px; color: var(--text-sec); margin-top: 2px; }
.pt-world-log { font-size: 12px; color: var(--text-sec); margin-top: 4px; line-height: 1.6; }
.pt-recon {
  width: 100%; height: 48px; border-radius: 14px; border: none;
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 600;
}
.pt-recon:disabled { opacity: 0.5; }
.pt-recon-bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
  background: var(--card); border-top: 1px solid var(--card-border);
  padding: 12px 16px calc(12px + var(--safe-bottom));
}
.pt-recon-row { display: flex; align-items: center; gap: 12px; }
.pt-recon-track { flex: 1; height: 4px; border-radius: 2px; background: var(--accent-bg); overflow: hidden; position: relative; }
.pt-recon-track i {
  position: absolute; top: 0; bottom: 0; left: -40%; width: 40%;
  background: var(--accent); border-radius: 2px;
  animation: pt-slide 1.2s infinite ease-in-out;
}
@keyframes pt-slide { 0% { left: -40%; } 100% { left: 100%; } }
.pt-recon-cancel { color: var(--danger); font-size: 13px; background: none; border: none; padding: 4px 8px; }
.pt-recon-text { font-size: 12px; color: var(--text-sec); margin-top: 6px; }

/* ═══ 加载 ═══ */

.loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999;
  transition: opacity 0.4s var(--ease);
}
.loading-screen.hide { opacity: 0; pointer-events: none; }
/* ── 启动页（对齐安卓 SplashScreen）── */
.splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transform: translateY(-20px);
  animation: splash-fade 0.8s var(--ease) both;
}
@keyframes splash-fade { from { opacity: 0; } to { opacity: 1; } }
.splash-logo-row { display: flex; align-items: center; }
.splash-logo {
  font-size: 72px;
  font-weight: 300;
  letter-spacing: -2px;
  color: var(--accent);
  line-height: 1;
}
.splash-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-left: 3px; align-self: flex-end; margin-bottom: 10px; }
.splash-subtitle { font-size: 13px; letter-spacing: 2px; color: var(--text-ter); }
.splash-desc { font-size: 16px; color: var(--text2); }
.splash-divider { width: 40px; height: 1px; background: var(--accent); opacity: 0.5; }
.splash-tagline { font-size: 14px; color: var(--text-ter); line-height: 22px; }
.splash-loading { font-size: 14px; color: var(--accent); margin-top: 16px; }
.splash-dots::after { content: ''; animation: splash-dots 1.5s linear infinite; }
@keyframes splash-dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
  100% { content: ''; }
}

/* ── 更新公告（对齐安卓 ChangelogScreen）── */
.cl-scroll { padding: 8px 20px 40px; }
.cl-block {
  background: var(--surface);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
}
.cl-head { display: flex; align-items: center; gap: 8px; }
.cl-version { font-size: 18px; font-weight: 700; color: var(--text); }
.cl-tag {
  font-size: 11px; font-weight: 600; color: var(--accent);
  background: var(--accent-dim);
  border-radius: 6px;
  padding: 2px 8px;
}
.cl-group { margin-top: 10px; }
.cl-group-title { font-size: 13px; font-weight: 600; color: var(--accent); margin-bottom: 6px; }
.cl-item { display: flex; gap: 8px; padding: 0 0 4px 4px; }
.cl-dot { font-size: 13px; color: var(--text-ter); line-height: 20px; flex-shrink: 0; }
.cl-text { font-size: 13px; color: var(--text2); line-height: 20px; }

/* ── 功能介绍弹卡（对齐安卓 FeatureIntroPanel）── */
.fi-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: flex-end;
}
.fi-panel {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  padding: 20px;
  padding-bottom: calc(20px + var(--safe-bottom));
  display: flex; flex-direction: column;
  max-height: 78vh;
}
.fi-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.fi-title { font-size: 18px; font-weight: 700; color: var(--text); }
.fi-sub { font-size: 12px; color: var(--text-ter); margin-top: 4px; }
.fi-close {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--bg); color: var(--text2);
  font-size: 13px; border: none; cursor: pointer; flex-shrink: 0;
}
.fi-body { overflow-y: auto; display: flex; flex-direction: column; gap: 16px; margin-bottom: 16px; }
.fi-sec-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.fi-sec-title { font-size: 14px; font-weight: 600; color: var(--text); }
.fi-badge { font-size: 10px; font-weight: 600; border-radius: 6px; padding: 3px 7px; }
.fi-item { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.fi-icon {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--accent-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.fi-name { font-size: 14px; font-weight: 600; color: var(--text); }
.fi-desc { font-size: 12px; color: var(--text2); margin-top: 2px; line-height: 1.5; }
.fi-cta {
  height: 48px; border-radius: 12px; border: none;
  background: var(--accent); color: #fff;
  font-size: 15px; font-weight: 600; cursor: pointer; flex-shrink: 0;
}
.fi-cta-done {
  height: 48px; border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  color: var(--accent); font-size: 14px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ── 激活码弹窗（对齐安卓 ActivationDialog）── */
.act-card { max-width: 300px; text-align: center; }
.act-head { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 14px; }
.act-title { font-size: 15px; font-weight: 600; color: var(--text); }
.act-sub { font-size: 11px; color: var(--text2); }
.act-input { text-align: center; letter-spacing: 1px; width: 100%; margin-bottom: 8px; text-transform: uppercase; }
.act-status { font-size: 13px; padding: 4px 0; }
.act-link { display: block; font-size: 12px; color: var(--accent); text-decoration: none; margin: 8px 0 14px; }
.act-submit {
  width: 100%; height: 44px; border-radius: 12px; border: none;
  background: var(--accent); color: #fff;
  font-size: 15px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.act-submit:disabled { opacity: 0.4; cursor: not-allowed; }
.act-cancel {
  width: 100%; height: 40px; border: none; background: transparent;
  color: var(--text2); font-size: 15px; cursor: pointer; margin-top: 4px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}

.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--surface2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══ Toast ═══ */
.toast {
  position: fixed;
  top: calc(60px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--surface2);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  opacity: 0;
  transition: all 0.3s var(--ease);
  z-index: 1000;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ═══ Textarea ═══ */
.textarea {
  height: auto;
  min-height: 80px;
  padding: 12px 16px;
  line-height: 1.5;
  resize: vertical;
}

/* ═══ 弹窗 ═══ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  padding: 24px;
}
.modal-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 320px;
  border: 1px solid var(--card-border);
}
.modal-title { font-size: 17px; font-weight: 600; margin-bottom: 12px; color: var(--text); }
.modal-msg { font-size: 14px; color: var(--text-sec); margin-bottom: 20px; }
.modal-actions { display: flex; gap: 12px; }
.modal-actions .btn { flex: 1; height: 42px; font-size: 15px; }
.modal-cancel { background: var(--surface2); color: var(--text); }
.modal-confirm { background: var(--accent); color: #fff; }

/* ═══ 世界卡片 ═══ */
.world-card { cursor: pointer; }
.world-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.world-type-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--accent-bg);
  color: var(--accent);
}
.world-time { font-size: 11px; color: var(--text-ter); }
.world-name { font-size: 16px; font-weight: 600; margin-bottom: 4px; color: var(--text); }
.world-desc { font-size: 13px; color: var(--text-sec); line-height: 1.5; }

/* ═══ 世界创建 ═══ */
.wc-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.wc-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}
.wc-toggle input { accent-color: var(--accent); width: 16px; height: 16px; }
.wc-progress { text-align: center; padding: 20px; }
.wc-progress-text { color: var(--text-sec); font-size: 14px; }

/* ═══ 世界探索 ═══ */
.wp-status-bar {
  display: flex;
  gap: 14px;
  padding: 8px 16px;
  font-size: 12px;
  color: var(--text-sec);
  border-bottom: 1px solid var(--card-border);
  flex-shrink: 0;
  overflow-x: auto;
  white-space: nowrap;
}
.wp-stat-hp { color: #E05555; }
.wp-stat-mp { color: #4A90E2; }
.wp-stat-gold { color: #E0A63C; }
.wp-stat-xp { color: #5CB882; }
.wp-stat-quest { color: var(--accent); }
.wp-narration {
  padding: 12px 16px;
  margin-bottom: 12px;
  background: var(--narrative);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
  font-size: 15px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}

/* 快捷指令栏 */
.wp-cmdbar {
  display: flex;
  gap: 8px;
  padding: 8px 12px 0;
  flex-shrink: 0;
  overflow-x: auto;
}
.wp-cmd {
  flex-shrink: 0;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text-sec);
  border-radius: 16px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.wp-cmd:active { background: var(--accent-bg); color: var(--accent); border-color: var(--accent-border); }

/* 出发面板 */
.dep-sheet { align-items: flex-end; }
.dep-card {
  width: 100%;
  max-width: 480px;
  background: var(--card);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 24px 20px calc(24px + var(--safe-bottom));
  animation: slideUp 0.3s var(--ease);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.dep-title { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.dep-sub { font-size: 13px; color: var(--text-sec); margin: 12px 0 8px; }
.dep-companions { display: flex; flex-wrap: wrap; gap: 8px; }
.dep-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 6px;
  border-radius: 20px;
  border: 1px solid var(--card-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.dep-chip.active { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); }
.dep-chip-av {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}
.dep-modes { display: flex; flex-direction: column; gap: 8px; }
.dep-mode {
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.dep-mode.active { border-color: var(--accent); background: var(--accent-bg); }
.dep-mode-name { font-size: 14px; font-weight: 600; color: var(--text); }
.dep-mode-desc { font-size: 12px; color: var(--text-sec); margin-top: 2px; }

/* 探索面板 */
.explore-panel { max-width: 340px; padding: 0; overflow: hidden; }
.explore-tabs {
  display: flex;
  border-bottom: 1px solid var(--card-border);
}
.explore-tab {
  flex: 1;
  padding: 12px 0;
  background: none;
  border: none;
  color: var(--text-sec);
  font-size: 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s var(--ease);
}
.explore-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.explore-body { padding: 16px; max-height: 340px; overflow-y: auto; }
.explore-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.explore-stat {
  background: var(--input-bg);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.es-label { font-size: 11px; color: var(--text-sec); }
.es-val { font-size: 15px; font-weight: 600; color: var(--text); }
.explore-sub { font-size: 12px; color: var(--text-sec); margin: 14px 0 6px; }
.explore-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  font-size: 14px;
  color: var(--text);
}
.explore-row.block { align-items: flex-start; }

/* ═══ 我的页 ═══ */
.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
}
.profile-avatar {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}
.profile-info { flex: 1; }
.profile-email { font-size: 15px; font-weight: 600; color: var(--text); }
.profile-badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 4px;
  background: var(--surface2);
  color: var(--text-sec);
}
.profile-badge.active {
  background: var(--accent-bg);
  color: var(--accent);
}
/* V 徽章（对齐安卓：高级版金色 V，未激活灰色） */
.profile-v {
  font-size: 20px;
  font-weight: 900;
  color: var(--text2);
  opacity: 0.5;
  flex-shrink: 0;
}
.profile-v.gold { color: #FFD700; opacity: 1; }
/* 编辑资料按钮 */
.profile-edit {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--surface2);
  color: var(--text2);
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
}
/* 开关（自动同步等） */
.toggle {
  display: inline-block;
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: var(--surface2);
  position: relative;
  transition: background 0.2s var(--ease);
  vertical-align: middle;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text2);
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}
.toggle.on { background: var(--accent); }
.toggle.on::after { transform: translateX(18px); background: #fff; }

/* ═══ 消息菜单 ═══ */
.msg-menu-item {
  padding: 12px 16px;
  font-size: 15px;
  cursor: pointer;
  border-radius: 8px;
  color: var(--text);
}
.msg-menu-item:active { background: var(--surface2); }
.msg-menu-item.danger { color: var(--danger); }

/* ═══ 主题选择 ═══ */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.theme-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.theme-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.theme-item.active .theme-dot { border-color: var(--text); }
.theme-name { font-size: 11px; color: var(--text-sec); }

/* 主题页（大卡片预览） */
.theme-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.theme-card {
  border: 2px solid var(--card-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.25s var(--ease), transform 0.15s var(--ease);
  background: var(--card);
}
.theme-card:active { transform: scale(0.97); }
.theme-card.active { border-color: var(--accent); }
.theme-card.locked { opacity: 0.75; }
.theme-preview {
  position: relative;
  height: 92px;
  padding: 10px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tp-bubble {
  align-self: flex-start;
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 10px 3px 10px 10px;
  max-width: 70%;
}
.tp-bubble.right {
  align-self: flex-end;
  border-radius: 3px 10px 10px 10px;
}
.tp-dot {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.theme-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
}
.theme-meta .theme-name { font-size: 13px; color: var(--text); font-weight: 600; }
.theme-lock { font-size: 11px; color: var(--text-sec); }
.theme-using { font-size: 11px; color: var(--accent); font-weight: 600; }

/* 字体大小 */
.font-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px;
}
.font-slider-row input[type="range"] {
  accent-color: var(--accent);
}
.font-preview {
  margin-top: 12px;
  padding: 14px;
  background: var(--ai-bubble);
  color: var(--text);
  border-radius: var(--radius-sm);
}

/* ═══ 捏球台 ═══ */
.sculpt-page { display: flex; flex-direction: column; height: 100%; }
.sculpt-canvas-wrap { flex: 1; position: relative; overflow: hidden; }
.sculpt-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-ter);
  font-size: 13px;
  line-height: 2;
  pointer-events: none;
  padding: 0 40px;
}
.sculpt-bar {
  display: flex;
  gap: 10px;
  padding: 12px 16px calc(12px + var(--safe-bottom));
  flex-shrink: 0;
}
.sculpt-pill {
  flex: 1;
  padding: 12px 0;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}
.sculpt-pill.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
  font-weight: 600;
}
/* 底部编辑面板（同窗口叠层） */
.sculpt-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: flex-end;
  z-index: 100;
}
.sculpt-panel {
  width: 100%;
  max-height: 78%;
  overflow-y: auto;
  background: var(--card);
  border-radius: 20px 20px 0 0;
  padding: 20px 20px calc(20px + var(--safe-bottom));
  animation: panel-up 0.22s var(--ease);
}
@keyframes panel-up { from { transform: translateY(40%); opacity: 0.4; } to { transform: translateY(0); opacity: 1; } }
.panel-title { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.panel-sub { font-size: 12px; color: var(--text-sec); line-height: 1.6; margin-bottom: 12px; }
.panel-actions { display: flex; gap: 10px; margin-top: 16px; }
.panel-actions .btn { flex: 1; }
.btn-ghost.danger { color: var(--danger); border-color: var(--danger); }
.dim-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.dim-chip {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface2);
  color: var(--text-sec);
  cursor: pointer;
  border: 1px solid transparent;
}
.dim-chip:active { border-color: var(--accent); color: var(--accent); }
.dim-chip.chip-on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ═══ 世界探索 · 战斗骰子 / 商店 / 关系 ═══ */
.wp-dicebar {
  display: flex;
  gap: 8px;
  padding: 8px 14px;
  overflow-x: auto;
  flex-shrink: 0;
  z-index: 5;
  position: relative;
}
.dice-chip {
  flex-shrink: 0;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--text-sec);
  white-space: nowrap;
  animation: panel-up 0.2s var(--ease);
}
.dice-chip.crit { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.dice-chip.hit { border-color: var(--accent); color: var(--accent); }
.dice-chip.miss { opacity: 0.55; }
.dice-chip.ehit { border-color: var(--danger); color: var(--danger); }
.dice-chip.emiss { opacity: 0.55; }

.shop-buy {
  flex-shrink: 0;
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}
.shop-buy:active { background: var(--accent); color: #FFFFFF; }

.res-remove {
  flex-shrink: 0;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--danger);
  background: transparent;
  color: var(--danger);
  cursor: pointer;
}
.res-remove:active { background: var(--danger); color: #FFFFFF; }

.quest-type {
  display: inline-block;
  font-size: 10px;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text2);
  font-weight: 400;
  vertical-align: middle;
}

.rel-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--surface2);
  overflow: hidden;
  margin-top: 6px;
}
.rel-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s var(--ease);
}

/* ═══ 我的页 · 账号星图 ═══ */
.profile-chart-wrap {
  position: relative;
  height: 300px;
  margin: 4px 0 12px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--card-border);
}
.profile-chart-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  text-align: center;
  font-size: 11px;
  color: var(--text-ter);
  pointer-events: none;
}

/* ═══ 发现世界（对齐安卓 DiscoverWorldsScreen）═══ */
.dw-searchbar { padding: 8px 16px 0; flex-shrink: 0; }
.dw-search { width: 100%; border-radius: 14px; }
.dw-chips-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; flex-shrink: 0;
}
.dw-chips { display: flex; gap: 8px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.dw-chips::-webkit-scrollbar { display: none; }
.dw-chip {
  font-size: 13px; padding: 6px 14px; border-radius: 10px;
  border: 1px solid var(--card-border); background: var(--card);
  color: var(--text-sec); cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.dw-chip.active {
  background: var(--accent-dim);
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  color: var(--accent);
}
.dw-count { font-size: 12px; color: var(--text-ter); flex-shrink: 0; }

.dw-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  padding: 4px 16px 20px;
}
.dw2-card {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 16px; padding: 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.dw2-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.dw2-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: rgba(255,255,255,0.92);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; flex-shrink: 0;
}
.dw2-name {
  font-size: 14px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0;
}
.dw2-genre {
  font-size: 9px; color: var(--accent);
  background: var(--accent-dim);
  border-radius: 5px; padding: 2px 5px; flex-shrink: 0;
}
.dw2-desc {
  font-size: 11px; color: var(--text-sec); line-height: 16px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.dw2-meta { font-size: 10px; color: var(--text-ter); }
.dw2-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.dw2-like {
  border: none; background: transparent; cursor: pointer;
  font-size: 11px; color: var(--text-sec); padding: 4px 6px; border-radius: 8px;
}
.dw2-like.liked { color: #FF6B8A; background: rgba(255,107,138,0.1); }
.dw2-import {
  height: 28px; border: none; border-radius: 8px;
  background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 600; padding: 0 12px; cursor: pointer;
}
.dw2-import:disabled { opacity: 0.5; }
.dw-panel-like { border: 1px solid var(--card-border); color: var(--text-sec); }
.dw-panel-like.liked {
  background: rgba(255,107,138,0.12);
  border-color: rgba(255,107,138,0.5);
  color: #FF6B8A;
}

/* ═══ 我的页（对齐安卓 ProfileScreen）═══ */
.pf-scroll { padding: 0 0 calc(16px + var(--safe-bottom)) 0; }
.pf-title {
  font-size: 24px; font-weight: 700; color: var(--text);
  padding: 18px 16px 10px; flex-shrink: 0;
}

/* 账号栏 */
.pf-account { display: flex; align-items: center; gap: 14px; padding: 6px 16px 16px; }
.pf-avatar {
  width: 64px; height: 64px; border-radius: 16px; flex-shrink: 0;
  background: var(--green-bg); color: var(--green);
  font-size: 26px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; cursor: pointer;
}
.pf-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pf-ainfo { flex: 1; min-width: 0; }
.pf-name-row { display: flex; align-items: center; gap: 6px; }
.pf-nick {
  font-size: 16px; font-weight: 600; color: var(--text);
  max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pf-edit { font-size: 12px; color: var(--text-ter); cursor: pointer; padding: 4px 2px; }
.pf-email {
  font-size: 12px; color: var(--text-sec); margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pf-badges { display: flex; gap: 8px; flex-shrink: 0; }
.pf-badge {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.pf-badge-v { background: rgba(255,215,0,0.20); }
.pf-badge-v .pf-badge-ico { font-size: 22px; font-weight: 800; color: #FFD700; line-height: 1; }
.pf-badge-v .pf-badge-cap { font-size: 10px; color: #FFD700; }
.pf-badge-p { background: var(--green-bg); }
.pf-badge-p .pf-badge-ico { font-size: 20px; line-height: 1; }
.pf-badge-p .pf-badge-cap { font-size: 10px; color: var(--green); }
.pf-badge-off { background: var(--card-border); cursor: pointer; }
.pf-badge-off .pf-badge-ico { font-size: 22px; font-weight: 800; color: var(--text-ter); line-height: 1; }
.pf-badge-off .pf-badge-cap { font-size: 10px; color: var(--text-sec); }

/* 未登录行 */
.pf-login-row {
  display: flex; align-items: center; gap: 12px;
  margin: 0 16px 16px; padding: 14px;
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 16px; cursor: pointer;
}
.pf-login-ava {
  width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0;
  background: var(--card-border); color: var(--text-sec);
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.pf-login-t { font-size: 16px; font-weight: 600; color: var(--text); }
.pf-login-s { font-size: 12px; color: var(--text-sec); margin-top: 2px; }
.pf-login-arrow { font-size: 20px; color: var(--text-ter); }

/* 身份管理横条 */
.pf-section-label {
  font-size: 12px; font-weight: 600; color: var(--text-ter);
  padding: 2px 16px 8px;
}
.pf-ids {
  display: flex; gap: 14px; overflow-x: auto;
  padding: 0 16px 16px; scrollbar-width: none;
}
.pf-ids::-webkit-scrollbar { display: none; }
.pf-id {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  flex-shrink: 0; cursor: pointer; user-select: none; -webkit-user-select: none;
}
.pf-id-ball {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700;
  background: var(--card); border: 1px solid var(--card-border); color: var(--text);
}
.pf-id.active .pf-id-ball {
  background: var(--green-bg); border-color: var(--green-border); color: var(--green);
}
.pf-id-name {
  font-size: 10px; color: var(--text-sec);
  max-width: 60px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pf-id-add .pf-id-ball {
  background: transparent; border: 1.5px dashed var(--green-border);
  color: var(--green); font-size: 24px; font-weight: 400;
}

/* 高频设置卡 */
.pf-card {
  margin: 0 16px 16px;
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 16px; overflow: hidden;
}
.pf-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 16px; min-height: 48px; cursor: pointer;
}
.pf-row + .pf-row { border-top: 1px solid var(--card-border); }
.pf-row-label {
  font-size: 14px; color: var(--text);
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.pf-row-sub { font-size: 11px; color: var(--text-ter); font-weight: 400; }
.pf-row-end {
  font-size: 14px; color: var(--text-ter);
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
  max-width: 45%; white-space: nowrap; overflow: hidden;
}

/* 同步进度 */
.pf-progress { padding: 10px 16px 14px; border-top: 1px solid var(--card-border); }
.pf-progress-head {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-sec); margin-bottom: 6px;
}
.pf-bar { height: 4px; border-radius: 2px; background: var(--green-bg); overflow: hidden; }
.pf-bar-fill { height: 100%; width: 0%; background: var(--green); border-radius: 2px; transition: width 0.2s; }

/* 退出登录 */
.pf-logout {
  margin: 0 16px 16px; height: 48px; border-radius: 14px;
  background: var(--red-bg); border: 1px solid rgba(224,85,85,0.30);
  color: var(--danger); font-size: 14px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.pf-footer { text-align: center; font-size: 12px; color: var(--text-ter); padding: 6px 0 18px; }

/* 小球形态：账号星图 */
.pf-chart-wrap { flex: 1; min-height: 380px; position: relative; margin: 0 8px; }

/* 版本更新弹窗：更新日志 */
.upd-log {
  max-height: 160px; overflow-y: auto;
  background: var(--bg); border: 1px solid var(--card-border);
  border-radius: 10px; padding: 10px 12px;
  font-size: 12px; line-height: 1.6; color: var(--text-sec);
  white-space: pre-wrap; margin-bottom: 10px;
}

/* ═══ 首页（对齐安卓 ChatListScreen）═══ */
.home-greet { padding: 20px 16px 8px 20px; flex-shrink: 0; }
.home-greet-hi { font-size: 26px; font-weight: 700; color: var(--text); }
.home-greet-sub { font-size: 14px; color: var(--text-ter); margin-top: 2px; }
.home-empty-btn { margin-top: 20px; width: auto; padding: 10px 22px; }
.home-chart-empty {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  text-align: center; line-height: 22px;
  font-size: 14px; color: var(--text-ter);
  padding: 0 32px;
}

/* +球：创建角色入口（形态是球、本质是按钮，对齐安卓 AddBall）*/
.add-ball {
  position: absolute; right: 20px; bottom: 20px;
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--surface);
  border: 2px dashed var(--accent);
  color: var(--accent);
  font-size: 26px; font-weight: 400; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
  opacity: 0.9;
}
.add-ball:active { transform: scale(0.94); }

/* ═══ 角色卡 / 对话操作卡（底部弹卡，对齐安卓 CharacterCardPanel / MoonActionPanel）═══ */
.charcard-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: flex-end;
}
.charcard-panel {
  width: 100%; max-height: 82vh; overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 20px 20px 0 0;
  padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
  animation: sheet-up 0.22s ease-out;
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0.6; } to { transform: translateY(0); opacity: 1; } }

.charcard-head { display: flex; align-items: center; gap: 12px; }
.charcard-avatar {
  width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent); color: rgba(255,255,255,0.92);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700;
}
.charcard-headinfo { flex: 1; min-width: 0; }
.charcard-name {
  font-size: 18px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.charcard-meta { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.charcard-lv {
  font-size: 11px; font-weight: 600; color: var(--accent);
  background: var(--accent-dim);
  border-radius: 6px; padding: 3px 7px;
}
.charcard-count { font-size: 11px; color: var(--text-ter); }
.charcard-desc {
  font-size: 13px; color: var(--text-sec); line-height: 20px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.charcard-moons {
  max-height: 150px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
}
.charcard-moon {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border-radius: 10px; cursor: pointer;
}
.charcard-moon:active { background: var(--accent-dim); }
.charcard-moon-dot {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-dim); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
}
.charcard-moon-title {
  flex: 1; min-width: 0; font-size: 13px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.charcard-moon-latest { font-size: 10px; color: var(--accent); flex-shrink: 0; }
.charcard-btns { display: flex; flex-direction: column; gap: 10px; }
.charcard-row2 { display: flex; gap: 10px; }
.charcard-btn {
  flex: 1; height: 46px; border-radius: 12px;
  background: var(--bg); border: 1px solid var(--card-border);
  color: var(--text-sec); font-size: 14px; font-weight: 600;
  cursor: pointer;
}
.charcard-btn.disabled { color: var(--text-ter); }
.charcard-btn.charcard-del {
  background: var(--danger-dim, rgba(255,107,138,0.08));
  border-color: rgba(255,107,138,0.35);
  color: var(--danger);
}
.charcard-btn.charcard-primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
}

/* 对话操作卡（长按对话珠）*/
.moonpanel { gap: 0; }
.moonpanel-head { display: flex; align-items: center; gap: 10px; }
.moonpanel-dot {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-dim); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
}
.moonpanel-title {
  font-size: 15px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.moonpanel-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 6px; border-radius: 10px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--text);
}
.moonpanel-row.danger { color: var(--danger); }
.moonpanel-ico { font-size: 18px; width: 20px; text-align: center; }
.moonpanel-divider { height: 1px; background: var(--card-border); margin: 0 6px; opacity: 0.5; }

/* ═══ 世界页头部（对齐安卓 WorldListScreen）═══ */
.worlds-title {
  font-size: 24px; font-weight: 700; color: var(--text);
  padding: 8px 16px 0 20px; flex-shrink: 0;
}
.worlds-actions {
  display: flex; gap: 12px;
  padding: 6px 16px; height: 60px; flex-shrink: 0;
  box-sizing: border-box;
}
.worlds-act {
  flex: 1; height: 48px; border-radius: 14px;
  background: var(--card-border); color: var(--text);
  border: 1px solid var(--card-border);
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.worlds-act:active { opacity: 0.85; }


/* ═══ 荣誉墙 ═══ */
.hn-avatar { width: 80px; height: 80px; border-radius: 50%; background: var(--surface2); margin: 0 auto; display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 700; color: var(--accent); }
.hn-level-chip { display: inline-block; background: rgba(92,184,130,.12); color: var(--accent); font-size: 12px; padding: 4px 12px; border-radius: 999px; margin-top: 8px; }
.hn-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 4px 16px 24px; }
.hn-badge { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 12px 4px 10px; background: var(--surface2); border-radius: 14px; opacity: .55; }
.hn-badge.earned { opacity: 1; box-shadow: 0 0 12px rgba(255,193,7,.25); }
.hn-icon { font-size: 30px; line-height: 1; }
.hn-level { color: #fff; font-size: 9px; font-weight: 700; padding: 1px 8px; border-radius: 999px; margin-top: 5px; }
.hn-lock { color: var(--text2); font-size: 9px; margin-top: 5px; }
.hn-name { font-size: 12px; font-weight: 600; margin-top: 6px; color: var(--text); }
.hn-desc { font-size: 9px; line-height: 1.5; color: var(--text2); margin-top: 2px; }

/* ═══ 我的页 · 荣誉行 / 佩戴槽 ═══ */
.pf-honor-row { display: flex; align-items: center; justify-content: space-between; margin: 10px 16px 0; padding: 10px 14px; background: var(--surface2); border-radius: 12px; color: var(--text); font-size: 13px; cursor: pointer; }
.pf-worn-row { display: flex; gap: 10px; margin: 8px 16px 0; }
.pf-worn-slot { flex: 1; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.worn-filled { background: var(--surface2); box-shadow: 0 0 8px rgba(255,193,7,.3); }
.worn-empty { background: var(--surface1); border: 1px dashed var(--text2); color: var(--text2); font-size: 16px; }

/* ═══ 我的页 · 消耗统计 ═══ */
.pf-usage-card { display: flex; align-items: center; margin: 14px 16px 0; padding: 12px 0; background: var(--surface2); border-radius: 14px; }
.pf-usage-cell { flex: 1; text-align: center; }
.pf-usage-num { font-size: 16px; font-weight: 700; color: var(--text); }
.pf-usage-label { font-size: 11px; color: var(--text2); margin-top: 2px; }
.pf-usage-div { width: 1px; height: 24px; background: var(--border); }

/* ═══ 佩戴选择器 ═══ */
.worn-picker-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 4px 0; }
.worn-pick { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 4px; background: var(--surface2); border-radius: 12px; cursor: pointer; }
.worn-pick.picked { outline: 2px solid var(--accent); }

/* ═══ 使用日历 ═══ */
.cal-card { max-width: 92vw; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-top: 8px; }
.cal-week { text-align: center; font-size: 10px; color: var(--text2); padding: 4px 0; }
.cal-cell { min-height: 40px; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--surface1); }
.cal-cell.empty { background: transparent; }
.cal-cell.has { background: rgba(92,184,130,.14); }
.cal-day { font-size: 12px; color: var(--text); }
.cal-info { font-size: 8px; color: var(--accent); line-height: 1.2; }
.cal-info.dim { color: var(--text2); }

/* ═══ 头像选择（身份/角色通用圆形）═══ */
.av-pick {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent-bg); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; flex-shrink: 0;
  overflow: hidden; cursor: pointer;
}
.av-pick img { width: 100%; height: 100%; object-fit: cover; }

/* ═══ 我的页 · 对齐安卓 ProfileScreen ═══ */
.pf-title { font-size: 24px; font-weight: 700; padding: 12px 20px 8px; color: var(--text); }
.pf-account { display: flex; align-items: center; gap: 14px; padding: 8px 20px; }
.pf-avatar { width: 64px; height: 64px; border-radius: 16px; background: var(--green-bg); display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; color: var(--green); overflow: hidden; flex-shrink: 0; cursor: pointer; }
.pf-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pf-ainfo { flex: 1; min-width: 0; }
.pf-name-row { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.pf-nick { font-weight: 700; font-size: 17px; color: var(--text); }
.pf-name-arrow { font-size: 14px; color: var(--text2); }
.pf-email { font-size: 12px; color: var(--text2); margin-top: 2px; }
.pf-unlock { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.pf-unlock-v { width: 52px; height: 52px; border-radius: 14px; background: var(--border); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 900; color: var(--text-ter); }
.pf-unlock-t { font-size: 10px; color: var(--text2); }
.pf-worn-row { display: flex; gap: 6px; }
.pf-worn-slot { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; cursor: pointer; }
.worn-filled { background: var(--card); box-shadow: 0 0 8px rgba(255,193,7,.3); }
.worn-empty { background: var(--input-bg); border: 1px dashed var(--text-ter); color: var(--text2); font-size: 15px; }

/* 横条卡（荣誉入口/资产/消耗，对齐安卓 Surface shadowElevation=1） */
.pf-card-x { display: flex; align-items: center; gap: 10px; margin: 10px 16px 0; padding: 14px 16px; background: var(--card); border-radius: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.25); cursor: pointer; }
.pf-cardx-emoji { font-size: 20px; }
.pf-cardx-main { flex: 1; min-width: 0; }
.pf-cardx-title { font-size: 14px; font-weight: 600; color: var(--text); }
.pf-cardx-sub { font-size: 11px; color: var(--text2); margin-top: 1px; }
.pf-cardx-go { font-size: 12px; color: var(--green); font-weight: 600; }

/* 资产/消耗 四列 */
.pf-assets { display: flex; align-items: center; width: 100%; padding: 2px 0; }
.pf-asset { flex: 1; text-align: center; }
.pf-asset-num { font-size: 15px; font-weight: 700; color: var(--text); }
.pf-asset-label { font-size: 11px; color: var(--text2); margin-top: 2px; }
.pf-asset-div { width: 1px; height: 26px; background: var(--border); }

/* 常用功能宫格（4 列，对齐安卓 MeTile） */
.pf-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 0 16px; }
.pf-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 0 10px; background: var(--card); border-radius: 14px; cursor: pointer; position: relative; }
.pf-tile-icon { font-size: 22px; }
.pf-tile-label { font-size: 11px; color: var(--text-sec); }
.pf-tile-toggle { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.pf-tile-toggle.on { background: var(--green); box-shadow: 0 0 4px var(--green); }

/* 身份 4 列瓦片（对齐安卓 IdentityTile） */
.pf-idgrid { padding: 4px 16px 0; }
.pf-idrow { display: flex; gap: 10px; margin-bottom: 12px; }
.pf-id-tile { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; cursor: pointer; }
.pf-id-tile-av { width: 46px; height: 46px; border-radius: 14px; background: var(--input-bg); display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; color: var(--text-sec); overflow: hidden; border: 1px solid var(--border); }
.pf-id-tile-av img { width: 100%; height: 100%; object-fit: cover; }
.pf-id-tile-av.add { color: var(--text-ter); font-size: 20px; border-style: dashed; }
.pf-id-tile.active .pf-id-tile-av { border-color: var(--green); color: var(--green); box-shadow: 0 0 6px rgba(92,184,130,.3); }
.pf-id-tile-name { font-size: 11px; color: var(--text2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 显示区（字体滑杆 + 联网搜索） */
.pf-row-inline { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; }
.pf-fontsize { font-size: 14px; color: var(--text2); }
.pf-slider { width: 100%; accent-color: var(--green); margin: 6px 0 2px; }
.pf-slider-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--text2); }
.pf-hr { height: 1px; background: var(--border); margin: 12px 0 8px; }
.pf-toggle { width: 44px; height: 26px; border-radius: 999px; background: var(--border); position: relative; cursor: pointer; transition: background .3s var(--ease); flex-shrink: 0; }
.pf-toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .3s var(--ease); }
.pf-toggle.on { background: var(--green); }
.pf-toggle.on::after { left: 21px; }

/* 退出 / 版本 */
.pf-logout { width: calc(100% - 32px); margin: 14px 16px 0; height: 48px; border-radius: 14px; background: var(--red-bg); border: 1px solid rgba(224,85,85,.3); color: var(--danger); font-size: 15px; font-weight: 600; cursor: pointer; }
.pf-version { text-align: center; font-size: 12px; color: var(--text-ter); margin: 24px 0 40px; }

/* ═══ 账号档案页 · 对齐安卓 AccountProfileScreen ═══ */
.ap-avatar-wrap { position: relative; }
.ap-avatar { width: 96px; height: 96px; border-radius: 50%; background: var(--green-bg); display: flex; align-items: center; justify-content: center; font-size: 36px; font-weight: 700; color: var(--green); overflow: hidden; }
.ap-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ap-crown { position: absolute; bottom: 0; right: 0; font-size: 20px; }
.ap-founder { font-size: 11px; color: #FFD700; background: rgba(255,215,0,.15); padding: 3px 8px; border-radius: 8px; font-weight: 600; }
.ap-honor { display: inline-block; margin-top: 8px; font-size: 13px; color: var(--green); background: rgba(92,184,130,.12); padding: 6px 14px; border-radius: 12px; font-weight: 600; cursor: pointer; }
.ap-card { margin: 10px 20px 0; padding: 16px 20px; background: var(--card); border: 1px solid var(--border); border-radius: 18px; }
.ap-stat { flex: 1; text-align: center; }
.ap-stat-num { font-size: 18px; font-weight: 700; color: var(--text); }
.ap-stat-label { font-size: 12px; color: var(--text2); margin-top: 2px; }
.ap-big { flex: 1; text-align: center; }
.ap-big-num { font-size: 24px; font-weight: 700; color: var(--green); }
.ap-big-label { font-size: 11px; color: var(--text2); margin-top: 2px; }
.ap-hr-line { height: 1px; background: var(--border); margin: 14px 20px; }
.ap-token-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; color: var(--text); }
.ap-token-val { font-weight: 700; color: var(--green); }

/* ═══ 荣誉墙 · 对齐安卓 HonorWallScreen（覆盖微调）═══ */
.hn-avatar { width: 88px; height: 88px; background: var(--green-bg); color: var(--green); font-size: 34px; }
.hn-level-chip { background: rgba(92,184,130,.12); color: var(--green); }
.hn-grid { gap: 12px 12px; }

/* ═══ 首页 · 对齐安卓 ChatListScreen 微调 ═══ */
.conv-item { margin-bottom: 0; border-radius: 0; border: none; border-bottom: 1px solid var(--card-border); }
.conv-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }

/* ═══ 聊天页 · 对齐安卓 ChatScreen 微调 ═══ */
.msg-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* ═══ 回复设置页 · 对齐安卓 ReplySettingsScreen ═══ */
.rs-avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--green-bg); color: var(--green); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; overflow: hidden; flex-shrink: 0; }
.rs-avatar img { width: 100%; height: 100%; object-fit: cover; }
.rs-label { font-size: 13px; font-weight: 600; color: var(--text2); padding: 4px 4px 8px; }
.rs-card { background: var(--card); border-radius: 14px; margin-bottom: 18px; overflow: hidden; }
.rs-opt { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; font-size: 14px; color: var(--text); cursor: pointer; border-bottom: 1px solid var(--card-border); }
.rs-opt:last-child { border-bottom: none; }
.rs-opt.on { color: var(--green); font-weight: 600; }
.rs-check { color: var(--green); font-weight: 700; }

/* ═══ 使用教程页 · 对齐安卓 TutorialScreen ═══ */
.tu-step { margin-bottom: 18px; }
.tu-title { font-size: 14px; font-weight: 700; color: var(--text); padding: 0 4px 8px; }
.tu-card { background: var(--card); border-radius: 14px; padding: 6px 0; }
.tu-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 16px; font-size: 13px; color: var(--text-sec); line-height: 1.6; border-bottom: 1px solid var(--card-border); }
.tu-item:last-child { border-bottom: none; }
.tu-num { width: 20px; height: 20px; border-radius: 50%; background: var(--green-bg); color: var(--green); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }

/* ═══ 身份进阶画像 ═══ */
.id-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.id-profile-item { position: relative; background: var(--surface2); border-radius: 12px; padding: 10px; margin-bottom: 8px; }
.id-profile-del { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border: none; border-radius: 50%; background: var(--red-bg); color: var(--danger); font-size: 11px; cursor: pointer; }

/* ═══ 捏球台模板面板 ═══ */
.tpl-list { max-height: 320px; overflow-y: auto; }
.tpl-item { padding: 12px 14px; border-radius: 12px; background: var(--surface2); margin-bottom: 8px; cursor: pointer; }
.tpl-name { font-size: 14px; font-weight: 600; color: var(--text); }
.tpl-desc { font-size: 12px; color: var(--text2); margin-top: 2px; }

/* ═══ 世界模板 chips ═══ */
.tpl-chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ═══ 世界捏球台（对齐安卓 CreateWorldScreen）═══ */
.wc-method { display: flex; gap: 8px; margin-bottom: 14px; }
.wc-sculpt-wrap { position: relative; height: 340px; background: var(--surface1); border-radius: 16px; overflow: hidden; margin-bottom: 12px; }
.wc-sculpt-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; line-height: 22px; font-size: 13px; color: var(--text-ter); pointer-events: none; }
.wc-systems { margin-bottom: 10px; }

/* ═══ 角色列表 · 对齐安卓 RoleGridScreen（4列瓦片 + 无遮罩详情卡）═══ */
.rg-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 12px; }
.rg-title { font-size: 24px; font-weight: 700; color: var(--text); }
.rg-create-btn { border: none; background: var(--accent-bg); color: var(--accent); font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 10px; cursor: pointer; }
.rg-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 4px 16px; }
.rg-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; }
.rg-avatar { width: 100%; aspect-ratio: 1; border-radius: 14px; background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; color: var(--text-sec); overflow: hidden; }
.rg-avatar img { width: 100%; height: 100%; object-fit: cover; }
.rg-name { font-size: 11px; color: var(--text2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rg-overlay { position: fixed; inset: 0; z-index: 500; display: flex; align-items: flex-end; justify-content: center; }
.rg-detail { width: 86%; max-width: 340px; background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 18px 16px; margin-bottom: 24px; box-shadow: 0 8px 28px rgba(0,0,0,.4); }
.rg-detail-head { display: flex; align-items: center; gap: 12px; }
.rg-detail-avatar { width: 62px; height: 62px; border-radius: 16px; background: var(--green-bg); color: var(--green); display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; overflow: hidden; flex-shrink: 0; }
.rg-detail-avatar img { width: 100%; height: 100%; object-fit: cover; }
.rg-detail-name { font-size: 18px; font-weight: 700; color: var(--text); }
.rg-detail-sub { font-size: 12px; color: var(--text2); margin-top: 2px; }
.rg-close { border: none; background: none; color: var(--text2); font-size: 16px; cursor: pointer; padding: 4px; }
.rg-detail-desc { font-size: 13px; color: var(--text-sec); line-height: 1.6; margin: 12px 0 14px; }
.rg-detail-actions { display: flex; flex-direction: column; gap: 8px; }
.rg-row2 { display: flex; gap: 8px; }
.rg-btn { flex: 1; height: 40px; border: none; border-radius: 12px; background: var(--surface2); color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; }
.rg-btn.primary { background: var(--accent); color: #fff; }
.rg-btn.danger { color: var(--danger); }

/* ═══ 世界列表 · 对齐安卓 WorldListScreen（3列瓦片）═══ */
.wl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 4px 0 24px; }
.wl-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 4px 10px; background: var(--card); border-radius: 14px; cursor: pointer; }
.wl-emoji { font-size: 28px; }
.wl-name { font-size: 12px; font-weight: 600; color: var(--text); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-type { font-size: 10px; color: var(--text2); }

/* ═══ 登录页 · 对齐安卓 LoginScreen ═══ */
.login-logo { font-size: 56px; font-weight: 300; display: flex; align-items: center; justify-content: center; gap: 4px; }
.login-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* ═══ 主题页 · 自定义主色 ═══ */
.accent-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.accent-swatch { height: 44px; border-radius: 12px; cursor: pointer; border: 2px solid transparent; }
.accent-swatch.on { border-color: var(--text); box-shadow: 0 0 6px rgba(0,0,0,.3); }
.accent-now { width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--border); }

/* ═══ 设置页 · 默认回复设置 ═══ */
.rd-group { margin-bottom: 12px; }
.rd-label { font-size: 12px; font-weight: 600; color: var(--text2); margin-bottom: 6px; }

/* ═══ 聊天页 · 用户消息头像（对齐安卓：右侧身份头像）═══ */
.msg-avatar.user { border-radius: 50%; margin-left: 8px; }
.msg-row.user .msg-bubble { order: -1; }

/* ═══ 主题页 · 我的色卡（对齐安卓 ColorCardView）═══ */
.ccard-list { display: flex; flex-direction: column; gap: 10px; }
.ccard-card {
  border: 2px solid var(--border); border-radius: 14px; overflow: hidden;
  cursor: pointer; transition: border-color .2s; background: var(--card);
}
.ccard-card.on { border-color: var(--accent); }
.ccard-strip { display: flex; height: 44px; }
.ccard-strip span { flex: 1; }
.ccard-name {
  padding: 8px 12px; font-size: 13px; color: var(--text);
  display: flex; align-items: center; justify-content: space-between;
}
.ccard-using { color: var(--accent); font-size: 12px; }

/* ═══ 主题页 · 一键生成协调主题 ═══ */
.gen-dark-row { display: flex; gap: 6px; }
.gen-chip { height: 32px; padding: 0 14px; font-size: 13px; }
.gen-chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
#gen-preview span { transition: background .2s; }

/* ═══ 流动渐变背景（对齐安卓 FlowingGradient：柔和流动，非 WebGL）═══ */
@keyframes ling-flow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.ambiance-flow {
  background: linear-gradient(120deg, var(--accent2-bg), var(--accent), var(--accent2-bg));
  background-size: 300% 300%;
  animation: ling-flow 8s ease-in-out infinite;
}
