/* ==========================================================================
   components.css — 按钮 / 卡片 / 数据表 / Tabs / 徽标 / 面包屑 / 表单
   ========================================================================== */

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 46px;
  padding: var(--sp-3) var(--sp-6);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: .04em;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background-color var(--dur-2) var(--ease-out),
    border-color var(--dur-2) var(--ease-out),
    color var(--dur-2) var(--ease-out),
    transform var(--dur-1) var(--ease-out);
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; flex: none; }

.btn--primary {
  background: var(--ember-600);
  color: var(--white);
}
.btn--primary:hover { background: var(--ember-500); }

.btn--ghost-dark {
  background: transparent;
  color: var(--white);
  border-color: var(--line);
}
.btn--ghost-dark:hover { border-color: var(--steel-500); background: rgba(255,255,255,.05); }

.btn--ghost-light {
  background: transparent;
  color: var(--ember-600);
  border-color: var(--mist-300);
}
.btn--ghost-light:hover { border-color: var(--ember-600); background: var(--mist-100); }

.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); }

/* ---------- 徽标 / 参数标签 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 5px var(--sp-3);
  font-size: var(--fs-xs);
  font-weight: 700;
  font-family: var(--font-mono);
  border-radius: var(--r-full);
  border: 1px solid var(--line);
  color: var(--steel-300);
  white-space: nowrap;
}
.section--light .badge, .section--white .badge {
  border-color: var(--mist-300);
  color: var(--ink-700);
  background: var(--white);
}
.badge--ember { border-color: var(--ember-700); color: var(--ember-300); }
.badge--jade { border-color: var(--jade-600); color: var(--jade-400); }
.badge-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

/* ---------- 产品卡（深色区） ---------- */
.pcard {
  display: flex;
  flex-direction: column;
  background: var(--ink-800);
  border-radius: var(--r-lg);
  box-shadow: var(--elev-dark);
  overflow: hidden;
  transition:
    transform var(--dur-3) var(--ease-out),
    box-shadow var(--dur-3) var(--ease-out);
}
.pcard:hover { transform: translateY(-4px); box-shadow: var(--elev-dark-hover); }

/* 材质色卡：程序化 Canvas 颗粒场（无 JS 时退化为分层渐变，仍然好看） */
.pcard__swatch {
  position: relative;
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(120% 100% at 30% 15%, rgba(255,255,255,.22), transparent 60%),
    linear-gradient(150deg, var(--swatch, var(--ink-700)) 0%, rgba(0,0,0,.55) 100%);
  overflow: hidden;
}
.pcard__swatch canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.pcard__swatch::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10,13,16,.82), transparent 62%);
  pointer-events: none;
}
.pcard__body { padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3); flex: 1; }
.pcard__name { font-size: 1.125rem; font-weight: 800; color: var(--white); letter-spacing: .03em; }
.pcard__en { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; color: var(--steel-500); }
.pcard__spec {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--ember-300);
  letter-spacing: .02em;
}
.pcard__desc { font-size: var(--fs-sm); color: var(--steel-400); line-height: 1.65; }
.pcard__more {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--steel-300);
  transition: color var(--dur-2) var(--ease-out), gap var(--dur-2) var(--ease-out);
}
.pcard:hover .pcard__more { color: var(--ember-400); gap: var(--sp-3); }

/* ---------- 数据表 ----------
   移动端：外层 .table-scroll 横滑 + 首列 sticky + 两侧渐隐
   tabindex="0" 让键盘用户也能滚动表格 */
.table-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--r-md);
  border: 1px solid var(--mist-200);
  background: var(--white);
  mask-image: linear-gradient(to right, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
}
.section--dark .table-scroll, .section--darker .table-scroll {
  border-color: var(--line);
  background: var(--ink-800);
}
.table-scroll:focus-visible { outline-offset: 0; }

.dtable {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
.dtable caption {
  caption-side: top;
  text-align: left;
  padding: var(--sp-4) var(--sp-5) var(--sp-1);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--steel-500);
}
.dtable th, .dtable td {
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--mist-200);
  line-height: 1.55;
}
.section--dark .dtable th, .section--dark .dtable td,
.section--darker .dtable th, .section--darker .dtable td { border-bottom-color: var(--line-soft); }

.dtable thead th {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--steel-500);
  white-space: nowrap;
  background: var(--mist-050);
}
.section--dark .dtable thead th, .section--darker .dtable thead th { background: var(--ink-700); }

