/* CSS 自定义属性（变量）定义 */
:root {
  /* 颜色变量 */
  --color-primary: rgba(0, 112, 240, 1);
  --color-primary-light: rgba(235, 244, 255, 1);
  --color-secondary: rgba(255, 255, 255, 1);
  --color-text-primary: rgba(31, 41, 55, 1);
  --color-text-secondary: rgba(107, 114, 128, 1);
  --color-text-tertiary: rgba(156, 163, 175, 1);
  --color-background: rgba(255, 255, 255, 1);
  --color-background-secondary: rgba(249, 250, 251, 1);
  --color-border: rgba(229, 231, 235, 1);
  --color-shadow: rgba(0, 0, 0, 0.05);
  --color-chat-sent: rgba(0, 112, 240, 1);
  --color-chat-received: rgba(229, 231, 235, 1);
  
  /* 字体变量 */
  --font-family-primary: 'DM Sans', sans-serif;
  --font-family-secondary: 'Roboto', sans-serif;
  
  /* 尺寸变量 - 使用相对单位以适配不同屏幕 */
  --container-max-width: 402px;
  --border-radius-small: 0.5rem;
  --border-radius-medium: 0.75rem;
  --border-radius-large: 1rem;
  --border-radius-round: 3.125rem;
  --border-radius-avatar: 50%;
  --spacing-xs: 0.25rem; /* 4px */
  --spacing-sm: 0.5rem; /* 8px */
  --spacing-md: 0.75rem; /* 12px */
  --spacing-lg: 1rem; /* 16px */
  --spacing-xl: 1.5rem; /* 24px */
  --spacing-xxl: 2rem; /* 32px */
  
  /* 安全区域变量（用于iPhone X等有刘海的设备） */
  --safe-area-inset-top: env(safe-area-inset-top, 0px);
  --safe-area-inset-right: env(safe-area-inset-right, 0px);
  --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-inset-left: env(safe-area-inset-left, 0px);
  
  /* 阴影变量 */
  --shadow-card: 0 2px 8px var(--color-shadow);
  --shadow-hover: 0 4px 6px 0px rgba(0, 0, 0, 0.1);
  
  /* 过渡变量 */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  
  /* 字体大小 - 使用rem单位，基础16px */
  --font-size-xs: 0.75rem; /* 12px */
  --font-size-sm: 0.875rem; /* 14px */
  --font-size-base: 1rem; /* 16px */
  --font-size-lg: 1.125rem; /* 18px */
  --font-size-xl: 1.25rem; /* 20px */
  --font-size-2xl: 1.5rem; /* 24px */
  --font-size-3xl: 2rem; /* 32px */
  
  /* 触摸目标最小尺寸（iOS建议44x44px） */
  --touch-target-min: 2.75rem; /* 44px */
}

/* ===================
   全局样式重置
   =================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  /* 设置基础字体大小为16px，便于rem计算 */
  font-size: 16px;
  /* 禁止iOS Safari的字体大小自动调整 */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* 平滑滚动 */
  scroll-behavior: smooth;
}

body {
  width: 100%;
  height: 100%;
  /* 防止横向滚动 */
  overflow-x: hidden;
  background-color: var(--color-background);
  font-family: var(--font-family-primary);
  color: var(--color-text-primary);
  /* iOS Safari优化 */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* 安全区域适配 */
  padding-top: var(--safe-area-inset-top);
  padding-left: var(--safe-area-inset-left);
  padding-right: var(--safe-area-inset-right);
}

/* ===================
   布局组件
   =================== */
body {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.app-container {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.content-container {
  flex: 1;
  overflow: hidden;
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.content-area {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  opacity: 0 !important;
  transform: translateX(100%) !important;
  transition: opacity var(--transition-normal), transform var(--transition-normal);
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
}

.content-area.active {
  opacity: 1 !important;
  transform: translateX(0) !important;
  pointer-events: all;
  position: absolute;
  z-index: 1;
}

.page-container {
  width: 100%;
  height: 100%;
  position: relative;
  background-color: var(--color-background);
  border-radius: 0;
  padding: var(--spacing-lg);
  margin: 0;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  /* 适配顶部固定标题 */
  padding-top: calc(64px + var(--safe-area-inset-top) + var(--spacing-lg));
  /* 适配底部导航栏和安全区域 - 为底部导航栏预留空间 */
  padding-bottom: calc(80px + var(--safe-area-inset-bottom) + var(--spacing-lg));
  /* 隐藏滚动条，但保留滚动功能 */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  /* iOS平滑滚动 */
  -webkit-overflow-scrolling: touch;
}

/* 对话页面的特殊样式 */
#chat-content {
  height: 100% !important;
  min-height: 100% !important;
}

#chat-content .page-header.with-back,
#add-character-content .page-header.with-back,
#recharge-content .page-header.with-back {
  justify-content: center; /* 标题居中 */
}

#chat-content .page-header.with-back .page-title,
#add-character-content .page-header.with-back .page-title,
#recharge-content .page-header.with-back .page-title {
  margin-left: 0; /* 移除左边距 */
  text-align: center;
  flex: 1;
}

#chat-content .back-button,
#add-character-content .back-button,
#recharge-content .back-button {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
}

/* 聊天页的 .page-container 不滚动，真正的滚动容器是 #chat-messages */
#chat-content .page-container {
  padding-top: calc(64px + var(--safe-area-inset-top) + var(--spacing-lg));
  /* 移除 padding-bottom，不再通过 page-container 预留底部空间 */
  height: 100%;
  display: flex;
  flex-direction: column;
  /* 移除滚动，真正的滚动容器是 #chat-messages */
  overflow: hidden; /* 覆盖通用规则，禁用滚动 */
}

#chat-content .page-content {
  flex: 1 1 0;
  height: 0; /* 配合 flex: 1，强制 flex 容器有高度限制 */
  min-height: 0; /* 允许 flex 子元素收缩 */
  display: flex;
  flex-direction: column;
}

#chat-content .page-section {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  height: 0; /* 配合 flex: 1，强制 flex 容器有高度限制 */
  min-height: 0; /* 允许 flex 子元素收缩，确保可以滚动 */
  /* 不再需要 padding-bottom，使用 scroll-padding-bottom 在滚动时预留空间 */
}

.page-container::-webkit-scrollbar {
  display: none; /* Chrome, Safari and Opera */
}

