/* SZ Hardware Hub — dark industrial theme (夜游 recipe values) */
:root {
  --bg: #0b0f1a;
  --card: #151b2b;
  --text: #e8ecf5;
  --muted: #9aa4b8;
  --primary: #6a48f0;
  --primary-hover: #5a38d6;
  --accent: #22d3ee;
  --border: #26304a;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  --radius: 12px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .06);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, .08);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

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

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.2;
  margin: 0 0 16px;
}
h1 { font-size: 48px; letter-spacing: -.01em; }
h2 { font-size: 28px; }
h3 { font-size: 22px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-row {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}
.brand:hover { text-decoration: none; color: var(--accent); }
.brand-mark { width: 22px; height: 22px; color: var(--accent); flex: none; }
.site-nav {
  display: flex;
  gap: 24px;
  margin-left: auto;
}
.site-nav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 0;
}
.site-nav a:hover { color: var(--text); text-decoration: none; }
.nav-toggle {
  display: none;
  margin-left: auto;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  min-height: 44px;
  cursor: pointer;
}

/* Hero — the one themed motif of this site: PCB traces */
.hero {
  position: relative;
  padding: 64px 0 48px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='560' height='360' viewBox='0 0 560 360'%3E%3Cg fill='none' stroke='%2322d3ee' stroke-width='1.2'%3E%3Cpath d='M20 320h120l40-40h90'/%3E%3Cpath d='M20 60h100l30 30h140l30-30h150'/%3E%3Cpath d='M110 180h80l40 40h130'/%3E%3Cpath d='M470 300v-80l-40-40'/%3E%3Cpath d='M540 40h-90l-30 30h-60'/%3E%3C/g%3E%3Cg fill='%2322d3ee'%3E%3Ccircle cx='20' cy='320' r='3'/%3E%3Ccircle cx='270' cy='280' r='3'/%3E%3Ccircle cx='540' cy='40' r='3'/%3E%3Ccircle cx='110' cy='180' r='3'/%3E%3Ccircle cx='360' cy='220' r='3'/%3E%3Ccircle cx='470' cy='300' r='3'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right -60px bottom -40px;
  opacity: .16;
  pointer-events: none;
}
.hero > .container { position: relative; }
.kicker {
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: 0 0 16px;
}
.hero h1 { max-width: 21ch; margin-bottom: 16px; }
.hero-sub {
  color: var(--muted);
  font-size: 18px;
  max-width: 70ch;
  margin: 0 0 24px;
}
.hero-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

/* Facts strip */
.facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.fact {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-1);
}
.fact-k {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 4px;
}
.fact-v { font-size: 14px; font-weight: 600; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-1); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Breadcrumbs */
.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 24px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); text-decoration: none; }
.crumb-sep { color: var(--border); }

/* Prose */
.prose { padding-top: 32px; padding-bottom: 48px; }
.prose h1 { margin-bottom: 24px; }
.prose h2 {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.prose h3 { margin-top: 32px; }
.prose p, .prose ul, .prose ol {
  max-width: 70ch;
  color: var(--text);
}
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 24px; }
.prose li { margin-bottom: 8px; }
.prose strong { font-weight: 600; }
.prose .lede {
  font-size: 18px;
  color: var(--muted);
}
.prose-narrow { max-width: 800px; }
.prose-after { padding-top: 0; }

/* Callout */
.callout {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 24px;
  margin: 24px 0;
  max-width: 70ch;
  box-shadow: var(--shadow-1);
}
.callout p:last-child { margin-bottom: 0; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 24px 0; max-width: 100%; }
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 520px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 14px;
}
th, td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: rgba(34, 211, 238, .06);
}
tr:last-child td { border-bottom: none; }
td strong { color: var(--accent); }

/* Entry cards (guide list on homepage) */
.entries {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 24px 0;
}
.entry {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-1);
}
.entry:hover { border-color: var(--accent); text-decoration: none; }
.entry-k {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 0 0 8px;
}
.entry-t {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px;
}
.entry:hover .entry-t { color: var(--accent); }
.entry-d { color: var(--muted); font-size: 14px; margin: 0; }

/* Numbered building list */
.stack { counter-reset: step; margin: 24px 0; padding: 0; list-style: none; }
.stack > li {
  counter-increment: step;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-1);
}
.stack > li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  display: block;
  margin-bottom: 8px;
}
.stack h3 { margin: 0 0 8px; font-size: 22px; }
.stack p { color: var(--muted); margin: 0 0 8px; }
.stack p:last-child { margin-bottom: 0; }
.stack .where { color: var(--text); font-weight: 600; font-size: 14px; }

/* Service panels (two wide, unequal treatment) */
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin: 24px 0;
  box-shadow: var(--shadow-2);
}
.panel h3 { margin-top: 0; }
.panel p { color: var(--muted); }
.panel ul { color: var(--muted); }
.panel .btn { margin-top: 8px; }

/* FAQ */
.faq { margin-top: 48px; }
.faq h2 {
  border-top: 1px solid var(--border);
  padding-top: 24px;
}
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  margin-bottom: 12px;
  max-width: 70ch;
}
.faq-item summary {
  cursor: pointer;
  padding: 16px;
  font-weight: 600;
  font-size: 16px;
  list-style-position: inside;
}
.faq-item summary:hover { color: var(--accent); }
.faq-item p {
  padding: 0 16px 16px;
  margin: 0;
  color: var(--muted);
}

/* Tool shell */
.tool-shell {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  padding: 32px;
  margin: 8px 0 32px;
}
.pcba-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 24px;
  margin-bottom: 24px;
}
.pcba-grid label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
.pcba-grid input, .pcba-grid select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 12px;
  font-size: 16px;
  font-family: var(--font-body);
  min-height: 48px;
}
.pcba-grid input:focus, .pcba-grid select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.pcba-dims { display: flex; align-items: center; gap: 8px; }
.pcba-dims input { width: 90px; }
.pcba-out {
  border-top: 1px solid var(--border);
  padding-top: 24px;
}
.pcba-price {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 4px;
}
.pcba-sub { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.pcba-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  margin: 16px 0 0;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 48px;
  padding: 48px 0 32px;
  background: var(--card);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
}
.footer-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  margin: 0 0 8px;
}
.footer-note { color: var(--muted); font-size: 14px; max-width: 40ch; margin: 0; }
.footer-h {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 0 0 12px;
}
.footer-col a {
  display: block;
  color: var(--muted);
  font-size: 14px;
  padding: 4px 0;
}
.footer-col a:hover { color: var(--accent); text-decoration: none; }
.footer-base {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.footer-base p { color: var(--muted); font-size: 14px; margin: 0; }

/* Mobile */
@media (max-width: 640px) {
  .container { padding-left: 16px; padding-right: 16px; }
  h1 { font-size: 32px; }
  h2 { font-size: 22px; }
  h3 { font-size: 18px; }
  .hero { padding: 40px 0 32px; }
  .hero h1 { max-width: 100%; }
  .facts { grid-template-columns: 1fr 1fr; }
  .entries { grid-template-columns: 1fr; }
  .panel { padding: 24px; }
  .tool-shell { padding: 20px; }
  .pcba-grid { grid-template-columns: 1fr; }
  .btn { width: 100%; }
  .hero-cta { flex-direction: column; }
  .nav-toggle { display: inline-block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    padding: 8px 16px 16px;
    box-shadow: var(--shadow-2);
  }
  .site-nav a { padding: 12px 0; font-size: 16px; }
  .site-header.nav-open .site-nav { display: flex; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}
