/* ==================== Reset & Base ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  color: #1A1A1A;
  background: #FFFFFF;
  -webkit-font-smoothing: antialiased;
}

input, textarea, button {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
  background: none;
}

img { display: block; max-width: 100%; }
.hidden { display: none !important; }

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  position: relative;
  overflow: hidden;
}

/* ==================== Navbar ==================== */
.navbar {
  flex-shrink: 0;
  background: #FFFFFF;
  border-bottom: 1px solid #F0F0F0;
  padding-top: env(safe-area-inset-top);
  z-index: 10;
}

.navbar-inner {
  display: flex;
  align-items: center;
  height: 48px;
  padding: 0 12px;
  position: relative;
}

.navbar-back {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 300;
  color: #1A1A1A;
  cursor: pointer;
  line-height: 1;
}

.navbar-back:active { opacity: 0.6; }

.navbar-title {
  flex: 1;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  color: #1A1A1A;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 8px;
}

.navbar-right {
  width: 36px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-size: 24px;
  cursor: pointer;
}

/* ==================== Page Container ==================== */
.page-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

/* ==================== TabBar ==================== */
.tabbar {
  flex-shrink: 0;
  position: relative;
  background: #FFFFFF;
  box-shadow: 0 -2px 16px rgba(0,0,0,0.05);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 100;
}

.tabbar-indicator {
  position: absolute;
  top: 0;
  left: 0;
  width: 25%;
  height: 3px;
  background: linear-gradient(90deg, #1E3A8A, #3B82F6);
  border-radius: 0 0 3px 3px;
  box-shadow: 0 2px 8px rgba(30,58,138,0.3);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: translateX(0);
}

.tabbar-items {
  display: flex;
  height: 56px;
}

.tabbar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  position: relative;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tabbar-item-icon {
  font-size: 22px;
  width: 38px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tabbar-item-label {
  font-size: 10px;
  color: #AAAAAA;
  font-weight: 500;
  transition: all 0.3s ease;
}

.tabbar-item.active .tabbar-item-icon {
  background: rgba(30, 58, 138, 0.1);
  transform: translateY(-3px) scale(1.15);
}

.tabbar-item.active .tabbar-item-label {
  color: #1E3A8A;
  font-weight: 600;
}

/* ==================== Home Page - 对话列表 ==================== */
.home-page {
  padding: 0;
}

.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: #FFFFFF;
}

.home-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: #1A1A1A;
}

.home-new-btn {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #1E3A8A, #2563EB);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(30,58,138,0.3);
  transition: transform 0.2s;
}

.home-new-btn:active { transform: scale(0.92); }

.conversation-list {
  padding: 0 16px 16px;
}

.conversation-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #F0F0F0;
  cursor: pointer;
  transition: background 0.2s;
}

.conversation-item:active { background: #FAFAFA; }

.conversation-avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  color: #FFFFFF;
  flex-shrink: 0;
}

.conversation-info {
  flex: 1;
  min-width: 0;
}

.conversation-title {
  font-size: 15px;
  font-weight: 600;
  color: #1A1A1A;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 4px;
}

.conversation-summary {
  font-size: 13px;
  color: #999;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-time {
  font-size: 12px;
  color: #BBBBBB;
  flex-shrink: 0;
}

.conversation-pin {
  font-size: 12px;
  color: #1E3A8A;
  font-weight: 500;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  color: #999;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state-text {
  font-size: 15px;
  color: #AAAAAA;
}

/* ==================== Chat Page ==================== */
.chat-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #FFFFFF;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 10px;
  -webkit-overflow-scrolling: touch;
}

.bottom-placeholder {
  height: 180px;
}

/* 消息样式 */
.message-wrapper {
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
  width: 100%;
}

.user-msg-wrapper {
  align-items: flex-end;
  padding-right: 6px;
}

.ai-msg-block {
  width: 100%;
  margin-bottom: 20px;
}

.bubble {
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-all;
  letter-spacing: 0.2px;
}

.user-bubble {
  background: #1E3A8A;
  color: #FFFFFF;
  border-bottom-right-radius: 2px;
  max-width: 70%;
  margin-right: 6px;
}

.ai-bubble {
  background: #F5F5F5;
  color: #1A1A1A;
  border-bottom-left-radius: 2px;
  max-width: 80%;
  border: 1px solid #E8E8E8;
  margin-left: 14px;
}

.welcome-bubble { margin-top: 16px; }

.user-images-full { margin-bottom: 8px; }

