/* 视觉规范对齐 smartx.com（榫卯 AI 平台产品页）：SMTX/Inter 字体、#0080ff 主色、胶囊按钮、浅蓝渐变头图。 */

@font-face {
  font-family: SMTX;
  font-weight: 400;
  font-display: fallback;
  src: url(https://cdn.smartx.com/inc/font/SMTX/woff2/SMTX-Regular.woff2) format("woff2");
}
@font-face {
  font-family: SMTX;
  font-weight: 500;
  font-display: fallback;
  src: url(https://cdn.smartx.com/inc/font/SMTX/woff2/SMTX-Medium.woff2) format("woff2");
}
@font-face {
  font-family: SMTX;
  font-weight: 600;
  font-display: fallback;
  src: url(https://cdn.smartx.com/inc/font/SMTX/woff2/SMTX-SemiBold.woff2) format("woff2");
}
@font-face {
  font-family: Inter;
  font-weight: 400;
  font-display: swap;
  src: url(https://cdn.smartx.com/inc/font/Inter/Inter-Regular.woff2) format("woff2");
}

:root {
  --blue-primary: #0080ff;
  --blue-hover: #0070e0;
  --blue-secondary: #009dff;
  --blue-dark: #1d326c;
  --blue-light-10: rgba(0, 136, 255, 0.1);
  --blue-light-20: rgba(0, 136, 255, 0.2);
  --blue-section-bg: #e5f4ff;
  --green: #25c764;
  --orange: #ff9f0a;
  --text-primary: #00122e;
  --text-soft: #2a416b;
  --text-secondary: #5a6779;
  --text-tertiary: #8e9aa9;
  --gray-border: rgba(211, 218, 235, 0.8);
  --gray-section-bg: #f2f5fa;
  --gray-fill: #edf0f7;
  --white: #ffffff;
  --shadow-card: 0 6px 24px -8px rgba(107, 128, 167, 0.6);
  --shadow-drawer: 0 8px 32px rgba(10, 37, 85, 0.25);
  --font: SMTX, Inter, "PingFang SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  --radius-card: 16px;
  --gutter: 24px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

body.drawer-open {
  overflow: hidden;
}

a {
  color: var(--blue-primary);
  text-decoration: none;
}

h1,
h2,
h3,
p,
dl,
dd {
  margin: 0;
}

code,
pre {
  font-family: var(--mono);
}

svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 16px;
  border: 2px solid transparent;
  border-radius: 9999px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.button-primary {
  color: var(--white);
  background: var(--blue-primary);
}

.button-primary:hover {
  background: var(--blue-hover);
}

.button-tertiary {
  color: var(--blue-primary);
  background: transparent;
  border-color: var(--blue-light-20);
}

.button-tertiary:hover {
  border-color: var(--blue-primary);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.icon-button:hover {
  background: var(--gray-fill);
  color: var(--text-primary);
}

.icon-button svg {
  width: 20px;
  height: 20px;
}

/* ---------- header ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  box-shadow: inset 0 -1px var(--gray-border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
}

.brand-name {
  font-size: 16px;
  font-weight: 600;
}

.brand-sep {
  width: 1px;
  height: 16px;
  background: var(--gray-border);
}

.brand-sub {
  color: var(--text-secondary);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.topnav > a:not(.button) {
  color: var(--text-primary);
}

.topnav > a:not(.button):hover {
  color: var(--blue-primary);
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background:
    repeating-radial-gradient(circle at 92% 30%, transparent 0 22px, rgba(255, 255, 255, 0.5) 22px 23px),
    linear-gradient(120deg, #dfeaff 0%, #eef4ff 45%, #e6e6fb 100%);
}

.hero::after {
  /* 产品页头图的同心圆纹理只在右侧出现，左侧用渐变遮住保证文字区干净 */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #e3ecff 0%, rgba(227, 236, 255, 0.92) 45%, rgba(227, 236, 255, 0) 80%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  padding-top: 72px;
  padding-bottom: 64px;
}

.eyebrow {
  color: var(--blue-primary);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}

.hero h1 {
  font-size: 44px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--text-primary);
}

.hero-desc {
  max-width: 720px;
  margin-top: 20px;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-soft);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 48px;
  margin-top: 36px;
}

.hero-stats div {
  display: flex;
  flex-direction: column-reverse;
}

.hero-stats dt {
  color: var(--text-secondary);
  font-size: 14px;
}

.hero-stats dd {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--blue-dark);
}

/* ---------- steps ---------- */

.steps {
  background: var(--gray-section-bg);
  border-bottom: 1px solid var(--gray-border);
}

.steps-inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gutter);
  padding-top: 28px;
  padding-bottom: 28px;
}

.step {
  display: flex;
  gap: 14px;
}

.step-no {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--blue-primary);
}

.step h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--blue-dark);
  margin-bottom: 4px;
}

.step p {
  color: var(--text-secondary);
}

/* ---------- toolbar ---------- */

.catalog {
  padding-top: 40px;
  padding-bottom: 80px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
}

.search {
  position: relative;
  flex: 1 1 280px;
  max-width: 420px;
}

.search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
}

