* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #1890ff;
  --primary-dark: #096dd9;
  --primary-light: #e6f7ff;
  --success: #52c41a;
  --warning: #faad14;
  --danger: #ff4d4f;
  --purple: #722ed1;
  --cyan: #13c2c2;
  --text-1: #262626;
  --text-2: #595959;
  --text-3: #8c8c8c;
  --text-4: #bfbfbf;
  --bg-page: #f0f2f5;
  --bg-card: #ffffff;
  --border: #e8e8e8;
  --border-light: #f0f0f0;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg-page);
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.app-container { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg-page); position: relative; }
.admin-container { max-width: 1200px; margin: 0 auto; min-height: 100vh; background: var(--bg-page); }

.page { display: none; padding: 16px; padding-bottom: 80px; }
.page.active { display: block; }

.header {
  background: var(--primary);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header h1 { font-size: 17px; font-weight: 500; }
.header .back-btn { background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; padding: 4px 8px; }
.header .action-btn { background: none; border: none; color: #fff; font-size: 14px; cursor: pointer; }

.admin-header {
  background: #001529;
  color: #fff;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.admin-header h1 { font-size: 16px; font-weight: 500; }
.admin-nav { display: flex; gap: 4px; }
.admin-nav a {
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: all 0.2s;
}
.admin-nav a:hover, .admin-nav a.active { color: #fff; background: var(--primary); }

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.card-title { font-size: 15px; font-weight: 500; margin-bottom: 12px; color: var(--text-1); }

.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 14px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-1);
  background: #fff;
  transition: border-color 0.2s;
  font-family: inherit;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(24,144,255,0.1);
}
.form-textarea { min-height: 100px; resize: vertical; }
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-4); }

.radio-group { display: flex; gap: 12px; }
.radio-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  background: #fff;
}
.radio-item.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.radio-item input { display: none; }

.upload-area {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.upload-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--border-light);
}
.upload-item img { width: 100%; height: 100%; object-fit: cover; }
.upload-item .remove-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.upload-trigger {
  aspect-ratio: 1;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-3);
  font-size: 12px;
  gap: 4px;
  background: #fafafa;
  transition: border-color 0.2s;
}
.upload-trigger:hover { border-color: var(--primary); color: var(--primary); }
.upload-trigger .icon { font-size: 28px; line-height: 1; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:active { transform: scale(0.98); }
.btn-success { background: var(--success); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-default { background: #fff; border: 1px solid var(--border); color: var(--text-2); }
.btn-default:hover { border-color: var(--primary); color: var(--primary); }
.btn-block { display: flex; width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 100;
}
.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
  color: var(--text-3);
  font-size: 11px;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s;
}
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item .nav-icon { font-size: 22px; margin-bottom: 2px; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
}
.badge-warning { background: #fff7e6; color: #d48806; }
.badge-info { background: #e6f7ff; color: #096dd9; }
.badge-success { background: #f6ffed; color: #389e0d; }
.badge-danger { background: #fff1f0; color: #cf1322; }
.badge-purple { background: #f9f0ff; color: #531dab; }
.badge-cyan { background: #e6fffb; color: #08979c; }
.badge-default { background: #fafafa; color: #8c8c8c; }

.order-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: box-shadow 0.2s;
  border: 1px solid var(--border-light);
}
.order-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.order-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.order-card-no { font-size: 13px; color: var(--text-3); font-family: monospace; }
.order-card-title { font-size: 15px; font-weight: 500; margin-bottom: 4px; }
.order-card-desc { font-size: 13px; color: var(--text-2); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.order-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border-light); }
.order-card-time { font-size: 12px; color: var(--text-3); }

.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 16px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: -20px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid #fff;
}
.timeline-item.active .timeline-dot { background: var(--primary); }
.timeline-item.done .timeline-dot { background: var(--success); }
.timeline-content { font-size: 13px; }
.timeline-title { font-weight: 500; color: var(--text-1); }
.timeline-time { color: var(--text-3); font-size: 12px; }
.timeline-desc { color: var(--text-2); margin-top: 2px; }

.info-row { display: flex; padding: 8px 0; border-bottom: 1px solid var(--border-light); }
.info-row:last-child { border-bottom: none; }
.info-label { width: 90px; color: var(--text-3); font-size: 13px; flex-shrink: 0; }
.info-value { flex: 1; color: var(--text-1); font-size: 13px; word-break: break-all; }

.tabs { display: flex; background: #fff; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.tab-item { flex: 1; text-align: center; padding: 12px 0; font-size: 14px; color: var(--text-2); cursor: pointer; position: relative; }
.tab-item.active { color: var(--primary); font-weight: 500; }
.tab-item.active::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 24px; height: 2px; background: var(--primary); border-radius: 1px; }

.empty-state { text-align: center; padding: 48px 16px; color: var(--text-3); }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state .text { font-size: 14px; }

.success-icon { font-size: 64px; color: var(--success); text-align: center; margin: 32px 0 16px; }
.success-text { text-align: center; font-size: 18px; font-weight: 500; margin-bottom: 8px; }
.success-desc { text-align: center; font-size: 14px; color: var(--text-3); margin-bottom: 24px; }

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-md); cursor: pointer; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: center;
  border: 1px solid var(--border-light);
}
.stat-card .stat-value { font-size: 28px; font-weight: 600; color: var(--text-1); }
.stat-card .stat-label { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.stat-card.danger .stat-value { color: var(--danger); }
.stat-card.warning .stat-value { color: var(--warning); }
.stat-card.success .stat-value { color: var(--success); }
.stat-card.primary .stat-value { color: var(--primary); }
.stat-card.info .stat-value { color: var(--cyan); }

table.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius-lg); overflow: hidden; }
table.data-table th { background: #fafafa; padding: 12px; text-align: left; font-size: 13px; color: var(--text-2); font-weight: 500; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data-table td { padding: 12px; font-size: 13px; color: var(--text-1); border-bottom: 1px solid var(--border-light); }
table.data-table tr:hover { background: #fafafa; }
table.data-table tr:last-child td { border-bottom: none; }

.filter-bar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; }
.filter-bar select, .filter-bar input { padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; }

.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 20px;
  width: 90%;
  max-width: 400px;
  max-height: 80vh;
  overflow-y: auto;
}
.modal-title { font-size: 16px; font-weight: 500; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; margin-top: 16px; }

.scan-sim { text-align: center; padding: 24px 16px; }
.scan-sim .scan-icon { font-size: 72px; color: var(--primary); margin-bottom: 16px; }
.scan-sim h2 { font-size: 18px; font-weight: 500; margin-bottom: 8px; }
.scan-sim p { font-size: 14px; color: var(--text-3); margin-bottom: 24px; }
.qr-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 16px; }
.qr-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}
.qr-item:hover { border-color: var(--primary); background: var(--primary-light); }
.qr-item .qr-code { font-size: 12px; color: var(--text-3); font-family: monospace; }
.qr-item .qr-name { font-size: 13px; font-weight: 500; margin-top: 4px; }

.star-rating { display: flex; gap: 4px; }
.star-rating .star { font-size: 28px; color: var(--border); cursor: pointer; transition: color 0.15s; }
.star-rating .star.active { color: var(--warning); }

.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.7);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  z-index: 300;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.toast.show { opacity: 1; }

.admin-content { padding: 20px 24px; }
.section-title { font-size: 16px; font-weight: 500; margin-bottom: 12px; color: var(--text-1); }

.chart-container { background: #fff; border-radius: var(--radius-lg); padding: 16px; margin-bottom: 16px; border: 1px solid var(--border-light); }
