/* OpenShop base — tokens, reset, type and shared primitives. */
:root {
  --paper: #f6f1e8;
  --paper-raised: #fffaf2;
  --paper-deep: #eee4d4;
  --ink: #221b16;
  --ink-soft: #4e4339;
  --muted: #776a5d;
  --line: #e3d6c4;
  --line-strong: #cdbaa2;
  --accent: #d7462c;
  --accent-deep: #a92d18;
  --accent-soft: #f7ded6;
  --jade: #1e6f5c;
  --jade-soft: #dfeee8;
  --honey: #e7b457;
  --honey-soft: #f8eccf;
  --danger: #ba3c32;
  --success: #28735e;
  --night: #1d2925;
  --night-soft: #2b3a34;
  --white: #fff;
  --font-display: "Noto Serif CJK SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --font-body: "Noto Sans CJK SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 26px;
  --radius-pill: 999px;
  --shadow-xs: 0 1px 2px rgba(46, 31, 18, .05);
  --shadow-sm: 0 8px 22px rgba(64, 42, 22, .07);
  --shadow: 0 20px 52px rgba(64, 42, 22, .12);
  --shadow-lg: 0 34px 88px rgba(43, 29, 17, .2);
  --ease: cubic-bezier(.22, .8, .2, 1);
  --content-wide: 1360px;
  --content: 1260px;
  --header-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.has-modal { overflow: hidden; }
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: .4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.06'/%3E%3C/svg%3E");
}
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.22; letter-spacing: -.02em; font-weight: 650; }
h1 { font-size: clamp(2.2rem, 4vw, 4.2rem); }
h2 { font-size: clamp(1.65rem, 2.4vw, 2.5rem); }
h3 { font-size: 1.25rem; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
input, select, textarea { min-width: 0; }
::selection { background: var(--accent); color: var(--white); }
:focus-visible { outline: 3px solid var(--jade); outline-offset: 3px; border-radius: 4px; }
/* Form controls must keep a visible keyboard focus ring even when a component
   class resets the default outline for mouse focus. */
body :is(input, select, textarea):focus-visible { outline: 2px solid var(--jade); outline-offset: 2px; }
main h1[tabindex="-1"]:focus, main h1[tabindex="-1"]:focus-visible { outline: none; }
[hidden] { display: none !important; }

.container { width: min(var(--content), calc(100% - 56px)); margin-inline: auto; }
.container--wide { width: min(var(--content-wide), calc(100% - 56px)); margin-inline: auto; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 16px; top: -100px; z-index: 1000; padding: 10px 18px; background: var(--ink); color: var(--paper); border-radius: 10px; transition: top .2s; }
.skip-link:focus { top: 12px; }
.noscript { padding: 28px; text-align: center; background: var(--honey-soft); }

.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-body); font-size: .72rem; font-weight: 700; letter-spacing: .17em; text-transform: uppercase; color: var(--accent); }
.eyebrow::before { content: ""; width: 20px; height: 1px; background: currentColor; }
.eyebrow--jade { color: var(--jade); }
.display { font-family: var(--font-display); }
.lede { color: var(--ink-soft); font-size: 1.06rem; line-height: 1.8; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.tiny { font-size: .74rem; }
.strong { font-weight: 700; }
.text-accent { color: var(--accent); }
.text-jade { color: var(--jade); }
.rupture { font-family: var(--font-display); font-style: italic; color: var(--accent); }

.btn {
  --btn-bg: var(--ink);
  --btn-fg: var(--paper-raised);
  --btn-line: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 46px; padding: 0 22px;
  border: 1px solid var(--btn-line); border-radius: var(--radius-pill);
  background: var(--btn-bg); color: var(--btn-fg);
  font-size: .92rem; font-weight: 650; line-height: 1.2; white-space: nowrap;
  transition: transform .22s var(--ease), background .22s, color .22s, box-shadow .22s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0) scale(.99); }