.dtable tbody th {
  font-weight: 700;
  color: var(--ink-800);
  white-space: nowrap;
  position: sticky;
  left: 0;
  background: var(--white);
  z-index: 1;
}
.section--dark .dtable tbody th, .section--darker .dtable tbody th {
  color: var(--white);
  background: var(--ink-800);
}
.dtable tbody tr:last-child th, .dtable tbody tr:last-child td { border-bottom: 0; }
.dtable tbody tr:hover td { background: var(--mist-050); }
.section--dark .dtable tbody tr:hover td, .section--darker .dtable tbody tr:hover td {
  background: rgba(255,255,255,.03);
}
.dtable tr[aria-current="true"] td, .dtable tr[aria-current="true"] th {
  background: rgba(224,140,58,.12) !important;
  color: var(--ember-300);
}
.dtable td small { display: block; color: var(--steel-500); font-size: .8125rem; }
.table-note {
  margin-top: var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--steel-500);
}

/* ---------- Tabs ----------
   无 JS 时所有 panel 可见（隐藏由 .js 守卫），退化为顺序排列的多张表 */
.tabs__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
  border-bottom: 1px solid var(--mist-200);
  padding-bottom: var(--sp-3);
}
.tab {
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--steel-500);
  border: 1px solid transparent;
  border-radius: var(--r-full);
  transition: color var(--dur-2) var(--ease-out), background-color var(--dur-2) var(--ease-out),
              border-color var(--dur-2) var(--ease-out);
}
.tab:hover { color: var(--ink-800); background: var(--white); }
.tab[aria-selected="true"] {
  color: var(--white);
  background: var(--ember-600);
  border-color: var(--ember-600);
}
.js .tabs__panel[hidden] { display: none; }
/* 无 JS 时：tab 按钮点了没反应，直接隐藏；所有 panel 全部展开，
   退化成顺序排列的多张表，内容不丢失。
   注意必须显式覆盖 UA 样式的 [hidden]{display:none}，光靠 .js 守卫不够。 */
html:not(.js) .tabs__list { display: none; }
html:not(.js) .tabs__panel[hidden] { display: block; }
html:not(.js) .tabs__panel + .tabs__panel { margin-top: var(--sp-8); }
.tabs__panel-title {
  margin-bottom: var(--sp-4);
  font-size: var(--fs-h3);
  font-weight: 800;
  color: var(--ink-900);
}
/* 无 JS 时把 panel 标题显出来做区隔 */
.tabs__panel-title { display: block; }
.js .tabs__panel-title { display: none; }

/* ---------- FAQ（原生 details，零 JS 可展开） ---------- */
.faq { display: grid; gap: var(--sp-3); }
.faq details {
  border: 1px solid var(--mist-200);
  border-radius: var(--r-md);
  background: var(--white);
  overflow: hidden;
}
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::marker { content: ""; }
.faq summary svg {
  width: 18px; height: 18px; flex: none;
  color: var(--ember-600);
  transition: transform var(--dur-3) var(--ease-out);
}
.faq details[open] summary svg { transform: rotate(45deg); }
.faq__body { padding: 0 var(--sp-5) var(--sp-5); color: var(--ink-700); }

/* ---------- 统计数字 ---------- */
.stats {
  display: grid;
  gap: var(--sp-5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
}
.stat { display: flex; flex-direction: column; gap: var(--sp-1); }
.stat__num {
  font-size: clamp(2rem, 1.4rem + 2vw, 2.75rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.01em;
  color: var(--white);
  white-space: nowrap;
}
.section--light .stat__num, .section--white .stat__num { color: var(--ink-900); }
.stat__num small { font-size: .5em; font-weight: 700; margin-left: 2px; color: var(--ember-400); }
.section--light .stat__num small, .section--white .stat__num small { color: var(--ember-600); }
.stat__label { font-size: var(--fs-xs); letter-spacing: .06em; color: var(--steel-500); }

/* ---------- 特性列表（为什么选择我们） ---------- */
.feature { display: flex; flex-direction: column; gap: var(--sp-3); }
.feature__idx {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--ember-500);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--line);
}
.section--light .feature__idx, .section--white .feature__idx {
  color: var(--ember-600);
  border-bottom-color: var(--mist-300);
}
.feature__title { font-size: var(--fs-h3); font-weight: 800; color: var(--white); }
.section--light .feature__title, .section--white .feature__title { color: var(--ink-900); }
.feature__text { font-size: var(--fs-sm); color: var(--steel-400); line-height: 1.7; }
.section--light .feature__text, .section--white .feature__text { color: var(--ink-700); }

