/* ============ 全局样式 ============ */
:root {
  --bg-primary: #1f151d;
  --bg-secondary: #291c25;
  --bg-chat: #181117;
  --bg-user-bubble: #c75b8a;
  --bg-ai-bubble: #35242f;
  --bg-input: #21161e;
  --bg-hover: #2e212b;
  --text-primary: #f0e4ec;
  --text-secondary: #b89eae;
  --text-muted: #786370;
  --border-color: rgba(255, 255, 255, 0.06);
  --accent: #c75b8a;
  --accent-hover: #d86e9a;
  --accent-glow: rgba(199, 91, 138, 0.18);
  --danger: #d4565e;
  --radius: 10px;
  --radius-lg: 16px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-width: 260px;
  --panel-max: 860px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, #3d1230 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, #2a0d20 0%, transparent 50%),
    radial-gradient(ellipse 50% 40% at 20% 20%, #1f0d18 0%, transparent 50%),
    #0e060a;
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
}

/* 背景星点 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 15%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 25% 35%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1.5px 1.5px at 40% 60%, rgba(255,255,255,0.35), transparent),
    radial-gradient(1px 1px at 55% 20%, rgba(255,255,255,0.25), transparent),
    radial-gradient(1px 1px at 70% 75%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1.5px 1.5px at 85% 45%, rgba(255,255,255,0.35), transparent),
    radial-gradient(1px 1px at 15% 80%, rgba(255,255,255,0.2), transparent),
    radial-gradient(1px 1px at 60% 10%, rgba(255,255,255,0.25), transparent),
    radial-gradient(1px 1px at 90% 90%, rgba(255,255,255,0.2), transparent),
    radial-gradient(1.5px 1.5px at 35% 45%, rgba(255,255,255,0.3), transparent);
  pointer-events: none;
  z-index: 0;
}

/* ============ 布局 ============ */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ============ 页面系统 ============ */
.page {
  display: none;
  flex: 1;
}

.page.active {
  display: flex;
  flex-direction: column;
}

/* 聊天页 - 悬浮面板，模仿桌面端聊天窗口 */
.page-chat.active {
  display: flex;
  flex-direction: row;
  flex: none;
  height: calc(100vh - 56px - 48px); /* 减去导航栏 + 上下各24px间距 */
  overflow: hidden;
  position: relative;
  max-width: var(--panel-max);
  margin: 24px auto;
  width: 100%;
  border-radius: 20px;
  background: var(--bg-chat);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow:
    0 0 80px rgba(199, 91, 138, 0.08),
    0 0 200px rgba(0, 0, 0, 0.5),
    0 24px 64px rgba(0, 0, 0, 0.4);
}

/* ============ 侧边栏（滑出覆盖层）============ */
.sidebar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-primary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 20;
  transform: translateX(0);
  transition: transform var(--transition);
  border-radius: 20px 0 0 20px;
}

.sidebar.collapsed {
  transform: translateX(-100%);
}

.sidebar-header {
  padding: 20px 16px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo {
  font-size: 28px;
  line-height: 1;
}

.logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.logo-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.btn-close-sidebar {
  opacity: 0.5;
}
.btn-close-sidebar:hover {
  opacity: 1;
}

.btn-new-chat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: calc(100% - 24px);
  margin: 0 12px 12px;
  padding: 10px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}

.btn-new-chat:hover {
  background: var(--accent-hover);
}

.session-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px;
}

.session-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  margin: 2px 0;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
  gap: 10px;
}

.session-item-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.session-item-avatar svg {
  width: 100%;
  height: 100%;
}

.session-item-avatar img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.session-avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.session-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.session-item-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.session-item-gender {
  font-size: 12px;
  color: var(--text-muted);
}

.session-item:hover {
  background: var(--bg-hover);
}

.session-item.active {
  background: var(--bg-hover);
  border-left: 3px solid var(--accent);
  padding-left: 9px;
}

.session-item-title {
  flex: 1;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
}

.session-flag-icon {
  border-radius: 2px;
  flex-shrink: 0;
  vertical-align: middle;
}

.session-item.active .session-item-name {
  color: var(--text-primary);
}

.session-item-time {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* 侧边栏遮罩 */
.sidebar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 15;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  border-radius: 20px;
}

.sidebar-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ============ 主聊天区 ============ */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-chat);
  min-width: 0;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-primary);
}

.chat-title {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-title-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(199, 91, 138, 0.15);
}
.chat-title-avatar img,
.chat-title-avatar svg {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.chat-title-name {
  flex-shrink: 0;
}

.chat-title-gender {
  font-size: 14px;
  flex-shrink: 0;
}

.chat-title-nationality {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  flex-shrink: 0;
}
.chat-title-nationality img {
  width: 18px;
  height: 13px;
  border-radius: 2px;
}

.header-actions {
  display: flex;
  gap: 4px;
}

.btn-toggle-sidebar,
.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.btn-toggle-sidebar:hover,
.btn-icon:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* ============ 消息区域 ============ */
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.welcome {
  text-align: center;
  padding: 40px 20px;
  margin: auto;
  position: relative;
}

.welcome-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(199, 91, 138, 0.14) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.welcome-avatar {
  margin-bottom: 20px;
  animation: float 3.5s ease-in-out infinite;
  position: relative;
  z-index: 1;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.welcome h2 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
  position: relative;
  z-index: 1;
}

.welcome p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 28px;
  position: relative;
  z-index: 1;
}

/* ============ 角色卡片 ============ */
.character-card {
  text-align: center;
  position: relative;
  z-index: 1;
  animation: cardSlideIn 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.character-card.switching {
  animation: cardSlideOut 0.2s ease-in forwards;
}

@keyframes cardSlideIn {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes cardSlideOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-8px) scale(0.96); }
}

.character-avatar {
  margin-bottom: 16px;
  animation: float 3.5s ease-in-out infinite;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  margin-left: auto;
  margin-right: auto;
}

.character-avatar svg {
  border-radius: 50%;
  display: block;
}

.character-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 6px;
}

.character-name {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 0;
  color: var(--text-primary);
  min-height: 36px;
}

.character-gender-icon {
  font-size: 16px;
  font-weight: 500;
  flex-shrink: 0;
  line-height: 1;
  opacity: 0.65;
}

.character-gender-icon.gender-male {
  color: #6a9fd8;
}

.character-gender-icon.gender-female {
  color: #e8879e;
}

.character-nationality {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-tertiary);
  opacity: 0.8;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.nationality-flag-icon {
  border-radius: 2px;
  flex-shrink: 0;
}

.character-story {
  color: var(--accent);
  font-size: 14px;
  margin-bottom: 12px;
  line-height: 1.6;
  min-height: 22px;
  padding: 0 20px;
}

.character-opening {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 28px;
  line-height: 1.7;
  padding: 0 20px;
  min-height: 44px;
  font-style: italic;
  opacity: 0.85;
}