.page-content {
  width: 100%;
  height: auto;
  position: relative;
  background-color: var(--color-background);
  border-radius: 0;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.page-section {
  width: 100%;
  margin-bottom: var(--spacing-lg);
  position: relative;
}

.page-section:last-child {
  margin-bottom: 0;
}

/* 删除不再需要的full-height类 */

.page-card {
  width: 100%;
  background-color: var(--color-background);
  border-radius: var(--border-radius-medium);
  box-shadow: var(--shadow-card);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  box-sizing: border-box;
}

.page-card:last-child {
  margin-bottom: 0;
}



/* ===================
   页面标题组件
   =================== */
.page-header {
  height: 64px;
  display: flex;
  align-items: center;
  margin-bottom: 0;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background-color: var(--color-background);
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding: 0 var(--spacing-lg);
  box-sizing: border-box;
}

.page-title {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  font-family: var(--font-family-primary);
  color: var(--color-text-primary);
  margin: 0;
}

.page-header.with-back {
  padding-left: 24px;
}

.page-header.with-back .page-title {
  margin-left: var(--spacing-lg);
}

.page-header.center {
  justify-content: center;
  margin-top: 0;
  margin-bottom: 0;
}

.page-header.left {
  justify-content: flex-start;
  padding-left: 24px;
  margin-top: 0;
  margin-bottom: 0;
}

/* ===================
   按钮组件
   =================== */
.back-button {
  background: none;
  border: none;
  font-size: 1.25rem; /* 20px */
  cursor: pointer;
  color: var(--color-text-primary);
  width: var(--touch-target-min);
  height: var(--touch-target-min);
  display: flex;
  align-items: center;
  justify-content: center;
  /* 触摸优化 */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  padding: 0;
  flex-shrink: 0;
}

.login-btn,
.pay-btn,
.save-button {
  width: 100%;
  min-height: var(--touch-target-min); /* 确保按钮高度符合触摸标准 */
  padding: var(--spacing-lg);
  background-color: #303437;
  color: var(--color-secondary);
  border: none;
  border-radius: var(--border-radius-small);
  font-size: var(--font-size-base);
  font-weight: 500;
  font-family: var(--font-family-secondary);
  cursor: pointer;
  margin-top: var(--spacing-lg);
  transition: background-color var(--transition-fast);
  /* 触摸优化 */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  box-sizing: border-box;
}

/* 登录按钮不改变颜色 */
.login-btn:hover {
  background-color: #303437;
  filter: none;
}

/* 支付按钮不改变颜色 */
.pay-btn:hover {
  background-color: #303437;
  filter: none;
}

/* 其他按钮保持悬停效果 */
.save-button:hover {
  background-color: var(--color-primary);
  filter: brightness(0.95);
}

/* 移除特定按钮的悬停效果 */
.save-button.no-hover:hover {
  background-color: #303437;
  filter: none;
}

/* ===================
   底部导航栏组件
   =================== */
.bottom-navigation {
  height: 80px;
  background: transparent !important;
  background-color: transparent !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--spacing-lg) 0;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  /* 安全区域适配 */
  padding-bottom: calc(var(--spacing-lg) + var(--safe-area-inset-bottom));
  /* 输入法弹出时隐藏底部导航 */
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
  /* 确保完全透明，不遮挡背景 */
  pointer-events: none;
}

/* 输入法弹出时隐藏底部导航 */
.bottom-navigation.keyboard-visible {
  opacity: 0;
  pointer-events: none;
  transform: translateY(100%);
}

/* 新的统一导航栏样式 */
.unified-navbar {
  width: 100%;
  max-width: 320px;
  height: 60px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0.5rem;
  border-radius: 30px;
  box-shadow: 10px 14px 56px 0px rgba(0, 0, 0, 0.12);
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  /* 响应式宽度 */
  box-sizing: border-box;
  /* 恢复指针事件，使导航栏可点击 */
  pointer-events: auto;
}

.navbar-items {
  width: 100%;
  max-width: 295px;
  height: 44px;
  position: relative;
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-xs);
  box-sizing: border-box;
}

.navbar-item {
  width: 60px;
  height: 44px;
  position: relative;
  flex-shrink: 0;
  background-color: transparent;
  cursor: pointer;
  transition: transform 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

.navbar-item:hover {
  transform: scale(1.1);
}

.navbar-item.active {
  width: 70px;
  height: 44px;
  position: relative;
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  gap: 3px;
  align-items: center;
  padding: 0 16px 0 16px;
  border-radius: 22px;
  background-color: rgba(48, 52, 55, 1);
}

.navbar-item.active:hover {
  transform: none;
}

.icon-container {
  width: 44px;
  height: 44px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.navbar-item.active .icon-container {
  position: relative;
  width: 24px;
  height: 24px;
}

.icon-group {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.icon-vector {
  width: 22px;
  height: 22px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 22px;
}

.navbar-text {
  font-size: 14px;
  font-family: DM Sans;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  justify-content: center;
  letter-spacing: 0em;
  line-height: 20px;
  color: rgba(242.35, 243.82, 244.8, 1);
  width: auto;
  height: auto;
  position: relative;
  flex-shrink: 0;
  white-space: pre;
  flex-grow: 0;
  display: none;
}

.navbar-item.active .navbar-text {
  display: block;
}

/* 图标样式 */
/* 消息图标 */
.message-icon .icon-vector {
  font-family: 'iconfont';
  color: rgba(0, 0, 0, 0.5);
}
.message-icon .icon-vector:before {
  content: '\e61e';
}

/* 发现图标 */
.discover-icon .icon-vector {
  font-family: 'iconfont-faxian';
  color: rgba(0, 0, 0, 0.5);
}
.discover-icon .icon-vector:before {
  content: '\e61c';
}

/* 添加图标 */
.add-icon .icon-vector {
  font-family: 'iconfont';
  color: rgba(0, 0, 0, 0.5);
}
.add-icon .icon-vector:before {
  content: '\e61d';
}

/* 我的图标 */
.profile-icon .icon-vector {
  font-family: 'iconfont';
  color: rgba(0, 0, 0, 0.5);
}
.profile-icon .icon-vector:before {
  content: '\e61c';
}

/* 选中状态的图标颜色 */
.navbar-item.active .icon-vector {
  color: white;
}

/* 交互效果 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.navbar-item.active .navbar-text {
  animation: fadeIn 0.2s ease-in-out;
}

/* ===================
   发现页面样式
   =================== */
.discover-header {
  text-align: left;
  margin-left: 24px;
  margin-bottom: var(--spacing-xl);
  height: 64px;
  display: flex;
  align-items: center;
}

.discover-title {
  font-size: var(--font-size-2xl);
  font-family: var(--font-family-primary);
  font-weight: 700;
  line-height: 32px;
  color: var(--color-text-primary);
  text-align: left;
  margin-top: 0;
}

.search-bar {
  width: 100%;
  height: 34px;
  display: flex;
  align-items: center;
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--border-radius-round);
  background-color: var(--color-background-secondary);
  margin-bottom: var(--spacing-xl);
}

.search-icon {
  width: 16px;
  height: 16px;
  margin-right: var(--spacing-sm);
  background-image: url(243203c055db16f5a237e141d13ee58ba210d548.png);
  background-size: cover;
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  background-color: transparent;
  font-size: 15px;
  font-family: var(--font-family-secondary);
  color: var(--color-text-secondary);
}

/* 角色网格布局 - 瀑布流 */
.characters-grid {
  column-count: 2;
  column-gap: var(--spacing-lg);
  column-fill: auto; /* 改为auto，让新元素追加到最后一列，避免重新分配导致重叠 */
}

/* 角色卡片样式 - 瀑布流布局 */
.character-card {
  width: 100%;
  break-inside: avoid;
  page-break-inside: avoid;
  border-radius: var(--border-radius-medium);
  box-shadow: var(--shadow-hover);
  background-color: var(--color-background);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr auto;
  grid-template-areas: 
    "avatar header"
    "tags tags"
    "desc desc";
  padding: 12px;
  gap: 12px;
  box-sizing: border-box;
  position: relative;
  margin-bottom: var(--spacing-lg);
}

.character-card:active {
  transform: scale(0.98);
  box-shadow: var(--shadow-card);
}

/* 圆形头像容器 - 左上角，占据四分之一 */
.character-avatar-container {
  grid-area: avatar;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  position: relative;
  padding-right: 6px;
  padding-top: 0;
}

/* 圆形头像 - 优化后 */
.character-image {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-color: var(--color-border);
  border: 2.5px solid var(--color-background);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  position: relative;
  flex-shrink: 0;
  overflow: hidden; /* 确保SVG被限制在容器内 */
}

/* 年龄和性别信息容器 - 放在名称下面 */
.character-age-gender {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 2px 7px;
  border-radius: 50px;
  border: 2.5px solid white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  white-space: nowrap;
  min-height: 16px;
  width: fit-content;
  margin: 2px auto 0;
}

.character-card.female .character-age-gender {
  background-color: #ff3b30;
}

.character-card.male .character-age-gender {
  background-color: #007aff;
}

.character-card.robot .character-age-gender {
  background-color: #8e8e93;
}

/* 性别标识图标 - 与年龄合并显示 */
.character-gender-badge {
  width: 11px;
  height: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 6px;
  color: white;
  line-height: 1;
}

/* 角色头部信息 - 右上角，四分之一区域 */
.character-header {
  grid-area: header;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding-left: 6px;
  padding-top: 0;
  padding-bottom: 0;
  position: relative;
  height: 100%;
}

.character-name {
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-family-secondary);
  color: var(--color-text-primary);
  line-height: 1.3;
  text-align: left;
  align-self: flex-start;
  width: 100%;
}

.character-age {
  font-size: 8px;
  font-weight: 600;
  font-family: var(--font-family-secondary);
  white-space: nowrap;
  line-height: 1.2;
  text-align: center;
  color: white;
  letter-spacing: 0.1px;
}

/* 标签区域 - 中间位置，占据整行 */
.character-tags {
  grid-area: tags;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-content: center;
  width: 100%;
  padding: 0;
}

/* 描述信息 - 底部 */
.character-info {
  grid-area: desc;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  width: 100%;
  padding-top: 0;
}

.character-desc {
  font-size: 13px;
  font-weight: 400;
  font-family: var(--font-family-secondary);
  color: var(--color-text-secondary);
  line-height: 1.5;
  width: 100%;
  word-wrap: break-word;
  word-break: break-word;
}

/* 角色列表加载提示 */
.loading-more {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-lg);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  gap: var(--spacing-sm);
  width: 100%;
  grid-column: 1 / -1;
}