/* ---------- 应用领域图标卡 ---------- */
.appcard {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-5);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: border-color var(--dur-2) var(--ease-out), background-color var(--dur-2) var(--ease-out);
}
.appcard:hover { border-color: var(--ember-600); background: rgba(255,255,255,.03); }
.appcard__icon { width: 34px; height: 34px; color: var(--steel-400); flex: none; }
.appcard__icon path, .appcard__icon circle, .appcard__icon rect, .appcard__icon line {
  transition: stroke var(--dur-3) var(--ease-out);
}
.appcard:hover .appcard__icon { color: var(--ember-400); }
.appcard__name { font-size: 1.0625rem; font-weight: 700; color: var(--white); }
.appcard__text { font-size: var(--fs-sm); color: var(--steel-400); line-height: 1.6; }
.appcard__mat { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--ember-300); }

/* ---------- 面包屑 ---------- */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-xs);
  color: var(--steel-500);
  padding-block: var(--sp-5);
}
.crumbs a { color: var(--steel-400); }
.crumbs a:hover { color: var(--ember-400); }
.crumbs li { display: flex; align-items: center; gap: var(--sp-2); }
.crumbs li + li::before { content: "/"; color: var(--line); }
.crumbs [aria-current="page"] { color: var(--white); font-weight: 600; }

/* ---------- 表单控件 ---------- */
.field { display: grid; gap: var(--sp-2); }
.field__label { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; color: var(--steel-400); }
.section--light .field__label, .section--white .field__label { color: var(--ink-700); }

.input, .select, .textarea {
  width: 100%;
  min-height: 46px;
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-sm);
  color: var(--ink-800);
  background: var(--white);
  border: 1px solid var(--mist-300);
  border-radius: var(--r-sm);
  transition: border-color var(--dur-2) var(--ease-out);
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--ember-600); }
.textarea { min-height: 120px; resize: vertical; line-height: 1.7; font-family: var(--font-mono); }

.check {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--mist-200);
  border-radius: var(--r-sm);
  cursor: pointer;
  background: var(--white);
  transition: border-color var(--dur-2) var(--ease-out);
}
.check:hover { border-color: var(--ember-600); }
.check input { width: 18px; height: 18px; margin-top: 3px; flex: none; accent-color: var(--ember-600); }
.check__name { font-weight: 700; font-size: var(--fs-sm); }
.check__spec { display: block; font-size: var(--fs-xs); color: var(--steel-500); font-family: var(--font-mono); }

/* 滑块（粒度探索器） */
.range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 34px;
  background: transparent;
  cursor: pointer;
}
.range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--ember-600), var(--steel-500));
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  margin-top: -9px;
  border-radius: var(--r-full);
  background: var(--white);
  border: 3px solid var(--ember-500);
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.range::-moz-range-track {
  height: 4px;
  border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--ember-600), var(--steel-500));
}
.range::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: var(--r-full);
  background: var(--white);
  border: 3px solid var(--ember-500);
}

/* 状态提示（role=status） */
.status-msg {
  min-height: 22px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--jade-500);
}
.status-msg[data-tone="error"] { color: var(--ember-500); }

/* ---------- 询价清单生成器 ---------- */
.inq { display: grid; gap: var(--sp-7); }
.inq fieldset { border: 0; padding: 0; margin: 0; }
.inq legend {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ember-600);
  margin-bottom: var(--sp-4);
}
.inq-rows { display: grid; gap: var(--sp-3); }
.inq-row { display: grid; gap: var(--sp-2); align-items: start; }
@media (min-width: 760px) {
  .inq-row { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, .8fr); gap: var(--sp-3); }
}
.inq-row .input:disabled { background: var(--mist-100); color: var(--steel-500); cursor: not-allowed; }
.inq-fields {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}
.inq-out {
  width: 100%;
  min-height: 190px;
  padding: var(--sp-4);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  line-height: 1.7;
  color: var(--ink-800);
  background: var(--mist-050);
  border: 1px solid var(--mist-300);
  border-radius: var(--r-sm);
  resize: vertical;
}
.inq-out:focus { border-color: var(--ember-600); }

/* ---------- 联系方式大卡 ---------- */
.ccards {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}
.ccard {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-5);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .02);
}
.ccard__k { font-size: var(--fs-xs); letter-spacing: .1em; color: var(--steel-500); }
.ccard__v { font-size: 1.125rem; font-weight: 800; color: var(--white); line-height: 1.45; }
.ccard__v a { color: var(--ember-400); font-family: var(--font-mono); }
.ccard__note { font-size: var(--fs-xs); color: var(--steel-500); }
.ccard__note button {
  color: var(--ember-400);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- 区位简图 ---------- */
.map-svg {
  width: 100%;
  height: auto;
  border: 1px solid var(--mist-200);
  border-radius: var(--r-lg);
  background: var(--mist-050);
}