.welcome-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.btn-reroll {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-reroll:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-reroll:active {
  transform: scale(0.96);
}

.btn-reroll.spinning svg {
  animation: spin 0.6s ease-in-out;
}

.btn-share {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-share:hover {
  background: rgba(199, 91, 138, 0.15);
  color: var(--accent);
  border-color: rgba(199, 91, 138, 0.3);
  transform: translateY(-1px);
}

.btn-share:active {
  transform: scale(0.96);
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ============ 性别筛选 ============ */
.gender-toggle {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

.gender-btn {
  padding: 7px 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.gender-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.gender-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 2px 8px var(--accent-glow);
}

/* ============ 风格筛选（artStyle） ============ */
.artstyle-toggle {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

.artstyle-btn {
  padding: 7px 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.artstyle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.artstyle-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 2px 8px var(--accent-glow);
}

/* ============ 文化区/国家筛选（两级下拉） ============ */
.culture-select {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

.culture-dropdown {
  padding: 7px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  outline: none;
  max-width: 44vw;
}

.culture-dropdown:hover {
  background: rgba(255, 255, 255, 0.08);
}

.culture-dropdown:focus {
  border-color: var(--accent);
}

.culture-dropdown:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.culture-dropdown option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.btn-start-chat {
  padding: 10px 28px;
  background: var(--accent);
  border: none;
  border-radius: 24px;
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-start-chat:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--accent-glow);
}

.btn-start-chat:active {
  transform: scale(0.97);
}

/* 加载状态 */
.character-loading {
  display: none;
  text-align: center;
  position: relative;
  z-index: 1;
  padding: 20px 0;
}

.character-loading.visible {
  display: block;
}

.character-card.loading {
  display: none;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}



.character-loading span {
  color: var(--text-muted);
  font-size: 14px;
}

/* ============ 消息气泡 ============ */
.message {
  display: flex;
  gap: 12px;
  max-width: 80%;
  margin-bottom: 16px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message.assistant {
  align-self: flex-start;
}

.message-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  background: var(--bg-secondary);
  overflow: hidden;
}

.message-avatar svg,
.message-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}
.message-avatar img {
  object-fit: cover;
}

.message.user .message-avatar {
  display: none;
}

.message.assistant .message-avatar {
  background: rgba(199, 91, 138, 0.15);
  color: var(--accent);
  font-size: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  opacity: 0.8;
  cursor: pointer;
}
.message.assistant .message-avatar:hover {
  opacity: 1;
  border-color: rgba(199, 91, 138, 0.35);
}

/* ============ 头像悬浮卡片 ============ */
.avatar-hover-card {
  position: fixed;
  background: rgba(20, 14, 18, 0.96);
  border: 1px solid rgba(199, 91, 138, 0.2);
  border-radius: 14px;
  padding: 16px;
  width: 400px;
  max-width: calc(100vw - 24px);
  z-index: 9999;
  user-select: text;
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  animation: avatarCardIn 0.2s ease;
}

.avatar-hover-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.avatar-hover-card-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid rgba(199, 91, 138, 0.3);
}
.avatar-hover-card-avatar svg,
.avatar-hover-card-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-hover-card-meta {
  flex: 1;
  min-width: 0;
}

.avatar-hover-card-name {
  font-size: 15px;
  font-weight: 600;
  color: #f0e4ec;
  line-height: 1.3;
}

.avatar-hover-card-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}
.avatar-hover-card-tags img {
  vertical-align: middle;
}

.avatar-hover-card-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 10px 0;
}

.avatar-hover-card-section {
  margin-bottom: 8px;
}
.avatar-hover-card-section:last-child {
  margin-bottom: 0;
}

.avatar-hover-card-label {
  font-size: 11px;
  color: rgba(199, 91, 138, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.avatar-hover-card-text {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
}

.avatar-hover-card-text.quote {
  font-style: italic;
  color: rgba(199, 91, 138, 0.75);
}

@keyframes avatarCardIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.message-content {
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}

.message.user .message-content {
  background: var(--bg-user-bubble);
  border-bottom-right-radius: 4px;
}

.message.assistant .message-content {
  background: var(--bg-ai-bubble);
  border: 1px solid rgba(199, 91, 138, 0.12);
  border-left: 3px solid rgba(199, 91, 138, 0.35);
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Markdown 渲染 */
.message-content p {
  margin: 4px 0;
}

.message-content p:first-child {
  margin-top: 0;
}

.message-content p:last-child {
  margin-bottom: 0;
}

.message-content code {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

.message-content pre {
  background: rgba(0, 0, 0, 0.4);
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 8px 0;
}

.message-content pre code {
  background: none;
  padding: 0;
}

.message-content ul,
.message-content ol {
  padding-left: 20px;
  margin: 4px 0;
}

.message-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 12px;
  margin: 6px 0;
  color: var(--text-secondary);
}

.message-content .scene-desc {
  font-style: italic;
  color: #b8a0b8;
}

/* 正在输入动画 */

/* ============ 照片功能提示 ============ */
.photo-hint {
  text-align: center;
  padding: 8px 20px;
  font-size: 13px;
  color: var(--text-tertiary);
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  animation: hintFadeIn 0.5s ease;
}
.photo-hint strong {
  color: var(--accent-color, #c75b8a);
  cursor: pointer;
  border-bottom: 1px dashed var(--accent-color, #c75b8a);
}
.photo-hint strong:hover {
  opacity: 0.8;
}
.photo-hint-link {
  color: var(--accent-color, #c75b8a);
  cursor: pointer;
  margin-left: 4px;
  border-bottom: 1px dashed var(--accent-color, #c75b8a);
}
.photo-hint-link:hover {
  opacity: 0.8;
}
.photo-hint-sub {
  display: block;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
  opacity: 0.8;
}
@keyframes hintFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}



/* ============ AI 内容声明 ============ */
.chat-ai-label {
  text-align: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.18);
  background: var(--bg-primary);
  padding: 6px 20px 4px;
  user-select: none;
  pointer-events: none;
}

/* ============ 输入区 ============ */
.input-area {
  padding: 12px 20px 20px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-primary);
}

.input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 8px 12px;
  transition: border-color var(--transition);
}

.input-wrapper:focus-within {
  border-color: var(--accent);
}

.input-wrapper textarea {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  line-height: 1.5;
  resize: none;
  max-height: 120px;
  padding: 4px 0;
}

.input-wrapper textarea::placeholder {
  color: var(--text-muted);
}

.btn-send {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: white;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.btn-send:hover {
  background: var(--accent-hover);
  transform: scale(1.05);
}

.btn-send:disabled {
  background: var(--bg-hover);
  color: var(--text-muted);
  cursor: not-allowed;
  transform: none;
}

.input-hint {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 6px;
}

/* ============ 模态框 ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 90%;
  max-width: 400px;
  box-shadow: var(--shadow);
}

.modal h3 {
  font-size: 18px;
  margin-bottom: 12px;
}

.modal p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 16px;
}

.modal input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  margin-bottom: 16px;
}

.modal input:focus {
  border-color: var(--accent);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.btn-cancel {
  padding: 8px 16px;
  background: var(--bg-hover);
  border: none;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-cancel:hover {
  background: var(--border-color);
}

.btn-confirm {
  padding: 8px 16px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: white;
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-confirm:hover {
  background: var(--accent-hover);
}

.btn-danger {
  padding: 8px 16px;
  background: var(--danger);
  border: none;
  border-radius: var(--radius);
  color: white;
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-danger:hover {
  background: #e8707f;
}

/* ============ 设置面板 ============ */
.settings-modal {
  max-width: 420px;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 8px;
}

.form-field {
  display: flex;
  flex-direction: column;
}

.form-field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 3px;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
  margin-bottom: 3px;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--accent);
}

.form-field select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23786370' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.form-field select option {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.form-field textarea {
  resize: vertical;
  min-height: 56px;
  line-height: 1.5;
}

.field-hint {
  font-size: 12px;
  color: var(--text-muted);
}

/* ============ 滚动条 ============ */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ============ 网站导航栏 ============ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(24, 17, 23, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 18px;
  transition: opacity var(--transition);
}

.nav-brand:hover {
  opacity: 0.8;
}

.nav-logo {
  font-size: 22px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
}

.nav-link {
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
}

.nav-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-link.active {
  color: var(--accent);
  background: rgba(199, 91, 138, 0.1);
}

.nav-cta {
  background: var(--accent);
  color: white !important;
  margin-left: 4px;
  border-radius: 20px;
  padding: 6px 20px;
}

.nav-cta:hover {
  background: var(--accent-hover);
  color: white !important;
}

.nav-cta.active {
  background: var(--accent);
  color: white !important;
  box-shadow: 0 2px 12px var(--accent-glow);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition);
}

/* ========== 首页 Landing ========== */
.home-hero {
  position: relative;
  text-align: center;
  padding: 80px 20px 60px;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(199, 91, 138, 0.12) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  animation: starTwinkle 3s ease-in-out infinite;
}

@keyframes starTwinkle {
  0%, 100% { opacity: 0.2; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.5); }
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 680px;
  margin: 0 auto;
}

