/* e替代 (etidai.com) — Industrial Precision Design System */
:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-subtle: #f1f5f9;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --brand: #0b5ed7;
  --brand-hover: #094db1;
  --brand-soft: #eff6ff;
  --brand-border: #bfdbfe;
  --teal: #0f766e;
  --teal-soft: #f0fdfa;
  --teal-border: #99f6e4;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --amber-border: #fde68a;
  --danger: #be123c;
  --danger-soft: #fff1f2;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 28px rgba(15, 23, 42, 0.09);
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --max-w: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }

.wrap {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

/* Top Utility Strip */
.topbar {
  background: #0f172a;
  color: #cbd5e1;
  font-size: 12.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.topbar-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 36px;
  padding: 6px 0;
  flex-wrap: wrap;
}
.topbar-left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.topbar-right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.topbar a { color: #e2e8f0; }
.topbar a:hover { color: #ffffff; text-decoration: none; }
.topbar-sep { opacity: 0.35; }

/* Main Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 66px;
}
.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
}
.brand-link:hover { text-decoration: none; }
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--brand);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.04em;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.16);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: 0.02em; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.main-nav a {
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: 14.5px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}
.main-nav a:hover {
  background: var(--surface-subtle);
  color: var(--ink);
  text-decoration: none;
}
.main-nav a.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.cart-btn:hover { border-color: var(--brand); color: var(--brand); box-shadow: var(--shadow-xs); }
.cart-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--brand);
  color: #ffffff;
  font-size: 12px;
  font-family: var(--font-mono);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.menu-toggle {
  display: none;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(11, 94, 215, 0.25);
}
.btn-primary:hover { background: var(--brand-hover); color: #ffffff; }
.btn-dark {
  background: var(--ink);
  color: #ffffff;
}
.btn-dark:hover { background: #1e293b; color: #ffffff; }
.btn-outline {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-outline:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--surface-subtle); color: var(--ink); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-xs { padding: 4px 8px; font-size: 12px; }

/* Hero Search Section */
.hero {
  background: linear-gradient(180deg, #ffffff 0%, #f6f8fb 100%);
  border-bottom: 1px solid var(--line);
  padding: 40px 0 36px;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.85fr);
  gap: 28px;
  align-items: start;
}
.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(26px, 3.2vw, 36px);
  line-height: 1.22;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.hero-lead {
  margin: 0 0 22px;
  color: var(--ink-2);
  font-size: 15.5px;
  max-width: 66ch;
}

.search-box {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 6px;
  display: flex;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search-box:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11, 94, 215, 0.12);
}
.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  padding: 10px 12px;
  font-size: 15px;
  background: transparent;
}
.search-box input::placeholder { color: #94a3b8; }

.quick-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--muted);
}
.quick-tag {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: 5px;
  padding: 3px 9px;
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.quick-tag:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

.hero-side-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-xs);
}
.hero-side-card h2 {
  margin: 0 0 6px;
  font-size: 16.5px;
  color: var(--ink);
}
.hero-side-card p {
  margin: 0 0 14px;
  font-size: 13.5px;
  color: var(--muted);
}
.mini-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-2);
}
.mini-steps li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.step-num {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: var(--brand-soft);
  color: var(--brand);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Metrics Strip */
.metrics-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}
.metric-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.metric-val {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}
.metric-lbl {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 3px;
}