.loading-more .loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.character-tag {
  padding: 4px 9px;
  background-color: var(--color-background-secondary);
  border-radius: var(--border-radius-small);
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-family-secondary);
  color: var(--color-text-primary);
  box-sizing: border-box;
  text-align: center;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.4;
}

/* 标签宽度控制 - 适配小卡片 */
.character-tag.tag-2-chars {
  flex: 0 0 auto;
  min-width: auto;
}

.character-tag.tag-3-chars {
  flex: 0 0 auto;
  min-width: auto;
}

.character-tag.tag-4-chars {
  flex: 0 0 auto;
  min-width: auto;
}

.character-tag.tag-default {
  flex: 0 0 auto;
  min-width: auto;
}

/* 女性角色标签样式 */
.character-card.female .character-tag {
  color: #ff3b30;
  background-color: rgba(255, 59, 48, 0.1);
}

/* 男性角色标签样式 */
.character-card.male .character-tag {
  color: #007aff;
  background-color: rgba(0, 122, 255, 0.1);
}

/* 机器人角色标签样式 */
.character-card.robot .character-tag {
  color: #8e8e93;
  background-color: rgba(142, 142, 147, 0.1);
}

/* ===================
   消息页面样式
   =================== */
.message-list-item {
  width: 100%;
  height: 80px;
  position: relative;
  border-radius: 12px;
  box-shadow: 0px 4px 6px 0px rgba(0, 0, 0, 0.1);
  background-color: white;
  margin-bottom: 12px;
  cursor: pointer;
}

.message-list-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.message-avatar {
  width: 56px;
  height: 56px;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  position: absolute;
  left: 12px;
  top: 12px;
  border-radius: 50%;
}

.message-avatar::after {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  background-color: #ff3b30;
  border-radius: 50%;
  border: 2px solid white;
}

.message-list-item.read .message-avatar::after {
  display: none;
}

.message-info {
  width: 247px;
  height: 56px;
  position: absolute;
  left: 84px;
  top: 12px;
}

.message-header {
  width: 247px;
  height: 21px;
  position: absolute;
  left: 0px;
  top: 0px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.message-name {
  font-size: 16px;
  font-family: Roboto;
  font-weight: 500;
  font-feature-settings: "frac" 1, "lnum" 1, "pnum" 1;
  color: rgba(31, 41, 55, 255);
  width: auto;
  height: auto;
}

.message-preview {
  font-size: 14.4px;
  font-family: Roboto;
  font-weight: 400;
  font-feature-settings: "frac" 1, "lnum" 1, "pnum" 1;
  color: rgba(107, 114, 128, 255);
  width: 200px;
  height: auto;
  position: absolute;
  left: 0px;
  top: 25px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-time {
  font-size: 12px;
  font-family: Roboto;
  font-weight: 400;
  font-feature-settings: "frac" 1, "lnum" 1, "pnum" 1;
  color: rgba(107, 114, 128, 255);
  width: auto;
  height: auto;
}

/* ===================
   对话页面样式 - CSS 实现自动滚动和布局
   =================== */

/* 对话消息容器 - 真正的滚动容器 */
#chat-messages {
  /* 关键修复：使用 height: 0 配合 flex: 1，确保 flex 容器有明确高度限制 */
  flex: 1 1 0;
  height: 0; /* 配合 flex: 1，强制 flex 容器有高度限制 */
  min-height: 0; /* 允许 flex 子元素收缩，确保可以滚动 */
  
  overflow-y: auto;
  overflow-x: hidden;
  
  padding: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  
  /* CSS 自动滚动到底部 - 使用 scroll-behavior 实现平滑滚动 */
  /* 注意：JavaScript 可能会临时设置为 'auto' 以实现精确滚动 */
  scroll-behavior: smooth;
  
  /* 使用 scroll-snap 实现消息对齐（可选） */
  scroll-snap-type: y proximity;
  
  /* 预留底部空间，避免被 fixed 输入框遮挡 */
  /* 必须使用 padding-bottom（不是 margin-bottom） */
  padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px));
  
  /* 可选增强：scrollIntoView 等用法时使用 */
  scroll-padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px));
  
  /* 隐藏滚动条但保留滚动功能 */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  
  /* 优化滚动性能 */
  -webkit-overflow-scrolling: touch; /* iOS 平滑滚动 */
  will-change: scroll-position; /* 提示浏览器优化滚动 */
  
  /* 移除 justify-content: flex-end，这会导致内容被压缩，scrollHeight = clientHeight */
  /* 滚动到底部应该由 JavaScript 实现，而不是 flex 布局 */
}

/* 兼容类选择器（如果其他地方使用了 .chat-messages） */
.chat-messages {
  /* 继承 #chat-messages 的样式 */
  flex: 1 1 0;
  height: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--spacing-lg);
  padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
  scroll-padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px));
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  will-change: scroll-position;
}

/* 精确滚动模式 - JavaScript 会临时应用此样式 */
.chat-messages.scroll-precise {
  scroll-behavior: auto !important;
}

.chat-messages::-webkit-scrollbar {
  display: none; /* Chrome, Safari and Opera */
}

/* 消息项 - 使用 scroll-snap-align 实现对齐 */
.chat-messages > * {
  scroll-snap-align: end;
  flex-shrink: 0; /* 防止消息被压缩 */
}

/* 接收消息容器 - CSS 布局优化 */
.frame-403_2934 {
    width: 100%;
    height: auto;
    position: relative;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    align-items: flex-start;
    
    /* CSS 动画 - 消息出现效果 */
    animation: messageSlideIn 0.3s ease-out;
}

/* 发送消息容器 - 右对齐 */
.frame-403_2934.message-sent {
    align-items: flex-end;
}

