/* allchinabuyqc.org — hand-written stylesheet
   QC reference station. Warm-white, dark-gray, low-saturation amber status band.
   No framework, no CDN, no build step. */

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, ul, ol, li, figure, blockquote, dl, dd { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:where(a, button, input, [tabindex]):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ---------- tokens ---------- */
:root {
  --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;

  --bg: #faf8f5;
  --surface: #ffffff;
  --surface-2: #f3f0ea;
  --ink: #23201c;
  --ink-soft: #47423b;
  --muted: #746d63;
  --line: #e6e1d8;
  --line-strong: #d6cfc3;

  --accent: #2f5b73;
  --accent-ink: #204154;
  --accent-soft: #eaf1f5;

  --amber-bg: #fbf1d9;
  --amber-border: #ecd39c;
  --amber-ink: #855510;

  --focus: #2f5b73;

  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(35, 32, 28, .05), 0 1px 3px rgba(35, 32, 28, .04);

  --wrap: 1200px;
  --prose: 68ch;

  --section-gap: 56px;
  --grid-gap: 20px;
  --card-pad: 16px;
}

/* ---------- base ---------- */
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { color: var(--ink); text-wrap: balance; }
h1 { font-size: 48px; font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; }
h2 { font-size: 28px; font-weight: 700; line-height: 1.3; }
h3 { font-size: 18px; font-weight: 600; line-height: 1.4; }
p, li { font-size: 16px; line-height: 1.7; }
small, .small { font-size: 14px; line-height: 1.55; }

a { color: var(--accent); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-ink); }

