:root {
  --bg: #fafaf8; --card: #fff; --ink: #1c1c1a; --muted: #6b6b66; --line: #e4e4de;
  --accent: #1f6f5c; --accent-ink: #fff; --danger: #b3261e; --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #151514; --card: #1e1e1c; --ink: #f1f1ec; --muted: #a3a39b; --line: #333330; --accent: #4fb89e; --accent-ink: #0b1a16; --danger: #f2877f; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: inherit; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
#site-header { border-bottom: 1px solid var(--line); background: var(--card); position: sticky; top: 0; z-index: 5; }
#site-header .wrap { display: flex; align-items: center; gap: 12px; height: 56px; }
#site-header .brand { font-weight: 700; font-size: 1.15rem; text-decoration: none; margin-right: auto; }
#site-header a.nav { text-decoration: none; padding: 6px 10px; border-radius: 8px; }
#site-header a.nav:hover { background: var(--bg); }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-size: .8rem; text-align: center; }
main.wrap { padding: 24px 16px 48px; min-height: 70vh; }
h1 { font-size: 1.5rem; margin: 0 0 14px; } h2 { font-size: 1.1rem; }
.muted { color: var(--muted); font-size: .9rem; }
input, select, button { font: inherit; color: inherit; }
input, select { padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); max-width: 100%; }
button { padding: 10px 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); cursor: pointer; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button:disabled { opacity: .5; cursor: not-allowed; }
.search { display: flex; gap: 8px; margin-bottom: 18px; }
.search input { flex: 1; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.card { display: block; text-decoration: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card:hover { border-color: var(--accent); }
.card .img { aspect-ratio: 1; background: var(--line); }
.card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .body { padding: 10px 12px 12px; }
.card .name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .95rem; }
.notice { padding: 12px 14px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); margin: 12px 0; }
.notice.err { border-color: var(--danger); color: var(--danger); }
.product { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 800px) { .product { grid-template-columns: 1.1fr 1fr; } }
.gallery .main { aspect-ratio: 1; background: var(--line); border-radius: var(--radius); overflow: hidden; }
.gallery .main img, .gallery .main video { width: 100%; height: 100%; object-fit: contain; display: block; background: var(--card); }
.gallery .main video { background: #000; }
.thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; padding-bottom: 4px; }
.thumbs button { padding: 0; width: 64px; height: 64px; flex: none; overflow: hidden; border-radius: 8px; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.field { margin: 12px 0; display: grid; gap: 4px; }
.field label { font-size: .85rem; color: var(--muted); }
.field select, .field input { width: 100%; }
.price { font-size: 1.7rem; font-weight: 700; margin: 10px 0 2px; min-height: 2.6rem; line-height: 2.6rem; }
#ship-info { min-height: 3.2em; }
#message { min-height: 1px; }
.desc { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 16px; overflow-wrap: anywhere; }
.desc img { max-width: 100%; height: auto; display: block; margin: 8px 0; }
.desc table { max-width: 100%; display: block; overflow-x: auto; }
.line { display: grid; grid-template-columns: 72px 1fr auto; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; margin-bottom: 10px; }
.line img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; background: var(--line); }
.line .controls { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.line .controls input { width: 70px; }
.line .amount { text-align: right; font-weight: 600; }
.total { display: flex; justify-content: space-between; font-size: 1.2rem; font-weight: 700; padding: 14px 4px; }
#site-footer { border-top: 1px solid var(--line); padding: 20px 0; color: var(--muted); font-size: .85rem; }