/* 消息出现动画 - 纯 CSS 实现 */
@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 消息时间戳样式 - CSS 优化 */
.text-403_2935 {
    font-size: var(--font-size-xs);
    font-family: var(--font-family-primary);
    font-weight: 500;
    letter-spacing: 0em;
    line-height: 16px;
    color: var(--color-text-tertiary);
    width: auto;
    height: auto;
    position: relative;
    flex-shrink: 0;
    white-space: nowrap; /* 时间戳不换行 */
    flex-grow: 0;
    align-self: flex-start;
    margin-left: var(--spacing-lg);
    
    /* 时间戳淡入动画 */
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.frame-403_2936 {
    width: 100%;
    height: auto;
    position: relative;
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: flex-start;
}

.frame-403_2937 {
    width: 32px;
    height: 32px;
    position: relative;
    flex-shrink: 0;
}

.vector-403_2938 {
    width: 32px;
    height: 32px;
    background-image: url(Ellipse_403_2938.png);
    background-size: 100% 100%;
    background-repeat: no-repeat;
    position: absolute;
    left: 0px;
    top: 0px;
}

.frame-403_2939 {
    width: 16px;
    height: 16px;
    overflow: hidden;
    position: relative;
    left: 8px;
    top: 8px;
}

.vector-403_2940 {
    width: 92%;
    height: 88%;
    background-image: url(Vector_403_2940.png);
    background-size: 100% 100%;
    background-repeat: no-repeat;
    position: absolute;
    left: 4%;
    right: 4%;
    top: 6%;
    bottom: 6%;
}

/* 接收消息气泡样式 - CSS 优化 */
.frame-403_2941 {
    max-width: 70%;
    min-width: fit-content;
    width: fit-content;
    height: auto;
    position: relative;
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    gap: var(--spacing-xs);
    padding: 10px 16px;
    border-radius: var(--border-radius-round);
    background-color: rgba(242.35, 243.82, 244.80, 1);
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word; /* 长单词换行 */
    box-sizing: border-box;
    
    /* CSS 过渡效果 */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* 消息气泡悬停效果（桌面端） */
@media (hover: hover) {
    .frame-403_2941:hover {
        transform: translateY(-1px);
        box-shadow: var(--shadow-card);
    }
}

.text-403_2942 {
    font-size: 16px;
    font-family: DM Sans;
    font-weight: 500;
    letter-spacing: 0em;
    line-height: 24px;
    color: rgba(48, 52, 55, 1);
    width: 100%;
    height: auto;
    position: relative;
    flex-shrink: 1;
    flex-grow: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 发送消息气泡样式 - CSS 优化 */
.frame-403_2943 {
    max-width: 70%;
    min-width: fit-content;
    width: fit-content;
    height: auto;
    position: relative;
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    gap: var(--spacing-xs);
    padding: 10px 16px;
    border-radius: var(--border-radius-round);
    background-color: rgba(242, 248, 255, 1);
    align-self: flex-end;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word; /* 长单词换行 */
    box-sizing: border-box;
    
    /* CSS 过渡效果 */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* 发送消息气泡悬停效果（桌面端） */
@media (hover: hover) {
    .frame-403_2943:hover {
        transform: translateY(-1px);
        box-shadow: var(--shadow-card);
    }
}

.text-403_2944 {
    font-size: 16px;
    font-family: DM Sans;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    justify-content: center;
    letter-spacing: 0em;
    line-height: 24px;
    color: rgba(0, 107.10003662109375, 229.5, 1);
    width: 100%;
    height: auto;
    position: relative;
    flex-shrink: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 另一种发送消息气泡样式 */
.frame-403_2945 {
    max-width: 70%;
    height: auto;
    position: relative;
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    gap: 4px;
    padding: 10px 16px;
    border-radius: 24px 24px 24px 24px;
    background-color: rgba(242, 248, 255, 1);
    align-self: flex-end;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
}

.text-403_2946 {
    font-size: 16px;
    font-family: DM Sans;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    justify-content: center;
    letter-spacing: 0em;
    line-height: 24px;
    color: rgba(0, 107.10003662109375, 229.5, 1);
    width: 100%;
    height: auto;
    position: relative;
    flex-shrink: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.chat-input-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--spacing-sm) var(--spacing-lg);
  background-color: var(--color-background);
  box-sizing: border-box;
  min-height: 80px;
  height: auto;
  margin-top: auto;
  /* 安全区域适配 */
  padding-bottom: calc(var(--spacing-sm) + var(--safe-area-inset-bottom));
}

.chat-input {
  flex: 1;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-round);
  padding: var(--spacing-lg);
  font-size: var(--font-size-base);
  font-family: var(--font-family-secondary);
  outline: none;
}

.send-btn {
  background-color: rgba(48, 52, 55, 1);
  color: var(--color-secondary);
  border: none;
  border-radius: var(--border-radius-round);
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  margin-left: var(--spacing-sm);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
  /* 确保触摸目标足够大 */
  touch-action: manipulation;
}

.send-btn i {
  font-size: 20px;
}

/* ===================
   对话页面辅助样式 - CSS 实现
   =================== */

/* 输入指示器 - 纯 CSS 动画实现 */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-md) var(--spacing-lg);
  margin: var(--spacing-sm) 0;
  align-self: flex-start;
}

.typing-indicator .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-text-tertiary);
  animation: typingDot 1.4s infinite ease-in-out;
}

.typing-indicator .dot:nth-child(1) {
  animation-delay: 0s;
}

.typing-indicator .dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator .dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingDot {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

/* 空状态样式 */
.chat-messages .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xxl);
  color: var(--color-text-tertiary);
  text-align: center;
  flex: 1;
  min-height: 200px;
}

.chat-messages .empty-state-icon {
  font-size: 48px;
  margin-bottom: var(--spacing-lg);
  opacity: 0.5;
}

.chat-messages .empty-state-text {
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
}

/* CSS 自动滚动到底部 - 使用锚点实现 */
.chat-messages.auto-scroll {
  scroll-behavior: smooth;
}

/* 消息容器自动滚动到底部（使用 CSS anchor 定位，需要浏览器支持） */
.chat-messages::after {
  content: '';
  display: block;
  height: 1px;
  scroll-margin-top: auto;
  scroll-snap-align: end;
}

/* 响应式优化 - 小屏幕 */
@media (max-width: 375px) {
  .chat-messages {
    padding: var(--spacing-md);
    gap: var(--spacing-md);
  }
  
  .frame-403_2941,
  .frame-403_2943 {
    max-width: 85%; /* 小屏幕下消息气泡更宽 */
  }
  
  .text-403_2942,
  .text-403_2944 {
    font-size: var(--font-size-sm); /* 小屏幕字体稍小 */
  }
}

/* 响应式优化 - 大屏幕 */
@media (min-width: 768px) {
  .chat-messages {
    padding: var(--spacing-xl);
  }
  
  .frame-403_2941,
  .frame-403_2943 {
    max-width: 60%; /* 大屏幕下消息气泡更窄 */
  }
}

/* 消息加载动画 - CSS 实现 */
.message-loading {
  opacity: 0.6;
  animation: messagePulse 1.5s ease-in-out infinite;
}

@keyframes messagePulse {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 0.8;
  }
}

/* 消息发送状态指示器 */
.message-status {
  font-size: var(--font-size-xs);
  color: var(--color-text-tertiary);
  margin-top: var(--spacing-xs);
  align-self: flex-end;
}

.message-status.sending {
  opacity: 0.6;
}

.message-status.sent {
  opacity: 1;
}

.message-status.failed {
  color: #ef4444;
}

/* 消息选择状态（长按选择） */
.chat-messages.select-mode .frame-403_2934 {
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.chat-messages.select-mode .frame-403_2934.selected {
  background-color: var(--color-primary-light);
  border-radius: var(--border-radius-medium);
  padding: var(--spacing-xs);
}

/* ===================
   登录页面样式
   =================== */
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--spacing-xl);
}

.login-logo {
  width: 80px;
  height: 80px;
  margin-bottom: var(--spacing-xl);
  border-radius: 40px;
  background-color: var(--color-primary);
  display: flex;
  justify-content: center;
  align-items: center;
}

.login-logo i {
  font-size: 40px;
  color: var(--color-secondary);
}

.login-title {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  font-family: var(--font-family-primary);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-xl);
}

