/* 基础样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  color: #333;
  background: #f5f5f5;
  -webkit-tap-highlight-color: transparent;
}

/* 页面容器 */
.page {
  display: none;
  height: 100%;
  flex-direction: column;
}

.page.active {
  display: flex;
}

/* ========== 登录页 ========== */
#loginPage {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  justify-content: center;
  align-items: center;
}

.login-container {
  width: 85%;
  max-width: 360px;
  background: #fff;
  border-radius: 16px;
  padding: 30px 24px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

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

.logo-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 28px;
  color: #fff;
  font-weight: bold;
}

.login-logo h1 {
  font-size: 20px;
  color: #333;
}

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

.login-form label {
  display: block;
  margin-bottom: 6px;
  color: #666;
  font-size: 13px;
}

.login-form input {
  width: 100%;
  height: 44px;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 0 14px;
  font-size: 15px;
  transition: border-color 0.3s;
}

.login-form input:focus {
  outline: none;
  border-color: #667eea;
}

.btn-primary {
  width: 100%;
  height: 46px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 10px;
  transition: opacity 0.3s;
}

.btn-primary:active {
  opacity: 0.8;
}

.login-tip {
  text-align: center;
  margin-top: 16px;
  color: #999;
  font-size: 12px;
}

/* ========== 主页面 ========== */
.header {
  height: 50px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

.header-title {
  font-size: 18px;
  font-weight: 500;
}

.header-right {
  font-size: 13px;
}

.content {
  flex: 1;
  margin-top: 50px;
  margin-bottom: 60px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Tab 内容 */
.tab-content {
  display: none;
  padding: 12px;
}

.tab-content.active {
  display: block;
}

/* ========== 首页 ========== */
/* 轮播 - 自适应比例，2倍图适配 */
.carousel {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 45.33%; /* 340/750 ≈ 45.33%，保持2.2:1比例 */
  border-radius: 10px;
  overflow: hidden;
  background: #e0e0e0;
}

.carousel-inner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.carousel-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s;
}

.carousel-item.active {
  opacity: 1;
}

.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.carousel-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.carousel-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-size: 16px;
}}

.carousel-indicators {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}

.indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
}

.indicator.active {
  background: #fff;
}

/* 通知栏 */
.notice-bar {
  margin-top: 12px;
  background: #fff8e1;
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.notice-icon {
  font-size: 16px;
}

.notice-content {
  flex: 1;
  overflow: hidden;
}

.notice-marquee {
  display: flex;
  white-space: nowrap;
  animation: marquee-scroll 12s linear infinite;
 width: max-content;
}

@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.notice-text {
  color: #f57c00;
  font-size: 13px;
  white-space: nowrap;
}

/* 功能区 */
.function-area {
  margin-top: 16px;
}

.section-title {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 12px;
  color: #333;
}

.function-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.function-item {
  background: #fff;
  border-radius: 10px;
  padding: 14px 8px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.function-item.placeholder {
  opacity: 0.6;
}

.function-icon {
  font-size: 24px;
  display: block;
  margin-bottom: 6px;
}

.function-name {
  font-size: 12px;
  color: #666;
}

/* ========== 底部通栏广告 ========== */
.banner-strip {
  margin-top: 16px;
  width: 100%;
  height: 0;
  padding-bottom: 26.67%; /* 200/750 ≈ 26.67%，保持3.75:1比例 */
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #e0e0e0;
}

.banner-strip img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.banner-strip-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ff9a56 0%, #ff6347 100%);
  color: #fff;
  font-size: 15px;
  border-radius: 10px;
}

/* ========== 双列小广告 ========== */
.ad-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ad-grid-item {
  position: relative;
  height: 0;
  padding-bottom: 66.67%; /* 240/360 ≈ 66.67%，保持3:2比例 */
  border-radius: 8px;
  overflow: hidden;
  background: #e0e0e0;
}

.ad-grid-item img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ad-grid-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4dabf7 0%, #339af0 100%);
  color: #fff;
  font-size: 13px;
}

/* ========== 订单页 ========== */
.new-order-alert {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  cursor: pointer;
  margin-bottom: 12px;
}

.alert-icon {
  position: relative;
  font-size: 20px;
}

.badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 16px;
  height: 16px;
  background: #fff;
  color: #ff6b6b;
  font-size: 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.alert-text {
  font-size: 14px;
  font-weight: 500;
}

/* 订单筛选 */
.order-filter {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.filter-btn {
  flex: 1;
  height: 36px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 18px;
  font-size: 13px;
  color: #666;
  cursor: pointer;
  transition: all 0.3s;
}

.filter-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: transparent;
  color: #fff;
}

/* 订单列表 */
.order-list {
  min-height: 200px;
}

.order-card {
  background: #fff;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  cursor: pointer;
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.order-no {
  font-size: 13px;
  color: #999;
}

.order-status {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
}

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

.status-completed {
  background: #e8f5e9;
  color: #4caf50;
}

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

.order-product-img {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  background: #f0f0f0;
  object-fit: cover;
}

.order-info {
  flex: 1;
}

.order-product-name {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin-bottom: 4px;
}

.order-price {
  font-size: 15px;
  color: #ff5722;
  font-weight: 500;
}

.order-role {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

.order-footer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #999;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.empty-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 12px;
}

/* ========== 我的页 ========== */
.user-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: #fff;
  margin-bottom: 16px;
}

.user-avatar {
  width: 56px;
  height: 56px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 500;
}

.user-info h3 {
  font-size: 18px;
  margin-bottom: 4px;
}

.user-info p {
  font-size: 13px;
  opacity: 0.8;
}

