:root {
  --primary: #0d9488;
  --primary-dark: #0f766e;
  --accent: #e74c3c;
  --bg: #f6f8f9;
  --card: #ffffff;
  --text: #1f2937;
  --text-2: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 2px 12px rgba(13, 148, 136, 0.08);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
a { text-decoration: none; color: inherit; }
.btn { border: none; cursor: pointer; border-radius: 8px; font-size: 14px; padding: 9px 20px; transition: 0.2s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.btn-block { width: 100%; padding: 12px; font-size: 16px; }

/* topbar */
.topbar { background: var(--primary-dark); color: #d1fae5; font-size: 13px; }
.topbar-inner { display: flex; justify-content: space-between; padding: 7px 16px; flex-wrap: wrap; gap: 4px; }

/* header */
.header { background: #fff; box-shadow: var(--shadow); position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; gap: 28px; padding: 14px 16px; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark { width: 44px; height: 44px; border-radius: 10px; background: linear-gradient(135deg, var(--primary), #14b8a6); color: #fff; font-size: 24px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.logo-name { font-size: 20px; font-weight: 700; color: var(--primary-dark); }
.logo-sub { font-size: 11px; color: var(--text-2); letter-spacing: 1px; }
.search-box { flex: 1; display: flex; gap: 8px; max-width: 520px; }
.search-box input { flex: 1; border: 2px solid var(--primary); border-radius: 8px; padding: 9px 14px; font-size: 14px; outline: none; }
.header-user { margin-left: auto; }

/* nav */
.nav { background: #fff; border-top: 1px solid var(--border); }
.nav-inner { display: flex; gap: 32px; padding: 0 16px; }
.nav a { padding: 12px 4px; font-size: 15px; font-weight: 500; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--primary); border-color: var(--primary); }

/* carousel */
.carousel-wrap { padding: 20px 0 0; }
.carousel { position: relative; border-radius: 14px; overflow: hidden; height: 340px; box-shadow: var(--shadow); }
.carousel-track { display: flex; height: 100%; transition: transform 0.5s ease; }
.slide { min-width: 100%; height: 100%; position: relative; cursor: pointer; }
.slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.carousel-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.25); color: #fff; border: none; font-size: 30px; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; }
.carousel-btn.prev { left: 14px; }
.carousel-btn.next { right: 14px; }
.carousel-dots { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.5); cursor: pointer; }
.dot.active { background: #fff; width: 24px; border-radius: 5px; }

/* sections */
.section { padding: 34px 0 6px; }
.section-title { font-size: 24px; margin-bottom: 20px; padding-left: 12px; border-left: 4px solid var(--primary); }

/* categories */
.category-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.category-card { background: var(--card); border-radius: 12px; padding: 20px 10px; text-align: center; cursor: pointer; box-shadow: var(--shadow); transition: 0.2s; }
.category-card:hover { transform: translateY(-4px); border: 1px solid var(--primary); }
.category-icon { font-size: 34px; margin-bottom: 8px; }
.category-name { font-size: 15px; font-weight: 600; }
.category-desc { font-size: 12px; color: var(--text-2); margin-top: 3px; }

/* promo */
.promo-section { background: linear-gradient(180deg, #fff7ed, var(--bg)); padding-bottom: 30px; margin-top: 20px; }
.promo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.promo-card { border-radius: 12px; padding: 22px; color: #fff; position: relative; overflow: hidden; box-shadow: var(--shadow); cursor: pointer; transition: 0.2s; }
.promo-card:hover { transform: translateY(-3px); }
.promo-badge { position: absolute; top: 0; right: 0; background: rgba(255,255,255,0.9); color: #c2410c; font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 0 0 0 10px; }
.promo-title { font-size: 19px; font-weight: 700; margin-bottom: 8px; }
.promo-desc { font-size: 13px; opacity: 0.92; }
.promo-end { margin-top: 14px; font-size: 12px; opacity: 0.8; }

/* products */
.product-filter { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.filter-chip { padding: 6px 16px; border-radius: 20px; background: #fff; border: 1px solid var(--border); font-size: 13px; cursor: pointer; }
.filter-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding-bottom: 30px; }
.product-card { background: var(--card); border-radius: 12px; overflow: hidden; cursor: pointer; box-shadow: var(--shadow); transition: 0.2s; position: relative; }
.product-card:hover { transform: translateY(-4px); box-shadow: 0 6px 20px rgba(13,148,136,0.15); }
.product-card.is-soldout { opacity: .72; }
.product-card.is-soldout .product-img { filter: grayscale(1); }
.soldout-badge { position: absolute; top: 10px; right: 10px; background: rgba(17,24,39,.78); color: #fff; font-size: 12px; padding: 3px 10px; border-radius: 12px; z-index: 2; }
.product-img { width: 100%; height: 200px; object-fit: cover; background: #f0fdfa; display: block; }
.product-info { padding: 14px; }
.product-tag { display: inline-block; background: #fee2e2; color: var(--accent); font-size: 11px; padding: 2px 8px; border-radius: 4px; margin-bottom: 6px; }
.product-name { font-size: 14px; font-weight: 600; line-height: 1.4; height: 40px; overflow: hidden; }
.product-desc { font-size: 12px; color: var(--text-2); margin-top: 4px; height: 32px; overflow: hidden; }
.product-bottom { display: flex; align-items: baseline; gap: 8px; margin-top: 8px; }
.product-price { color: var(--accent); font-size: 20px; font-weight: 700; }
.product-price::before { content: "¥"; font-size: 13px; }
.product-orig { color: #9ca3af; font-size: 12px; text-decoration: line-through; }
.product-meta { font-size: 12px; color: var(--text-2); margin-left: auto; }
.product-meta::before { content: "★ "; color: #f59e0b; }

/* qualify */
.qualify { background: #fff; margin-top: 24px; padding-bottom: 30px; }
.qualify-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.qualify-item { background: #f0fdfa; border: 1px dashed var(--primary); border-radius: 10px; padding: 16px; font-size: 13px; color: var(--primary-dark); text-align: center; }
.legal-note { margin-top: 18px; font-size: 12px; color: var(--text-2); line-height: 1.8; background: #f9fafb; padding: 14px; border-radius: 8px; }

/* footer */
.footer { background: #134e4a; color: #a7f3d0; padding: 34px 0; margin-top: 10px; }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-size: 13px; line-height: 2; }
.footer .logo-name { color: #fff; }

/* modal */
.modal-mask { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200; align-items: center; justify-content: center; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 14px; padding: 30px; width: 380px; max-width: 92vw; position: relative; max-height: 86vh; overflow-y: auto; }
.modal-close { position: absolute; top: 10px; right: 14px; background: none; border: none; font-size: 26px; cursor: pointer; color: var(--text-2); }
.auth-tabs { display: flex; gap: 24px; margin-bottom: 20px; }
.auth-tab { background: none; border: none; font-size: 18px; font-weight: 700; color: var(--text-2); cursor: pointer; padding-bottom: 6px; border-bottom: 2px solid transparent; }
.auth-tab.active { color: var(--primary); border-color: var(--primary); }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; margin-bottom: 6px; color: var(--text-2); }
.form-group input { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 14px; outline: none; }
.form-group input:focus { border-color: var(--primary); }
.auth-msg { margin-top: 12px; font-size: 13px; text-align: center; min-height: 18px; }
.auth-msg.err { color: var(--accent); }
.auth-msg.ok { color: var(--primary); }

/* product detail */
.product-detail { width: 680px; }
.pd-img { width: 100%; height: 300px; object-fit: cover; border-radius: 10px; background: #f0fdfa; }
.pd-price { font-size: 30px; color: var(--accent); font-weight: 700; margin: 12px 0; }
.pd-price::before { content: "¥"; font-size: 18px; }
.pd-name { font-size: 20px; font-weight: 700; margin-top: 14px; }
.pd-desc { color: var(--text-2); font-size: 14px; line-height: 1.8; margin: 10px 0 18px; }
.pd-actions { display: flex; gap: 12px; }

/* cart & orders */
.cart-btn { position: relative; background: none; border: 1px solid var(--border); border-radius: 8px; font-size: 20px; padding: 8px 12px; cursor: pointer; }
.cart-badge { position: absolute; top: -6px; right: -6px; background: var(--accent); color: #fff; font-size: 11px; min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.cart-modal { width: 480px; }
.modal-title { margin-bottom: 16px; font-size: 19px; }
.cart-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.cart-img { width: 64px; height: 64px; border-radius: 8px; background: #f0fdfa; object-fit: cover; }
.cart-info { flex: 1; }
.cart-name { font-size: 14px; font-weight: 600; }
.cart-price { font-size: 13px; color: var(--text-2); margin: 4px 0; }
.cart-ops { display: flex; align-items: center; gap: 8px; }
.cart-ops button { width: 26px; height: 26px; border: 1px solid var(--border); background: #fff; border-radius: 6px; cursor: pointer; }
.cart-del { font-size: 12px; color: var(--accent); margin-left: 12px; cursor: pointer; }
.cart-total { text-align: right; padding: 14px 0; font-size: 15px; }
.cart-total .amount, .amount { color: var(--accent); font-size: 22px; font-weight: 700; }
.order-card { border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 14px; }
.order-head { font-size: 13px; color: var(--text-2); display: flex; justify-content: space-between; margin-bottom: 8px; }
.order-status { font-weight: 700; }
.st-pending { color: #f59e0b; } .st-paid { color: var(--primary); } .st-cancelled { color: #9ca3af; }
.st-shipped { color: #2563eb; } .st-completed { color: #059669; } .st-refunded { color: #dc2626; }

/* 微信支付扫码弹窗 */
.wxpay-box { text-align: center; padding: 6px 0 2px; }
.wxpay-head { font-size: 15px; font-weight: 600; color: var(--primary-dark); margin-bottom: 6px; }
.wxpay-amount { font-size: 32px; font-weight: 700; color: #07c160; margin: 8px 0 4px; }
.wxpay-amount small { font-size: 14px; font-weight: 400; color: var(--text-2); margin-left: 6px; }
.wxpay-qr-wrap { position: relative; display: inline-block; padding: 12px; background: #fff; border: 1px solid var(--border); border-radius: 12px; margin: 12px 0 8px; }
.wxpay-qr-wrap img, .wxpay-qr-wrap canvas { display: block; width: 208px; height: 208px; }
.wxpay-qr-wrap .qr-logo { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 42px; height: 42px; border-radius: 8px; background: #07c160; color: #fff; font-size: 11px; line-height: 42px; font-weight: 600; box-shadow: 0 0 0 3px #fff; }
.qr-fallback { width: 208px; height: 208px; display: flex; align-items: center; justify-content: center; flex-direction: column; font-size: 13px; color: var(--text-2); }
.wxpay-status { font-size: 14px; color: var(--text-1); margin: 8px 0 4px; }
.wxpay-tip { font-size: 12px; color: var(--text-2); line-height: 1.8; }
.wxpay-tip b { color: #07c160; }
.wxpay-countdown { font-size: 12px; color: var(--text-3, #9ca3af); margin-top: 6px; }
.wxpay-success { display: none; padding: 20px 0 8px; }
.wxpay-success .icon { width: 64px; height: 64px; border-radius: 50%; background: #07c160; color: #fff; font-size: 34px; line-height: 64px; margin: 0 auto 14px; }
.wxpay-success .t1 { font-size: 18px; font-weight: 600; color: var(--primary-dark); }
.wxpay-success .t2 { font-size: 14px; color: var(--text-2); margin-top: 6px; }
.wxpay-actions { display: flex; gap: 10px; margin-top: 16px; }
.wxpay-actions .btn { flex: 1; }
.order-item { font-size: 14px; padding: 3px 0; }
.empty-tip { text-align: center; color: var(--text-2); padding: 30px 0; }
.btn-sm { padding: 5px 14px; font-size: 13px; margin-left: 10px; }

/* 个人中心 & 地址簿 */
.uc-tabs { display: flex; gap: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.uc-tab { background: none; border: none; font-size: 14px; font-weight: 600; color: var(--text-2); cursor: pointer; padding: 8px 2px; border-bottom: 2px solid transparent; }
.uc-tab.active { color: var(--primary); border-color: var(--primary); }
.uc-label { font-size: 13px; font-weight: 700; color: var(--text-2); margin: 12px 0 8px; }
.addr-list { display: flex; flex-direction: column; gap: 8px; max-height: 220px; overflow-y: auto; }
.addr-row { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; cursor: pointer; }
.addr-row:has(input:checked) { border-color: var(--primary); background: #f0fdfa; }
.addr-text { font-size: 13px; line-height: 1.6; flex: 1; }
.addr-default { color: var(--accent); }
.addr-check { font-size: 13px; color: var(--text-2); display: block; margin-bottom: 12px; }
.addr-ops { display: flex; gap: 8px; margin-top: 8px; }
.addr-card .addr-text { font-size: 14px; }
.addr-add-btn { margin-top: 10px; }
.addr-form { margin-top: 10px; padding: 16px; background: #f9fafb; }
.order-shipTo { font-size: 12px; color: var(--text-2); background: #f9fafb; border-radius: 6px; padding: 8px 10px; margin-top: 6px; line-height: 1.7; }
.btn-danger { background: #fee2e2; color: var(--accent); }

@media (max-width: 900px) {
  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .promo-grid { grid-template-columns: 1fr; }
  .carousel { height: 200px; }
  .header-inner { flex-wrap: wrap; }
  .search-box { order: 3; max-width: 100%; width: 100%; }
  .qualify-grid { grid-template-columns: repeat(2, 1fr); }
}