.user-chat-image-full {
  width: 180px;
  height: 180px;
  border-radius: 4px;
  border: 1px solid #E8E8E8;
  object-fit: cover;
  cursor: pointer;
}

.user-text-row {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  width: 100%;
}

/* AI thinking */
.thinking-row {
  display: flex;
  align-items: center;
}

.thinking-content {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #F5F5F5;
  padding: 12px 16px;
  border-radius: 4px;
  border-bottom-left-radius: 2px;
  border: 1px solid #E8E8E8;
  margin-left: 14px;
}

.thinking-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1E3A8A;
  animation: bounce 1.4s ease-in-out infinite;
}

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

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

.thinking-text {
  font-size: 13px;
  color: #999;
}

/* AI 图片 */
.ai-images-full {
  margin-top: 8px;
  margin-left: 14px;
}

.ai-image-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.ai-generated-image {
  border-radius: 4px;
  border: 1px solid #E8E8E8;
  object-fit: cover;
  cursor: pointer;
}

.grid-1 .ai-generated-image { width: 260px; height: 260px; }
.grid-2 .ai-generated-image { width: 160px; height: 160px; }
.grid-multi .ai-generated-image { width: 110px; height: 110px; }

/* AI 文字 */
.ai-text-row {
  display: flex;
  align-items: flex-start;
  margin-top: 8px;
}

.ai-plain-text {
  font-size: 13px;
  line-height: 1.6;
  color: #1A1A1A;
  word-break: break-all;
  background: #F5F5F5;
  padding: 12px 16px;
  border-radius: 4px;
  border-bottom-left-radius: 2px;
  border: 1px solid #E8E8E8;
  margin-left: 14px;
  white-space: pre-wrap;
}

.ai-actions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  margin-left: 14px;
}

.ai-action-btn {
  padding: 8px 16px;
  background: #FFFFFF;
  border: 1px solid #E8E8E8;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  color: #1E3A8A;
  cursor: pointer;
  transition: background 0.2s;
}

