/* 公网商城 · 轻量样式 */
:root {
  --bg: #f6f7f9;
  --surface: #fff;
  --text: #1a1d23;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #0f766e;
  --accent-hover: #0d9488;
  --danger: #b91c1c;
  --warn-bg: #fff7ed;
  --warn-text: #9a3412;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
  --max: 1080px;
  --font: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.shop-shell { max-width: var(--max); margin: 0 auto; padding: 0 16px 48px; }

.shop-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.shop-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.shop-brand:hover { text-decoration: none; color: var(--accent); }
.shop-nav { display: flex; flex-wrap: wrap; gap: 12px; flex: 1; }
.shop-nav a { color: var(--muted); font-size: 0.95rem; }
.shop-nav a:hover, .shop-nav a.is-active { color: var(--accent); }
.shop-header-actions { display: flex; align-items: center; gap: 10px; }
.shop-locale select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  background: var(--surface);
  font: inherit;
}

.banner {
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}
.banner-warn { background: var(--warn-bg); color: var(--warn-text); }
.banner-error { background: #fef2f2; color: var(--danger); }
.banner-info { background: #f0fdfa; color: #115e59; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.product-card { display: flex; flex-direction: column; gap: 8px; overflow: hidden; padding: 0; }
.product-card a { color: inherit; text-decoration: none; display: block; }
.product-card img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  background: #eef0f3;
  display: block;
}
.product-card .meta { padding: 12px 14px 14px; }
.product-card .name { font-weight: 600; margin: 0 0 4px; }
.product-card .sku, .product-card .price { margin: 0; color: var(--muted); font-size: 0.9rem; }
.product-card .price { color: var(--text); font-weight: 600; }
.badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  margin-top: 6px;
}

.detail {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
@media (max-width: 760px) {
  .detail { grid-template-columns: 1fr; }
}
.detail-media,
.detail > .card { min-width: 0; }
.detail-media img, .detail-media video {
  width: 100%;
  border-radius: var(--radius);
  background: #eef0f3;
  max-height: 720px;
  object-fit: contain;
}
.gallery-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-top: 10px;
  padding-bottom: 4px;
}
.gallery-thumb {
  flex: 0 0 64px;
  width: 64px;
  height: 80px;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
}
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  max-height: none;
  border-radius: 0;
}
.gallery-thumb.is-selected { border-color: var(--accent); }
.spec-row {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 12px;
  font-size: 0.92rem;
  padding: 4px 0;
  align-items: start;
}
.spec-row span:last-child {
  text-align: left;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.product-story { margin: 4px 0 8px; }
.story-headline {
  font-size: 0.98rem;
  font-weight: 600;
  margin: 6px 0 0;
  line-height: 1.45;
}
.story-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  margin: 8px 0 0;
  color: var(--text);
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; }
.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font: inherit;
}
.chip.is-selected:not(.chip-swatch) { border-color: var(--accent); background: #f0fdfa; color: var(--accent); }
.chip.chip-swatch {
  border-color: rgba(0, 0, 0, 0.22);
}
.chip.chip-swatch.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent);
}
.chip:disabled { opacity: 0.45; cursor: not-allowed; }

label.field { display: block; margin-bottom: 12px; font-size: 0.9rem; color: var(--muted); }
label.field input, label.field select, label.field textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

.btn {
  appearance: none;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font: inherit;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
}
.btn:hover { background: var(--accent-hover); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-secondary { background: #fff; color: var(--text); border: 1px solid var(--line); }
.btn-secondary:hover { background: #f9fafb; }
.btn-danger { background: var(--danger); }

.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table input[type="number"] { width: 72px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }

.muted { color: var(--muted); }
.err { color: var(--danger); }
.h1 { font-size: 1.4rem; margin: 0 0 12px; }
.h2 { font-size: 1.1rem; margin: 0 0 8px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); }
.qty-row { display: flex; align-items: center; gap: 10px; }
.qty-row input { width: 88px; }
.thumb {
  width: 56px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  background: #eef0f3;
}
.cart-count {
  display: inline-flex;
  min-width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  margin-left: 4px;
  padding: 0 5px;
}
.hidden { display: none !important; }
.loading { color: var(--muted); padding: 24px 0; }
