/* ============================================
   H5健康咨询应用 - 移动端专属样式
   大健康主题：翡翠绿 + 薄荷青 + 暖金
   ============================================ */

/* ===== 移动端容器 ===== */
.app-container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg-gradient);
  position: relative;
  overflow-x: hidden;
}

/* ===== 页面通用结构 ===== */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-content {
  flex: 1;
  padding-bottom: 20px;
}

/* ===== 顶部导航栏 ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-light);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
}

.navbar-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  text-align: center;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* 正文/描述长串断词，防止撑破卡片布局 */
.address-detail,
.order-detail-name,
.product-name-detail,
.product-desc-short,
.product-detail-content,
.chat-header-name {
  overflow-wrap: break-word;
  word-break: break-word;
}

.navbar-back,
.navbar-action {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 20px;
  transition: all var(--transition-fast);
}

.navbar-back:active,
.navbar-action:active {
  background: var(--gray-100);
  transform: scale(0.95);
}

/* ===== 底部安全区 ===== */
.safe-bottom {
  height: env(safe-area-inset-bottom, 0px);
}

/* ============================================
   对话页 (Chat Page)
   ============================================ */
.chat-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

/* 对话头部 */
.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-light);
  position: relative;
  z-index: 10;
}

.chat-header-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-400), var(--secondary-400));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

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

.chat-header-name {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-header-status {
  font-size: var(--font-size-xs);
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.chat-header-status::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse-soft 2s infinite;
}

.chat-header-actions {
  display: flex;
  gap: 4px;
}

.chat-header-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--gray-50);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.chat-header-btn:active {
  background: var(--gray-200);
  transform: scale(0.95);
}

/* 消息列表 */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  -webkit-overflow-scrolling: touch;
}

/* 日期分割 */
.chat-date-divider {
  text-align: center;
  padding: 8px 0;
}

.chat-date-divider span {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.8);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

/* 消息气泡通用 */
.message {
  display: flex;
  gap: 8px;
  max-width: 85%;
  animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.message-avatar.ai {
  background: linear-gradient(135deg, var(--primary-400), var(--secondary-400));
  color: white;
}

.message-avatar.user {
  background: linear-gradient(135deg, var(--warm-300), var(--warm-500));
  color: white;
}

.message-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.message-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: var(--font-size-base);
  line-height: 1.6;
  word-wrap: break-word;
  word-break: break-word;
}

.message-time {
  font-size: 11px;
  color: var(--text-muted);
  padding: 0 4px;
}

/* AI消息（左对齐） */
.message.ai {
  align-self: flex-start;
}

.message.ai .message-bubble {
  background: white;
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* 用户消息（右对齐） */
.message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message.user .message-bubble {
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  color: white;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.message.user .message-time {
  text-align: right;
}

/* 打字机光标 */
.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--primary-500);
  margin-left: 2px;
  animation: blink 1s infinite;
  vertical-align: text-bottom;
}

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

/* 思考中动画 */
.thinking-dots {
  display: flex;
  gap: 4px;
  padding: 8px 4px;
}

.thinking-dots span {
  width: 6px;
  height: 6px;
  background: var(--primary-400);
  border-radius: 50%;
  animation: thinkingBounce 1.4s infinite ease-in-out both;
}

.thinking-dots span:nth-child(1) { animation-delay: -0.32s; }
.thinking-dots span:nth-child(2) { animation-delay: -0.16s; }

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

/* 引用来源 */
.message-sources {
  margin-top: 8px;
  background: var(--primary-50);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.sources-toggle {
  padding: 8px 12px;
  font-size: var(--font-size-xs);
  color: var(--primary-700);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.sources-toggle:active {
  background: var(--primary-100);
}

.sources-toggle .arrow {
  transition: transform var(--transition-fast);
  font-size: 10px;
}

.sources-toggle.expanded .arrow {
  transform: rotate(180deg);
}

.sources-list {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-base);
}

.sources-list.expanded {
  max-height: 300px;
}

.source-item {
  padding: 8px 12px;
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  border-top: 1px solid var(--primary-100);
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.source-item .source-index {
  background: var(--primary-200);
  color: var(--primary-800);
  padding: 0 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
}

/* 商品卡片 */
.product-card {
  margin-top: 10px;
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border-light);
}

.product-card-inner {
  display: flex;
  padding: 12px;
  gap: 12px;
}

.product-card-image {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary-100), var(--secondary-100));
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  overflow: hidden;
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.product-card-name {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}