.hero-title {
  font-size: 48px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 20px;
}

.hero-line {
  display: block;
}

.hero-gradient {
  background: linear-gradient(135deg, #c75b8a 0%, #e892b3 30%, #d4a5c4 60%, #c75b8a 90%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;
  animation: gradientShift 4s ease-in-out infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-sub {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 36px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-hero-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  border-radius: 28px;
  font-size: 16px;
  font-weight: 600;
  transition: all var(--transition);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-hero-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(199, 91, 138, 0.3);
}

.btn-hero-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 28px;
  font-size: 16px;
  font-weight: 500;
  transition: all var(--transition);
}

.btn-hero-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* 浮动角色装饰 */
.hero-float-chars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.float-char {
  position: absolute;
  font-size: 32px;
  opacity: 0.12;
  animation: floatChar 8s ease-in-out infinite;
  filter: blur(0.5px);
}

@keyframes floatChar {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33% { transform: translateY(-20px) rotate(3deg); }
  66% { transform: translateY(10px) rotate(-3deg); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ========== 特性卡片 ========== */
.home-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 960px;
  margin: 0 auto 60px;
  padding: 0 24px;
}

.feature-card {
  text-align: center;
  padding: 32px 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  transition: all var(--transition);
}

.feature-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.feature-icon {
  font-size: 40px;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.feature-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ========== 统计栏 ========== */
.home-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  max-width: 960px;
  margin: 0 auto 80px;
  padding: 32px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-item {
  text-align: center;
}

.stat-num {
  display: block;
  font-size: 36px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.2;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ========== 已遇见页 ========== */
.gallery-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  width: 100%;
}

.gallery-header {
  text-align: center;
  margin-bottom: 40px;
}

.gallery-header h2 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
}

.gallery-header p {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 24px;
}

.gallery-filter {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 32px;
}

.gallery-filter-btn {
  padding: 7px 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.gallery-filter-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.gallery-filter-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.gallery-search-input {
  padding: 7px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition);
  font-family: inherit;
  width: 150px;
}

.gallery-search-input::placeholder {
  color: var(--text-muted);
}

.gallery-search-input:focus {
  border-color: var(--accent);
}

.gallery-nationality-dropdown {
  position: relative;
}

.gallery-nationality-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color var(--transition);
  font-family: inherit;
  white-space: nowrap;
}

.gallery-nationality-trigger:hover {
  border-color: rgba(255, 255, 255, 0.20);
}

.gallery-nationality-arrow {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.gallery-nationality-dropdown.open .gallery-nationality-arrow {
  transform: rotate(180deg);
}

.gallery-nationality-dropdown.open .gallery-nationality-trigger {
  border-color: var(--accent);
}

.gallery-nationality-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 160px;
  max-height: 260px;
  overflow-y: auto;
  background: #1e1720;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  padding: 6px;
  z-index: 50;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.gallery-nationality-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s;
  border: none;
  background: none;
  width: 100%;
  font-family: inherit;
  text-align: left;
}

.gallery-nationality-option:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.gallery-nationality-option.selected {
  color: var(--accent);
  background: rgba(199, 91, 138, 0.12);
}

.gallery-nationality-option img {
  border-radius: 2px;
  flex-shrink: 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
}

.gallery-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.gallery-empty p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.8;
}

.gallery-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 24px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  position: relative;
  text-align: left;
}

.gallery-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(199, 91, 138, 0.3);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.gallery-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gallery-card-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.gallery-card-avatar-svg {
  background: transparent;
  overflow: hidden;
  padding: 5px;
}

.gallery-card-avatar-svg svg {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.gallery-avatar-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.gallery-card-avatar.male {
  background: linear-gradient(135deg, #2d4070, #1a2a50);
}

.gallery-card-avatar.female {
  background: linear-gradient(135deg, #6d3050, #4a2038);
}

.gallery-card-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.gallery-flag-icon {
  border-radius: 2px;
  flex-shrink: 0;
  vertical-align: middle;
}

.gallery-card-gender {
  font-size: 12px;
  color: var(--text-muted);
}

.gallery-card-story {
  font-size: 13px;
  color: var(--accent);
  line-height: 1.6;
  opacity: 0.85;
}

.gallery-card-traits {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 4px;
  opacity: 0.7;
}

.gallery-card-opening {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  font-style: italic;
  opacity: 0.8;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gallery-card-time {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: auto;
}

.gallery-continue-btn {
  margin-top: 8px;
  padding: 8px 0;
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: opacity 0.2s, letter-spacing 0.2s;
  opacity: 0.6;
}

.gallery-card:hover .gallery-continue-btn {
  opacity: 1;
  letter-spacing: 0.5px;
}

/* ========== 关于页 ========== */
.about-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  width: 100%;
}

.about-hero {
  text-align: center;
  margin-bottom: 48px;
}

.about-hero h2 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
}

.about-hero p {
  color: var(--text-secondary);
  font-size: 15px;
}

.about-content {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.about-section h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.about-section p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tech-tag {
  padding: 5px 14px;
  background: rgba(199, 91, 138, 0.12);
  border: 1px solid rgba(199, 91, 138, 0.2);
  border-radius: 16px;
  font-size: 13px;
  color: var(--accent);
}

.about-steps {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.about-steps li {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ========== 全局页脚 ========== */
.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(15, 7, 11, 0.6);
  padding: 32px 24px;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-logo {
  font-size: 18px;
}

.footer-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 15px;
}

.footer-tagline {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 4px;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-copy {
  font-size: 12px;
  color: var(--text-muted);
}

.footer-contact {
  margin-left: 16px;
  padding-left: 16px;
  border-left: 1px solid var(--border-color);
}

/* ========== 导航栏用户区域 ========== */
.nav-user-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: 16px;
  color: var(--text-secondary);
  margin-left: 8px;
}

.nav-user-btn:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
}

.nav-user-btn.logged-in {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(199,91,138,0.1);
}

.nav-user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: rgba(24,17,23,0.98);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 6px;
  min-width: 140px;
  z-index: 200;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.nav-user-menu a {
  display: block;
  padding: 10px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition);
}

.nav-user-menu a:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}

/* ========== 语言切换（localStorage 持久化 + 手动覆盖） ========== */
.lang-switch {
  position: relative;
  margin-left: 8px;
}

.lang-switch-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 10px;
  transition: all var(--transition);
}

