/* ==================== 团队订单管理系统 - 统一风格规范 ==================== */

/* --- CSS变量 --- */
:root {
  /* 主色 */
  --primary: #10b981;
  --primary-dark: #059669;
  --primary-light: #d1fae5;
  --primary-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);

  /* 功能色 */
  --blue: #3b82f6;
  --blue-light: #dbeafe;
  --red: #ef4444;
  --red-light: #fee2e2;
  --orange: #f59e0b;
  --orange-light: #fef3c7;
  --purple: #8b5cf6;
  --purple-light: #ede9fe;
  --cyan: #06b6d4;
  --cyan-light: #cffafe;

  /* 中性色 */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* 背景 */
  --bg: #f5f7fa;
  --card: #ffffff;
  --border: #e5e7eb;

  /* 圆角 */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  /* 阴影 */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.1);

  /* 字体 */
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

/* --- 全局重置 --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* --- 页面头部 --- */
.page-header {
  background: transparent;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.page-header .back-btn {
  padding: 8px 20px;
  background: #10b981;
  border: none;
  border-radius: 20px;
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.page-header .back-btn:hover {
  opacity: 0.85;
}

.page-header .header-title {
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  flex: 1;
}

.page-header .header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* --- 容器 --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
}

/* --- 卡片 --- */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin: 12px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

/* --- 表单 --- */
.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

input[type="text"],
input[type="number"],
input[type="tel"],
input[type="password"],
input[type="email"],
input[type="search"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--gray-800);
  background: var(--card);
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: var(--font);
  margin: 0;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16,185,129,0.1);
}

input::placeholder,
textarea::placeholder {
  color: var(--gray-400);
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  padding: 0;
  margin: 0 4px 0 0;
  accent-color: #10b981;
  cursor: pointer;
  vertical-align: middle;
}

/* --- 按钮 --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
  white-space: nowrap;
  text-decoration: none;
}

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

.btn-primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 2px 6px rgba(16,185,129,0.3);
}

.btn-primary:hover {
  box-shadow: 0 4px 12px rgba(16,185,129,0.4);
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
}

.btn-secondary:hover {
  background: var(--gray-200);
}

.btn-blue {
  background: var(--blue);
  color: white;
  box-shadow: 0 2px 6px rgba(59,130,246,0.3);
}

.btn-blue:hover {
  background: #2563eb;
}

.btn-danger {
  background: var(--red);
  color: white;
  box-shadow: 0 2px 6px rgba(239,68,68,0.3);
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-warning {
  background: var(--orange);
  color: white;
  box-shadow: 0 2px 6px rgba(245,158,11,0.3);
}

.btn-warning:hover {
  background: #d97706;
}

.btn-purple {
  background: var(--purple);
  color: white;
  box-shadow: 0 2px 6px rgba(139,92,246,0.3);
}

.btn-purple:hover {
  background: #7c3aed;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
  border-radius: var(--radius-md);
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid #10b981;
  color: #10b981;
}

.btn-outline:hover {
  background: rgba(16,185,129,0.1);
}

/* --- 表格 --- */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  table-layout: auto;
}

table thead th {
  background: var(--gray-50);
  color: var(--gray-600);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 10px 8px;
  text-align: left;
  border-bottom: 2px solid var(--gray-200);
  white-space: nowrap;
}

table tbody td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: middle;
}

table tbody tr:hover {
  background: var(--gray-50);
}

table tbody tr:nth-child(even) {
  background: var(--gray-50);
}

table tbody tr:nth-child(even):hover {
  background: var(--gray-100);
}

/* 订单详情弹窗布局 */
.view-order-layout {
  display: flex;
  gap: 20px;
}
.view-order-info {
  flex: 1;
  min-width: 0;
}
.view-order-photo {
  width: 300px;
  text-align: center;
  flex-shrink: 0;
}