.product-card-price {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--warm-600);
}

.product-card-price .currency {
  font-size: var(--font-size-xs);
  font-weight: 500;
}

.product-card-stock {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.product-card-action {
  padding: 0 12px 12px;
}

.product-card-action .btn {
  width: 100%;
  padding: 8px;
  font-size: var(--font-size-sm);
}

.product-card-tag {
  display: inline-block;
  padding: 2px 6px;
  background: var(--warm-100);
  color: var(--warm-700);
  font-size: 10px;
  border-radius: 4px;
  margin-bottom: 4px;
}

/* 输入栏 */
.chat-input-bar {
  background: white;
  border-top: 1px solid var(--border-light);
  padding: 10px 12px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.chat-input-wrapper {
  flex: 1;
  background: var(--gray-50);
  border-radius: 20px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.chat-input-wrapper:focus-within {
  background: white;
  border-color: var(--primary-300);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.chat-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: var(--font-size-base);
  color: var(--text-primary);
  resize: none;
  max-height: 100px;
  min-height: 24px;
  line-height: 1.5;
  font-family: inherit;
  outline: none;
}

.chat-input::placeholder {
  color: var(--text-muted);
}

.chat-send-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  color: white;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.chat-send-btn:active {
  transform: scale(0.95);
}

.chat-send-btn:disabled {
  background: var(--gray-300);
  box-shadow: none;
  cursor: not-allowed;
}

/* 快捷问题 */
.quick-questions {
  padding: 12px 12px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-question {
  padding: 8px 14px;
  background: white;
  border: 1px solid var(--primary-200);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  color: var(--primary-700);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.quick-question:active {
  background: var(--primary-50);
  transform: scale(0.98);
}

/* 欢迎消息 */
.welcome-message {
  text-align: center;
  padding: 20px 16px;
}

.welcome-avatar {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-400), var(--secondary-400));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 28px;
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.3);
}

.welcome-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.welcome-subtitle {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============================================
   登录页
   ============================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 40px 24px 24px;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--primary-400), var(--secondary-400));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 36px;
  box-shadow: 0 8px 24px rgba(34, 197, 94, 0.3);
}

.login-logo h1 {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.login-logo p {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.login-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  box-shadow: var(--shadow-lg);
}

.login-tabs {
  display: flex;
  background: var(--gray-100);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 24px;
}

.login-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.login-tab.active {
  background: white;
  color: var(--primary-600);
  box-shadow: var(--shadow-sm);
}

.login-form-group {
  margin-bottom: 16px;
}

.login-input-group {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.login-input-group:focus-within {
  background: white;
  border-color: var(--primary-400);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.login-input-icon {
  padding: 0 12px;
  color: var(--text-muted);
  font-size: 18px;
}

.login-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 14px 14px 14px 0;
  font-size: var(--font-size-base);
  color: var(--text-primary);
  outline: none;
  font-family: inherit;
}

.login-input::placeholder {
  color: var(--text-muted);
}

.login-code-btn {
  padding: 0 16px;
  font-size: var(--font-size-xs);
  color: var(--primary-600);
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 500;
}

.login-code-btn:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
}

.login-submit {
  width: 100%;
  padding: 14px;
  font-size: var(--font-size-base);
  font-weight: 600;
  margin-top: 8px;
}

.login-agreement {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 16px;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  line-height: 1.5;
}

.login-agreement input[type="checkbox"] {
  margin-top: 2px;
  accent-color: var(--primary-500);
}

.login-agreement a {
  color: var(--primary-600);
}

/* ============================================
   健康档案页（分步表单）
   ============================================ */
.health-record-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.step-indicator {
  padding: 16px;
  background: white;
  border-bottom: 1px solid var(--border-light);
}

.step-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.step-progress-text {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.step-progress-text strong {
  color: var(--primary-600);
  font-size: var(--font-size-lg);
}

.step-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray-200);
  transition: all var(--transition-base);
}