.lang-switch-btn:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
}

.lang-switch-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: rgba(24,17,23,0.98);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 6px;
  min-width: 130px;
  z-index: 200;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

/* 全语言菜单（19 语种）：两列网格 + 高度上限滚动，避免超长单列溢出屏幕 */
.lang-switch-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  max-height: 55vh;
  max-width: 90vw;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.lang-switch-grid a {
  text-align: left;
  white-space: nowrap;
}

.lang-switch-menu a {
  display: block;
  padding: 9px 14px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}

.lang-switch-menu a:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}

.lang-switch-menu a.active {
  color: var(--accent);
  font-weight: 600;
}

@media (max-width: 768px) {
  .lang-switch-btn span {
    display: none; /* 移动端仅显示地球图标，省横向空间 */
  }
  .lang-switch-menu {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* ========== 举报与黑名单（合规 5a/5e） ========== */
.moment-more-btn {
  background: none;
  border: none;
  color: rgba(200,180,220,.4);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 8px;
  flex-shrink: 0;
}
.moment-more-btn:hover { color: #e0d0f0; background: rgba(180,120,220,.12); }

.moment-more-menu {
  position: relative;
  margin: -8px 0 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.moment-more-menu a {
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  color: rgba(220,205,235,.75);
  cursor: pointer;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
}
.moment-more-menu a:hover { background: rgba(180,120,220,.12); color: #f0e4f8; }
.moment-more-menu a[data-act="block-author"] { color: #e0a0a0; }

/* 外部分享渠道菜单（P3，与 more-menu 同构） */
.moment-share-menu {
  position: relative;
  margin: -8px 0 8px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
.moment-share-menu a {
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 13px;
  color: rgba(220,205,235,.8);
  cursor: pointer;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  white-space: nowrap;
}
.moment-share-menu a:hover { background: rgba(180,120,220,.15); color: #f0e4f8; }

.moment-comment-report {
  background: none;
  border: none;
  color: rgba(200,180,220,.3);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 6px;
  flex-shrink: 0;
}
.moment-comment-report:hover { color: #e0a0a0; }

.report-modal textarea {
  width: 100%;
  resize: none;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  padding: 10px 12px;
  color: #f0e4ec;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
}
.report-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.report-reasons {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}
.report-reasons label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
  transition: background var(--transition);
}
.report-reasons label:hover { background: rgba(255,255,255,.05); }
.report-reasons input[type="radio"] { accent-color: var(--accent); }

.blocked-user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.blocked-user-row:last-child { border-bottom: none; }
.blocked-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(180,120,220,.14);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.blocked-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.blocked-user-name { flex: 1; font-size: 14px; color: var(--text-secondary); }
.blocked-user-unblock {
  background: none;
  border: 1px solid rgba(180,120,220,.25);
  color: #d4c0ee;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 14px;
  cursor: pointer;
  font-family: inherit;
}
.blocked-user-unblock:hover { background: rgba(180,120,220,.15); }

/* ========== 站内通知铃铛（5b） ========== */
.nav-bell {
  position: relative;
  margin-left: 8px;
}
.nav-bell-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 8px 10px;
  border-radius: 10px;
  transition: all var(--transition);
}
.nav-bell-btn:hover { background: rgba(255,255,255,.08); color: var(--text-primary); }
.nav-bell-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.nav-bell-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 300px;
  max-width: 86vw;
  background: rgba(24,17,23,.98);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 6px;
  z-index: 200;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
.nav-bell-head {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  padding: 8px 12px 4px;
}
.nav-bell-list { max-height: 320px; overflow-y: auto; }
.nav-bell-item {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: default;
}
.nav-bell-item:hover { background: rgba(255,255,255,.04); }
.nav-bell-item.unread { background: rgba(199,91,138,.08); }
.nav-bell-item-text { font-size: 13px; color: var(--text-secondary); line-height: 1.5; word-break: break-word; }
.nav-bell-item.unread .nav-bell-item-text { color: var(--text-primary); }
.nav-bell-item-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.nav-bell-empty { padding: 24px 12px; text-align: center; font-size: 13px; color: var(--text-muted); }
.nav-bell-readall {
  display: block;
  width: calc(100% - 8px);
  margin: 4px auto 2px;
  background: none;
  border: 1px solid rgba(199,91,138,.3);
  color: var(--accent);
  font-size: 12px;
  padding: 7px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}
.nav-bell-readall:hover { background: rgba(199,91,138,.12); }

/* 动态审核状态角标（仅作者自己可见的 pending/rejected） */
.moment-status-badge {
  display: inline-block;
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 10px;
  margin-right: 6px;
  vertical-align: middle;
}
.moment-status-badge.pending {
  background: rgba(255,200,100,.14);
  color: #f0c060;
}
.moment-status-badge.rejected {
  background: rgba(220,100,100,.14);
  color: #e0a0a0;
}

/* ========== 危险操作区 + 账号注销（5f） ========== */
.profile-danger {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid rgba(220,100,100,.2);
  border-radius: 14px;
  background: rgba(220,100,100,.04);
}
.profile-danger-title {
  font-size: 13px;
  font-weight: 600;
  color: #e0a0a0;
  margin-bottom: 10px;
}
.profile-danger-btn {
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(220,100,100,.35);
  background: none;
  color: #e0a0a0;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition);
}
.profile-danger-btn:hover { background: rgba(220,100,100,.12); }
.delete-account-modal .delete-account-body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}
.delete-account-code-section {
  margin-bottom: 16px;
}
.delete-account-code-section label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.delete-account-code-section input {
  width: 100%;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 15px;
  letter-spacing: 4px;
  outline: none;
  box-sizing: border-box;
}
.delete-account-code-section .code-row {
  display: flex;
  gap: 8px;
}
.delete-account-code-section .btn-send-code {
  flex-shrink: 0;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid rgba(199,91,138,.35);
  background: none;
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.delete-account-code-section .btn-send-code:hover { background: rgba(199,91,138,.12); }

/* ========== OAuth 快捷登录（P4） ========== */
.oauth-section { margin-bottom: 18px; }
.oauth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 14px;
  color: var(--text-muted);
  font-size: 12px;
}
.oauth-divider::before,
.oauth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,.08);
}
.oauth-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}
.oauth-btn:hover { background: rgba(255,255,255,.08); transform: translateY(-1px); }
.oauth-btn svg { flex-shrink: 0; }

/* ========== 登录弹窗 ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  background: #1c1119;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 32px;
  max-width: 400px;
  width: 100%;
  position: relative;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  transition: color var(--transition);
}

.modal-close:hover {
  color: var(--text-primary);
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-icon {
  font-size: 40px;
  display: block;
  margin-bottom: 8px;
}

.login-header h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.login-header p {
  font-size: 13px;
  color: var(--text-muted);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  transition: border-color var(--transition);
  box-sizing: border-box;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
}

.code-row {
  display: flex;
  gap: 10px;
}

.code-row input {
  flex: 1;
}

.btn-send-code {
  padding: 12px 16px;
  background: rgba(199,91,138,0.15);
  border: 1px solid rgba(199,91,138,0.25);
  border-radius: 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: all var(--transition);
}

.btn-send-code:hover {
  background: rgba(199,91,138,0.25);
}

.btn-send-code:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-login {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-login:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-login:active {
  transform: scale(0.98);
}

.login-hint {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 12px;
  opacity: 0.6;
}

/* ========== 图片验证码 ========== */
.captcha-section {
  margin-bottom: 20px;
}

.captcha-section label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.captcha-img-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.captcha-img-canvas {
  display: block;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.captcha-refresh-btn {
  width: 36px;
  min-width: 36px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}

.captcha-refresh-btn:hover {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.75);
  border-color: rgba(255,255,255,0.2);
}

.captcha-refresh-btn:active svg {
  transform: rotate(180deg);
  transition: transform 0.3s ease;
}

.captcha-input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 15px;
  letter-spacing: 4px;
  text-align: center;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s;
  font-family: "Courier New", monospace;
  font-weight: 700;
}

.captcha-input:focus {
  border-color: var(--accent);
}

/* ========== 我的页面 ========== */
.profile-container {
  max-width: 560px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  width: 100%;
}

.profile-header {
  text-align: center;
  margin-bottom: 32px;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #6d3050);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin: 0 auto 12px;
}

.profile-nickname-row {
  position: relative;
  display: inline-block;
}

.profile-nickname-row h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
}

.profile-edit-nick-btn {
  position: absolute;
  right: -28px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 50%;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
  opacity: 0.45;
}
.profile-edit-nick-btn:hover {
  background: var(--bg-page);
  color: var(--accent);
  opacity: 1;
}

.profile-nickname-edit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
}
.profile-nickname-edit input {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  max-width: 180px;
  background: var(--bg-page);
  color: var(--text);
  outline: none;
}
.profile-nickname-edit input:focus {
  border-color: var(--accent);
}
.btn-sm {
  padding: 4px 12px;
  font-size: 12px;
  border-radius: 6px;
}