.search input {
  width: 100%;
  height: 40px;
  padding: 0 16px 0 40px;
  border: 1px solid var(--gray-border);
  border-radius: 9999px;
  font: inherit;
  color: var(--text-primary);
  background: var(--white);
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.search input:focus {
  border-color: var(--blue-primary);
  box-shadow: 0 0 0 3px var(--blue-light-10);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-label {
  color: var(--text-secondary);
}

.chip {
  padding: 4px 14px;
  border: 1px solid var(--gray-border);
  border-radius: 9999px;
  background: var(--white);
  color: var(--text-soft);
  font: inherit;
  cursor: pointer;
  transition: all 0.12s ease;
}

.chip:hover {
  border-color: var(--blue-primary);
  color: var(--blue-primary);
}

.chip[aria-pressed="true"] {
  border-color: var(--blue-primary);
  background: var(--blue-primary);
  color: var(--white);
}

.result-count {
  margin: 20px 0 16px;
  color: var(--text-tertiary);
}

/* ---------- cards ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr));
  gap: var(--gutter);
}

.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-card);
  background: var(--white);
  cursor: pointer;
  transition: box-shadow 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.card:hover,
.card:focus-visible {
  border-color: var(--blue-light-20);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
  outline: none;
}

.card-engine {
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--blue-primary);
  overflow-wrap: anywhere;
}

.card h3 {
  font-size: 20px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--blue-dark);
  word-break: break-word;
}

.card-model {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-tertiary);
  word-break: break-all;
}

.card-desc {
  margin-top: 12px;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-specs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 20px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--gray-section-bg);
}

.card-specs dt {
  font-size: 12px;
  color: var(--text-tertiary);
}

.card-specs dd {
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 20px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 10px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 20px;
  white-space: nowrap;
  background: var(--gray-fill);
  color: var(--text-soft);
}

.tag-ascend {
  background: #fff3e0;
  color: #b25e00;
}

.tag-nvidia {
  background: #e7f8ee;
  color: #138a43;
}

.tag-warn {
  background: #fff3e0;
  color: #b25e00;
}

.tag-mono {
  font-family: var(--mono);
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--blue-primary);
  font-weight: 600;
  white-space: nowrap;
}

.empty {
  padding: 80px 0;
  text-align: center;
  color: var(--text-tertiary);
}

/* ---------- footer ---------- */

.footer {
  background: var(--blue-dark);
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 28px;
  padding-bottom: 28px;
}

/* ---------- drawer ---------- */

.drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 18, 46, 0.4);
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  width: min(820px, 100%);
  background: var(--white);
  box-shadow: var(--shadow-drawer);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.24s ease, visibility 0s linear 0.24s;
}

.drawer.open {
  transform: none;
  visibility: visible;
  transition: transform 0.24s ease;
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 32px 0;
}

.drawer-head .eyebrow {
  margin-bottom: 4px;
}

.drawer-head h2 {
  font-size: 28px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
}

.tabs {
  display: flex;
  gap: 28px;
  padding: 0 32px;
  margin-top: 16px;
  box-shadow: inset 0 -1px var(--gray-border);
}

.tabs button {
  padding: 10px 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  font: inherit;
  font-size: 15px;
  color: var(--text-secondary);
  cursor: pointer;
}

.tabs button[aria-selected="true"] {
  border-bottom-color: var(--blue-primary);
  color: var(--blue-primary);
  font-weight: 600;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px 40px;
}

.section + .section {
  margin-top: 32px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--blue-dark);
  margin-bottom: 12px;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px 24px;
}

.facts dt {
  font-size: 12px;
  color: var(--text-tertiary);
}

.facts dd {
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.variant {
  padding: 16px 20px;
  border: 1px solid var(--gray-border);
  border-radius: 12px;
}

.variant + .variant {
  margin-top: 12px;
}

.variant-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.variant-name {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
}

.variant-desc {
  margin-top: 8px;
  color: var(--text-secondary);
}

.variant .facts {
  margin-top: 12px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.feature-group + .feature-group {
  margin-top: 16px;
}

.feature-group-name {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 16px;
  padding: 10px 0;
  border-top: 1px solid var(--gray-border);
}

.feature-name {
  font-weight: 600;
}

.feature-name code {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-tertiary);
}

.feature-desc {
  grid-column: 1 / -1;
  color: var(--text-secondary);
}

.kv {
  margin: 0;
  padding: 16px 20px;
  border-radius: 12px;
  background: var(--gray-section-bg);
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre;
}

.yaml-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.yaml-actions .hint {
  color: var(--text-tertiary);
  font-family: var(--mono);
  font-size: 12px;
}

.yaml {
  margin: 0;
  padding: 20px;
  border-radius: 12px;
  background: #0d1b3a;
  color: #dbe4f5;
  font-size: 12.5px;
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre;
  tab-size: 2;
}

.yaml .y-key {
  color: #7cc4ff;
}

.yaml .y-str {
  color: #a8e6a3;
}

.yaml .y-com {
  color: #7d8aa6;
  font-style: italic;
}

.yaml .y-doc {
  color: #ffb86b;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  z-index: 60;
  padding: 8px 18px;
  border-radius: 9999px;
  background: var(--text-primary);
  color: var(--white);
  transform: translate(-50%, 20px);
  opacity: 0;
  transition: all 0.2s ease;
  pointer-events: none;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  .steps-inner {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (max-width: 640px) {
  :root {
    --gutter: 16px;
  }

  .brand-sep,
  .brand-sub,
  .topnav > a:not(.button) {
    display: none;
  }

  .hero-inner {
    padding-top: 44px;
    padding-bottom: 40px;
  }

  .hero h1 {
    font-size: 30px;
  }

  .hero-desc {
    font-size: 15px;
  }

  .hero-stats {
    gap: 16px 32px;
  }

  .hero-stats dd {
    font-size: 22px;
  }

  .card {
    padding: 20px;
  }

  .drawer-head,
  .drawer-body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .tabs {
    padding: 0 16px;
  }

  .drawer-head h2 {
    font-size: 22px;
  }
}