.ai-action-btn:active { background: #F5F5F5; }

/* ==================== 底部输入区 ==================== */
.input-area {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #FFFFFF;
  border-top: 1px solid #E8E8E8;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 10;
}

.reference-preview {
  padding: 12px 16px 0;
}

.reference-preview-list {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.reference-preview-item {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #E8E8E8;
}

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

.reference-preview-add {
  background: #F5F5F5;
  border: 1px dashed #CCCCCC;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.reference-add-icon {
  font-size: 24px;
  color: #999;
}

.reference-preview-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: rgba(0,0,0,0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #FFFFFF;
  cursor: pointer;
  line-height: 1;
}

.reference-tip {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding-bottom: 8px;
  font-size: 12px;
  color: #999;
}

/* 快捷操作栏 */
.quick-actions {
  padding: 8px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.quick-actions::-webkit-scrollbar { display: none; }

.quick-actions-inner {
  display: inline-flex;
  gap: 12px;
}

.quick-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #FFFFFF;
  border: 1px solid #E8E8E8;
  border-radius: 4px;
  font-size: 13px;
  color: #666;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.quick-action-btn.active {
  background: #1E3A8A;
  border-color: transparent;
  color: #FFFFFF;
}

.quick-action-btn.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* 数量选择器 */
.count-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  background: #FFFFFF;
  border-top: 1px solid #E8E8E8;
}

.count-option {
  padding: 8px 20px;
  background: #F5F5F5;
  border: 1px solid #E8E8E8;
  border-radius: 4px;
  font-size: 13px;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
}

.count-option.active {
  background: #1E3A8A;
  border-color: transparent;
  color: #FFFFFF;
}

/* 输入栏 */
.chat-input-bar {
  display: flex;
  align-items: flex-end;
  padding: 12px 16px;
  gap: 12px;
}

.input-camera, .input-plus {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 24px;
  cursor: pointer;
}

.input-field-wrap {
  flex: 1;
  background: #F5F5F5;
  border: 1px solid #E8E8E8;
  border-radius: 4px;
  padding: 10px 16px;
  min-height: 40px;
  max-height: 120px;
  overflow-y: auto;
  transition: all 0.2s;
}

.input-field-wrap:focus-within {
  border-color: #1E3A8A;
  box-shadow: 0 0 0 2px rgba(30,58,138,0.1);
}

.chat-input {
  width: 100%;
  font-size: 14px;
  color: #1A1A1A;
  line-height: 1.6;
  max-height: 80px;
  resize: none;
  border: none;
  outline: none;
  background: transparent;
}

.input-send {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1E3A8A;
  border-radius: 50%;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.2s;
}

.input-send:active {
  transform: scale(0.95);
  background: #1E40AF;
}

.send-arrow {
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 10px solid #FFFFFF;
  margin-bottom: 2px;
}

/* 会员状态条 */
.member-bar {
  position: fixed;
  bottom: 56px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #F5F5F5;
  border-top: 1px solid #E8E8E8;
  z-index: 9;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
}

.member-bar-active {
  background: #E8F4FD;
  border-top-color: #B3D8FF;
}

.member-bar-text {
  font-size: 13px;
  color: #666;
}

.member-bar-btn {
  padding: 6px 16px;
  background: #1E3A8A;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  color: #FFFFFF;
  cursor: pointer;
}

/* ==================== Profile Page ==================== */
.profile-page {
  padding: 0;
}

.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px 30px;
  background: linear-gradient(135deg, #1E3A8A 0%, #2563EB 100%);
  color: #FFFFFF;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 12px;
  border: 2px solid rgba(255,255,255,0.3);
}

.profile-username {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.profile-status {
  font-size: 13px;
  opacity: 0.8;
}

.profile-section {
  margin: 16px;
  background: #FFFFFF;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.profile-item {
  display: flex;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid #F0F0F0;
  cursor: pointer;
  transition: background 0.2s;
}

.profile-item:last-child { border-bottom: none; }
.profile-item:active { background: #FAFAFA; }

.profile-item-icon {
  font-size: 20px;
  margin-right: 12px;
}

.profile-item-text {
  flex: 1;
  font-size: 15px;
  color: #1A1A1A;
}

.profile-item-value {
  font-size: 13px;
  color: #999;
}

.profile-item-arrow {
  color: #CCCCCC;
  font-size: 18px;
}

/* ==================== 弹窗通用 ==================== */
.overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
}

/* 登录弹窗 */
.login-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 310px;
  max-width: calc(100vw - 40px);
  background: #FFFFFF;
  border-radius: 24px;
  padding: 28px 24px 20px;
  z-index: 1001;
  box-shadow: 0 20px 60px rgba(0,0,0,0.12);
}

.login-modal-title {
  font-size: 19px;
  font-weight: 700;
  color: #1A1A1A;
  text-align: center;
  margin-bottom: 6px;
}

.login-modal-desc {
  font-size: 13px;
  color: #AAA;
  text-align: center;
  margin-bottom: 20px;
  line-height: 1.5;
}

.login-input {
  width: 100%;
  height: 44px;
  border: 1px solid #EAEAEA;
  border-radius: 12px;
  padding: 0 16px;
  font-size: 14px;
  color: #1A1A1A;
  background: #F8FAFC;
  margin-bottom: 10px;
  transition: all 0.25s;
}

.login-input:focus {
  border-color: #3B82F6;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
}

.login-submit-btn {
  width: 100%;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1E3A8A, #2563EB);
  border-radius: 12px;
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  box-shadow: 0 4px 12px rgba(30,58,138,0.3);
  cursor: pointer;
  margin-top: 6px;
}

.login-submit-btn:active { transform: scale(0.97); }

.login-switch {
  text-align: center;
  margin-top: 12px;
  font-size: 13px;
  color: #1E3A8A;
  cursor: pointer;
  font-weight: 500;
}

.login-cardkey-link {
  text-align: center;
  font-size: 13px;
  color: #BBB;
  margin-top: 12px;
  padding: 6px 0;
  cursor: pointer;
}

.login-close {
  text-align: center;
  font-size: 14px;
  color: #BBB;
  margin-top: 8px;
  padding: 10px 0;
  cursor: pointer;
}

/* 卡密弹窗 */
.cardkey-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 310px;
  max-width: calc(100vw - 40px);
  background: #FFFFFF;
  border-radius: 24px;
  padding: 28px 24px 20px;
  z-index: 1001;
  box-shadow: 0 20px 60px rgba(0,0,0,0.12);
}

.cardkey-input {
  width: 100%;
  height: 48px;
  border: 1px solid #E8E8E8;
  border-radius: 12px;
  padding: 0 16px;
  font-size: 15px;
  color: #1A1A1A;
  background: #F5F5F5;
  letter-spacing: 2px;
}

.cardkey-input:focus { border-color: #1E3A8A; }

.cardkey-confirm-btn {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1E3A8A;
  border-radius: 12px;
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 500;
  margin-top: 20px;
  cursor: pointer;
}

/* 提示词预览弹窗 */
.prompt-preview-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 330px;
  max-width: calc(100vw - 40px);
  max-height: 70vh;
  background: #FFFFFF;
  border-radius: 24px;
  padding: 28px 24px 20px;
  z-index: 1001;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
}