.form-group {
  width: 100%;
  margin-bottom: var(--spacing-lg);
}

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 500;
  font-family: var(--font-family-secondary);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-sm);
}

.form-input {
  width: 100%;
  min-height: var(--touch-target-min); /* 确保输入框高度符合触摸标准 */
  padding: var(--spacing-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-small);
  font-size: var(--font-size-base);
  font-family: var(--font-family-secondary);
  outline: none;
  transition: border-color var(--transition-fast);
  box-sizing: border-box;
  /* 防止iOS自动缩放 */
  font-size: 16px;
  /* 触摸优化 */
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  /* 确保输入框可以正常唤起输入法 */
  -webkit-user-select: text;
  user-select: text;
  touch-action: manipulation;
  /* 确保输入框可以正常获取焦点 */
  pointer-events: auto;
}

/* 防止iOS Safari在聚焦时自动缩放 */
@media screen and (max-width: 480px) {
  .form-input,
  .form-textarea,
  .form-select,
  .frame-403_3019 {
    font-size: 16px !important;
  }
}

.form-input:focus {
  border-color: var(--color-primary);
  /* 确保聚焦时显示光标 */
  caret-color: var(--color-text-primary);
}

.form-textarea {
  width: 100%;
  padding: var(--spacing-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-small);
  font-size: var(--font-size-base);
  font-family: var(--font-family-secondary);
  outline: none;
  min-height: 100px;
  resize: vertical;
  transition: border-color var(--transition-fast);
  /* 确保文本域可以正常唤起输入法 */
  -webkit-user-select: text;
  user-select: text;
  touch-action: manipulation;
  /* 确保文本域可以正常获取焦点 */
  pointer-events: auto;
}

.form-textarea:focus {
  border-color: var(--color-primary);
  /* 确保聚焦时显示光标 */
  caret-color: var(--color-text-primary);
}

.login-options {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-top: var(--spacing-lg);
}

.forgot-password,
.register-link {
  font-size: var(--font-size-sm);
  font-weight: 500;
  font-family: var(--font-family-secondary);
  color: var(--color-primary);
  cursor: pointer;
}

/* ===================
   个人页面样式
   =================== */
.profile-header {
  display: flex;
  align-items: center;
  margin-bottom: var(--spacing-xl);
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 40px;
  margin-right: var(--spacing-lg);
  background-color: #f5f5f5;
  display: flex;
  justify-content: center;
  align-items: center;
}

.profile-avatar i {
  font-size: 40px;
  color: rgba(0, 0, 0, 0.5);
}

.profile-info {
  flex: 1;
}

.profile-name {
  font-size: var(--font-size-xl);
  font-weight: 700;
  font-family: var(--font-family-secondary);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-xs);
}

.profile-phone {
  font-size: var(--font-size-sm);
  font-weight: 400;
  font-family: var(--font-family-secondary);
  color: var(--color-text-secondary);
}

.menu-item {
  display: flex;
  align-items: center;
  padding: var(--spacing-lg) 0;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.menu-item:last-child {
  border-bottom: none;
}

.menu-item:hover {
  background-color: var(--color-background-secondary);
}

.menu-icon {
  width: 24px;
  height: 24px;
  margin-right: var(--spacing-lg);
  display: flex;
  justify-content: center;
  align-items: center;
}

.menu-icon i {
  font-size: 20px;
  color: var(--color-text-secondary);
}

.menu-text {
  flex: 1;
  font-size: var(--font-size-base);
  font-weight: 500;
  font-family: var(--font-family-secondary);
  color: var(--color-text-primary);
}

.menu-arrow {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

/* 邀请码显示样式 */
.menu-arrow.invite-code-display {
  display: flex;
  align-items: center;
  gap: 8px;
}

.invite-code-text {
  font-size: 12px;
  color: #666;
  font-weight: 500;
}

.invite-code-icon {
  font-size: 14px;
  color: #999;
}

/* ===================
   充值页面样式
   =================== */
.recharge-container {
  padding: var(--spacing-lg);
}

.recharge-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  font-family: var(--font-family-primary);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-xl);
}

.balance-card {
  background-color: var(--color-background);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  padding: var(--spacing-xl);
  border-radius: var(--border-radius-medium);
  margin-bottom: var(--spacing-xl);
  position: relative;
}

.sign-in-btn {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  padding: 8px 16px;
  background-color: #303437;
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sign-in-btn:hover:not(:disabled) {
  background-color: #1f2224;
  transform: translateY(-50%) scale(1.05);
}

.sign-in-btn:disabled {
  background-color: #999;
  cursor: not-allowed;
  opacity: 0.7;
}

/* 签到按钮响应式适配 */
@media (max-width: 402px) {
  .sign-in-btn {
    font-size: 0.75rem; /* 12px */
    padding: 0.375rem 0.75rem; /* 6px 12px */
    right: var(--spacing-md); /* 12px */
    min-height: var(--touch-target-min);
  }
  
  .sign-in-btn i {
    font-size: 0.75rem; /* 12px */
  }
}

@media (max-width: 360px) {
  .sign-in-btn {
    font-size: 0.6875rem; /* 11px */
    padding: 0.25rem 0.5rem; /* 4px 8px */
  }
  
  .balance-amount {
    font-size: var(--font-size-2xl); /* 在小屏幕上稍微缩小 */
  }
}

.balance-label {
  font-size: var(--font-size-sm);
  font-weight: 500;
  font-family: var(--font-family-secondary);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-sm);
}

.balance-amount {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  font-family: var(--font-family-secondary);
  color: var(--color-text-primary);
}

.balance-note {
  font-size: var(--font-size-sm);
  font-weight: 400;
  font-family: var(--font-family-secondary);
  color: var(--color-text-secondary);
  margin-top: var(--spacing-sm);
}

.recharge-options {
  margin-bottom: var(--spacing-xl);
}

.options-title {
  font-size: var(--font-size-base);
  font-weight: 700;
  font-family: var(--font-family-secondary);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-lg);
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-md);
}

.recharge-option {
  padding: var(--spacing-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-small);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.recharge-option.selected {
  border-color: var(--color-primary);
  background-color: var(--color-primary-light);
}

.option-amount {
  font-size: var(--font-size-lg);
  font-weight: 700;
  font-family: var(--font-family-secondary);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-xs);
}

.option-description {
  font-size: var(--font-size-xs);
  font-weight: 400;
  font-family: var(--font-family-secondary);
  color: var(--color-text-secondary);
}

/* ===================
   充值记录样式
   =================== */
.records-container {
  margin-top: var(--spacing-xl);
}

.records-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  font-family: var(--font-family-secondary);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-lg);
}

/* 金币明细样式 */
.recharge-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md) 0;
  border-bottom: 1px solid var(--color-border);
}

.recharge-item:last-child {
  border-bottom: none;
}

.recharge-item-description {
  font-size: var(--font-size-base);
  font-weight: 500;
  font-family: var(--font-family-secondary);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-xs);
}

.recharge-item-amount {
  font-size: var(--font-size-base);
  font-weight: 700;
  font-family: var(--font-family-secondary);
}

.recharge-item-amount.increase {
  color: #4CAF50;
}

.recharge-item-amount.decrease {
  color: #f44336;
}

.recharge-item-time {
  font-size: var(--font-size-sm);
  font-weight: 400;
  font-family: var(--font-family-secondary);
  color: var(--color-text-secondary);
}

.empty-state {
  text-align: center;
  padding: var(--spacing-xl);
  color: var(--color-text-secondary);
  font-size: var(--font-size-base);
}

.record-item {
  display: flex;
  align-items: center;
  padding: var(--spacing-lg) 0;
  border-bottom: 1px solid var(--color-border);
}

.record-item:last-child {
  border-bottom: none;
}

.record-info {
  flex: 1;
}

