* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: {{theme_primary}};
  --accent: {{theme_accent}};
  --dark: {{theme_dark}};
  --bg: {{theme_bg}};
  --light: {{theme_light}};
  --btn: {{theme_btn}};
}
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: #2b2f36;
  font-size: 15px;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ---------- 顶部 ---------- */
.topbar { background: var(--dark); color: rgba(255,255,255,.85); font-size: 12px; }
.topbar .container { display: flex; justify-content: space-between; padding-top: 6px; padding-bottom: 6px; }
.header { background: #fff; border-bottom: 1px solid #ececec; }
.header .container { display: flex; align-items: center; gap: 24px; padding-top: 18px; padding-bottom: 18px; }
.logo { display: flex; flex-direction: column; flex-shrink: 0; }
.logo-name { font-size: 24px; font-weight: 700; color: var(--primary); letter-spacing: 1px; }
.logo-tag { font-size: 12px; color: #999; }
.search-box { flex: 1; max-width: 520px; display: flex; border: 2px solid var(--primary); border-radius: 22px; overflow: hidden; }
.search-box input { flex: 1; border: none; outline: none; padding: 9px 18px; font-size: 14px; }
.search-box button { background: var(--primary); color: #fff; border: none; padding: 0 26px; font-size: 14px; cursor: pointer; }
.header-cart { margin-left: auto; flex-shrink: 0; background: var(--light); color: var(--primary); border-radius: 20px; padding: 8px 20px; font-size: 14px; }

/* ---------- 分类导航 ---------- */
.mainnav { background: var(--primary); }
.mainnav .container { display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.mainnav .container::-webkit-scrollbar { display: none; }
.nav-home { color: #fff; font-weight: 600; padding: 12px 18px; white-space: nowrap; background: rgba(0,0,0,.15); }
.mainnav a { color: rgba(255,255,255,.95); padding: 12px 16px; font-size: 14px; white-space: nowrap; }
.mainnav a:hover { background: rgba(255,255,255,.15); }

/* ---------- Hero ---------- */
.hero { padding: 18px 0; }
.hero .container { display: grid; grid-template-columns: 220px 1fr; gap: 18px; }
.hero-cats { background: #fff; border-radius: 12px; padding: 10px; box-shadow: 0 2px 10px rgba(0,0,0,.05); display: flex; flex-direction: column; }
.hero-cat { display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; font-size: 14px; border-radius: 8px; }
.hero-cat:hover { background: var(--light); color: var(--primary); }
.hero-cat-arrow { color: #bbb; }
.carousel { position: relative; border-radius: 12px; overflow: hidden; min-height: 320px; background: #ddd; }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity .6s; }
.slide.active { opacity: 1; }
.slide img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.carousel-dots { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 2; }
.carousel-dots span { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.5); cursor: pointer; }
.carousel-dots span.on { background: #fff; }
.hero-text { position: absolute; left: 40px; top: 50%; transform: translateY(-50%); z-index: 2; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.45); max-width: 480px; }
.hero-text h1 { font-size: 34px; margin-bottom: 12px; }
.hero-text p { font-size: 16px; opacity: .95; }
.hero-text .hero-cta { display: inline-block; margin-top: 20px; background: #fff; color: var(--primary); font-weight: 600; padding: 9px 28px; border-radius: 24px; font-size: 14px; }

/* ---------- 区块通用 ---------- */
.section { padding: 26px 0 6px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.section-head h2 { font-size: 21px; color: #222; }
.section-head h2::before { content: ""; display: inline-block; width: 5px; height: 20px; background: var(--primary); border-radius: 3px; margin-right: 10px; vertical-align: -3px; }
.section-head .more { font-size: 13px; color: #999; }

/* ---------- 商品卡片 ---------- */
.g-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.g-card { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 6px rgba(0,0,0,.06); transition: transform .2s, box-shadow .2s; }
.g-card:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(0,0,0,.1); }
.g-card-img img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.g-card-body { padding: 12px 14px 14px; }
.g-card-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; min-height: 42px; }
.g-card-name:hover { color: var(--primary); }
.g-card-spec { font-size: 12px; color: #999; margin: 4px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-card-price { display: flex; align-items: baseline; gap: 8px; }
.price { color: var(--primary); font-weight: 700; font-size: 18px; }
.price::first-letter { font-size: 13px; }
.oprice { color: #bbb; font-size: 12px; text-decoration: line-through; }

/* ---------- 品牌保障 ---------- */
.promises { padding: 30px 0; }
.promise-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.promise { background: #fff; border-radius: 12px; padding: 20px; display: flex; gap: 14px; align-items: center; box-shadow: 0 1px 6px rgba(0,0,0,.05); }
.promise-icon { width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; background: var(--light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.promise h3 { font-size: 15px; margin-bottom: 2px; }
.promise p { font-size: 12px; color: #999; }

/* ---------- 页脚 ---------- */
.footer { background: #2b2f36; color: #b8bcc4; margin-top: 40px; font-size: 13px; }
.footer-main { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 30px; padding: 36px 16px; max-width: 1200px; margin: 0 auto; }
.footer h4 { color: #fff; font-size: 15px; margin-bottom: 14px; }
.footer-about p { line-height: 1.9; }
.footer-links a { display: block; padding: 4px 0; color: #b8bcc4; }
.footer-links a:hover { color: #fff; }
.footer-contact p { padding: 4px 0; }
.footer-contact .tel { font-size: 20px; font-weight: 700; color: #ffd76e; }
.footer-beian { border-top: 1px solid #3d434d; text-align: center; padding: 16px; font-size: 12px; color: #8a8f99; }
.footer-beian a { color: #8a8f99; }
.footer-beian a:hover { color: #fff; }

/* ---------- 商品页 / 详情页 / 订单页共用 ---------- */
.page-main { padding: 22px 0; }
.cat-block { margin-bottom: 30px; }
.cat-block-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.cat-block-head h2 { font-size: 19px; }
.cat-block-head h2::before { content: ""; display: inline-block; width: 5px; height: 18px; background: var(--primary); border-radius: 3px; margin-right: 10px; vertical-align: -3px; }
.cat-block-head .more { font-size: 13px; color: #999; }
.empty-tip { text-align: center; color: #999; padding: 40px 0; }

/* 面包屑 */
.crumbs { font-size: 13px; color: #999; padding: 14px 0; }
.crumbs a:hover { color: var(--primary); }

/* 详情页 */
.detail { display: grid; grid-template-columns: 460px 1fr; gap: 36px; background: #fff; border-radius: 14px; padding: 28px; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.detail-img img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.detail-info h1 { font-size: 23px; line-height: 1.4; margin-bottom: 10px; }
.detail-spec { color: #999; font-size: 14px; margin-bottom: 16px; }
.detail-price-box { background: var(--light); border-radius: 10px; padding: 16px 20px; margin-bottom: 20px; }
.detail-price-box .d-price { color: var(--primary); font-size: 32px; font-weight: 700; }
.detail-price-box .d-price::first-letter { font-size: 18px; }
.detail-price-box .d-oprice { color: #aaa; text-decoration: line-through; margin-left: 12px; }
.detail-desc { color: #555; font-size: 14px; line-height: 1.9; padding: 16px 0; border-top: 1px dashed #eee; }
.qty-row { display: flex; align-items: center; gap: 12px; margin: 20px 0; }
.qty-row input { width: 64px; padding: 8px; text-align: center; border: 1px solid #ddd; border-radius: 8px; font-size: 15px; }
.buy-btn { display: inline-block; background: var(--btn); color: #fff; border: none; border-radius: 26px; padding: 13px 60px; font-size: 17px; font-weight: 600; cursor: pointer; }
.buy-btn:hover { opacity: .9; }
.detail-serv { font-size: 12px; color: #999; margin-top: 16px; }

/* 订单页 */
.order-head { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; border-radius: 14px; padding: 26px 30px; margin-bottom: 20px; }
.order-head h1 { font-size: 22px; margin-bottom: 6px; }
.order-head p { font-size: 14px; opacity: .9; }
.panel { background: #fff; border-radius: 14px; padding: 24px 28px; margin-bottom: 18px; box-shadow: 0 1px 6px rgba(0,0,0,.05); }
.panel h3 { font-size: 16px; margin-bottom: 16px; padding-left: 12px; border-left: 4px solid var(--primary); }
.order-goods { display: flex; gap: 16px; align-items: center; }
.order-goods img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; }
.order-goods .g-name { font-size: 15px; font-weight: 600; }
.order-goods .g-spec { font-size: 13px; color: #999; margin-top: 4px; }
.order-goods .g-price { margin-left: auto; color: var(--primary); font-weight: 700; font-size: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { display: block; font-size: 13px; color: #666; margin-bottom: 6px; }
.form-grid input { width: 100%; padding: 11px 14px; border: 1px solid #ddd; border-radius: 9px; font-size: 14px; }
.form-grid input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--light); }
.pay-methods { display: flex; gap: 14px; }
.pay-method { flex: 1; border: 2px solid #eee; border-radius: 12px; padding: 16px; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.pay-method input { accent-color: var(--primary); width: 18px; height: 18px; }
.pay-method.active { border-color: var(--primary); background: var(--light); }
.pay-logo { width: 38px; height: 38px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; font-weight: 700; }
.order-total { display: flex; justify-content: flex-end; align-items: baseline; gap: 14px; padding: 16px 0 4px; }
.order-total strong { color: var(--primary); font-size: 26px; }
.submit-row { text-align: right; margin-top: 8px; }

/* 支付结果页 */
.result-card { max-width: 640px; margin: 40px auto; background: #fff; border-radius: 16px; padding: 44px 40px; text-align: center; box-shadow: 0 4px 20px rgba(0,0,0,.07); }
.result-icon { width: 76px; height: 76px; border-radius: 50%; background: #22c55e; color: #fff; font-size: 42px; line-height: 76px; margin: 0 auto 20px; }
.result-card h1 { font-size: 24px; margin-bottom: 8px; }
.result-card .sub { color: #999; font-size: 14px; margin-bottom: 26px; }
.result-list { text-align: left; border-top: 1px solid #f0f0f0; }
.result-list .r-row { display: flex; justify-content: space-between; padding: 13px 4px; border-bottom: 1px solid #f5f5f5; font-size: 14px; }
.result-list .r-row span:first-child { color: #999; }
.result-list .r-row .r-pay { color: var(--primary); font-weight: 700; font-size: 17px; }
.result-card .back-home { display: inline-block; margin-top: 28px; background: var(--primary); color: #fff; padding: 11px 46px; border-radius: 26px; font-size: 15px; }

/* ---------- 移动端（760px 断点） ---------- */
@media (max-width: 760px) {
  body { font-size: 14px; }
  .header .container { flex-wrap: wrap; gap: 12px; padding-top: 14px; padding-bottom: 14px; }
  .logo-name { font-size: 20px; }
  .search-box { order: 3; width: 100%; max-width: none; flex-basis: 100%; }
  .header-cart { padding: 6px 14px; font-size: 13px; }
  .mainnav .container { padding: 0; }
  .hero .container { grid-template-columns: 1fr; }
  .hero-cats { flex-direction: row; overflow-x: auto; padding: 6px; }
  .hero-cat { white-space: nowrap; }
  .hero-cat-arrow { display: none; }
  .carousel { min-height: 200px; height: 52vw; }
  .hero-text { left: 20px; max-width: 75%; }
  .hero-text h1 { font-size: 22px; }
  .hero-text p { font-size: 13px; }
  .g-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .promise-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .footer-main { grid-template-columns: 1fr; gap: 20px; }
  .detail { grid-template-columns: 1fr; gap: 18px; padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .pay-methods { flex-direction: column; }
  .order-goods .g-price { font-size: 16px; }
  .buy-btn { width: 100%; padding: 13px 0; }
  .result-card { margin: 20px 8px; padding: 32px 20px; }
  .order-head { padding: 20px; }
  .panel { padding: 18px; }
}
