/* 哗哗呷·4W预约点餐网 —— 全局样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --brand: #c0392b; --brand-light: #e74c3c; --brand-dark: #922b21;
  --gold: #f39c12; --ink: #2c3e50; --gray: #7f8c8d; --line: #e5e5e5;
  --bg: #f7f7f5; --white: #fff; --ok: #27ae60; --warn: #e67e22; --radius: 8px;
}
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.6; font-size: 14px; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-light); }
ul { list-style: none; }

/* 顶部导航 */
.topbar { background: var(--white); border-bottom: 2px solid var(--brand);
  padding: 0 24px; display: flex; align-items: center; height: 60px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06); position: sticky; top: 0; z-index: 100; }
.topbar .logo { font-size: 20px; font-weight: 800; color: var(--brand);
  letter-spacing: 1px; white-space: nowrap; }
.topbar .logo small { font-size: 12px; color: var(--gray); font-weight: 400;
  margin-left: 8px; letter-spacing: 0; }
.topbar nav { flex: 1; display: flex; gap: 28px; margin-left: 48px; }
.topbar nav a { color: var(--ink); font-size: 15px; font-weight: 500; }
.topbar nav a:hover { color: var(--brand); }
.topbar .user { display: flex; align-items: center; gap: 12px; }
.topbar .user .who { color: var(--gray); font-size: 13px; }

/* 布局 */
.wrap { max-width: 1080px; margin: 24px auto; padding: 0 16px; }
.wrap.wide { max-width: 1280px; }
.card { background: var(--white); border-radius: var(--radius); padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06); margin-bottom: 20px; }
.card h2 { font-size: 18px; margin-bottom: 16px; padding-left: 10px;
  border-left: 4px solid var(--brand); }
.card h3 { font-size: 15px; margin: 16px 0 10px; color: var(--ink); }
.grid { display: grid; gap: 16px; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 768px) { .g3,.g2,.g4 { grid-template-columns: 1fr; } }

/* 表单 */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--gray);
  margin-bottom: 6px; font-weight: 500; }
.field label.req::after { content: " *"; color: var(--brand); }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: 6px; font-size: 14px; background: var(--white);
  font-family: inherit; transition: border .15s; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 2px rgba(192,57,43,.12); }
.field textarea { min-height: 80px; resize: vertical; }
.field-inline { display: flex; gap: 12px; align-items: center; }
.field-inline input { width: auto; flex: 1; }

/* 按钮 */
.btn { display: inline-block; padding: 9px 20px; border: none; border-radius: 6px;
  background: var(--brand); color: var(--white); font-size: 14px; cursor: pointer;
  font-family: inherit; text-align: center; transition: opacity .15s; }
.btn:hover { opacity: .9; color: var(--white); }
.btn.sm { padding: 5px 12px; font-size: 13px; }
.btn.lg { padding: 12px 32px; font-size: 16px; }
.btn.ghost { background: var(--white); color: var(--brand);
  border: 1px solid var(--brand); }