.prompt-preview-header {
  text-align: center;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.prompt-preview-title {
  font-size: 18px;
  font-weight: 700;
  color: #1A1A1A;
  display: block;
  margin-bottom: 4px;
}

.prompt-preview-subtitle {
  font-size: 13px;
  color: #999;
}

.prompt-preview-body {
  flex: 1;
  max-height: 45vh;
  background: #F8FAFC;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  overflow-y: auto;
}

.prompt-preview-text {
  font-size: 14px;
  color: #333;
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.prompt-preview-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.prompt-action-btn {
  flex: 1;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s;
}

.prompt-action-btn:active { transform: scale(0.96); }

.prompt-action-cancel {
  background: #F3F4F6;
  color: #6B7280;
}

.prompt-action-retry {
  background: #FEF3C7;
  color: #D97706;
}

.prompt-action-confirm {
  background: linear-gradient(135deg, #1E3A8A, #2563EB);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(30,58,138,0.25);
}

/* ==================== History Page ==================== */
.history-page { padding: 0; }

.history-filter {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.history-filter::-webkit-scrollbar { display: none; }

.history-filter-item {
  padding: 6px 16px;
  background: #F5F5F5;
  border-radius: 16px;
  font-size: 13px;
  color: #666;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}

.history-filter-item.active {
  background: #1E3A8A;
  color: #FFFFFF;
}

.history-group {
  padding: 0 16px;
  margin-bottom: 20px;
}

.history-group-title {
  font-size: 13px;
  color: #999;
  font-weight: 500;
  padding: 12px 0 8px;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.history-grid-item {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}

.history-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-grid-item-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0,0,0,0.6);
  color: #FFFFFF;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
}

/* ==================== Toast ==================== */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.8);
  color: #FFFFFF;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 9999;
  max-width: 80%;
  text-align: center;
  pointer-events: none;
}

.toast.success { background: rgba(30,58,138,0.9); }
.toast.error { background: rgba(231,76,60,0.9); }

/* ==================== Loading ==================== */
.loading {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.7);
  padding: 24px 32px;
  border-radius: 12px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text {
  color: #FFFFFF;
  font-size: 13px;
}

/* ==================== ActionSheet ==================== */
.action-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1001;
}

.action-sheet-content {
  background: #FFFFFF;
  border-radius: 12px 12px 0 0;
  padding-bottom: env(safe-area-inset-bottom);
}

.action-sheet-title {
  text-align: center;
  padding: 16px;
  font-size: 14px;
  color: #999;
  border-bottom: 1px solid #E8E8E8;
}

.action-sheet-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  font-size: 15px;
  color: #1A1A1A;
  border-bottom: 1px solid #E8E8E8;
  cursor: pointer;
}

.action-sheet-item.danger { color: #e74c3c; }
.action-sheet-item:active { background: #F5F5F5; }

.action-sheet-cancel {
  padding: 16px;
  text-align: center;
  font-size: 15px;
  color: #999;
  margin-top: 8px;
  background: #F5F5F5;
  cursor: pointer;
  font-weight: 500;
}

/* ==================== Modal ==================== */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
}

.modal-content {
  width: 280px;
  background: #FFFFFF;
  border-radius: 16px;
  padding: 24px 20px 16px;
}

.modal-title {
  font-size: 17px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 12px;
}

.modal-body {
  font-size: 14px;
  color: #666;
  text-align: center;
  line-height: 1.6;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 12px;
}

.modal-btn {
  flex: 1;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
}

.modal-cancel {
  background: #F3F4F6;
  color: #6B7280;
}

.modal-confirm {
  background: #1E3A8A;
  color: #FFFFFF;
}

.modal-confirm.danger { background: #e74c3c; }

/* ==================== Image Preview ==================== */
.image-preview {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.9);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-preview-img {
  max-width: 95vw;
  max-height: 90vh;
  object-fit: contain;
}

.image-preview-close {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 24px;
  cursor: pointer;
  z-index: 10001;
}

/* ==================== 工具类 ==================== */
.fade-in {
  animation: fadeIn 0.3s ease;
}

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

.slide-up {
  animation: slideUp 0.35s cubic-bezier(0.34, 1.8, 0.64, 1);
}

@keyframes slideUp {
  from { transform: translate(-50%, -50%) scale(0.7); opacity: 0; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
