:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --ink: #0f172a;
  --muted: #475569;
  --line: #e2e8f0;
  --brand: #16324f;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --ok: #15803d;
  --ok-soft: #f0fdf4;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --radius: 14px;
  --shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 16px; flex-wrap: wrap; padding: 8px 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 17px; }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.nav { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.nav a { color: var(--muted); font-size: 15px; font-weight: 500; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--brand); font-weight: 600; text-decoration: none; }
.nav .nav-cta {
  padding: 7px 15px; border-radius: 9px;
  background: var(--brand); color: #ffffff; font-size: 14px; font-weight: 600;
}
.nav .nav-cta:hover, .nav .nav-cta[aria-current="page"] { background: #1e4268; color: #ffffff; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 22px; border-radius: 10px; font-size: 15px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; font-family: inherit;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--brand); color: #ffffff; }
.btn-primary:hover { background: #1e4268; color: #ffffff; }
.btn-accent { background: var(--accent); color: #ffffff; }
.btn-accent:hover { background: #1d4ed8; color: #ffffff; }
.btn-secondary { background: var(--surface); color: var(--brand); border-color: var(--line); }
.btn-secondary:hover { border-color: #cbd5e1; background: var(--surface-soft); }

.hero {
  padding: 68px 0 56px;
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
  border-bottom: 1px solid var(--line);
}
.eyebrow {
  display: inline-block; padding: 5px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 13px; font-weight: 600; margin-bottom: 16px;
}
.hero h1 { margin: 0 0 16px; font-size: clamp(28px, 4.2vw, 44px); line-height: 1.22; letter-spacing: -0.02em; max-width: 820px; }
.hero-lead { margin: 0 0 26px; font-size: 16px; color: var(--muted); max-width: 720px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 40px; }
.metric-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.metric-card strong { display: block; font-size: 19px; color: var(--brand); margin-bottom: 4px; }
.metric-card span { font-size: 14px; color: var(--muted); }

.section { padding: 60px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { margin-bottom: 30px; max-width: 740px; }
.section-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.section-head-row .section-head { margin-bottom: 0; }
.section-head h1, .section-head h2 { margin: 0 0 10px; font-size: clamp(24px, 3vw, 32px); line-height: 1.28; }
.section-head p { margin: 0; font-size: 15px; color: var(--muted); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card-tag { display: inline-block; font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 3px 10px; border-radius: 999px; margin-bottom: 12px; }
.card h3 { margin: 0 0 10px; font-size: 18px; line-height: 1.35; }
.card p { margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.card ul { margin: 0; padding-left: 18px; font-size: 14px; color: var(--muted); }
.card li { margin-bottom: 6px; }

/* Storefront Product Cards */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.filter-pill {
  padding: 7px 16px; border-radius: 999px; font-size: 14px; font-weight: 600;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer;
  font-family: inherit; transition: all 0.15s ease;
}
.filter-pill:hover { border-color: #94a3b8; color: var(--ink); }
.filter-pill.is-active { background: var(--brand); border-color: var(--brand); color: #ffffff; }

.product-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); transition: border-color 0.15s ease, transform 0.15s ease;
}
.product-card:hover { border-color: #93c5fd; transform: translateY(-2px); }
.product-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.product-sku { font-size: 12px; color: #64748b; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.product-card h3 { margin: 0 0 8px; font-size: 18px; line-height: 1.35; color: var(--ink); }
.product-desc { margin: 0 0 14px; font-size: 14px; color: var(--muted); flex: 1; }
.product-meta { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 10px; background: var(--bg); font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.product-meta strong { color: var(--ink); font-weight: 600; }
.product-price-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.price { font-size: 24px; font-weight: 800; color: #b91c1c; letter-spacing: -0.02em; }
.price small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.product-delivery { font-size: 12px; color: var(--ok); background: var(--ok-soft); padding: 2px 8px; border-radius: 6px; font-weight: 600; }
.product-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Breadcrumb & Detail Page */
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 20px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); }
.detail-grid { display: grid; grid-template-columns: 1.35fr 0.95fr; gap: 24px; align-items: start; }
.spec-list { display: grid; gap: 10px; margin: 14px 0 20px; }
.spec-option {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; text-align: left; padding: 14px 16px; border-radius: 11px;
  border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-family: inherit;
  transition: all 0.15s ease;
}
.spec-option:hover { border-color: #93c5fd; }
.spec-option.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.spec-name { font-size: 15px; font-weight: 700; color: var(--ink); display: block; }
.spec-sub { font-size: 13px; color: var(--muted); display: block; margin-top: 2px; }
.spec-price { font-size: 18px; font-weight: 800; color: #b91c1c; white-space: nowrap; }

.qty-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0 20px; padding: 12px 14px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.qty-ctrl { display: inline-flex; align-items: center; gap: 8px; }
.qty-btn {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 16px; font-weight: 700; cursor: pointer;
}
.qty-btn:hover { background: var(--surface-soft); }
.qty-val { min-width: 28px; text-align: center; font-weight: 700; font-size: 15px; }

.guarantee-box {
  margin-top: 20px; padding: 16px 18px; border-radius: 12px;
  background: var(--ok-soft); border: 1px solid #bbf7d0; font-size: 13px; color: #166534;
}
.guarantee-box strong { display: block; margin-bottom: 4px; font-size: 14px; }

/* Checkout Page */
.checkout-grid { display: grid; grid-template-columns: 1.35fr 0.85fr; gap: 24px; align-items: start; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink); }
.field label span { color: #dc2626; margin-left: 2px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border-radius: 9px; border: 1px solid #cbd5e1;
  background: #ffffff; color: var(--ink); font-size: 14px; font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }

.pay-methods { display: grid; gap: 12px; margin-top: 12px; }
.pay-option {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 16px; border-radius: 11px; border: 1.5px solid var(--line);
  background: var(--surface); cursor: pointer; transition: all 0.15s ease;
}
.pay-option:hover { border-color: #93c5fd; }
.pay-option.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.pay-left { display: flex; align-items: center; gap: 12px; }
.pay-icon {
  width: 36px; height: 36px; border-radius: 9px; display: inline-flex;
  align-items: center; justify-content: center; font-weight: 800; font-size: 14px; color: #ffffff; flex-shrink: 0;
}
.pay-wx { background: #07c160; }
.pay-ali { background: #1677ff; }
.pay-bank { background: #334155; }
.pay-title { font-size: 15px; font-weight: 700; color: var(--ink); display: block; }
.pay-sub { font-size: 12px; color: var(--muted); display: block; }
.pay-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); }

.summary-card { position: sticky; top: 88px; }
.summary-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; padding: 8px 0; color: var(--muted); }
.summary-row strong { color: var(--ink); text-align: right; }
.summary-divider { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.summary-total { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0 16px; }
.summary-total span { font-size: 15px; font-weight: 700; color: var(--ink); }
.summary-total strong { font-size: 28px; font-weight: 800; color: #b91c1c; }

.agree-row { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--muted); margin: 14px 0 18px; }
.agree-row input { margin-top: 4px; }
.form-msg { margin: 10px 0 0; font-size: 13px; color: #b91c1c; min-height: 20px; }

/* Cashier Panel / Modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(15, 23, 42, 0.56);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-backdrop.is-open { display: flex; }
.cashier-modal {
  width: 100%; max-width: 500px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
  display: flex; flex-direction: column;
  background: #ffffff; border-radius: 16px;
  border: 1px solid var(--line); box-shadow: 0 24px 64px rgba(15, 23, 42, 0.25);
  overflow: hidden;
}
.cashier-head {
  flex: none;
  padding: 18px 22px; background: var(--brand); color: #ffffff;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.cashier-head h3 { margin: 0; font-size: 17px; }
.cashier-close { background: transparent; border: 0; color: #cbd5e1; font-size: 22px; cursor: pointer; line-height: 1; }
.cashier-body { padding: 22px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.cashier-amount { text-align: center; padding: 14px; border-radius: 12px; background: var(--bg); margin-bottom: 16px; }
.cashier-amount small { display: block; font-size: 12px; color: var(--muted); }
.cashier-amount strong { font-size: 32px; color: #b91c1c; }
.cashier-meta { font-size: 13px; color: var(--muted); margin: 0 0 16px; display: grid; gap: 6px; }
.cashier-meta div { display: flex; justify-content: space-between; gap: 12px; }
.cashier-meta span:last-child { color: var(--ink); font-weight: 600; text-align: right; }
.cashier-notice {
  padding: 14px 16px; border-radius: 10px; background: var(--warn-soft);
  border: 1px solid #fde68a; font-size: 13px; color: var(--warn); margin-bottom: 16px;
}

.step-card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.step-num { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; background: var(--brand); color: #ffffff; font-weight: 700; font-size: 14px; margin-bottom: 12px; }
.step-card h3 { margin: 0 0 8px; font-size: 16px; }
.step-card p { margin: 0; font-size: 14px; color: var(--muted); }

.info-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.info-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 28px; margin: 0; }
.info-list dt { font-size: 13px; color: var(--muted); margin-bottom: 3px; }
.info-list dd { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink); }

.doc-page { padding: 52px 0 72px; }
.doc-article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 36px 40px; max-width: 880px; }
.doc-article h1 { margin: 0 0 12px; font-size: 28px; }
.doc-article .doc-meta { font-size: 13px; color: var(--muted); margin: 0 0 24px; }
.doc-article h2 { margin: 26px 0 10px; font-size: 18px; color: var(--brand); }
.doc-article p, .doc-article li { font-size: 15px; color: var(--muted); }

.site-footer { background: #0f172a; color: #cbd5e1; padding: 44px 0 32px; }
.footer-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 28px; flex-wrap: wrap; padding-bottom: 24px; border-bottom: 1px solid rgba(148, 163, 184, 0.2); }
.footer-brand { max-width: 500px; }
.footer-brand strong { display: block; color: #ffffff; font-size: 16px; margin-bottom: 8px; }
.footer-brand p { margin: 0; font-size: 13px; color: #94a3b8; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: #cbd5e1; font-size: 14px; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding-top: 20px; font-size: 13px; color: #94a3b8; }
.footer-bottom a { color: #cbd5e1; }

@media (max-width: 920px) {
  .metrics, .grid-2, .grid-3, .grid-4, .info-list, .detail-grid, .checkout-grid, .form-grid { grid-template-columns: 1fr; }
  .summary-card { position: static; }
  .hero { padding: 48px 0 40px; }
  .section { padding: 44px 0; }
  .doc-article { padding: 24px 20px; }
  .nav { gap: 14px; }
  .modal-backdrop { padding: 12px; }
  .cashier-body { padding: 16px; }
  input, textarea, select { font-size: 16px; }
}