.profile-header h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
}

.profile-phone {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.profile-membership {
  margin-top: 10px;
}

.membership-badge {
  display: inline-block;
  padding: 4px 16px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.membership-badge.free {
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
  border: 1px solid rgba(255,255,255,0.1);
}

.membership-badge.premium {
  background: linear-gradient(135deg, rgba(199,91,138,0.2), rgba(199,91,138,0.1));
  color: var(--accent);
  border: 1px solid rgba(199,91,138,0.3);
}

/* ---- 升级按钮 ---- */
.profile-upgrade-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 20px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  transition: all 0.2s;
}
.profile-upgrade-btn:hover {
  background: var(--accent);
  color: #fff;
}

/* ---- 定价弹窗 ---- */
.pricing-modal {
  max-width: 780px;
  width: 90vw;
  padding: 36px 32px;
  text-align: center;
}
.pricing-modal h3 {
  font-size: 24px;
  margin: 0 0 6px;
}
.pricing-sub {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 28px;
}
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 700px) {
  .pricing-grid {
    grid-template-columns: 1fr;
  }
}
.pricing-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 24px 20px;
  text-align: center;
  position: relative;
  transition: transform 0.2s, border-color 0.2s;
}
.pricing-card:hover {
  transform: translateY(-2px);
}
.pricing-card.featured {
  border-color: var(--accent);
  background: rgba(199,91,138,0.06);
}
.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 14px;
  border-radius: 10px;
  white-space: nowrap;
}
.pricing-plan {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  margin-top: 4px;
}
.pricing-price {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
}
.pricing-price span {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
}
.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  text-align: left;
  font-size: 13px;
  color: var(--text-secondary);
}
.pricing-features li {
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.pricing-features li:last-child {
  border-bottom: none;
}
.pricing-btn {
  width: 100%;
  padding: 10px 0;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}
.pricing-btn.primary {
  background: var(--accent);
  color: #fff;
  border: none;
}
.pricing-btn.primary:hover {
  filter: brightness(1.15);
}
.pricing-btn.outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid rgba(255,255,255,0.12);
  cursor: default;
}

/* ---- 积分包 ---- */
.pricing-divider {
  margin: 32px 0 20px;
  text-align: center;
  position: relative;
}
.pricing-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255,255,255,0.08);
}
.pricing-divider span {
  position: relative;
  display: inline-block;
  padding: 0 16px;
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}
.credit-pack-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
@media (max-width: 750px) {
  .credit-pack-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 480px) {
  .credit-pack-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.credit-pack-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.credit-pack-card:hover {
  border-color: var(--accent);
  background: rgba(199,91,138,0.08);
  transform: translateY(-2px);
}
.credit-pack-card.featured {
  border-color: var(--accent);
  background: rgba(199,91,138,0.06);
}
.credit-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 8px;
  white-space: nowrap;
}
.credit-amount {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 2px;
}
.credit-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.credit-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 2px;
}
.credit-per {
  font-size: 10px;
  color: var(--text-muted);
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.profile-stat-card {
  text-align: center;
  padding: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
}

.ps-num {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.ps-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.profile-quota {
  padding: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  margin-bottom: 24px;
}

.quota-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 14px;
}

.quota-num {
  font-weight: 600;
  color: var(--accent);
  font-size: 16px;
}

.quota-bar {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}

.quota-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.quota-fill.warn {
  background: #e8a85c;
}

.quota-fill.full {
  background: var(--danger);
}

.quota-fill.unlimited {
  background: linear-gradient(90deg, var(--accent), #7d4aea);
}

.profile-invite {
  background: linear-gradient(135deg, rgba(125, 74, 234, 0.08), rgba(255, 100, 150, 0.06));
  border: 1px solid rgba(125, 74, 234, 0.2);
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 4px;
}
.invite-header {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}
.invite-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.invite-code-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.invite-code-label {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.invite-code-val {
  font-family: 'Courier New', monospace;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 2px;
  background: rgba(0, 0, 0, 0.08);
  padding: 4px 12px;
  border-radius: 8px;
  color: var(--accent);
  user-select: all;
}
.invite-copy-btn {
  flex-shrink: 0;
  padding: 7px 16px;
  border: none;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  background: var(--accent);
  color: #fff;
  transition: transform 0.15s, box-shadow 0.15s;
  margin-left: auto;
}
.invite-copy-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 14px rgba(125, 74, 234, 0.3);
}
.invite-stats {
  font-size: 13px;
  color: var(--text-secondary);
}
.invite-stats strong {
  color: var(--accent);
  font-weight: 700;
}
.invite-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* ============ 聊天高光分享 ============ */

/* 多选复选框 */
.share-check {
  position: absolute;
  top: 10px;
  left: -6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(180,120,220,0.4);
  background: rgba(20,10,30,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.15s;
  color: transparent;
}
.share-check.checked {
  background: linear-gradient(135deg, rgba(180,100,240,0.8), rgba(220,130,180,0.8));
  border-color: transparent;
  color: #fff;
}
.message.user .share-check { left: auto; right: -6px; }
.message { padding-left: 6px !important; }
.message.user { padding-left: 0 !important; padding-right: 6px !important; }

/* 底部操作栏 */
.share-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 580px;
  height: 60px;
  background: rgba(20,10,30,0.95);
  border-top: 1px solid rgba(180,120,220,0.2);
  border-radius: 16px 16px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 1000;
  backdrop-filter: blur(10px);
}
.share-bar-cancel {
  background: none;
  border: 1px solid rgba(200,180,220,0.3);
  color: rgba(200,180,220,0.8);
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}
.share-bar-count {
  font-size: 14px;
  color: rgba(200,180,220,0.7);
  font-weight: 600;
}
.share-bar-confirm {
  padding: 8px 24px;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(180,100,240,0.8), rgba(220,130,180,0.8));
  color: #fff;
  transition: transform 0.15s, box-shadow 0.15s;
}
.share-bar-confirm:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}
.share-bar-confirm:not(:disabled):hover {
  transform: scale(1.03);
  box-shadow: 0 4px 16px rgba(180,100,240,0.3);
}