.info-list {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
}

.info-item {
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f0f0f0;
}

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

.info-label {
  color: #666;
  font-size: 14px;
}

.info-value {
  color: #333;
  font-size: 14px;
}

.info-value-with-btn {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-copy {
  padding: 4px 10px;
  background: #f0f0f0;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  color: #666;
  cursor: pointer;
}

.btn-copy:active {
  background: #e0e0e0;
}

.action-list {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
}

.action-item {
  width: 100%;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  background: #fff;
  border: none;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  text-align: left;
}

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

.action-icon {
  font-size: 18px;
  margin-right: 12px;
}

.action-text {
  flex: 1;
  font-size: 14px;
  color: #333;
}

.action-arrow {
  font-size: 16px;
  color: #ccc;
}

.logout-btn .action-text {
  color: #ff5722;
}

/* ========== 底部导航 ========== */
.bottom-nav {
  height: 60px;
  background: #fff;
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
  z-index: 100;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #999;
  transition: color 0.3s;
}

.nav-item.active {
  color: #667eea;
}

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

.nav-text {
  font-size: 11px;
}

/* ========== 弹窗 ========== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: #fff;
  border-radius: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 16px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 16px;
}

.modal-close {
  width: 28px;
  height: 28px;
  border: none;
  background: #f0f0f0;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body {
  padding: 16px;
  overflow-y: auto;
}

/* ========== Toast ========== */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.toast.show {
  opacity: 1;
}

/* ========== 表单通用 ========== */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: #666;
}

.form-group input {
  width: 100%;
  height: 42px;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0 12px;
  font-size: 14px;
}

.form-group input:focus {
  outline: none;
  border-color: #667eea;
}

/* 订单详情样式 */
.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  color: #666;
}

.detail-value {
  color: #333;
  font-weight: 500;
}

.detail-product {
  margin: 12px 0;
  padding: 12px;
  background: #f9f9f9;
  border-radius: 8px;
}

.detail-product-img {
  width: 100%;
  height: 120px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
  margin-bottom: 8px;
}

.detail-product-name {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}
/* 订单详情分区 */
.detail-section {
  margin: 16px 0;
  padding: 0 16px;
}

.detail-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #667eea;
  margin-bottom: 8px;
  padding-left: 8px;
  border-left: 3px solid #667eea;
}

/* 二维码容器 */
.qr-container {
  text-align: center;
  padding: 16px;
  background: #f9f9f9;
  border-radius: 8px;
  margin: 12px 16px;
}

.qr-img {
  width: 180px;
  height: 180px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
  padding: 8px;
}

.qr-tip {
  font-size: 12px;
  color: #999;
  margin-top: 8px;
}

/* 弹窗 body 全屏适配 */
.modal-body {
  padding: 0;
  overflow-y: auto;
  flex: 1;
}

.modal-header {
  padding: 16px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 10;
}


/* ========== 订单详情样式（完全按照参考截图设计）========== */

/* 订单详情主容器 */
.order-detail-container {
  padding: 16px;
  background: #f5f5f5;
  min-height: 100%;
  box-sizing: border-box;
}

/* ---------- 用户信息卡片（卖家/买家）---------- */
.user-card-seller,
.user-card-buyer {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* 圆形图标 */
.user-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  color: #fff;
  flex-shrink: 0;
}

.seller-icon {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
}

.buyer-icon {
  background: linear-gradient(135deg, #4dabf7 0%, #339af0 100%);
}

/* 用户信息文字 */
.user-info-text {
  flex: 1;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 2px;
}

.user-code {
  font-size: 12px;
  color: #888;
}

/* ---------- 商品信息卡片 ---------- */
.product-card {
  display: flex;
  gap: 10px;
  background: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.product-image {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  background: #f5f5f5;
  flex-shrink: 0;
}

.product-image-placeholder {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  background: #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #999;
  flex-shrink: 0;
}

.product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.product-name {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  line-height: 1.3;
}

.product-sku {
  font-size: 12px;
  color: #666;
}

.product-order-no {
  font-size: 12px;
  color: #666;
}

.product-time {
  font-size: 12px;
  color: #888;
}

/* ---------- 金额信息区域 ---------- */
.amount-section {
  background: #fff;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.amount-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

.amount-row.last {
  border-bottom: none;
}

.amount-label {
  font-size: 13px;
  color: #555;
  font-weight: 500;
}

.amount-value-main {
  font-size: 18px;
  color: #ff5722;
  font-weight: 700;
}

.amount-value-sub {
  font-size: 13px;
  color: #555;
  font-weight: 500;
}

/* ---------- 收款码区域 ---------- */
.qr-section {
  text-align: center;
  padding: 16px 0;
}

.qr-image {
  width: 200px;
  height: 200px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

/* 旧版样式兼容 - 已弃用 */
.alipay-section {
  opacity: 0.9;
}

/* 模态框全屏：确保不滚动 */
#orderDetailModal .modal-body {
  padding: 0;
  overflow: hidden;
}

#orderDetailModal .modal-content {
  border-radius: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
}

#orderDetailModal .modal-header {
  padding: 12px 16px;
  flex-shrink: 0;
}

#orderDetailModal .modal-body {
  flex: 1;
  overflow: hidden;
}

/* ========== 新订单页（待处理订单列表）========== */
.new-order-page-title {
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  padding: 10px 0 6px;
  color: #333;
}

.new-order-empty {
  text-align: center;
  padding: 80px 20px;
  color: #999;
  font-size: 15px;
}

.new-order-card {
  background: #fff;
  border-radius: 10px;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  overflow: hidden;
}
