/* ===== 全局重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #ff6b35;
  --primary-dark: #e8531e;
  --secondary: #ffd166;
  --bg: #f7f8fa;
  --card-bg: #fff;
  --text: #1a1a2e;
  --text-muted: #888;
  --border: #e8e8e8;
  --radius: 12px;
  --shadow: 0 2px 16px rgba(0,0,0,.08);
  --shadow-hover: 0 8px 32px rgba(255,107,53,.18);
}
body { font-family: 'PingFang SC','Microsoft YaHei',sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
ul { list-style: none; }
button { cursor: pointer; border: none; outline: none; }

/* ===== 顶部导航 ===== */
.navbar {
  background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  position: sticky; top: 0; z-index: 1000;
  padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.nav-logo { display: flex; align-items: center; gap: 10px; }
.nav-logo .logo-icon { width: 36px; height: 36px; background: linear-gradient(135deg,#ff6b35,#ffd166); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.nav-logo .logo-text { font-size: 18px; font-weight: 700; color: var(--primary); }
.nav-links { display: flex; gap: 28px; }
.nav-links a { font-size: 14px; color: var(--text-muted); transition: color .2s; padding: 4px 0; }
.nav-links a:hover, .nav-links a.active { color: var(--primary); border-bottom: 2px solid var(--primary); }
.nav-actions { display: flex; gap: 12px; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px; border-radius: 8px; font-size: 14px; font-weight: 500; transition: all .2s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-hover); }
.btn-outline { border: 1.5px solid var(--primary); color: var(--primary); background: #fff; }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--primary); }
.cart-btn { position: relative; }
.cart-badge { position: absolute; top: -6px; right: -6px; background: #ff3b30; color: #fff; border-radius: 50%; width: 18px; height: 18px; font-size: 11px; display: flex; align-items: center; justify-content: center; font-weight: 700; display: none; }
.cart-badge.show { display: flex; }

/* ===== Hero 区域 ===== */
.hero {
  background: linear-gradient(135deg, #ff6b35 0%, #ff9d66 50%, #ffd166 100%);
  padding: 60px 24px 80px;
  text-align: center; color: #fff;
}
.hero h1 { font-size: clamp(26px,5vw,48px); font-weight: 800; margin-bottom: 14px; text-shadow: 0 2px 8px rgba(0,0,0,.1); }
.hero p { font-size: 16px; opacity: .9; margin-bottom: 32px; }
.search-box {
  max-width: 600px; margin: 0 auto;
  display: flex; background: #fff; border-radius: 50px; overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
}
.search-box input { flex: 1; border: none; padding: 16px 24px; font-size: 15px; outline: none; color: var(--text); }
.search-box button { background: var(--primary); color: #fff; padding: 0 32px; font-size: 15px; font-weight: 600; transition: background .2s; }
.search-box button:hover { background: var(--primary-dark); }
.hero-tags { margin-top: 20px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.hero-tags span { background: rgba(255,255,255,.25); color: #fff; border-radius: 20px; padding: 5px 14px; font-size: 13px; cursor: pointer; transition: background .2s; }
.hero-tags span:hover { background: rgba(255,255,255,.4); }

/* ===== 分类标签 ===== */
.categories {
  padding: 28px 24px 0;
  max-width: 1200px; margin: 0 auto;
}
.categories h2 { font-size: 20px; font-weight: 700; margin-bottom: 16px; }
.category-list { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.category-list::-webkit-scrollbar { display: none; }
.category-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  min-width: 72px; padding: 12px 8px; border-radius: var(--radius);
  background: var(--card-bg); cursor: pointer; transition: all .2s;
  box-shadow: var(--shadow); border: 2px solid transparent;
}
.category-item:hover, .category-item.active { border-color: var(--primary); background: #fff5f1; }
.category-item .cat-icon { font-size: 26px; }
.category-item .cat-name { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.category-item.active .cat-name { color: var(--primary); font-weight: 600; }

/* ===== 商户列表区域 ===== */
.section { max-width: 1200px; margin: 28px auto; padding: 0 24px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.section-header h2 { font-size: 20px; font-weight: 700; }
.section-header a { font-size: 13px; color: var(--primary); }
.merchant-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(260px,1fr)); gap: 20px; }
.merchant-card {
  background: var(--card-bg); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: all .25s; cursor: pointer;
}
.merchant-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.merchant-card .thumb { width: 100%; height: 160px; object-fit: cover; background: #f0f0f0; display: block; }
.merchant-card .thumb-placeholder { width: 100%; height: 160px; display: flex; align-items: center; justify-content: center; font-size: 48px; }
.merchant-info { padding: 14px; }
.merchant-name { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.merchant-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.rating { color: #f0a500; font-weight: 600; }
.tag { background: #fff5f1; color: var(--primary); border-radius: 4px; padding: 2px 7px; font-size: 11px; }
.delivery-info { display: flex; gap: 14px; font-size: 12px; color: var(--text-muted); }
.delivery-info span { display: flex; align-items: center; gap: 3px; }

/* ===== 商户详情页 ===== */
.detail-hero { background: linear-gradient(135deg,#1a1a2e,#16213e); color: #fff; padding: 32px 24px; }
.detail-hero-inner { max-width: 1200px; margin: 0 auto; display: flex; gap: 24px; align-items: flex-start; }
.detail-hero-icon { font-size: 64px; background: rgba(255,255,255,.1); border-radius: 16px; padding: 16px; flex-shrink: 0; }
.detail-hero-info h1 { font-size: 26px; font-weight: 800; margin-bottom: 8px; }
.detail-hero-info .meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; opacity: .85; margin-bottom: 12px; }
.detail-hero-info .tags { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-hero-info .tags span { background: rgba(255,107,53,.3); color: #ffb89a; border-radius: 4px; padding: 3px 10px; font-size: 12px; }
.detail-body { max-width: 1200px; margin: 0 auto; padding: 24px; display: grid; grid-template-columns: 1fr 320px; gap: 24px; }
@media(max-width:768px){ .detail-body { grid-template-columns: 1fr; } .detail-hero-inner { flex-direction: column; } }

/* 菜单 */
.menu-categories { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.menu-cat-btn { padding: 7px 18px; border-radius: 20px; font-size: 13px; background: var(--bg); color: var(--text-muted); transition: all .2s; border: 1.5px solid transparent; }
.menu-cat-btn.active, .menu-cat-btn:hover { background: var(--primary); color: #fff; }
.dish-list { display: flex; flex-direction: column; gap: 14px; }
.dish-item { background: #fff; border-radius: var(--radius); padding: 14px; display: flex; gap: 14px; box-shadow: var(--shadow); transition: box-shadow .2s; }
.dish-item:hover { box-shadow: var(--shadow-hover); }
.dish-thumb { width: 88px; height: 88px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: #f5f5f5; display: flex; align-items: center; justify-content: center; font-size: 36px; }
.dish-info { flex: 1; }
.dish-name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.dish-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; line-height: 1.6; }
.dish-bottom { display: flex; align-items: center; justify-content: space-between; }
.dish-price { font-size: 18px; font-weight: 700; color: var(--primary); }
.dish-price span { font-size: 12px; font-weight: 400; color: var(--text-muted); text-decoration: line-through; margin-left: 6px; }
.qty-ctrl { display: flex; align-items: center; gap: 8px; }
.qty-ctrl button { width: 28px; height: 28px; border-radius: 50%; font-size: 18px; font-weight: 700; transition: all .2s; }
.qty-ctrl .minus { background: #f0f0f0; color: var(--text-muted); }
.qty-ctrl .minus:hover { background: var(--primary); color: #fff; }
.qty-ctrl .plus { background: var(--primary); color: #fff; }
.qty-ctrl .plus:hover { background: var(--primary-dark); }
.qty-ctrl .qty { font-size: 15px; font-weight: 600; min-width: 20px; text-align: center; }

/* 购物车侧栏 */
.cart-panel { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; position: sticky; top: 80px; }
.cart-panel h3 { font-size: 16px; font-weight: 700; margin-bottom: 16px; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.cart-items { min-height: 60px; max-height: 320px; overflow-y: auto; }
.cart-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.cart-item-name { flex: 1; }
.cart-item-qty { color: var(--text-muted); margin: 0 10px; }
.cart-item-price { font-weight: 600; color: var(--primary); }
.cart-empty { text-align: center; color: var(--text-muted); font-size: 13px; padding: 24px 0; }
.cart-total { display: flex; justify-content: space-between; margin-top: 14px; padding-top: 12px; border-top: 2px solid var(--border); font-weight: 700; font-size: 16px; }
.cart-total .total-price { color: var(--primary); font-size: 20px; }
.cart-note { margin-top: 10px; font-size: 12px; color: var(--text-muted); }
.checkout-btn { width: 100%; margin-top: 14px; padding: 14px; border-radius: 10px; background: var(--primary); color: #fff; font-size: 15px; font-weight: 700; transition: all .2s; }
.checkout-btn:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.checkout-btn:disabled { background: #ccc; transform: none; box-shadow: none; cursor: not-allowed; }

/* 评价区 */
.reviews-section { margin-top: 28px; }
.reviews-section h3 { font-size: 17px; font-weight: 700; margin-bottom: 16px; }
.review-summary { display: flex; gap: 24px; align-items: center; background: #fff; border-radius: var(--radius); padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow); }
.big-score { font-size: 48px; font-weight: 800; color: var(--primary); line-height: 1; }
.score-detail { flex: 1; }
.star-row { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 5px; }
.star-bar { flex: 1; height: 6px; background: #f0f0f0; border-radius: 3px; overflow: hidden; }
.star-bar-fill { height: 100%; background: #f0a500; border-radius: 3px; }
.review-form-card { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 20px; }
.review-form-card h4 { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.star-select { display: flex; gap: 6px; margin-bottom: 14px; }
.star-select span { font-size: 28px; cursor: pointer; transition: transform .15s; color: #ddd; }
.star-select span.active, .star-select span:hover { color: #f0a500; transform: scale(1.2); }
.review-form-card textarea { width: 100%; border: 1.5px solid var(--border); border-radius: 8px; padding: 12px; font-size: 14px; resize: vertical; min-height: 80px; outline: none; transition: border-color .2s; font-family: inherit; }
.review-form-card textarea:focus { border-color: var(--primary); }
.review-form-card .form-row { display: flex; gap: 10px; margin-bottom: 12px; }
.review-form-card input { flex: 1; border: 1.5px solid var(--border); border-radius: 8px; padding: 10px 14px; font-size: 14px; outline: none; transition: border-color .2s; }
.review-form-card input:focus { border-color: var(--primary); }
.submit-review-btn { background: var(--primary); color: #fff; padding: 10px 28px; border-radius: 8px; font-size: 14px; font-weight: 600; transition: all .2s; }
.submit-review-btn:hover { background: var(--primary-dark); }
.review-list { display: flex; flex-direction: column; gap: 14px; }
.review-item { background: #fff; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.review-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.review-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg,var(--primary),var(--secondary)); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 15px; flex-shrink: 0; }
.review-name { font-weight: 600; font-size: 14px; }
.review-date { font-size: 12px; color: var(--text-muted); margin-left: auto; }
.review-stars { color: #f0a500; font-size: 14px; }
.review-text { font-size: 14px; color: var(--text); line-height: 1.7; }
.review-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.review-tag { background: #f5f5f5; color: var(--text-muted); border-radius: 4px; padding: 2px 8px; font-size: 11px; }

/* ===== 结算页 ===== */
.checkout-page { max-width: 720px; margin: 32px auto; padding: 0 24px; }
.checkout-page h2 { font-size: 22px; font-weight: 800; margin-bottom: 24px; }
.form-card { background: #fff; border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 20px; }
.form-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 16px; color: var(--primary); border-left: 3px solid var(--primary); padding-left: 10px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; border: 1.5px solid var(--border); border-radius: 8px; padding: 11px 14px; font-size: 14px; outline: none; transition: border-color .2s; font-family: inherit; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); }
.order-item-list { margin-bottom: 14px; }
.order-item-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.order-total-row { display: flex; justify-content: space-between; font-weight: 700; font-size: 17px; padding-top: 12px; }
.order-total-row .price { color: var(--primary); }
.payment-methods { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.payment-method { border: 2px solid var(--border); border-radius: 8px; padding: 12px; text-align: center; cursor: pointer; transition: all .2s; }
.payment-method.active { border-color: var(--primary); background: #fff5f1; }
.payment-method .pm-icon { font-size: 24px; margin-bottom: 4px; }
.payment-method .pm-name { font-size: 12px; color: var(--text-muted); }
.submit-order-btn { width: 100%; padding: 16px; border-radius: 12px; background: var(--primary); color: #fff; font-size: 16px; font-weight: 700; transition: all .2s; margin-top: 8px; }
.submit-order-btn:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: var(--shadow-hover); }

/* ===== 商户入驻页 ===== */
.join-page { max-width: 800px; margin: 40px auto; padding: 0 24px; }
.join-hero { text-align: center; margin-bottom: 40px; }
.join-hero h1 { font-size: 32px; font-weight: 800; margin-bottom: 12px; }
.join-hero p { color: var(--text-muted); font-size: 15px; }
.benefits { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 16px; margin-bottom: 36px; }
.benefit-card { background: #fff; border-radius: var(--radius); padding: 20px; text-align: center; box-shadow: var(--shadow); }
.benefit-card .b-icon { font-size: 36px; margin-bottom: 10px; }
.benefit-card h4 { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.benefit-card p { font-size: 12px; color: var(--text-muted); }

/* ===== 成功弹窗 ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none; align-items: center; justify-content: center; z-index: 9999; }
.modal-overlay.show { display: flex; }
.modal { background: #fff; border-radius: 20px; padding: 40px 32px; text-align: center; max-width: 380px; width: 90%; box-shadow: 0 20px 60px rgba(0,0,0,.2); animation: popIn .3s ease; }
@keyframes popIn { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal .modal-icon { font-size: 56px; margin-bottom: 14px; }
.modal h3 { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.modal p { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }
.modal .order-no { background: var(--bg); border-radius: 8px; padding: 10px 16px; font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.modal .order-no strong { color: var(--primary); }
.modal-close-btn { background: var(--primary); color: #fff; padding: 12px 36px; border-radius: 10px; font-size: 15px; font-weight: 700; transition: all .2s; }
.modal-close-btn:hover { background: var(--primary-dark); }

/* ===== 页脚 ===== */
footer { background: #1a1a2e; color: rgba(255,255,255,.7); text-align: center; padding: 28px 24px; margin-top: 60px; font-size: 13px; line-height: 2; }
footer a { color: rgba(255,255,255,.5); transition: color .2s; }
footer a:hover { color: var(--secondary); }
footer .footer-logo { font-size: 20px; font-weight: 700; color: #fff; margin-bottom: 8px; }

/* ===== toast ===== */
.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(20px); background: rgba(26,26,46,.9); color: #fff; padding: 12px 24px; border-radius: 30px; font-size: 14px; z-index: 99999; opacity: 0; transition: all .3s; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== 响应式 ===== */
@media(max-width:600px) {
  .navbar { padding: 0 12px; }
  .nav-links { display: none; }
  .hero { padding: 40px 16px 60px; }
  .section { padding: 0 12px; }
  .merchant-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .payment-methods { grid-template-columns: repeat(2,1fr); }
}