/* 分享结果弹窗 */
.share-result-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(4px);
  padding: 20px;
}
.share-result-dialog {
  background: linear-gradient(135deg, #1a1025, #0f0a1a);
  border: 1px solid rgba(180,120,220,0.25);
  border-radius: 20px;
  padding: 28px 24px;
  max-width: 420px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.share-result-title {
  font-size: 17px;
  font-weight: 700;
  color: #f0e0ff;
}
.share-result-preview {
  width: 100%;
  max-height: 300px;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(180,120,220,0.05);
}
.share-result-actions {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 10px;
}
.share-result-btn {
  width: 100%;
  padding: 13px 20px;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.share-result-btn.primary {
  background: linear-gradient(135deg, rgba(180,100,240,0.8), rgba(220,130,180,0.8));
  color: #fff;
}
.share-result-btn:not(.primary):not(.cancel) {
  background: rgba(180,120,220,0.12);
  color: #e0d0f0;
  border: 1px solid rgba(180,120,220,0.2);
}
.share-result-btn.cancel {
  background: none;
  color: rgba(200,180,220,0.5);
  font-size: 14px;
  font-weight: 400;
}
.share-result-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 14px rgba(180,100,240,0.2);
}

.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-btn {
  width: 100%;
  padding: 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}

.profile-btn:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
}

.profile-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  font-weight: 600;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.profile-btn.primary:hover {
  background: var(--accent-hover);
}

/* ============ 移动端适配更新 ============ */
@media (max-width: 768px) {
  body {
    padding: 0;
  }

  .app {
    min-height: 100vh;
  }

  /* 导航栏移动端 */
  .nav-inner {
    padding: 0 16px;
    height: 52px;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(24, 17, 23, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 8px 16px;
    gap: 2px;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-link {
    padding: 12px 16px;
    border-radius: 8px;
    width: 100%;
  }

  .nav-cta {
    margin-left: 0;
    text-align: center;
  }

  /* 首页移动端 */
  .home-hero {
    padding: 56px 16px 40px;
  }

  .hero-title {
    font-size: 32px;
  }

  .home-features {
    grid-template-columns: 1fr;
    padding: 0 16px;
    gap: 12px;
    margin-bottom: 40px;
  }

  .home-stats {
    gap: 32px;
    padding: 24px 16px;
    margin-bottom: 48px;
  }

  .stat-num {
    font-size: 28px;
  }

  /* 聊天页移动端 - 贴边全屏 */
  .page-chat.active {
    flex: none;
    max-width: 100%;
    height: calc(100vh - 52px);
    margin: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    border-radius: 0;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    z-index: 200;
  }

  .sidebar.collapsed {
    transform: translateX(-100%);
  }

  .sidebar-overlay {
    position: fixed;
    z-index: 150;
    border-radius: 0;
  }

  .message {
    max-width: 90%;
  }

  .messages {
    padding: 12px;
  }

  .input-area {
    padding: 8px 12px 12px;
  }

  /* 画廊移动端 */
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-container {
    padding: 32px 16px 60px;
  }

  .gallery-header h2 {
    font-size: 26px;
  }

  /* 关于页移动端 */
  .about-container {
    padding: 32px 16px 60px;
  }

  .about-hero h2 {
    font-size: 26px;
  }

  /* 页脚移动端 */
  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }

  .footer-links {
    gap: 16px;
  }

  /* 小屏手机：按钮堆叠 */
  .welcome-actions {
    flex-wrap: wrap;
  }

  .btn-hero-primary,
  .btn-hero-secondary {
    padding: 12px 24px;
    font-size: 15px;
  }

  .hero-sub {
    font-size: 15px;
  }

  /* ======== 触控目标 ≥44px ======== */
  .btn-send {
    width: 44px;
    height: 44px;
  }

  .btn-toggle-sidebar,
  .btn-icon {
    width: 44px;
    height: 44px;
  }

  .btn-settings {
    width: 44px;
    height: 44px;
    border-radius: 8px;
  }

  .gender-btn {
    padding: 10px 20px;
    font-size: 14px;
  }

  .gallery-filter-btn {
    padding: 10px 20px;
    font-size: 14px;
  }


  .gallery-search-input {
    width: 100%;
    max-width: 200px;
    box-sizing: border-box;
  }


/* 故事书页样式已移至 index.html 内联 <style> */

  .gallery-nationality-trigger {
    font-size: 13px;
    padding: 7px 14px;
  }

  .gallery-nationality-menu {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }

  .session-item {
    padding: 12px 14px;
  }

  /* ======== 侧边栏宽度适配小屏 ======== */
  .sidebar {
    width: min(260px, 82vw);
  }

  /* ======== 登录弹窗短屏窄屏 ======== */
  .modal-card {
    padding: 20px;
    max-height: 90vh;
    overflow-y: auto;
  }

  /* ======== Profile 统计两列 ======== */
  .profile-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  /* ======== 排版微调 ======== */
  .character-name {
    font-size: 22px;
  }

  .message-image {
    max-width: min(220px, 70vw);
  }

  .input-hint {
    font-size: 12px;
  }

  .profile-container {
    padding: 24px 16px 60px;
  }
}

/* ============ iOS 安全区域适配 ============ */
@supports (padding: max(0px)) {
  .site-nav {
    padding-top: max(0px, env(safe-area-inset-top));
  }

  @media (max-width: 768px) {
    .page-chat.active {
      height: calc(100vh - max(0px, env(safe-area-inset-top)));
    }

    .input-area {
      padding-bottom: max(12px, env(safe-area-inset-bottom));
    }

    .site-footer {
      padding-bottom: max(32px, env(safe-area-inset-bottom));
    }
  }
}

/* 防止 iOS 输入缩放 */
@media (max-width: 768px) {
  .input-wrapper textarea,
  input[type="text"],
  input[type="search"] {
    font-size: 16px !important;
  }
}

/* 移动端去掉点击高亮 */
@media (max-width: 768px) {
  * {
    -webkit-tap-highlight-color: transparent;
    -webkit-overflow-scrolling: touch;
  }
}

/* ============ 移动端底部 Tab Bar ============ */
.mobile-tabs {
  display: none;
}
.mobile-only {
  display: none;
}

@media (max-width: 768px) {
  /* 隐藏顶部全局导航（由底部 Tab 替代） */
  .site-nav {
    display: none;
  }

  .mobile-only {
    display: block;
  }

  .mobile-tabs {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: 56px;
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(24, 17, 23, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    justify-content: space-around;
    align-items: center;
  }

  .mob-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 0;
    min-width: 56px;
    min-height: 52px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
  }

  .mob-tab.active {
    color: var(--accent);
  }

  .mob-tab svg {
    pointer-events: none;
  }

  /* 聊天页减去底部 Tab 高度（顶部导航已隐藏） */
  .page-chat.active {
    height: calc(100vh - 56px - env(safe-area-inset-bottom, 0px) - env(safe-area-inset-top, 0px));
  }

  /* 其他页面底部留白 */
  .gallery-container,
  .about-container,
  .profile-container,
  .storybooks-container,
  .discover-container {
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
  }

  .site-footer {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  /* 输入区加 safe-area */
  .input-area {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
}

/* ============ 页面过渡动画 ============ */
@media (max-width: 768px) {
  .page {
    animation: pageIn 0.2s ease-out;
  }

  @keyframes pageIn {
    from {
      opacity: 0.6;
      transform: translateX(24px);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }
}

/* ============ 图片消息 ============ */
/* 图片配文 */
.message-caption {
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  word-break: break-word;
}

.message-caption p {
  margin: 0;
}

/* 图片生成等待期 - 模拟"对方正在输入"体验 */
.image-generating {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0 4px;
}

.image-generating-text {
  font-size: 12px;
  color: var(--text-tertiary, #999);
}

.image-generating-dots {
  display: flex;
  gap: 4px;
  align-items: center;
}

.image-generating-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-tertiary, #999);
  animation: dot-pulse 1.2s ease-in-out infinite;
}

.image-generating-dots span:nth-child(1) { animation-delay: 0s; }
.image-generating-dots span:nth-child(2) { animation-delay: 0.2s; }
.image-generating-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-pulse {
  0%, 80%, 100% { opacity: 0.2; transform: scale(1); }
  40% { opacity: 0.8; transform: scale(1.2); }
}

/* 游客占位卡片 —— 模拟加载后锁定 */
.guest-image-lock {
  background: linear-gradient(135deg, #2a2030, #1e1825);
  border: 1px solid rgba(199, 91, 138, 0.25);
  border-radius: 14px;
  padding: 20px 18px;
  text-align: center;
  max-width: 240px;
  margin: 4px 0;
  box-shadow: 0 2px 16px rgba(0,0,0,0.3);
}
.guest-image-lock-icon {
  font-size: 36px;
  margin-bottom: 10px;
  filter: grayscale(0.3);
}
.guest-image-lock-text strong {
  display: block;
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.guest-image-lock-text p {
  font-size: 13px;
  color: var(--text-tertiary, #aaa);
  margin: 4px 0 12px;
  font-style: italic;
}
.guest-image-lock-btn {
  display: inline-block;
  padding: 8px 22px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: var(--bg-user-bubble, #c75b8a);
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.guest-image-lock-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 2px 10px rgba(199, 91, 138, 0.4);
}
.guest-image-lock-btn:active {
  transform: scale(0.97);
}

.message-image {
  margin-top: 10px;
  border-radius: 12px;
  overflow: hidden;
  max-width: 220px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

.message-image.loading {
  background: rgba(255,255,255,0.04);
  border: 1px dashed rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
}

.image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 13px;
}

.message-image.loaded img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
  cursor: zoom-in;
  transition: opacity 0.4s ease;
}

.message-image.loaded img:hover {
  opacity: 0.9;
}

.message-image.error {
  padding: 16px 20px;
  background: rgba(212,86,94,0.08);
  border: 1px solid rgba(212,86,94,0.15);
  border-radius: var(--radius);
}

.image-error-text {
  color: rgba(212,86,94,0.8);
  font-size: 13px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.4s ease;
}

/* ============ 分享预览弹窗 ============ */
.share-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease;
}

.share-preview-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

.share-preview-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90vw;
  max-height: 92vh;
}

.share-preview-card img {
  max-width: min(400px, 85vw);
  max-height: 70vh;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  object-fit: contain;
}

.share-preview-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  line-height: 1;
}

.share-preview-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.share-preview-actions {
  margin-top: 20px;
  display: flex;
  gap: 12px;
}

.btn-share-download {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--accent);
  border: none;
  border-radius: 28px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-share-download:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.btn-share-download:active {
  transform: scale(0.96);
}

/* ============ Lightbox ============ */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  animation: fadeIn 0.2s ease;
}

.lightbox-overlay img {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

/* ============ 积分不足弹窗 ============ */
.credits-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.credits-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
}

.credits-modal-card {
  position: relative;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  width: 90%;
  max-width: 380px;
  text-align: center;
  z-index: 1;
}

.credits-modal-card h3 {
  font-size: 20px;
  margin-bottom: 16px;
}

.credits-info {
  margin-bottom: 20px;
}

.credits-info p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.8;
}

.credits-info strong {
  color: var(--text-primary);
}

.credits-packages {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.credit-pkg {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 12px 6px;
  cursor: pointer;
  transition: all var(--transition);
}

.credit-pkg:hover {
  border-color: var(--accent);
  background: rgba(199,91,138,0.08);
}

.credit-pkg.highlight {
  border-color: var(--accent);
  background: rgba(199,91,138,0.08);
  position: relative;
}

.pkg-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.credit-pkg.highlight .pkg-name {
  color: var(--accent);
}

.pkg-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.pkg-per {
  font-size: 11px;
  color: var(--text-muted);
}

.pkg-badge {
  position: absolute;
  top: -8px;
  right: -4px;
  background: var(--accent);
  color: white;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.credits-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.credits-close {
  padding: 10px 24px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}

.credits-close:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
}

/* ============ 积分明细弹窗（流水列表 + 账目复核） ============ */
.credits-history-card {
  max-width: 420px;
  text-align: left;
}

.credits-history-card h3 {
  text-align: center;
}

.credits-history-list {
  overflow-y: auto;
  max-height: 46vh;
  min-height: 80px;
  margin-bottom: 12px;
}

.credits-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 13px;
}

.ch-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ch-type {
  color: var(--text-primary);
  font-weight: 600;
}

.ch-time {
  color: var(--text-muted);
  font-size: 11px;
}

.ch-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.ch-delta {
  font-weight: 700;
}

.ch-delta.plus {
  color: #4ade80;
}

.ch-delta.minus {
  color: #f87171;
}

.ch-balance {
  color: var(--text-muted);
  font-size: 11px;
}

.credits-history-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 24px 0;
}

.credits-history-more {
  width: 100%;
  padding: 8px;
  margin-bottom: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}

.credits-history-more:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
}

.credits-history-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.credits-history-link {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  padding: 0 4px;
}

.credits-history-link:hover {
  text-decoration: underline;
}

/* ============ 照片积分 ============ */
.photo-credits-sub {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
  margin-top: 4px;
}

/* ============ 语音消息（VOICE_ENABLED=false 时元素不渲染，样式无影响） ============ */
/* 输入栏麦克风按钮 */
.btn-voice {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transition: all var(--transition);
}
.btn-voice:hover { color: var(--accent); background: var(--accent-glow); }
.btn-voice:active { transform: scale(0.9); }

/* 语音条（微信式） */
.voice-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 14px;
  min-width: 130px;
  max-width: 280px;
  background: var(--accent-glow);
  /* 禁用浏览器长按默认行为（长按语音气泡弹自动播放菜单） */
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
.message.user .voice-bar { background: rgba(255, 255, 255, 0.08); }

.voice-play {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.voice-play:hover { background: var(--accent-hover); }

.voice-wave {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 24px;
}
.voice-wave span {
  flex: 1;
  max-width: 4px;
  height: 40%;
  background: var(--accent);
  border-radius: 2px;
  opacity: 0.75;
}
.voice-wave span:nth-child(2) { height: 90%; }
.voice-wave span:nth-child(3) { height: 55%; }
.voice-wave span:nth-child(4) { height: 100%; }
.voice-wave span:nth-child(5) { height: 65%; }
.voice-wave span:nth-child(6) { height: 85%; }
.voice-wave span:nth-child(7) { height: 45%; }

/* 播放中波形跳动（兄弟选择器：按钮.playing 带动波形） */
.voice-play.playing ~ .voice-wave span { animation: voiceWave 0.9s ease-in-out infinite; }
.voice-play.playing ~ .voice-wave span:nth-child(2) { animation-delay: 0.1s; }
.voice-play.playing ~ .voice-wave span:nth-child(3) { animation-delay: 0.2s; }
.voice-play.playing ~ .voice-wave span:nth-child(4) { animation-delay: 0.05s; }
.voice-play.playing ~ .voice-wave span:nth-child(5) { animation-delay: 0.25s; }
.voice-play.playing ~ .voice-wave span:nth-child(6) { animation-delay: 0.15s; }
.voice-play.playing ~ .voice-wave span:nth-child(7) { animation-delay: 0.3s; }
@keyframes voiceWave {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1); }
}

