/* 餐厅点餐系统 · 顾客端公共样式（移动优先，仿金数据风格） */
:root {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --bg: #f5f6f8;
  --card: #ffffff;
  --line: #eceef1;
  --text: #1f2329;
  --text2: #6b7280;
  --text3: #9ca3af;
  --red: #e5484d;
  --red-bg: #fdf0f0;
  --orange: #f59e0b;
  --green: #22a06b;
  --radius: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 15px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.6; padding-bottom: 88px;
}
.page { max-width: 480px; margin: 0 auto; }

/* 头部 */
.header {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff; padding: 22px 18px 30px; border-radius: 0 0 18px 18px;
}
.header h1 { font-size: 19px; font-weight: 600; }
.header .notice { font-size: 13px; margin-top: 8px; opacity: .92; line-height: 1.7; }
.header .phone { display: inline-block; margin-top: 10px; font-size: 13px; background: rgba(255,255,255,.16); padding: 3px 12px; border-radius: 999px; }

/* 信息表单区 */
.form-card { background: var(--card); border-radius: var(--radius); margin: -12px 14px 12px; padding: 14px 16px; box-shadow: 0 1px 6px rgba(0,0,0,.05); position: relative; z-index: 2; }
.form-row { display: flex; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.form-row:last-child { border-bottom: none; }
.form-row label { width: 92px; flex-shrink: 0; font-size: 14px; color: var(--text); font-weight: 500; }
.form-row label .req { color: var(--red); margin-left: 2px; }
.form-row input, .form-row select, .form-row textarea {
  flex: 1; border: none; outline: none; font-size: 14px; color: var(--text); background: transparent; min-width: 0;
}
.form-row input::placeholder, .form-row textarea::placeholder { color: var(--text3); }
.form-row select { appearance: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 4px center; padding-right: 22px; }
.form-row textarea { resize: none; height: 56px; padding: 6px 0; }

/* 分类导航 */
.cat-nav { position: sticky; top: 0; z-index: 20; background: var(--bg); padding: 8px 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav .tab { flex-shrink: 0; font-size: 13px; padding: 6px 14px; background: #fff; border: 1px solid var(--line); border-radius: 999px; color: var(--text2); cursor: pointer; transition: all .15s; }
.cat-nav .tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* 分类分组 */
.cat-block { margin: 4px 14px 14px; }
.cat-title { display: flex; align-items: baseline; gap: 8px; padding: 10px 4px 8px; }
.cat-title h2 { font-size: 17px; font-weight: 600; }
.cat-title .cat-notes { font-size: 12px; color: var(--orange); }
.cat-card { background: var(--card); border-radius: var(--radius); box-shadow: 0 1px 6px rgba(0,0,0,.04); overflow: hidden; }

/* 菜品行 */
.dish { display: flex; align-items: center; padding: 13px 14px; border-bottom: 1px solid var(--line); }
.dish:last-child { border-bottom: none; }
.dish .info { flex: 1; min-width: 0; }
.dish .name { font-size: 15px; font-weight: 500; }
.dish .desc { font-size: 12px; color: var(--text3); margin-top: 2px; line-height: 1.5; }
.dish .tags { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 4px; }
.tag { font-size: 11px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--text2); }
.tag.red { color: var(--red); border-color: rgba(229,72,77,.4); background: var(--red-bg); }
.tag.blue { color: var(--primary); border-color: rgba(59,130,246,.4); background: #eff6ff; }
.tag.green { color: var(--green); border-color: rgba(34,160,107,.4); background: #f0faf5; }
.tag.orange { color: var(--orange); border-color: rgba(245,158,11,.4); background: #fff8ec; }
.tag.gray { color: var(--text3); }

.dish .price-box { text-align: right; margin-left: 10px; }
.dish .price { color: var(--red); font-weight: 600; font-size: 15px; }
.dish .price .cur { font-size: 12px; }
.dish .price-min { color: var(--text2); font-weight: 400; font-size: 13px; }
.dish .orig-price { font-size: 11px; color: var(--text3); text-decoration: line-through; margin-left: 4px; }
.dish .need-spec { font-size: 11px; color: var(--orange); display: block; margin-top: 2px; }

/* 数量加减 */
.qty-ctl { display: flex; align-items: center; gap: 0; margin-left: 12px; flex-shrink: 0; }
.qty-ctl .btn { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--primary); color: var(--primary); background: #fff; font-size: 18px; line-height: 1; display: flex; align-items: center; justify-content: center; cursor: pointer; user-select: none; }
.qty-ctl .btn.minus { border-color: var(--line); color: var(--text2); }
.qty-ctl .num { min-width: 32px; text-align: center; font-size: 15px; font-weight: 500; }
.dish.soldout { opacity: .45; }
.dish.soldout .qty-ctl { display: none; }
.soldout-badge { font-size: 12px; color: var(--text3); background: var(--bg); border-radius: 999px; padding: 2px 10px; margin-left: 8px; }

/* 底部购物车栏 */
.cart-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 12px; max-width: 480px; margin: 0 auto; }
.cart-bar .cart-info { flex: 1; }
.cart-bar .count { font-size: 12px; color: var(--text2); }
.cart-bar .total { font-size: 17px; font-weight: 600; color: var(--red); }
.cart-bar .submit { background: var(--primary); color: #fff; border: none; border-radius: 999px; padding: 11px 26px; font-size: 15px; font-weight: 500; cursor: pointer; }
.cart-bar .submit:disabled { background: #c3cbd8; }

/* 规格弹窗 */
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; }
.sheet { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 480px; background: #fff; border-radius: 18px 18px 0 0; z-index: 50; max-height: 82vh; overflow-y: auto; padding: 20px 20px calc(24px + env(safe-area-inset-bottom)); animation: up .22s ease; }
@keyframes up { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
.sheet h3 { font-size: 16px; margin-bottom: 4px; }
.sheet .sheet-sub { font-size: 13px; color: var(--text3); margin-bottom: 14px; }
.spec-group { margin-bottom: 16px; }
.spec-group .g-label { font-size: 14px; font-weight: 500; margin-bottom: 8px; }
.spec-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.spec-opts .opt { padding: 7px 18px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; color: var(--text); cursor: pointer; }
.spec-opts .opt.selected { border-color: var(--primary); color: var(--primary); background: #eff6ff; font-weight: 500; }
.sheet .sheet-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; }
.sheet .sheet-price { font-size: 18px; font-weight: 600; color: var(--red); }
.sheet .sheet-price .tip { font-size: 12px; color: var(--text3); font-weight: 400; }
.btn-primary { background: var(--primary); color: #fff; border: none; border-radius: 999px; padding: 11px 30px; font-size: 15px; font-weight: 500; cursor: pointer; }
.btn-primary:disabled { background: #c3cbd8; }
.btn-plain { background: #fff; color: var(--text2); border: 1px solid var(--line); border-radius: 999px; padding: 10px 20px; font-size: 14px; cursor: pointer; }

/* 购物车明细弹层 */
.cart-sheet .item { display: flex; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-sheet .item .i-name { flex: 1; font-size: 14px; }
.cart-sheet .item .i-spec { font-size: 12px; color: var(--text3); }
.cart-sheet .item .i-price { font-size: 14px; margin: 0 10px; }

/* 提交确认弹窗 */
.confirm-box { position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%); width: calc(100% - 56px); max-width: 400px; background: #fff; border-radius: 16px; z-index: 50; padding: 22px; max-height: 76vh; overflow-y: auto; }
.confirm-box h3 { font-size: 16px; margin-bottom: 12px; }
.confirm-box .c-item { display: flex; font-size: 14px; padding: 5px 0; }
.confirm-box .c-item .k { color: var(--text2); width: 84px; flex-shrink: 0; }
.confirm-box .c-item .v { flex: 1; text-align: right; }
.confirm-box .c-total { display: flex; justify-content: space-between; font-weight: 600; padding: 12px 0; border-top: 1px dashed var(--line); margin-top: 8px; }
.confirm-box .c-btns { display: flex; gap: 10px; margin-top: 14px; }
.confirm-box .c-btns .btn-primary { flex: 1; }
.confirm-box .c-btns .btn-plain { flex: 1; }

/* 成功页 */
.success-page { position: fixed; inset: 0; background: #fff; z-index: 60; display: flex; flex-direction: column; padding: 40px 24px; overflow-y: auto; }
.success-page .s-icon { width: 64px; height: 64px; border-radius: 50%; background: #e8f7ef; color: var(--green); font-size: 34px; display: flex; align-items: center; justify-content: center; margin: 20px auto 14px; }
.success-page h2 { text-align: center; font-size: 20px; }
.success-page .s-sub { text-align: center; color: var(--text2); font-size: 14px; margin-top: 6px; }
.s-card { background: var(--bg); border-radius: 12px; padding: 16px; margin-top: 24px; font-size: 14px; }
.s-card .row { display: flex; padding: 4px 0; }
.s-card .row .k { color: var(--text2); width: 80px; flex-shrink: 0; }
.s-card .order-no { color: var(--primary); font-weight: 600; }
.success-page .s-tip { margin-top: 20px; font-size: 13px; color: var(--orange); text-align: center; }
.success-page .s-btns { margin-top: auto; padding-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.success-page .btn-primary { width: 100%; padding: 13px; }

/* 通用 */
.btn { border: none; border-radius: 10px; padding: 12px; font-size: 15px; cursor: pointer; }
.hidden { display: none !important; }
.err-tip { color: var(--red); font-size: 13px; padding: 2px 2px 0; }