.step-dot.active {
  background: var(--primary-500);
  width: 24px;
  border-radius: 4px;
}

.step-dot.completed {
  background: var(--primary-300);
}

.step-title {
  padding: 20px 16px 12px;
}

.step-title h2 {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.step-title p {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.step-content {
  flex: 1;
  padding: 0 16px 16px;
  overflow-y: auto;
}

.form-section {
  background: white;
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.form-section-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-section-title::before {
  content: '';
  width: 3px;
  height: 14px;
  background: var(--primary-500);
  border-radius: 2px;
}

/* 选项组 */
.option-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.option-chip {
  padding: 10px 16px;
  background: var(--gray-50);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.option-chip:active {
  transform: scale(0.98);
}

.option-chip.selected {
  background: var(--primary-50);
  border-color: var(--primary-400);
  color: var(--primary-700);
  font-weight: 500;
}

/* 行内字段 */
.inline-fields {
  display: flex;
  gap: 12px;
}

.inline-fields .form-group {
  flex: 1;
}

/* 底部按钮 */
.step-footer {
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  background: white;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 12px;
}

.step-footer .btn {
  flex: 1;
  padding: 14px;
  font-size: var(--font-size-base);
  font-weight: 600;
}

/* ============================================
   个人中心页
   ============================================ */
.profile-page {
  min-height: 100vh;
}

.profile-header {
  background: linear-gradient(135deg, var(--primary-500), var(--secondary-500));
  padding: 40px 20px 60px;
  color: white;
  position: relative;
  overflow: hidden;
}

.profile-header::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.profile-header::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -30px;
  width: 150px;
  height: 150px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.profile-user-info {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.profile-name {
  font-size: var(--font-size-xl);
  font-weight: 600;
  margin-bottom: 4px;
}

.profile-phone {
  font-size: var(--font-size-sm);
  opacity: 0.9;
}

.profile-stats {
  display: flex;
  margin: 0 16px;
  margin-top: -32px;
  background: white;
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 2;
}

.profile-stat-item {
  flex: 1;
  text-align: center;
}

.profile-stat-value {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--primary-600);
}

.profile-stat-label {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin-top: 2px;
}

.profile-menu {
  padding: 20px 16px;
}

.menu-group {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background var(--transition-fast);
}

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

.menu-item:active {
  background: var(--gray-50);
}

.menu-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-right: 12px;
}

.menu-icon.green { background: var(--primary-100); color: var(--primary-600); }
.menu-icon.teal { background: var(--secondary-100); color: var(--secondary-600); }
.menu-icon.gold { background: var(--warm-100); color: var(--warm-600); }
.menu-icon.gray { background: var(--gray-100); color: var(--gray-600); }

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

.menu-arrow {
  color: var(--text-muted);
  font-size: 14px;
}

.menu-badge {
  background: var(--error);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  margin-right: 6px;
}

/* ============================================
   咨询历史页
   ============================================ */
.history-page {
  min-height: 100vh;
}

.history-list {
  padding: 12px;
}

.history-item {
  background: white;
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.history-item:active {
  transform: scale(0.99);
  background: var(--gray-50);
}

.history-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.history-item-title {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 12px;
}

.history-item-date {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  flex-shrink: 0;
}

.history-item-preview {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.history-item-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.history-item-meta .msg-count {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============================================
   订单页
   ============================================ */
.orders-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.orders-tabs {
  position: sticky;
  top: 56px;
  z-index: 99;
  background: white;
  display: flex;
  border-bottom: 1px solid var(--border-light);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.orders-tabs::-webkit-scrollbar {
  display: none;
}

.orders-tab {
  flex-shrink: 0;
  padding: 12px 16px;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  transition: color var(--transition-fast);
}

.orders-tab.active {
  color: var(--primary-600);
  font-weight: 600;
}

.orders-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--primary-500);
  border-radius: 2px;
}

.orders-list {
  flex: 1;
  padding: 12px;
}

.order-card {
  background: white;
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.order-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
}

.order-no {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.order-status {
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.order-status.pending { color: var(--warm-600); }
.order-status.shipping { color: var(--info); }
.order-status.completed { color: var(--success); }
.order-status.cancelled { color: var(--text-muted); }

.order-card-body {
  padding: 12px 16px;
  display: flex;
  gap: 12px;
}

.order-product-img {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary-100), var(--secondary-100));
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

.order-product-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.order-product-name {
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.order-product-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.order-price {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--warm-600);
}

.order-qty {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.order-card-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--gray-50);
}

.order-total {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.order-total strong {
  font-size: var(--font-size-base);
  color: var(--warm-600);
  font-weight: 700;
}

.order-actions {
  display: flex;
  gap: 8px;
}

.order-actions .btn {
  padding: 6px 14px;
  font-size: var(--font-size-xs);
}

/* ============================================
   订单详情页
   ============================================ */
.order-detail-page {
  min-height: 100vh;
  padding-bottom: 80px;
}

.order-status-banner {
  background: linear-gradient(135deg, var(--primary-500), var(--secondary-500));
  color: white;
  padding: 30px 20px;
  text-align: center;
}

.order-status-banner h2 {
  font-size: var(--font-size-xl);
  font-weight: 600;
  margin-bottom: 6px;
}

.order-status-banner p {
  font-size: var(--font-size-sm);
  opacity: 0.9;
}

.order-detail-section {
  background: white;
  margin: 12px;
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.order-detail-section h3 {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.order-detail-section h3::before {
  content: '';
  width: 3px;
  height: 14px;
  background: var(--primary-500);
  border-radius: 2px;
}

.address-info {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.address-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--warm-100);
  color: var(--warm-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.address-content {
  flex: 1;
}

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

.address-detail {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.5;
}

.order-detail-product {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.order-detail-product:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.order-detail-product:first-child {
  padding-top: 0;
}

.order-detail-img {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary-100), var(--secondary-100));
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

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

.order-detail-name {
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 6px;
}

.order-detail-spec {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-bottom: 6px;
}

.order-detail-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.order-detail-price {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--warm-600);
}

.order-detail-qty {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.order-fee-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.order-fee-row.total {
  padding-top: 10px;
  margin-top: 6px;
  border-top: 1px solid var(--border-light);
  font-weight: 600;
  color: var(--text-primary);
}

.order-fee-row.total .fee-value {
  font-size: var(--font-size-lg);
  color: var(--warm-600);
}

.order-info-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: var(--font-size-sm);
}

.order-info-label {
  color: var(--text-muted);
}

.order-info-value {
  color: var(--text-secondary);
}

.order-detail-bottom {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: white;
  border-top: 1px solid var(--border-light);
  padding: 10px 16px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  display: flex;
  gap: 10px;
  z-index: 100;
}

.order-detail-bottom .btn {
  flex: 1;
  padding: 12px;
  font-size: var(--font-size-sm);
  font-weight: 600;
}

/* ============================================
   商品详情页
   ============================================ */
.product-detail-page {
  min-height: 100vh;
  padding-bottom: 70px;
}

.product-gallery {
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(135deg, var(--primary-100), var(--secondary-100));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 120px;
  position: relative;
}

.product-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-info-card {
  background: white;
  margin: -20px 12px 12px;
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  position: relative;
  z-index: 2;
  box-shadow: var(--shadow-md);
}

.product-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.product-price-big {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  color: var(--warm-600);
}

.product-price-big .currency {
  font-size: var(--font-size-lg);
}

.product-original-price {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  text-decoration: line-through;
}

.product-tag {
  display: inline-block;
  padding: 2px 8px;
  background: linear-gradient(135deg, var(--warm-400), var(--warm-500));
  color: white;
  font-size: 10px;
  border-radius: 4px;
  font-weight: 500;
}

.product-name-detail {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 8px;
}

.product-desc-short {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

.product-meta-row {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.product-detail-section {
  background: white;
  margin: 12px;
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.product-detail-section h3 {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.product-detail-section h3::before {
  content: '';
  width: 3px;
  height: 14px;
  background: var(--primary-500);
  border-radius: 2px;
}

.product-detail-content {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.8;
}

.product-detail-content p {
  margin-bottom: 10px;
}

.product-detail-content ul {
  padding-left: 20px;
  margin-bottom: 10px;
}

.product-detail-content li {
  margin-bottom: 4px;
}

.product-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: white;
  border-top: 1px solid var(--border-light);
  padding: 10px 12px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 100;
}

.product-bottom-icons {
  display: flex;
  gap: 4px;
}

.product-bottom-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 10px;
  font-size: 10px;
  color: var(--text-secondary);
  cursor: pointer;
}

.product-bottom-icon .icon {
  font-size: 20px;
  margin-bottom: 2px;
}

.product-bottom-btns {
  flex: 1;
  display: flex;
  gap: 8px;
}

.product-bottom-btns .btn {
  flex: 1;
  padding: 12px;
  font-size: var(--font-size-sm);
  font-weight: 600;
}

/* ============================================
   Toast 移动端适配
   ============================================ */
.toast-container {
  top: auto;
  bottom: 100px;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  flex-direction: column-reverse;
}

.toast {
  min-width: auto;
  max-width: 90vw;
  border-left: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

/* ============================================
   通用列表项
   ============================================ */
.list-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: white;
  border-bottom: 1px solid var(--border-light);
}

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

.list-item-label {
  font-size: var(--font-size-base);
  color: var(--text-primary);
  flex: 1;
}

.list-item-value {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-right: 8px;
}

.list-item-arrow {
  color: var(--text-muted);
  font-size: 14px;
}

/* ============================================
   分段控制器
   ============================================ */
.segmented-control {
  display: flex;
  background: var(--gray-100);
  border-radius: var(--radius-md);
  padding: 3px;
  margin-bottom: 16px;
}

.segmented-item {
  flex: 1;
  padding: 8px;
  text-align: center;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.segmented-item.active {
  background: white;
  color: var(--primary-600);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

/* ============================================
   滑动删除/操作
   ============================================ */
.swipe-action {
  position: relative;
  overflow: hidden;
}

/* ============================================
   空状态移动端适配
   ============================================ */
.empty-state {
  padding: 60px 20px;
}

.empty-state-icon {
  font-size: 56px;
  margin-bottom: 12px;
}

/* ============================================
   底部导航栏（如果需要）
   ============================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: white;
  border-top: 1px solid var(--border-light);
  display: flex;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 100;
}

.bottom-nav-item {
  flex: 1;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.bottom-nav-item.active {
  color: var(--primary-600);
}

.bottom-nav-item .nav-icon {
  font-size: 22px;
}

/* ============================================
   标签选择器（多选）
   ============================================ */
.tag-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-item {
  padding: 8px 14px;
  background: var(--gray-50);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tag-item.selected {
  background: var(--primary-50);
  border-color: var(--primary-400);
  color: var(--primary-700);
}

/* ============================================
   滑块/范围选择
   ============================================ */
.slider-value {
  text-align: center;
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--primary-600);
  margin-bottom: 8px;
}

.slider-value small {
  font-size: var(--font-size-sm);
  font-weight: 400;
  color: var(--text-muted);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--primary-500);
}

/* ============================================
   数字输入加减器
   ============================================ */
.stepper {
  display: inline-flex;
  align-items: center;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.stepper-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 18px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stepper-btn:active {
  background: var(--gray-200);
}

.stepper-value {
  width: 40px;
  text-align: center;
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--text-primary);
}

/* ============================================
   通用间距工具类
   ============================================ */
.mt-4 { margin-top: 16px; }
.mt-3 { margin-top: 12px; }
.mt-2 { margin-top: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 12px; }
.p-4 { padding: 16px; }
.p-3 { padding: 12px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary-600); }
.text-warm { color: var(--warm-600); }
.fw-600 { font-weight: 600; }

/* ============================================
   对话详情页（历史）
   ============================================ */
.chat-detail-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

/* ============================================
   骨架屏
   ============================================ */
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================
   下拉刷新提示
   ============================================ */
.pull-refresh {
  text-align: center;
  padding: 12px;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

/* ============================================
   响应式 - PC端展示手机列样式
   ============================================ */
@media (min-width: 481px) {
  body {
    background: var(--gray-100);
  }

  .app-container {
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.1);
    min-height: 100vh;
  }
}