/* 小按钮通用 */
.btn-small {
  padding: 3px 8px;
  font-size: 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.4;
}
.btn-small.btn-info { background: #3b82f6; color: #fff; }
.btn-small.btn-info:hover { background: #2563eb; }
.btn-small.btn-primary { background: #10b981; color: #fff; }
.btn-small.btn-primary:hover { background: #059669; }
.btn-small.btn-danger { background: #ef4444; color: #fff; }
.btn-small.btn-danger:hover { background: #dc2626; }
.btn-small.btn-warning { background: #f59e0b; color: #fff; }
.btn-small.btn-warning:hover { background: #d97706; }

/* --- 状态标签 --- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
}

.tag-green {
  background: rgba(16,185,129,0.1);
  color: #065f46;
}

.tag-blue {
  background: var(--blue-light);
  color: #1e40af;
}

.tag-red {
  background: var(--red-light);
  color: #991b1b;
}

.tag-orange {
  background: var(--orange-light);
  color: #92400e;
}

.tag-purple {
  background: var(--purple-light);
  color: #5b21b6;
}

.tag-gray {
  background: var(--gray-100);
  color: var(--gray-600);
}

/* --- 搜索栏 --- */
.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.search-bar input {
  flex: 1;
}

/* --- 统计卡片 --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.stat-card {
  text-align: center;
  padding: 10px 6px;
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.stat-card .stat-num {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
}

.stat-card .stat-label {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 2px;
}

/* --- 弹窗/模态框 --- */
.modal,
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  overflow-y: auto;
}

.modal.hide,
.modal-overlay.hide {
  display: none !important;
}

.modal-content {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-content h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--gray-800);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.modal-actions .btn {
  flex: 1;
}

/* --- 分页 --- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 8px 0;
}

.pagination button {
  padding: 6px 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--gray-600);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.pagination button:hover {
  background: var(--gray-50);
  border-color: #10b981;
  color: #10b981;
}

.pagination button.active {
  background: #10b981;
  color: white;
  border-color: #10b981;
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* --- Toast提示 --- */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  color: white;
  font-size: 14px;
  font-weight: 600;
  z-index: 2000;
  transition: transform 0.3s ease;
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast-success { background: #059669; }
.toast-error { background: var(--red); }
.toast-warning { background: var(--orange); }
.toast-info { background: var(--blue); }

/* --- 空状态 --- */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray-400);
}

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

.empty-state .empty-text {
  font-size: 14px;
}

/* --- 工具栏 --- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

/* --- 选项卡 --- */
.tabs {
  display: flex;
  gap: 0;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 14px;
}

.tab-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--gray-500);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--card);
  color: #059669;
  box-shadow: var(--shadow-sm);
}


/* --- 响应式 --- */

/* 表格wrap - 所有设备都可横向滚动 */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

/* 提示用户可以滑动 */
.table-wrap::after {
  content: '';
  position: sticky;
  right: 0;
  top: 0;
  width: 20px;
  height: 100%;
  background: linear-gradient(to right, transparent, rgba(0,0,0,0.05));
  pointer-events: none;
  display: block;
}

.action-btns {
  display: inline-flex;
  gap: 4px;
  flex-wrap: nowrap;
  align-items: center;
}

/* 手机端 (≤480px) */
@media (max-width: 480px) {
  /* 表格不压缩，保证内容可读 */
  table {
    min-width: 600px;
  }

  .table th, .table td {
    font-size: 12px;
    padding: 6px 5px;
    white-space: nowrap;
  }

  .table th {
    font-size: 11px;
  }

  /* 操作列固定在右侧 */
  .table td:last-child,
  .table th:last-child {
    position: sticky;
    right: 0;
    background: #fff;
    z-index: 1;
    box-shadow: -2px 0 4px rgba(0,0,0,0.06);
    min-width: 100px;
  }

  .btn-small {
    padding: 4px 8px;
    font-size: 11px;
    min-height: 28px;
  }

  .hide-mobile {
    display: none !important;
  }

  /* 详情弹窗上下排列 */
  .view-order-layout {
    flex-direction: column !important;
  }

  /* 统计卡片 */
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  }

  .stat-card .stat-num {
    font-size: 18px;
  }

  /* 容器 */
  .container {
    padding: 0 4px;
  }

  .card {
    margin: 6px;
    padding: 10px;
  }

  .page-header {
    padding: 8px 12px;
  }

  .page-header .header-title {
    font-size: 16px;
  }

  /* 弹窗适配 */
  .modal-content {
    width: 95% !important;
    max-width: 520px !important;
    max-height: 90vh;
  }

  /* 滑动提示 */
  .table-wrap::after {
    display: block;
  }
}

/* 平板 (481-768px) */
@media (min-width: 481px) and (max-width: 768px) {
  table {
    min-width: 700px;
  }

  .hide-md {
    display: none !important;
  }

  /* 操作列固定在右侧 */
  .table td:last-child,
  .table th:last-child {
    position: sticky;
    right: 0;
    background: #fff;
    z-index: 1;
    box-shadow: -2px 0 4px rgba(0,0,0,0.06);
  }

  .view-order-layout {
    flex-direction: column !important;
  }

  .modal-content {
    width: 90% !important;
    max-width: 520px !important;
    max-height: 85vh;
  }
}

/* PC端 (>768px) */
@media (min-width: 769px) {
  table {
    min-width: unset;
  }

  .table td:last-child,
  .table th:last-child {
    white-space: nowrap;
  }
}

/* 小屏手机 (≤360px) */
@media (max-width: 360px) {
  table {
    min-width: 550px;
  }

  .table th, .table td {
    font-size: 11px;
    padding: 5px 4px;
  }

  .btn-small {
    padding: 3px 6px;
    font-size: 10px;
    min-height: 26px;
  }
}
  background: var(--gray-400);
}

/* --- 链接 --- */
a {
  color: #059669;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* --- 图片 --- */
img {
  max-width: 100%;
  height: auto;
}

/* --- 标题统一 --- */
h1 { font-size: 20px; font-weight: 800; color: var(--gray-900); }
h2 { font-size: 17px; font-weight: 700; color: var(--gray-800); }
h3 { font-size: 15px; font-weight: 700; color: var(--gray-700); }

/* --- 章节标题 --- */
.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-800);
  margin: 16px 0 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid #10b981;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --- 信息提示框 --- */
.info-box {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 12px;
  line-height: 1.5;
}

.info-box.info { background: var(--blue-light); color: #1e40af; }
.info-box.success { background: rgba(16,185,129,0.1); color: #065f46; }
.info-box.warning { background: var(--orange-light); color: #92400e; }
.info-box.danger { background: var(--red-light); color: #991b1b; }

/* --- 批量操作栏 --- */
.batch-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--blue-light);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  flex-wrap: wrap;
  font-size: 13px;
}

/* --- 隐藏 --- */
.hide {
  display: none !important;
}

/* --- 文字截断 --- */
.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