.btn--primary { --btn-bg: var(--accent); --btn-fg: #fff9f4; --btn-line: var(--accent); }
.btn--primary:hover { --btn-bg: var(--accent-deep); --btn-line: var(--accent-deep); }
.btn--jade { --btn-bg: var(--jade); --btn-fg: #f4fff9; --btn-line: var(--jade); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--ink); --btn-line: var(--line-strong); box-shadow: none; }
.btn--ghost:hover { --btn-bg: var(--paper-raised); --btn-line: var(--ink); }
.btn--quiet { --btn-bg: transparent; --btn-fg: var(--muted); --btn-line: transparent; padding-inline: 12px; }
.btn--small { min-height: 36px; padding-inline: 16px; font-size: .8rem; }
.btn--large { min-height: 54px; padding-inline: 30px; font-size: 1rem; }
.btn--block { width: 100%; }
.btn--danger { --btn-bg: transparent; --btn-fg: var(--danger); --btn-line: #e5b8b2; }
.link-arrow { display: inline-flex; align-items: center; gap: 7px; font-size: .85rem; font-weight: 650; border-bottom: 1px solid transparent; transition: border-color .2s, gap .2s; }
.link-arrow:hover { border-color: currentColor; gap: 10px; }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink); transition: background .2s; }
.icon-btn:hover { background: rgba(34, 27, 22, .06); }

.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 13px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--paper-raised); color: var(--ink-soft); font-size: .78rem; white-space: nowrap; }
.chip--accent { border-color: transparent; background: var(--accent-soft); color: var(--accent-deep); font-weight: 650; }
.chip--jade { border-color: transparent; background: var(--jade-soft); color: var(--jade); font-weight: 650; }
.chip--honey { border-color: transparent; background: var(--honey-soft); color: #7a5519; font-weight: 650; }
.chip--ghost { background: transparent; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.badge { display: inline-flex; align-items: center; gap: 4px; min-height: 22px; padding: 0 8px; border-radius: 6px; background: var(--ink); color: var(--paper-raised); font-size: .68rem; font-weight: 650; letter-spacing: .02em; }
.badge--light { background: rgba(255, 250, 242, .88); color: var(--ink); backdrop-filter: blur(8px); }
.badge--jade { background: var(--jade); color: #f5fffb; }
.badge--outline { border: 1px solid rgba(34,27,22,.18); background: transparent; color: var(--ink-soft); }

.surface { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.surface--flush { overflow: hidden; }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }
.rule-label { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.rule-label::before, .rule-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.field { display: grid; gap: 7px; }
.field > label, .field-label { font-size: .82rem; font-weight: 700; color: var(--ink-soft); }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 11px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--paper-raised); color: var(--ink); transition: border-color .2s, box-shadow .2s;
}
.input::placeholder, .textarea::placeholder { color: #9c8b7b; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--jade); box-shadow: 0 0 0 3px rgba(30,111,92,.12); outline: none; }
.textarea { min-height: 110px; resize: vertical; }
.field-hint { font-size: .75rem; color: var(--muted); }
.field-error { font-size: .78rem; color: var(--danger); font-weight: 600; }
.form-grid { display: grid; gap: 16px; }
.form-grid--2 { grid-template-columns: 1fr 1fr; gap: 14px; }
.check { display: inline-flex; align-items: center; gap: 9px; font-size: .86rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--jade); }

.price { display: inline-flex; align-items: baseline; color: var(--accent); font-family: var(--font-body); font-variant-numeric: tabular-nums; font-weight: 750; letter-spacing: -.035em; white-space: nowrap; }
.price .currency { font-size: .68em; font-weight: 700; margin-right: 2px; }
.price .amount { font-size: 1.45em; line-height: 1; }
.price--small .amount { font-size: 1.12em; }
.price--lg .amount { font-size: 2.15em; }
.price--muted { color: var(--muted); }
.was-price { color: #998877; font-size: .8em; text-decoration: line-through; text-decoration-thickness: 1px; }
.save-note { color: var(--accent-deep); font-size: .74rem; font-weight: 650; }
.rating-line { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .76rem; }
.stars { display: inline-flex; gap: 1px; color: #c58b28; letter-spacing: -.08em; font-size: .78rem; }
.stars--muted { color: #c7b9a6; }

.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 26px 20px; }
.product-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.product-grid--five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stack { display: grid; gap: 12px; }
.cluster { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.between { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 36px; } .mt-5 { margin-top: 52px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 36px; }
.w-full { width: 100%; }

.skeleton { position: relative; overflow: hidden; background: #eadfce; border-radius: 10px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,250,242,.6), transparent); animation: shimmer 1.45s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }
.loading-line { width: 100%; height: 2px; position: fixed; top: 0; left: 0; z-index: 1200; background: transparent; overflow: hidden; }
.loading-line.active::after { content: ""; position: absolute; left: 0; width: 36%; height: 2px; background: var(--accent); animation: loading 1.2s var(--ease) infinite; }
@keyframes loading { 0% { transform: translateX(-100%); } 100% { transform: translateX(340%); } }

.error-inline { padding: 14px 16px; border: 1px solid #ecc9c3; border-radius: var(--radius-sm); background: #fff5f2; color: var(--danger); font-size: .86rem; }
.notice { padding: 14px 16px; border: 1px solid #d6e5de; border-radius: var(--radius-sm); background: var(--jade-soft); color: #1d5a4c; font-size: .86rem; }
.demo-note { display: flex; gap: 10px; align-items: flex-start; font-size: .78rem; color: var(--muted); }
.demo-note::before { content: "◉"; color: var(--accent); font-size: .7rem; line-height: 1.5; }

@media (max-width: 1080px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .product-grid-- five, .product-grid--five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .container, .container--wide { width: min(100% - 32px, var(--content)); }
  .product-grid, .product-grid--five { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
  .product-grid--three { grid-template-columns: 1fr; }
  .form-grid--2 { grid-template-columns: 1fr; }
}
@media (max-width: 440px) {
  body { font-size: 14px; }
  .container, .container--wide { width: calc(100% - 28px); }
  .btn { min-height: 44px; padding-inline: 18px; }
  h1 { font-size: 2.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
