/* 0401 即时配送 - 线稿公共样式 · 设备参考 375×812 / 管理端 1400 */
:root {
  --primary: #9e6b6b;
  --primary-dark: #7d5555;
  --primary-light: #f3eaea;
  --bg: #f5f6fa;
  --card: #ffffff;
  --text: #2c3e50;
  --muted: #7f8c8d;
  --radius: 12px;
  --safe-top: env(safe-area-inset-top, 20px);
  --safe-bottom: env(safe-area-inset-bottom, 12px);
  --border: #e8e0e0;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
}

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

body {
  font-family: 'PingFang SC', 'Microsoft YaHei', -apple-system, sans-serif;
  background: #dfe3ea;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  color: var(--text);
}

/* 与烘焙项目 app-frame 对齐：同 phone-frame */
.app-frame,
.phone-frame {
  width: 375px;
  min-height: 812px;
  max-width: 100%;
  background: var(--bg);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  border: 8px solid #1a1a1a;
  position: relative;
}

.status-bar {
  height: 44px;
  padding: var(--safe-top) 16px 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.nav-bar {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 17px;
  color: var(--text);
  background: var(--card);
  border-bottom: 1px solid #eee;
}

.nav-bar.with-back {
  justify-content: space-between;
  padding: 0 12px;
}

.nav-back {
  font-size: 14px;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.content {
  padding: 16px;
  padding-bottom: calc(56px + var(--safe-bottom));
  min-height: 560px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.wire-label {
  font-size: 11px;
  color: var(--primary);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.placeholder-line {
  height: 12px;
  background: linear-gradient(90deg, #e8ddd9, #f0f0f0);
  border-radius: 4px;
  margin-bottom: 8px;
}

.btn-primary {
  display: block;
  width: 100%;
  padding: 14px;
  text-align: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  margin-top: 12px;
  cursor: pointer;
  transition: transform 0.08s ease, opacity 0.15s;
}

.btn-primary:active { transform: scale(0.98); opacity: 0.92; }

.btn-secondary {
  display: block;
  width: 100%;
  padding: 12px;
  text-align: center;
  background: #fff;
  color: var(--primary-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  margin-top: 10px;
  cursor: pointer;
}

.btn-secondary:active { background: var(--primary-light); }

.tab-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(56px + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--card);
  border-top: 1px solid #eee;
  display: flex;
  justify-content: space-around;
  align-items: center;
  font-size: 10px;
  color: var(--muted);
}

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

/* 可选类型 Chip */
.wire-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.wire-chip {
  padding: 8px 14px;
  background: #f0f0f0;
  border-radius: 20px;
  font-size: 13px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.wire-chip.active {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: var(--primary);
  font-weight: 600;
}

/* 地址行（可点） */
.wire-row-tap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
}
.wire-row-tap:last-child { border-bottom: none; }
.wire-row-tap:active { opacity: 0.75; }
.wire-row-tap .arrow { color: #ccc; font-size: 18px; }

/* 弹窗 */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.is-open { display: flex; }
.modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 320px;
  overflow: hidden;
  animation: modalIn 0.2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}
.modal-header {
  padding: 18px 18px 8px;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
}
.modal-body { padding: 8px 18px 16px; font-size: 14px; color: #555; line-height: 1.55; text-align: center; }
.modal-footer { display: flex; border-top: 1px solid #eee; }
.modal-footer button {
  flex: 1;
  padding: 14px;
  border: none;
  background: #fff;
  font-size: 16px;
  cursor: pointer;
}
.modal-footer button + button { border-left: 1px solid #eee; }
.modal-footer .btn-confirm { color: var(--primary); font-weight: 600; }
.modal-footer .btn-cancel { color: #888; }

/* 底部抽屉（地址/日期） */
.sheet-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 900;
}
.sheet-mask.is-open { display: block; }
.bottom-sheet {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 72vh;
  background: #fff;
  border-radius: 16px 16px 0 0;
  z-index: 901;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 30px rgba(0,0,0,0.12);
  animation: sheetUp 0.25s ease;
}
.bottom-sheet.is-open { display: block; }
@keyframes sheetUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.sheet-handle {
  width: 36px;
  height: 4px;
  background: #ddd;
  border-radius: 2px;
  margin: 0 auto 12px;
}
.sheet-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; text-align: center; }
.sheet-item {
  padding: 14px 12px;
  border-bottom: 1px solid #f5f5f5;
  font-size: 14px;
  cursor: pointer;
  border-radius: 8px;
}
.sheet-item:active, .sheet-item.selected { background: var(--primary-light); }
.sheet-close {
  margin-top: 12px;
  width: 100%;
  padding: 12px;
  border: none;
  background: #f5f5f5;
  border-radius: 10px;
  font-size: 15px;
  cursor: pointer;
}

/* 日期选择线稿 */
.date-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.date-cell {
  padding: 10px 4px;
  text-align: center;
  border: 1px solid #eee;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
}
.date-cell.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }

/* Toast */
.wire-toast {
  position: fixed;
  left: 50%;
  bottom: 120px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(0,0,0,0.82);
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  max-width: 300px;
  text-align: center;
}
.wire-toast.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 管理端（参考 admin-1.1） */
body.body-admin {
  display: block;
  padding: 16px;
  max-width: 1400px;
  margin: 0 auto;
}
.admin-frame {
  width: 100%;
  background: var(--card);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-height: 480px;
  display: flex;
  overflow: hidden;
  border: 1px solid var(--border);
}
.admin-frame-inner { flex: 1; display: flex; min-width: 0; }
.admin-sidebar {
  width: 220px;
  min-width: 200px;
  background: #f8f9fb;
  border-right: 1px solid var(--border);
  padding: 12px;
}
.admin-sidebar-title { font-size: 13px; font-weight: 700; margin-bottom: 8px; color: #333; }
.admin-sidebar-item {
  padding: 10px 12px;
  font-size: 13px;
  color: #666;
  border-radius: 6px;
  margin-bottom: 4px;
  cursor: pointer;
}
.admin-sidebar-item.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }
.admin-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.admin-toolbar .btn {
  padding: 6px 12px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}
.admin-toolbar .btn-primary-adm {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.admin-toolbar .search {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
}
.admin-toolbar .flex1 { flex: 1; min-width: 8px; }
.admin-table-wrap { overflow-x: auto; flex: 1; padding: 8px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th, .admin-table td { border: 1px solid #eee; padding: 10px 8px; text-align: left; }
.admin-table th { background: #f8f9fb; font-weight: 600; }
.admin-table tr:hover td { background: #fafafa; }
.admin-pagination {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #666;
}
.page-btn {
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}

.back-link {
  display: inline-block;
  margin-top: 16px;
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 600;
}

.hall-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}
.hall-card .price { font-size: 18px; font-weight: 800; color: var(--primary-dark); }

.grid-icons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; text-align: center; font-size: 11px; color: #666; }
.grid-icons .ic {
  width: 48px;
  height: 48px;
  margin: 0 auto 6px;
  background: var(--primary-light);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.order-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 8px; }
.order-tabs button {
  flex-shrink: 0;
  padding: 8px 14px;
  border: 1px solid #ddd;
  border-radius: 20px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
}
.order-tabs button.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }

.timeline { border-left: 3px solid var(--primary-light); margin-left: 8px; padding-left: 16px; }
.timeline-item { position: relative; padding-bottom: 14px; font-size: 13px; color: #555; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -23px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--primary-light);
}

@media (max-width: 420px) {
  .phone-frame { border-width: 4px; width: 100%; }
}