/* 语音骨架（voicePending 未合成）：虚线轮廓 + 点击懒合成 */
.voice-bar-pending {
  background: transparent;
  border: 1px dashed var(--border, rgba(255, 255, 255, 0.18));
}
.voice-bar-pending .voice-wave span { opacity: 0.35; }
.voice-duration-est { font-style: italic; }

/* 懒合成中：播放键转圈 + 禁止重复点击 */
.voice-bar.synthing .voice-play {
  pointer-events: none;
  opacity: 0.8;
}
.voice-bar.synthing .voice-play-icon {
  display: inline-block;
  animation: voiceSpin 0.8s linear infinite;
}
@keyframes voiceSpin { to { transform: rotate(360deg); } }

/* 长按语音气泡弹出的自动播放菜单 */
.voice-menu-card { max-width: 320px; }
.voice-menu-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  text-align: center;
}
.menu-option {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: none;
  background: none;
  text-align: left;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: 8px;
  margin-bottom: 4px;
  transition: background var(--transition, 0.2s);
}
.menu-option:hover { background: var(--bg-hover); }
.menu-option.active {
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 600;
}
.voice-menu-card .btn-cancel { margin-top: 6px; }

/* 设置弹窗：开关行（checkbox + 文案） */
.form-field-toggle { padding: 10px 0; }
.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}
.toggle-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex: 0 0 auto;
}