.record-amount {
  font-size: var(--font-size-base);
  font-weight: 700;
  font-family: var(--font-family-secondary);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-xs);
}

.record-time {
  font-size: var(--font-size-xs);
  font-weight: 400;
  font-family: var(--font-family-secondary);
  color: var(--color-text-secondary);
}

.record-status {
  font-size: var(--font-size-sm);
  font-weight: 500;
  font-family: var(--font-family-secondary);
  color: var(--color-text-primary);
}

.no-records {
  text-align: center;
  font-size: var(--font-size-sm);
  font-weight: 400;
  font-family: var(--font-family-secondary);
  color: var(--color-text-secondary);
  padding: var(--spacing-xl) 0;
}

/* ===================
   新的消息发送框组件样式
   =================== */
.frame-403_3017 {
  display: flex;
  align-items: flex-end;
  padding: var(--spacing-lg) var(--spacing-lg) calc(var(--spacing-lg) + var(--safe-area-inset-bottom));
  background-color: var(--color-background);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  gap: var(--spacing-md);
  width: 100%;
  position: fixed; /* 固定在页面底部 */
  left: 0px;
  right: 0px;
  bottom: 0px;
  z-index: 1000; /* 确保在最上层 */
  box-sizing: border-box;
}

.frame-403_3018 {
  width: 100%;
  height: auto;
  position: relative;
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  gap: var(--spacing-md);
  align-items: flex-end;
}

.frame-403_3019 {
  flex: 1;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-large);
  padding: var(--spacing-md) var(--spacing-lg);
  font-size: var(--font-size-base);
  font-family: var(--font-family-secondary);
  outline: none;
  transition: all var(--transition-fast);
  min-height: var(--touch-target-min);
  max-height: 120px;
  resize: none;
  overflow-y: auto;
  line-height: 1.5;
  /* 隐藏文本域的调整工具 */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  background-color: var(--color-background);
  box-sizing: border-box;
  /* 确保与按钮底部对齐 */
  align-self: flex-end;
}

/* 隐藏Webkit浏览器的滚动条 */
.frame-403_3019::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.frame-403_3019:focus {
  border-color: #303437;
  box-shadow: none;
}

/* 防止输入框在聚焦或清空时变形 */
.frame-403_3019.input-focused {
  min-height: var(--touch-target-min);
  height: auto;
}

/* 输入框光标闪烁效果 */
.text-403_3020 .input-cursor,
.frame-403_3019.input-focused .text-403_3020 .input-cursor {
  display: inline-block;
  width: 2px;
  height: 16px;
  background-color: rgba(48, 52, 55, 1);
  margin-left: 2px;
  vertical-align: middle;
  animation: cursor-blink 1s infinite;
}

@keyframes cursor-blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0;
  }
}

.center-stroke-403_3019 {
  display: none; /* 隐藏边框，使用textarea的border */
}

.text-403_3020 {
  font-size: var(--font-size-base);
  font-family: var(--font-family-secondary);
  font-weight: 400;
  letter-spacing: 0em;
  line-height: 1.5;
  color: var(--color-text-primary);
  width: 100%;
  height: 100%;
  position: relative;
  flex-shrink: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  resize: none;
  border: none;
  outline: none;
  background: transparent;
  padding: 0;
  margin: 0;
}

.frame-403_3022 {
  width: var(--touch-target-min); /* 44px */
  height: var(--touch-target-min); /* 44px */
  min-width: var(--touch-target-min);
  min-height: var(--touch-target-min);
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  background-color: #9CA3AF;
  opacity: 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  /* 触摸优化 */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  /* 确保内部元素不受父元素 transform 影响 */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  /* 确保与输入框对齐 */
  align-self: flex-end;
  margin-bottom: 0;
}

.vector-403_3023 {
  display: none; /* 隐藏背景图片，使用纯色背景 */
}

.frame-418_119 {
  width: 24px;
  height: 24px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2; /* 确保发送图标显示在背景图片之上 */
}

.group-418_120 {
  width: 18.802980422973633px;
  height: 18.803007125854492px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vector-418_121 {
  width: 100%;
  height: 100%;
  background-image: url(Vector_418_121.png);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  position: relative;
  opacity: 1; /* 默认完全不透明 */
  filter: brightness(0) invert(1); /* 将图标转换为白色 */
}

/* ===================
   登录页面特殊样式
   =================== */
#login-content .page-container {
  padding-top: calc(64px + var(--safe-area-inset-top) + var(--spacing-lg));
  padding-bottom: var(--spacing-lg);
}

.login-note {
  margin-top: var(--spacing-lg);
  font-size: var(--font-size-sm);
  font-weight: 400;
  font-family: var(--font-family-secondary);
  color: var(--color-text-secondary);
  text-align: center;
}

/* 隐藏登录页面的底部导航栏 */
.bottom-navigation {
  display: block;
}

/* 当登录页面显示时隐藏底部导航栏 */
body.login-page-active .bottom-navigation {
  display: none !important;
}

/* ===================
   响应式布局 - 完善的移动端适配
   =================== */

/* 超小屏幕（< 360px，如iPhone SE等） */
@media (max-width: 359px) {
  html {
    font-size: 14px; /* 缩小基础字体 */
  }
  
  .app-container {
    max-width: 100%;
  }
  
  .content-container {
    max-width: 100%;
  }
  
  .content-area {
    max-width: 100%;
  }
  
  .bottom-navigation {
    width: calc(100% - var(--spacing-lg) * 2);
    max-width: 100%;
    margin-left: var(--spacing-lg);
    margin-right: var(--spacing-lg);
    padding: var(--spacing-md) 0;
  }
  
  .unified-navbar {
    width: calc(100% - var(--spacing-lg) * 2);
    max-width: 320px;
  }
  
  .navbar-items {
    width: 100%;
    padding: 0 var(--spacing-xs);
  }
  
  .navbar-item {
    width: 52px;
    min-width: 52px;
  }
  
  .navbar-item.active {
    width: 64px;
    min-width: 64px;
    padding: 0 var(--spacing-sm);
  }
  
  .page-container {
    padding: var(--spacing-md);
    padding-top: calc(64px + var(--safe-area-inset-top) + var(--spacing-md));
    /* 适配底部导航栏和安全区域 - 为底部导航栏预留空间 */
    padding-bottom: calc(80px + var(--safe-area-inset-bottom) + var(--spacing-md));
  }
  
  /* 瀑布流布局，卡片宽度由 column-count 控制 */
  
  .page-title {
    font-size: var(--font-size-xl);
  }
  
  .message-list-item {
    height: 72px;
  }
  
  .message-avatar {
    width: 48px;
    height: 48px;
  }
}

/* 小屏幕（360px - 402px，大部分手机） */
@media (min-width: 360px) and (max-width: 402px) {
  html {
    font-size: 15px;
  }
  
  .app-container {
    max-width: 100%;
  }
  
  .content-container {
    max-width: 100%;
  }
  
  .content-area {
    max-width: 100%;
  }
  
  .bottom-navigation {
    width: calc(100% - var(--spacing-xl) * 2);
    max-width: 100%;
    margin-left: var(--spacing-xl);
    margin-right: var(--spacing-xl);
  }
  
  .unified-navbar {
    width: calc(100% - var(--spacing-lg) * 2);
    max-width: 320px;
  }
  
  /* 瀑布流布局，卡片宽度由 column-count 控制 */
  
  .page-container {
    padding: var(--spacing-lg);
    padding-top: calc(64px + var(--safe-area-inset-top) + var(--spacing-lg));
    /* 适配底部导航栏和安全区域 - 为底部导航栏预留空间 */
    padding-bottom: calc(80px + var(--safe-area-inset-bottom) + var(--spacing-lg));
  }
}