/* ---------- layout helpers ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }
.prose { max-width: var(--prose); }
.prose p, .prose ul, .prose ol { margin-top: 14px; }
.prose h2 { margin-top: 32px; }
.prose h3 { margin-top: 24px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-top: 6px; }
.prose li::marker { color: var(--muted); }

.stack { display: flex; flex-direction: column; }
.page { display: flex; flex-direction: column; gap: var(--section-gap); }
.page > * { min-width: 0; }
.section-pad { padding-block: 8px; }

main { display: block; }
.muted { color: var(--muted); }
.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 8px;
}

/* ---------- skip link ---------- */
.skip {
  position: absolute; left: 8px; top: -60px; z-index: 200;
  background: var(--ink); color: #fff; padding: 8px 14px; border-radius: var(--radius-sm);
  transition: top .15s ease; text-decoration: none;
}
.skip:focus { top: 8px; color: #fff; }

/* ---------- status band ---------- */
.statusbar {
  background: var(--amber-bg);
  border-bottom: 1px solid var(--amber-border);
  color: var(--amber-ink);
}
.statusbar__inner {
  display: flex; align-items: flex-start; gap: 10px;
  padding-block: 9px; font-size: 14px; line-height: 1.5;
}
.statusbar__dot {
  flex: none; width: 9px; height: 9px; border-radius: 50%;
  background: var(--amber-ink); margin-top: 6px;
}
.statusbar a { color: var(--amber-ink); font-weight: 600; }
.statusbar strong { font-weight: 700; }

/* ---------- header ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header__inner {
  display: flex; align-items: center; gap: 20px;
  min-height: 62px; padding-block: 10px;
}
.brand { display: inline-flex; align-items: baseline; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 800; letter-spacing: -0.01em; }
.brand:hover { color: var(--ink); }
.brand__mark { font-size: 18px; }
.brand__tag { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }

.mainnav { margin-left: auto; display: flex; align-items: center; gap: 20px; }
.mainnav ul { display: flex; align-items: center; gap: 22px; list-style: none; margin: 0; padding: 0; }
.mainnav .searchform { width: 236px; }
.mainnav .searchform .btn { padding-inline: 12px; }
.mainnav a { font-size: 14px; font-weight: 500; text-decoration: none; color: var(--ink-soft); }
.mainnav a:hover, .mainnav a[aria-current="page"] { color: var(--accent-ink); }
.mainnav a[aria-current="page"] { font-weight: 600; }

.nav-toggle {
  display: none; margin-left: auto; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 8px 12px; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--ink);
}

/* ---------- search ---------- */
.searchform { display: flex; gap: 8px; align-items: stretch; }
.searchform__field {
  flex: 1 1 auto; min-width: 0;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 9px 12px; font-size: 15px; background: var(--surface); color: var(--ink);
}
.searchform__field::placeholder { color: #9a9186; }
.searchhint { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 15px; font-weight: 600; line-height: 1.2;
  padding: 10px 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent; text-decoration: none; cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.btn--primary { background: var(--ink); color: #fff; }
.btn--primary:hover { background: #100e0c; color: #fff; }
.btn--ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn--ghost:hover { border-color: var(--muted); color: var(--ink); }
.btn--block { width: 100%; }
.btn__ext { font-size: 12px; opacity: .8; }

/* ---------- hero ---------- */
.hero { padding-top: 8px; }
.hero__grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 40px; align-items: start; }
.hero__grid > * { min-width: 0; }
.hero h1 { margin-bottom: 14px; }
.hero__lead { font-size: 18px; line-height: 1.6; color: var(--ink-soft); max-width: 46ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.hero__card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.hero__card h2 { font-size: 16px; margin-bottom: 8px; }
.hero__card ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hero__card li { font-size: 14px; line-height: 1.5; color: var(--ink-soft); padding-left: 18px; position: relative; }
.hero__card li::before { content: ""; position: absolute; left: 0; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ---------- section header ---------- */
.section-head { margin-bottom: 20px; max-width: 62ch; }
.section-head h2 { margin-bottom: 8px; }
.section-head p { color: var(--ink-soft); }

/* ---------- generic cards ---------- */
.cards { display: grid; gap: var(--grid-gap); }
.cards > * { min-width: 0; }
.cards--3 { grid-template-columns: repeat(3, 1fr); }
.cards--2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--card-pad); box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 8px;
}
.card h3 { font-size: 17px; }
.card p { font-size: 14px; line-height: 1.55; color: var(--ink-soft); }
.card a.card__link { text-decoration: none; font-weight: 600; color: var(--accent); }
.card a.card__link:hover { color: var(--accent-ink); }

/* ---------- product grid + card ---------- */
.grid-products { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--grid-gap); }
.grid-products > * { min-width: 0; }

.pcard {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.pcard__thumb { position: relative; aspect-ratio: 1 / 1; background: var(--surface-2); overflow: hidden; }
.pcard__thumb img { width: 100%; height: 100%; object-fit: cover; }
.pcard__badge {
  position: absolute; top: 8px; left: 8px;
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
  padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,.94); color: var(--ink);
  border: 1px solid var(--line);
}
.pcard__badge--qc { background: var(--accent-soft); color: var(--accent-ink); border-color: #cfe0e9; }
.pcard__body { padding: 12px 13px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pcard__title { font-size: 14px; font-weight: 600; line-height: 1.35; }
.pcard__title a { text-decoration: none; color: var(--ink); }
.pcard__title a:hover { color: var(--accent-ink); }
.pcard__meta { font-size: 13px; color: var(--muted); margin-top: auto; }
.pcard__price { font-size: 14px; color: var(--ink-soft); font-weight: 600; }
.pcard__price span { font-weight: 400; color: var(--muted); }

/* ---------- badges (inline) ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink-soft);
}
.tag--qc { background: var(--accent-soft); color: var(--accent-ink); border-color: #cfe0e9; }
.tag--none { background: var(--surface-2); color: var(--muted); }

/* ---------- breadcrumb ---------- */
.crumbs { font-size: 13px; color: var(--muted); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.crumbs li { display: flex; gap: 6px; align-items: center; }
.crumbs li + li::before { content: "/"; color: var(--line-strong); }
.crumbs a { text-decoration: none; color: var(--muted); }
.crumbs a:hover { color: var(--accent-ink); }
.crumbs [aria-current="page"] { color: var(--ink-soft); }

/* ---------- product page ---------- */
.product { display: grid; grid-template-columns: 1.1fr 1fr; gap: 36px; align-items: start; }
.product > * { min-width: 0; }
.product__media { position: relative; }
.product__figure { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.product__figure img { width: 100%; height: auto; display: block; }
.product__figcap { font-size: 13px; color: var(--muted); margin-top: 8px; }
.product__info h1 { font-size: 32px; line-height: 1.2; letter-spacing: -0.01em; margin-bottom: 12px; }
.product__cat { font-size: 13px; color: var(--muted); margin-bottom: 10px; }

.pricebox { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--surface); margin: 16px 0; }
.pricebox__main { font-size: 22px; font-weight: 700; }
.pricebox__ref { font-size: 14px; color: var(--ink-soft); margin-top: 2px; }
.pricebox__note { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.5; }

.ctablock { margin: 18px 0; display: flex; flex-direction: column; gap: 10px; }
.ctablock__note { font-size: 14px; color: var(--ink-soft); line-height: 1.6; }

.callout { border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--surface); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; line-height: 1.6; color: var(--ink-soft); }
.callout--amber { border-left-color: var(--amber-ink); background: var(--amber-bg); border-color: var(--amber-border); color: var(--amber-ink); }
.callout h3, .callout strong { color: inherit; }
.callout h3 { font-size: 15px; margin-bottom: 4px; }

/* ---------- QC gallery ---------- */
.qc-section { margin-top: 26px; }
.qc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.qc-grid > * { min-width: 0; }
.qc-grid figure { margin: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.qc-grid .qc-cell { aspect-ratio: 1 / 1; }
.qc-grid img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- agent list ---------- */
.agentlist { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.agentlist li { font-size: 13px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-soft); }

/* ---------- data table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.data { border-collapse: collapse; width: 100%; min-width: 460px; font-size: 14px; }
table.data th, table.data td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { background: var(--surface-2); font-weight: 600; }
table.data tr:last-child td { border-bottom: none; }

/* ---------- faq ---------- */
.faq { display: flex; flex-direction: column; gap: 12px; max-width: var(--prose); }
.faq details { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 4px 16px; }
.faq summary { font-weight: 600; font-size: 16px; padding: 12px 0; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--muted); font-weight: 400; }
.faq details[open] summary::after { content: "\2013"; }
.faq details > p { padding-bottom: 14px; color: var(--ink-soft); font-size: 15px; }

/* ---------- meta list ---------- */
.metalist { display: grid; grid-template-columns: max-content 1fr; gap: 4px 18px; font-size: 14px; }
.metalist dt { color: var(--muted); }
.metalist dd { margin: 0; color: var(--ink-soft); }

/* ---------- footer ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); margin-top: 8px; }
.site-footer__inner { padding-block: 34px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.footer-grid > * { min-width: 0; }
.footer-col h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 12px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.footer-col a { font-size: 14px; text-decoration: none; color: var(--ink-soft); }
.footer-col a:hover { color: var(--accent-ink); }
.footer-about p { font-size: 14px; color: var(--muted); line-height: 1.6; max-width: 42ch; }
.footer-about .brand { margin-bottom: 10px; }
.footer-bottom { border-top: 1px solid var(--line); margin-top: 26px; padding-top: 18px; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between; }
.footer-note { max-width: 70ch; }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding-block: 60px; }
.notfound h1 { font-size: 40px; margin-bottom: 12px; }
.notfound p { color: var(--ink-soft); max-width: 48ch; margin-inline: auto; }
.notfound .btn { margin-top: 20px; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; gap: 26px; }
  .product { grid-template-columns: 1fr; gap: 24px; }
  .cards--3 { grid-template-columns: repeat(2, 1fr); }
  .grid-products { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-about { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  :root { --section-gap: 40px; --grid-gap: 14px; --card-pad: 14px; }
  h1 { font-size: 32px; line-height: 1.2; }
  h2 { font-size: 22px; }
  h3 { font-size: 16px; }
  body { font-size: 15px; line-height: 1.6; }
  p, li { font-size: 15px; }
  .hero__lead { font-size: 16px; }
  .product__info h1 { font-size: 28px; }

  .mainnav { display: none; }
  .mainnav--open { display: flex; flex-direction: column; align-items: stretch; gap: 0; position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); z-index: 90; }
  .mainnav--open ul { flex-direction: column; align-items: stretch; gap: 0; padding: 6px 0; }
  .mainnav--open li { border-top: 1px solid var(--line); }
  .mainnav--open li:first-child { border-top: none; }
  .mainnav--open a { display: block; padding: 12px 20px; }
  .mainnav--open .searchform { width: auto; padding: 12px 20px; border-top: 1px solid var(--line); }
  .nav-toggle { display: inline-flex; }
  .site-header__inner { position: relative; }

  .qc-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .grid-products { grid-template-columns: repeat(2, 1fr); }
  .cards--3, .cards--2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; }
  .hero__actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