.voice-duration {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--text-muted);
  min-width: 28px;
  text-align: right;
}

/* 用户语音转写小字 */
.voice-transcript {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  word-break: break-word;
  white-space: pre-wrap;
}

/* AI 语音气泡“转文本”按钮 */
.voice-to-text {
  margin-top: 6px;
  border: 1px solid rgba(199, 91, 138, 0.4);
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  padding: 3px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
}
.voice-to-text:hover { background: var(--accent-glow); }

/* 转文本展开区域 */
.voice-text {
  margin-top: 8px;
  word-break: break-word;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 8px;
}
.voice-text p { margin: 0 0 6px; }

/* 录音提示浮层 */
.voice-recording-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}
.voice-recording-box {
  background: var(--bg-secondary);
  border: 1px solid rgba(199, 91, 138, 0.5);
  border-radius: 16px;
  padding: 22px 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow: 0 0 40px var(--accent-glow);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.voice-recording-box.cancel {
  border-color: var(--danger);
  box-shadow: 0 0 40px rgba(212, 86, 94, 0.25);
}
.voice-recording-wave {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 30px;
}
.voice-recording-wave span {
  width: 5px;
  height: 10px;
  border-radius: 3px;
  background: var(--accent);
  animation: voiceRecordingWave 1s ease-in-out infinite;
}
.voice-recording-wave span:nth-child(2) { animation-delay: 0.15s; height: 18px; }
.voice-recording-wave span:nth-child(3) { animation-delay: 0.3s; height: 26px; }
.voice-recording-wave span:nth-child(4) { animation-delay: 0.45s; height: 16px; }
.voice-recording-wave span:nth-child(5) { animation-delay: 0.6s; }
.voice-recording-box.cancel .voice-recording-wave span {
  background: var(--danger);
  animation-play-state: paused;
}
@keyframes voiceRecordingWave {
  0%, 100% { transform: scaleY(0.5); }
  50% { transform: scaleY(1.4); }
}
.voice-recording-text {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color 0.2s;
}
.voice-recording-text.cancel { color: var(--danger); }

/* ========== 订阅与记录弹窗（2026-10-08） ========== */
.sub-manage-card {
  background: var(--bg-secondary, #f7f7fa);
  border: 1px solid var(--border-color, #e5e5ee);
  border-radius: 14px;
  padding: 16px;
}
.sub-manage-card .smc-label { font-size: 12px; color: var(--text-muted, #999); }
.sub-manage-card .smc-plan { font-size: 26px; font-weight: 700; color: var(--text-primary, #222); }
.sub-manage-card .smc-expire { font-size: 13px; color: var(--text-secondary, #666); margin-top: 4px; }
.sub-manage-card .smc-manage { margin-top: 12px; width: 100%; }
.sub-manage-card .smc-noautorenew { font-size: 12px; color: var(--text-muted, #999); margin-top: 12px; }
.sub-order-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: var(--bg-secondary, #f7f7fa);
  border: 1px solid var(--border-color, #e5e5ee);
  border-radius: 10px;
}
.sub-order-row .sor-product { font-size: 14px; font-weight: 600; color: var(--text-primary, #222); }
.sub-order-row .sor-meta { font-size: 12px; color: var(--text-muted, #999); margin-top: 2px; }
.sub-order-row .sor-side { text-align: right; }
.sub-order-row .sor-type { font-size: 12px; color: var(--text-secondary, #666); }
.sub-order-row .sor-amount { font-size: 13px; font-weight: 600; color: var(--accent, #7c5cff); margin-top: 2px; }