.btn.ghost:hover { background: var(--brand); color: var(--white); }
.btn.gray { background: var(--gray); }
.btn.gold { background: var(--gold); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-group { display: flex; gap: 12px; flex-wrap: wrap; }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
table th, table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
table th { background: #fafafa; font-weight: 600; color: var(--gray); white-space: nowrap; }
table tr:hover td { background: #fffaf9; }
.tbl-wrap { overflow-x: auto; }

/* 标签 */
.tag { display: inline-block; padding: 2px 10px; border-radius: 20px;
  font-size: 12px; background: #eee; color: var(--gray); white-space: nowrap; }
.tag.ok { background: #eafaf1; color: var(--ok); }
.tag.warn { background: #fef5ec; color: var(--warn); }
.tag.brand { background: #fdedec; color: var(--brand); }
.tag.gray { background: #eee; color: var(--gray); }
.money { color: var(--brand); font-weight: 700; }
.money::before { content: "¥"; font-size: .85em; margin-right: 1px; }

/* 提示 */
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; }
.flash.error { background: #fdedec; color: var(--brand); border: 1px solid #f5c6c0; }
.flash.success { background: #eafaf1; color: var(--ok); border: 1px solid #bfe8d0; }
.empty { text-align: center; color: var(--gray); padding: 40px 0; font-size: 14px; }

/* 商户卡片 */
.mcard { background: var(--white); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.06); transition: transform .15s; cursor: pointer; }
.mcard:hover { transform: translateY(-2px); }
.mcard .cover { height: 140px; background: linear-gradient(135deg, var(--brand), var(--gold)); }
.mcard .body { padding: 12px 14px; }
.mcard .body h4 { font-size: 15px; margin-bottom: 6px; }
.mcard .body p { font-size: 12px; color: var(--gray); }

/* 菜品卡片 */
.dcard { background: var(--white); border-radius: var(--radius); padding: 12px;
  border: 1px solid var(--line); display: flex; gap: 12px; align-items: center; }
.dcard .pic { width: 72px; height: 72px; border-radius: 6px; flex-shrink: 0;
  background: linear-gradient(135deg, #f39c12, #e74c3c); }
.dcard .info { flex: 1; min-width: 0; }
.dcard .info h4 { font-size: 15px; margin-bottom: 4px; }
.dcard .info .sub { font-size: 12px; color: var(--gray); }
.dcard .price { text-align: right; }

/* 协议 */
.agree-box { max-height: 60vh; overflow-y: auto; padding: 16px; background: #fafafa;
  border: 1px solid var(--line); border-radius: 6px; font-size: 13px; line-height: 1.9; }
.agree-box h3 { font-size: 15px; text-align: center; margin: 0 0 12px; }
.agree-box h4 { font-size: 13.5px; margin: 14px 0 6px; color: var(--ink); }
.checkbox-line { margin-top: 14px; font-size: 13px; }
.checkbox-line input { width: auto; margin-right: 6px; }

/* 状态条 */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
@media (max-width: 768px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--white); border-radius: var(--radius); padding: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06); text-align: center; }
.stat .num { font-size: 26px; font-weight: 800; color: var(--brand); }
.stat .lbl { font-size: 13px; color: var(--gray); margin-top: 4px; }

/* 筛选 */
.filter { background: var(--white); border-radius: var(--radius); padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06); margin-bottom: 20px; display: flex;
  gap: 12px; flex-wrap: wrap; align-items: end; }
.filter .field { margin-bottom: 0; flex: 1; min-width: 140px; }
.filter .btn { white-space: nowrap; }

/* 分页 */
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 20px; }
.pager a, .pager span { padding: 6px 12px; border: 1px solid var(--line);
  border-radius: 4px; font-size: 13px; color: var(--ink); }
.pager .current { background: var(--brand); color: var(--white); border-color: var(--brand); }

/* 时间网格 */
.slot-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.slot { text-align: center; padding: 8px 4px; border-radius: 4px; font-size: 12px;
  background: #eafaf1; color: var(--ok); }
.slot.taken { background: #fdedec; color: #c0392b; }
.slot.mine { background: #fef5ec; color: var(--warn); }

/* 时间输入组合 */
.datetime { display: flex; gap: 12px; }
.datetime input { flex: 1; }

/* 页脚 */
.footer { text-align: center; color: var(--gray); font-size: 12px;
  padding: 32px 16px; border-top: 1px solid var(--line); margin-top: 40px; }

/* 登录/注册 */
.auth { max-width: 420px; margin: 60px auto; padding: 32px; background: var(--white);
  border-radius: var(--radius); box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.auth h2 { text-align: center; margin-bottom: 24px; color: var(--brand); }
.auth .btn { width: 100%; margin-top: 8px; }
.auth .alt { text-align: center; margin-top: 16px; font-size: 13px; color: var(--gray); }
.agree-line { font-size: 12px; color: var(--gray); margin-top: 12px; text-align: center; }

/* 工具 */
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; }
.flex { display: flex; gap: 12px; align-items: center; }
.flex.between { justify-content: space-between; }
.text-r { text-align: right; } .text-c { text-align: center; }
.muted { color: var(--gray); } .small { font-size: 12px; }
.qty-box { display: flex; align-items: center; gap: 6px; }
.qty-box button { width: 28px; height: 28px; border-radius: 4px; border: 1px solid var(--line);
  background: var(--white); cursor: pointer; font-size: 16px; }
.qty-box input { width: 48px; text-align: center; padding: 4px; border: 1px solid var(--line);
  border-radius: 4px; }
.dish-row { display: flex; gap: 12px; align-items: center; padding: 10px 0;
  border-bottom: 1px solid var(--line); }
.dish-row:last-child { border-bottom: none; }
.dish-row .check { width: 20px; }
.dish-row .name { flex: 1; }
.chef-radio { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px;
  margin-bottom: 8px; cursor: pointer; transition: border .15s; }
.chef-radio:hover { border-color: var(--brand); }
.chef-radio.selected { border-color: var(--brand); background: #fffaf9; }
.auto-box { background: #fef5ec; border: 1px dashed var(--gold); border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px; font-size: 13px; }