/* Sections */
.section { padding: 36px 0; }
.section-tight { padding: 24px 0; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.section-head h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.section-desc {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

/* Tabs & Filters */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.tab-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tab-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tab-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.tab-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
}
.tab-count {
  font-family: var(--font-mono);
  font-size: 11.5px;
  opacity: 0.78;
  margin-left: 4px;
}
.filter-meta {
  font-size: 13px;
  color: var(--muted);
}

/* Data Table */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.data-table th {
  text-align: left;
  padding: 11px 14px;
  background: var(--surface-subtle);
  color: var(--ink-2);
  font-weight: 600;
  font-size: 12.5px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #f8fafc; }

.part-code {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
  background: var(--surface-subtle);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--line);
  display: inline-block;
  cursor: pointer;
}
.part-code:hover { border-color: var(--brand); color: var(--brand); }
.part-code.ft {
  background: var(--brand-soft);
  border-color: var(--brand-border);
  color: var(--brand);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-cat { background: var(--surface-subtle); color: var(--ink-2); border: 1px solid var(--line); }
.badge-exact { background: var(--teal-soft); color: var(--teal); border: 1px solid var(--teal-border); }
.badge-family { background: var(--amber-soft); color: var(--amber); border: 1px solid var(--amber-border); }
.badge-manual { background: var(--danger-soft); color: var(--danger); border: 1px solid #fecdd3; }

.spec-cell { color: var(--ink-2); max-width: 320px; }
.action-cell { white-space: nowrap; display: flex; gap: 6px; align-items: center; }

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface-subtle);
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 10px;
}

/* Cards & Grids */
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.card h3 { margin: 0 0 8px; font-size: 16.5px; color: var(--ink); }
.card p { margin: 0 0 12px; font-size: 13.5px; color: var(--ink-2); }
.card-kicker {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.brand-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.brand-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
.brand-card-name { font-weight: 600; font-size: 14.5px; color: var(--ink); }
.brand-card-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.brand-card-num {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 3px 8px;
  border-radius: 5px;
  flex-shrink: 0;
}

/* BOM Tool */
.bom-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.55fr);
  gap: 20px;
  align-items: start;
}
.bom-textarea {
  width: 100%;
  min-height: 190px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  resize: vertical;
  background: var(--surface);
}
.bom-textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11, 94, 215, 0.12);
}
.bom-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.dropzone {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--surface-subtle);
  font-size: 13px;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  cursor: pointer;
}
.dropzone.dragover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}
.progress-track {
  width: 100%;
  height: 10px;
  background: var(--surface-subtle);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
  margin: 10px 0 14px;
}
.progress-fill {
  height: 100%;
  background: var(--teal);
  width: 0%;
  transition: width 0.35s ease;
}

/* Breadcrumb & Page Banner */
.page-banner {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 28px 0 24px;
}
.breadcrumb {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.page-banner h1 {
  margin: 0 0 8px;
  font-size: clamp(22px, 2.8vw, 30px);
  letter-spacing: -0.02em;
}
.page-banner p {
  margin: 0;
  color: var(--ink-2);
  max-width: 72ch;
}

/* FAQ */
.faq-list { display: grid; gap: 10px; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--muted);
}
.faq-item[open] summary::after { content: "−"; color: var(--brand); }
.faq-item p {
  margin: 10px 0 0;
  color: var(--ink-2);
  font-size: 14px;
}

/* Notice / Disclaimer */
.notice-box {
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--ink-2);
}

/* Forms */
.form-grid { display: grid; gap: 12px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 5px;
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 14px;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11, 94, 215, 0.12);
}

/* Sample Cart Drawer */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(460px, 100vw);
  background: var(--surface);
  z-index: 100;
  box-shadow: -8px 0 32px rgba(15, 23, 42, 0.16);
  transform: translateX(100%);
  transition: transform 0.22s ease;
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-hd {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.drawer-hd h3 { margin: 0; font-size: 16.5px; }
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
}
.cart-list { display: grid; gap: 8px; margin-bottom: 18px; }
.cart-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg);
}
.cart-item-title { font-family: var(--font-mono); font-size: 13px; font-weight: 600; }
.cart-item-sub { font-size: 12px; color: var(--muted); }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: #0f172a;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  z-index: 120;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  box-shadow: var(--shadow-md);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Footer */
.site-footer {
  background: #0f172a;
  color: #cbd5e1;
  margin-top: 48px;
  padding: 40px 0 28px;
  font-size: 13.5px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.site-footer h4 {
  margin: 0 0 12px;
  font-size: 14px;
  color: #ffffff;
}
.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 7px;
}
.site-footer a { color: #94a3b8; }
.site-footer a:hover { color: #ffffff; text-decoration: none; }
.footer-bottom {
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: #94a3b8;
}

/* Responsive */
@media (max-width: 960px) {
  .hero-grid, .bom-layout, .footer-grid { grid-template-columns: 1fr; }
  .metrics-bar, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .main-nav {
    display: none;
    position: absolute;
    top: 66px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 12px 20px;
    flex-direction: column;
    align-items: stretch;
  }
  .main-nav.open { display: flex; }
  .menu-toggle { display: inline-flex; }
  .grid-3, .grid-2, .form-row-2 { grid-template-columns: 1fr; }
  .metrics-bar { grid-template-columns: 1fr 1fr; }
  .search-box { flex-direction: column; }
}
