:root {
  --primary: #07c160;
  --primary-dark: #06ad56;
  --accent: #ff6a00;
  --text: #1f2329;
  --text-2: #5c6470;
  --text-3: #98a1ad;
  --border: #ebedf0;
  --bg: #f5f6f8;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(31, 35, 41, .08);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul { list-style: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; outline: none; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ---------- 顶部 ---------- */
.topbar { background: #2b3038; color: #c9ced6; font-size: 12px; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; height: 32px; }

.nav { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.nav-inner { display: flex; align-items: center; height: 60px; gap: 24px; }
.logo { display: flex; align-items: center; gap: 8px; font-size: 19px; font-weight: 700; color: var(--primary); white-space: nowrap; }
.logo-mark { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--primary), #3ddc97); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.logo-sub { font-size: 11px; font-weight: 400; color: var(--text-3); letter-spacing: .5px; }
.nav-links { display: flex; gap: 22px; margin-left: 8px; }
.nav-links a { padding: 6px 0; color: var(--text-2); position: relative; }
.nav-links a:hover, .nav-links a.on { color: var(--primary); }
.nav-links a.on::after { content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--primary); border-radius: 2px; }
.nav-search { flex: 1; display: flex; justify-content: flex-end; }
.nav-search input { width: 220px; height: 34px; padding: 0 14px; border: 1px solid var(--border); border-radius: 18px; background: #f7f8fa; }
.cart-btn { display: flex; align-items: center; gap: 6px; padding: 7px 16px; border-radius: 18px; background: var(--primary); color: #fff; font-size: 13px; white-space: nowrap; }
.cart-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #fff; color: var(--primary); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* ---------- 通用 ---------- */
.page { padding: 20px 0 48px; }
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.crumb { font-size: 13px; color: var(--text-3); padding: 14px 0 0; }
.crumb a:hover { color: var(--primary); }
.sec-title { display: flex; align-items: baseline; gap: 10px; margin: 28px 0 14px; }
.sec-title h2 { font-size: 20px; }
.sec-title span { font-size: 13px; color: var(--text-3); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 44px; padding: 0 26px; border: none; border-radius: 22px; background: var(--primary); color: #fff; font-size: 15px; cursor: pointer; transition: .15s; }
.btn:hover { background: var(--primary-dark); }
.btn:disabled { background: #c8cdd4; cursor: not-allowed; }
.btn-ghost { background: #fff; color: var(--text-2); border: 1px solid var(--border); }
.btn-ghost:hover { background: #f7f8fa; color: var(--text); }
.btn-orange { background: linear-gradient(90deg, #ff8a00, var(--accent)); }
.btn-block { width: 100%; }
.btn-sm { height: 34px; padding: 0 16px; font-size: 13px; border-radius: 17px; }

.price { color: var(--accent); font-weight: 700; }
.price small { font-size: 12px; }
.price del { color: var(--text-3); font-weight: 400; font-size: 12px; margin-left: 6px; }

.tag { display: inline-block; padding: 1px 7px; border-radius: 3px; font-size: 11px; line-height: 18px; }
.tag-green { background: #e8f8ef; color: var(--primary-dark); }
.tag-orange { background: #fff2e6; color: #d96000; }

/* ---------- 首页 ---------- */
.hero { background: linear-gradient(120deg, #07c160, #0bb35f 45%, #3ddc97); color: #fff; padding: 44px 0 52px; }
.hero-inner { display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.hero h1 { font-size: 30px; line-height: 1.35; margin-bottom: 10px; }
.hero p { opacity: .92; margin-bottom: 22px; }
.hero-tags { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-tags span { padding: 5px 14px; border-radius: 14px; background: rgba(255, 255, 255, .18); font-size: 12px; }
.hero .btn { background: #fff; color: var(--primary-dark); font-weight: 600; }

.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 20px; position: relative; z-index: 2; }
.feature { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: flex; align-items: center; gap: 10px; }
.feature i { width: 34px; height: 34px; border-radius: 8px; background: #e8f8ef; color: var(--primary); display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 17px; }
.feature b { display: block; font-size: 14px; }
.feature em { font-style: normal; font-size: 12px; color: var(--text-3); }

.cat-bar { display: flex; gap: 10px; flex-wrap: wrap; margin: 24px 0 4px; }
.cat-bar a { padding: 6px 16px; border-radius: 16px; background: #fff; border: 1px solid var(--border); font-size: 13px; color: var(--text-2); }
.cat-bar a.on, .cat-bar a:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.goods { background: #fff; border-radius: var(--radius); overflow: hidden; transition: .2s; }
.goods:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(31, 35, 41, .12); }
.goods-pic { position: relative; padding-top: 100%; background: #f7f8fa; }
.goods-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.goods-pic .tag { position: absolute; left: 8px; top: 8px; }
.goods-body { padding: 12px 14px 16px; }
.goods-name { font-size: 14px; font-weight: 500; height: 40px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.goods-meta { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; }
.goods-sales { font-size: 12px; color: var(--text-3); }

/* ---------- 商品详情 ---------- */
.detail { display: grid; grid-template-columns: 420px 1fr; gap: 28px; }
.detail-pic { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.detail-info { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; }
.detail-info h1 { font-size: 21px; line-height: 1.45; }
.detail-sub { color: var(--text-3); font-size: 13px; margin: 6px 0 14px; }
.price-box { background: linear-gradient(90deg, #fff6ef, #fff); border-radius: 8px; padding: 14px 16px; margin-bottom: 16px; }
.price-box .price { font-size: 28px; }
.price-box .price small { font-size: 16px; }
.rows { display: grid; grid-template-columns: 72px 1fr; gap: 10px 12px; font-size: 13px; padding: 10px 0; border-top: 1px solid var(--border); }
.rows dt { color: var(--text-3); }
.rows dd { color: var(--text); }
.spec-list { display: flex; gap: 8px; flex-wrap: wrap; }
.spec-list span { padding: 4px 12px; border: 1px solid var(--border); border-radius: 4px; font-size: 12px; color: var(--text-2); background: #fafbfc; }
.num-ctrl { display: flex; align-items: center; gap: 2px; }
.num-ctrl button { width: 30px; height: 30px; border: 1px solid var(--border); background: #fff; cursor: pointer; }
.num-ctrl button:hover { color: var(--primary); border-color: var(--primary); }
.num-ctrl input { width: 52px; height: 30px; text-align: center; border: 1px solid var(--border); border-left: none; border-right: none; }
.buy-bar { display: flex; gap: 12px; margin-top: 20px; }

.review { border-top: 1px solid var(--border); padding: 14px 0; }
.review-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.review-stars { color: #ff9f1a; letter-spacing: 1px; }
.review-text { font-size: 13px; color: var(--text-2); margin-top: 6px; }

/* ---------- 表格 / 表单 ---------- */
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table th, .table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
.table th { background: #fafbfc; color: var(--text-2); font-weight: 500; }
.table tr:last-child td { border-bottom: none; }
.table .g-cell { display: flex; align-items: center; gap: 12px; }
.table .g-cell img { width: 56px; height: 56px; border-radius: 6px; object-fit: cover; }
.table tfoot td { background: #fafbfc; }

.form-row { display: grid; grid-template-columns: 88px 1fr; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.form-row:last-child { border-bottom: none; }
.form-row label { color: var(--text-2); font-size: 13px; }
.form-row label em { color: var(--accent); font-style: normal; }
.form-row input, .form-row textarea, .form-row select { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: 6px; }
.form-row textarea { height: 70px; padding: 10px 12px; resize: vertical; }
.form-row input:focus, .form-row textarea:focus { border-color: var(--primary); }
.form-inline { display: flex; gap: 10px; }
.err { color: var(--accent); font-size: 12px; min-height: 18px; padding-top: 6px; }

/* ---------- 结果页 ---------- */
.result { text-align: center; padding: 40px 24px; }
.result-icon { width: 62px; height: 62px; margin: 0 auto 16px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 32px; line-height: 62px; }
.result h2 { font-size: 21px; margin-bottom: 6px; }
.result p { color: var(--text-3); margin-bottom: 22px; }
.result-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.deliver { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 24px; margin-top: 20px; text-align: left; }
.deliver h3 { font-size: 15px; margin-bottom: 12px; }
.timeline { border-left: 2px solid var(--border); padding-left: 18px; margin-left: 6px; }
.timeline li { position: relative; padding-bottom: 18px; font-size: 13px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ''; position: absolute; left: -25px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
.timeline li.on::before { background: var(--primary); box-shadow: 0 0 0 3px #e8f8ef; }
.timeline li b { display: block; font-size: 13px; }
.timeline li span { color: var(--text-3); font-size: 12px; }

.empty { text-align: center; padding: 70px 20px; color: var(--text-3); }
.empty-icon { font-size: 46px; margin-bottom: 12px; }

/* ---------- 协议 / 正文 ---------- */
.doc { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px 34px; }
.doc h1 { font-size: 22px; text-align: center; margin-bottom: 6px; }
.doc .doc-meta { text-align: center; color: var(--text-3); font-size: 12px; padding-bottom: 20px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.doc h2 { font-size: 16px; margin: 24px 0 10px; padding-left: 10px; border-left: 3px solid var(--primary); }
.doc p, .doc li { font-size: 14px; color: var(--text-2); margin-bottom: 8px; }
.doc ol, .doc ul { padding-left: 22px; margin-bottom: 12px; }
.doc ul li { list-style: disc; }
.doc ol li { list-style: decimal; }
.doc strong { color: var(--text); }
.contact-box { background: #f7f8fa; border-radius: 8px; padding: 16px 20px; margin-top: 24px; font-size: 13px; color: var(--text-2); }

/* ---------- 页脚 ---------- */
.footer { background: #2b3038; color: #a8b0bb; margin-top: 40px; font-size: 13px; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; padding: 36px 0 24px; }
.footer h4 { color: #fff; font-size: 14px; margin-bottom: 12px; }
.footer p { margin-bottom: 5px; }
.footer li { margin-bottom: 7px; }
.footer li a:hover, .footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #3b414a; padding: 16px 0 26px; text-align: center; font-size: 12px; color: #7d858f; }
.footer-bottom a { color: #a8b0bb; }
.footer-bottom a:hover { color: #fff; }

.toast { position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%); background: rgba(0, 0, 0, .78); color: #fff; padding: 10px 20px; border-radius: 6px; font-size: 14px; z-index: 999; opacity: 0; transition: .2s; pointer-events: none; }
.toast.on { opacity: 1; }

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .features { grid-template-columns: repeat(2, 1fr); }
  .detail { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .nav-search { display: none; }
  .doc { padding: 20px; }
}
@media (max-width: 500px) {
  .hero h1 { font-size: 23px; }
  .nav-links { gap: 14px; font-size: 13px; }
  .nav-inner { gap: 12px; }
  .logo-sub { display: none; }
}