/* 中等屏幕（403px - 480px，大屏手机） */
@media (min-width: 403px) and (max-width: 480px) {
  html {
    font-size: 16px;
  }
  
  .app-container,
  .content-container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    position: relative;
  }
  
  .content-area {
    max-width: 100%;
    width: 100%;
    height: 100%;
  }
  
  .bottom-navigation {
    width: 100%;
    max-width: 402px;
    margin-left: auto;
    margin-right: auto;
    padding-bottom: var(--safe-area-inset-bottom);
  }
  
  .page-container {
    padding: var(--spacing-lg);
    padding-top: calc(64px + var(--safe-area-inset-top) + var(--spacing-lg));
    padding-bottom: calc(80px + var(--safe-area-inset-bottom) + var(--spacing-lg));
  }
  
  /* 瀑布流布局，卡片宽度由 column-count 控制 */
}

/* 大屏幕（> 480px，平板或横屏） */
@media (min-width: 481px) {
  html {
    font-size: 16px;
  }
  
  .app-container,
  .content-container {
    max-width: var(--container-max-width);
    width: 100%;
    margin: 0 auto;
    position: relative;
  }
  
  .content-area {
    max-width: var(--container-max-width);
    width: 100%;
    height: 100%;
    left: 50%;
    transform: translateX(-50%) !important;
  }
  
  #chat-content {
    height: 100% !important;
    min-height: 100% !important;
  }
  
  .content-area.active {
    transform: translateX(-50%) !important;
  }
  
  .bottom-navigation {
    max-width: var(--container-max-width);
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--safe-area-inset-bottom);
  }
  
  .page-container {
    padding: var(--spacing-lg);
    padding-top: calc(64px + var(--safe-area-inset-top) + var(--spacing-lg));
    padding-bottom: calc(80px + var(--safe-area-inset-bottom) + var(--spacing-lg));
  }
}

/* 横屏适配 */
@media (orientation: landscape) and (max-height: 500px) {
  html {
    font-size: 14px;
  }
  
  .bottom-navigation {
    height: 64px;
    padding: var(--spacing-sm) 0;
  }
  
  .unified-navbar {
    height: 52px;
  }
  
  .navbar-items {
    height: 40px;
  }
  
  .page-container {
    padding-top: calc(64px + var(--safe-area-inset-top) + var(--spacing-lg));
    padding-bottom: calc(64px + var(--safe-area-inset-bottom) + var(--spacing-lg));
  }
  
  .content-area {
    height: 100%;
  }
}

/* 高分辨率屏幕优化（Retina等） */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* 可以在这里添加高分辨率屏幕的优化样式 */
  .character-image,
  .message-avatar,
  .profile-avatar {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
  /* 增加触摸目标大小 */
  button,
  .navbar-item,
  .menu-item,
  .character-card,
  .message-list-item {
    min-height: var(--touch-target-min);
    min-width: var(--touch-target-min);
  }
  
  /* 移除悬停效果，改为点击效果 */
  .character-card:hover {
    transform: none;
  }
  
  .character-card:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }
  
  .navbar-item:hover {
    transform: none;
  }
  
  .navbar-item:active {
    transform: scale(0.95);
  }
  
  .menu-item:hover {
    background-color: transparent;
  }
  
  .menu-item:active {
    background-color: var(--color-background-secondary);
  }
}

/* 暗色模式支持（可选） */
@media (prefers-color-scheme: dark) {
  /* 如果将来需要支持暗色模式，可以在这里添加样式 */
  /* 目前保持亮色模式 */
}

/* ===================
   添加角色页面样式
   =================== */

.avatar-upload {
  margin-bottom: var(--spacing-xl);
}

.avatar-container {
  display: flex;
  justify-content: center;
}

.avatar-preview {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background-color: var(--color-background-secondary);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border: 2px dashed var(--color-border);
  position: relative;
  cursor: pointer;
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-upload-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-xs);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  opacity: 1;
  transition: opacity var(--transition-fast);
  justify-content: center;
}

.avatar-upload-overlay i {
  font-size: 20px;
  color: white;
}

.avatar-upload-overlay span {
  font-size: var(--font-size-xs);
  color: white;
}

/* 图片剪裁弹窗样式 */
.image-crop-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.image-crop-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
}

.image-crop-content {
  position: relative;
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  z-index: 10001;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.image-crop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #e5e5e5;
}

.image-crop-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.image-crop-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.image-crop-close:hover {
  background: #f5f5f5;
  color: #333;
}

.image-crop-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow: auto;
}

.image-crop-container {
  position: relative;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  background: #f5f5f5;
  border-radius: 8px;
  overflow: hidden;
  cursor: move;
}

#crop-canvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: 400px;
}

.crop-selection {
  position: absolute;
  border: 2px solid #007bff;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
  cursor: move;
  box-sizing: border-box;
}

.resize-handle {
  position: absolute;
  bottom: -5px;
  right: -5px;
  width: 20px;
  height: 20px;
  background: #007bff;
  border: 2px solid white;
  border-radius: 50%;
  cursor: nwse-resize;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.resize-handle:hover {
  background: #0056b3;
  transform: scale(1.1);
}

.crop-grid {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.3) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.3) 1px, transparent 1px);
  background-size: 33.33% 33.33%;
}

.image-crop-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.preview-label {
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

.preview-container {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #e5e5e5;
  background: #f5f5f5;
}

#preview-canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-crop-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px;
  border-top: 1px solid #e5e5e5;
}

.image-crop-btn {
  padding: 10px 24px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.image-crop-btn-cancel {
  background: #f5f5f5;
  color: #666;
}

.image-crop-btn-cancel:hover {
  background: #e5e5e5;
}

.image-crop-btn-confirm {
  background: #007bff;
  color: white;
}

.image-crop-btn-confirm:hover {
  background: #0056b3;
}

.image-crop-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-select {
  width: 100%;
  padding: var(--spacing-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-small);
  font-size: var(--font-size-base);
  font-family: var(--font-family-secondary);
  outline: none;
  background-color: var(--color-background);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6,9 12,15 18,9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--spacing-lg) center;
  background-size: 20px;
  padding-right: 40px;
}

.form-select:focus {
  border-color: var(--color-primary);
}

.tag-input-container {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.tags-display {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
}

.tag-item {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-md);
  background-color: var(--color-primary-light);
  border-radius: var(--border-radius-large);
  font-size: var(--font-size-xs);
  font-weight: 500;
  font-family: var(--font-family-secondary);
  color: var(--color-primary);
}

.tag-remove {
  cursor: pointer;
  font-size: 12px;
}

/* 文档内容样式（隐私政策、用户协议） */
.document-content {
  padding: var(--spacing-lg);
  line-height: 1.8;
  color: var(--color-text-primary);
  font-size: var(--font-size-base);
  font-family: var(--font-family-secondary);
  white-space: pre-wrap;
  word-wrap: break-word;
}

.document-content p {
  margin: var(--spacing-md) 0;
  line-height: 1.8;
}

.document-content p:first-child {
  margin-top: 0;
}

.document-content p:last-child {
  margin-bottom: 0;
}

.loading-text {
  text-align: center;
  color: var(--color-text-secondary);
  padding: var(--spacing-xl);
}

.error-text {
  color: #f44336;
  text-align: center;
  padding: var(--spacing-xl);
}

/* ===================
   统一的弹窗提示样式
   =================== */

/* Toast 提示样式 */
.toast-container {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  pointer-events: none;
  width: 100%;
  max-width: var(--container-max-width);
  padding: var(--spacing-lg);
  box-sizing: border-box;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md) var(--spacing-lg);
  background-color: var(--color-background);
  border-radius: var(--border-radius-medium);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: translateY(-100px);
  transition: opacity var(--transition-normal), transform var(--transition-normal);
  pointer-events: none;
  visibility: hidden;
  min-width: 200px;
  max-width: 90%;
  margin: 0 auto;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
}

.toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-lg);
}

.toast.success .toast-icon {
  color: #4caf50;
}

.toast.error .toast-icon {
  color: #f44336;
}

.toast.info .toast-icon {
  color: var(--color-primary);
}

.toast.warning .toast-icon {
  color: #ff9800;
}

.toast-message {
  flex: 1;
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
  line-height: 1.5;
  word-wrap: break-word;
}

/* 确认对话框样式 */
.confirm-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10001;
  display: none !important;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-lg);
  box-sizing: border-box;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.confirm-modal.show {
  display: flex !important;
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.confirm-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.confirm-modal-content {
  position: relative;
  background-color: var(--color-background);
  border-radius: var(--border-radius-large);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 340px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.confirm-modal-header {
  padding: var(--spacing-xl) var(--spacing-xl) var(--spacing-md);
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}

.confirm-modal-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--spacing-md);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--color-primary);
  background-color: var(--color-primary-light);
}

.confirm-modal.warning .confirm-modal-icon {
  color: #ff9800;
  background-color: rgba(255, 152, 0, 0.1);
}

.confirm-modal.danger .confirm-modal-icon {
  color: #f44336;
  background-color: rgba(244, 67, 54, 0.1);
}

.confirm-modal-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0;
  font-family: var(--font-family-primary);
}

.confirm-modal-body {
  padding: var(--spacing-xl);
  flex: 1;
  overflow-y: auto;
}

.confirm-modal-message {
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
  text-align: center;
}

.confirm-modal-footer {
  padding: var(--spacing-md) var(--spacing-xl) var(--spacing-xl);
  display: flex;
  gap: var(--spacing-md);
  border-top: 1px solid var(--color-border);
}

.confirm-modal-btn {
  flex: 1;
  padding: var(--spacing-md) var(--spacing-lg);
  border: none;
  border-radius: var(--border-radius-medium);
  font-size: var(--font-size-base);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-family-primary);
}

.confirm-modal-btn-cancel {
  background-color: var(--color-background-secondary);
  color: var(--color-text-primary);
}

.confirm-modal-btn-cancel:hover {
  background-color: var(--color-border);
}

.confirm-modal-btn-cancel:active {
  transform: scale(0.98);
}

.confirm-modal-btn-confirm {
  background-color: var(--color-primary);
  color: var(--color-secondary);
}

.confirm-modal-btn-confirm:hover {
  background-color: rgba(0, 112, 240, 0.9);
}

.confirm-modal-btn-confirm:active {
  transform: scale(0.98);
}

.confirm-modal-btn-confirm:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 我的角色页面样式 */
.my-characters-list {
  padding: var(--spacing-lg);
}

.my-character-card {
  background-color: var(--color-background);
  border-radius: var(--border-radius-medium);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  box-shadow: var(--shadow-card);
}

.character-card-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.character-card-header .character-avatar {
  width: 60px;
  height: 60px;
  border-radius: var(--border-radius-avatar);
  background-size: cover;
  background-position: center;
  background-color: var(--color-border);
  flex-shrink: 0;
}

.character-card-header .character-info {
  flex: 1;
}

.character-card-header .character-name {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-xs);
}

.character-status {
  display: flex;
  gap: var(--spacing-xs);
  flex-wrap: wrap;
}

.status-badge {
  padding: 4px 8px;
  border-radius: var(--border-radius-small);
  font-size: var(--font-size-xs);
  font-weight: 500;
  display: inline-block;
}

.status-badge.public {
  background-color: #e3f2fd;
  color: #1976d2;
}

.status-badge.hidden {
  background-color: #f5f5f5;
  color: #666;
}

.status-badge.pending {
  background-color: #fff3e0;
  color: #f57c00;
}

.character-actions {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.action-btn {
  padding: var(--spacing-sm) var(--spacing-md);
  border: none;
  border-radius: var(--border-radius-small);
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-family: var(--font-family-primary);
}

.action-btn.edit-btn {
  background-color: var(--color-primary);
  color: var(--color-secondary);
}

.action-btn.edit-btn:hover:not(:disabled) {
  background-color: rgba(0, 112, 240, 0.9);
}

.action-btn.edit-btn.disabled {
  background-color: var(--color-border);
  color: var(--color-text-tertiary);
  cursor: not-allowed;
}

.action-btn.delete-btn {
  background-color: #f44336;
  color: white;
}

.action-btn.delete-btn:hover {
  background-color: #d32f2f;
}

.action-btn.request-public-btn {
  background-color: #4caf50;
  color: white;
}

.action-btn.request-public-btn:hover {
  background-color: #388e3c;
}

.action-btn.hide-btn {
  background-color: #ff9800;
  color: white;
}

.action-btn.hide-btn:hover {
  background-color: #f57c00;
}

.action-btn:active:not(:disabled) {
  transform: scale(0.98);
}

/* ===================
   动态页面样式
   =================== */

/* 动态项 */
.post-item {
  width: 100%;
  background-color: white;
  border-radius: var(--border-radius-medium);
  box-shadow: var(--shadow-card);
  margin-bottom: var(--spacing-lg);
  padding: var(--spacing-lg);
  position: relative;
}

.post-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin-bottom: var(--spacing-md);
  position: relative;
}

.post-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: var(--color-background-secondary);
  margin-right: var(--spacing-md);
  flex-shrink: 0;
}

.post-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.post-name {
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.post-time {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}

.post-style {
  font-size: var(--font-size-xs);
  color: var(--color-primary);
  background-color: var(--color-primary-light);
  padding: 4px 8px;
  border-radius: var(--border-radius-small);
  margin-left: auto;
  white-space: nowrap;
}

.post-content {
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
  line-height: 1.6;
  word-wrap: break-word;
  white-space: pre-wrap;
  margin-top: var(--spacing-md);
}

/* 动态底部区域 */
.post-footer {
  margin-top: var(--spacing-md);
}

/* 动态底部分割线 */
.post-footer-divider {
  width: 100%;
  height: 1px;
  background-color: var(--color-border);
  margin-bottom: var(--spacing-md);
}

/* 评论按钮样式 */
.post-comment-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  width: 100%;
  transition: opacity var(--transition-fast);
  /* 触摸优化 */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.post-comment-btn:hover {
  opacity: 0.7;
}

.post-comment-btn:active {
  opacity: 0.5;
}

/* 刷新指示器 */
.refresh-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  gap: var(--spacing-sm);
}

.refresh-indicator i {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 加载更多指示器 */
.load-more-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-lg);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  gap: var(--spacing-sm);
}

.load-more-indicator i {
  animation: spin 1s linear infinite;
}

/* 没有更多提示 */
.no-more-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-lg);
  color: var(--color-text-tertiary);
  font-size: var(--font-size-sm);
}

/* 回到顶部按钮 */
.back-to-top-btn {
  position: fixed;
  bottom: 100px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--color-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 112, 240, 0.3);
  z-index: 1000;
  transition: all var(--transition-normal);
}

.back-to-top-btn:hover {
  background-color: rgba(0, 112, 240, 0.9);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 112, 240, 0.4);
}

.back-to-top-btn:active {
  transform: translateY(0);
}

.back-to-top-btn i {
  font-size: 20px;
}

/* 动态页面空状态 */
#posts-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xxl);
  color: var(--color-text-tertiary);
  text-align: center;
}

#posts-empty i {
  font-size: 48px;
  margin-bottom: var(--spacing-md);
  opacity: 0.5;
}

#posts-empty p {
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
}

/* 动态图标样式 */
.posts-icon .icon-vector {
  font-family: 'iconfont';
  color: rgba(0, 0, 0, 0.5);
}
.posts-icon .icon-vector:before {
  content: '\e61f';
}