/* dekooz 产品页共用样式：Genki 双足机器人、HX-25HM 舵机 */
:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #141a24;
  --muted: #5b6474;
  --border: #e2e5eb;
  --accent: #2357d8;
  --accent-text: #ffffff;
  --accent-soft: rgba(35, 87, 216, 0.08);
  --warn: #9a5b00;
  --warn-soft: rgba(214, 140, 0, 0.12);
  --ok: #0f7b4f;
  --photo-bg: #ffffff;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1016;
    --panel: #151a23;
    --text: #e8ecf2;
    --muted: #9aa4b4;
    --border: #262d3a;
    --accent: #6d97ff;
    --accent-text: #0b1020;
    --accent-soft: rgba(109, 151, 255, 0.12);
    --warn: #f0b44c;
    --warn-soft: rgba(240, 180, 76, 0.12);
    --ok: #3fcf8e;
    --photo-bg: #f4f5f7;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1016; --panel: #151a23; --text: #e8ecf2; --muted: #9aa4b4; --border: #262d3a;
  --accent: #6d97ff; --accent-text: #0b1020; --accent-soft: rgba(109, 151, 255, 0.12);
  --warn: #f0b44c; --warn-soft: rgba(240, 180, 76, 0.12); --ok: #3fcf8e; --photo-bg: #f4f5f7; --shadow: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
img { max-width: 100%; display: block; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* 顶栏 */
.topbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.topbar .wrap { display: flex; align-items: center; gap: 8px 20px; min-height: 56px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.brand { font-weight: 800; letter-spacing: .02em; color: var(--text); text-decoration: none; font-size: 18px; }
.nav { display: flex; gap: 4px 16px; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; padding: 4px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
.lang { margin-left: auto; font: inherit; font-size: 14px; padding: 4px 8px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--panel); color: var(--text); }

/* 首屏 */
.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; padding: 56px 0 40px; }
.eyebrow { color: var(--accent); font-weight: 600; font-size: 14px; letter-spacing: .04em; margin: 0 0 10px; }
.hero h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.12; margin: 0 0 16px; letter-spacing: -.01em; }
.lead { font-size: 18px; color: var(--muted); margin: 0 0 22px; max-width: 34em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 26px; padding: 0; list-style: none; }
.chips li { font-size: 14px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 10px; font-weight: 600; font-size: 15px;
  text-decoration: none; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text); cursor: pointer; font-family: inherit; }
.btn.secondary { background: transparent; color: var(--accent); }
.btn:hover { filter: brightness(1.06); }

.photo { background: var(--photo-bg); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--border); }
.photo img { width: 100%; height: 100%; object-fit: contain; }
.hero-photo { aspect-ratio: 3 / 4; max-height: 620px; margin-left: auto; width: 100%; }
.swatches { display: flex; align-items: center; gap: 10px; margin-top: 14px; justify-content: flex-end; font-size: 14px; color: var(--muted); }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; padding: 0; }
.swatch[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 2px; }
.swatch.white { background: #f2f2f0; }
.swatch.black { background: #1b1c1f; }
.photo-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.photo-pair .photo { aspect-ratio: 4 / 5; }

/* 区块 */
section.block { padding: 44px 0; border-top: 1px solid var(--border); scroll-margin-top: 64px; }
section.block h2 { font-size: clamp(24px, 3vw, 32px); margin: 0 0 8px; line-height: 1.25; }
section.block .sub { color: var(--muted); margin: 0 0 24px; max-width: 46em; }

/* 参数卡片 */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 18px 16px; box-shadow: var(--shadow); }
.card .label { color: var(--muted); font-size: 14px; margin: 0 0 6px; }
.card .value { font-size: 26px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.card .unit2 { font-size: 15px; font-weight: 500; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.card .note { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.disclaimer { margin: 18px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: 14px; }

/* 表格 */
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: none; }
thead th { font-size: 13px; color: var(--muted); font-weight: 600; background: color-mix(in srgb, var(--accent-soft) 40%, var(--panel)); }
.spec th { width: 30%; color: var(--muted); font-weight: 500; white-space: nowrap; }
.compare td:first-child { font-weight: 600; white-space: nowrap; }
.compare td.ours { color: var(--text); font-weight: 600; }
.compare td.theirs { color: var(--muted); }
code, .mono { font-family: ui-monospace, Consolas, monospace; font-size: 14px; }

/* 流程步骤 */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.steps li::before { counter-increment: step; content: counter(step, decimal-leading-zero); font-weight: 800; color: var(--accent); font-size: 14px; letter-spacing: .06em; }
.steps h3 { font-size: 18px; margin: 0; }
.steps p { margin: 0; color: var(--muted); font-size: 15px; flex: 1; }
.steps a { font-weight: 600; text-decoration: none; }
.steps a::after { content: " →"; }
.status-tag { align-self: flex-start; font-size: 13px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); }

/* 清单 */
.checklist { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px 24px; }
.checklist li { position: relative; padding-left: 28px; }
.checklist li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--ok); font-weight: 800; }
.fit { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fit .card h3 { margin: 0 0 10px; font-size: 18px; }
.fit ul { margin: 0; padding-left: 1.2em; color: var(--muted); }
.fit ul li { margin: 6px 0; }
.fit .no ul { list-style: "✕  "; }
.fit .yes ul { list-style: "✓  "; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-bottom: 20px; }
.features .card h3 { margin: 0 0 6px; font-size: 17px; }
.features .card p { margin: 0; color: var(--muted); font-size: 15px; }
.tags { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 0; }
.tags li { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; font-weight: 500; }
.bullets { margin: 0; padding-left: 1.2em; }
.bullets li { margin: 6px 0; }
.small { font-size: 14px; color: var(--muted); }

footer { border-top: 1px solid var(--border); padding: 28px 0 40px; color: var(--muted); font-size: 14px; }
footer p { margin: 4px 0; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 24px; padding-top: 32px; }
  .hero-photo { max-height: 520px; margin: 0 auto; }
  .swatches { justify-content: center; }
  .fit { grid-template-columns: 1fr; }
  .spec th { width: auto; white-space: normal; }
}
@media (max-width: 480px) {
  .lead { font-size: 16px; }
  th, td { padding: 10px 12px; }
  .photo-pair { grid-template-columns: 1fr; }
}

/* ---------------- 主站：首页、产品总览、工具页 ---------------- */
.hero.home { padding-bottom: 48px; }
.hero.home h1 { font-size: clamp(34px, 5.4vw, 58px); }
.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.product-card { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); color: inherit; text-decoration: none; }
a.product-card:hover { border-color: var(--accent); }
.product-card .media { aspect-ratio: 4 / 3; background: var(--photo-bg); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.product-card .media img { width: 100%; height: 100%; object-fit: cover; }
.product-card .media img.contain { object-fit: contain; padding: 12px; }
.product-card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-card h3 { margin: 0; font-size: 19px; }
.product-card p { margin: 0; color: var(--muted); font-size: 15px; flex: 1; }
.product-card .more { font-weight: 600; color: var(--accent); }
.product-card .more::after { content: " →"; }
.tag { align-self: flex-start; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; letter-spacing: .02em; }
.tag.live { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.tag.planned { background: var(--warn-soft); color: var(--warn); }
.tag.beta { background: var(--accent-soft); color: var(--accent); }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.tool-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 8px; color: inherit; text-decoration: none; }
a.tool-card:hover { border-color: var(--accent); }
.tool-card .icon { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; }
.tool-card .icon svg { width: 22px; height: 22px; }
.tool-card h3 { margin: 0; font-size: 18px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tool-card p { margin: 0; color: var(--muted); font-size: 15px; flex: 1; }
.tool-card .req { font-size: 13px; color: var(--muted); border-top: 1px dashed var(--border); padding-top: 8px; flex: 0; }
.tool-card .open { font-weight: 600; color: var(--accent); }
.tool-card .open::after { content: " →"; }
.page-head { padding: 48px 0 8px; }
.page-head h1 { font-size: clamp(30px, 4.4vw, 44px); margin: 0 0 10px; }
.page-head .lead { margin-bottom: 8px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 20px; margin-bottom: 16px; }
.footer-grid .brand { display: inline-block; margin-bottom: 6px; }
.footer-grid a { color: var(--muted); text-decoration: none; }
.footer-grid a:hover { color: var(--text); }
.footer-title { color: var(--text); font-weight: 600; }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }
/* 4 张卡片：宽屏一行 4 个，中等宽度 2×2，手机一列 */
.tool-grid, .product-grid.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1060px) { .tool-grid, .product-grid.four { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .tool-grid, .product-grid, .product-grid.four { grid-template-columns: 1fr; } }

/* ---------------- 主控板页：接口编号、排针表 ---------------- */
.board-figure { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: start; }
.board-photo { position: relative; }
.board-photo img { display: block; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--photo-bg); }
.marker { position: absolute; transform: translate(-50%, -50%); width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .9), 0 2px 6px rgba(0, 0, 0, .35); cursor: default; }
.legend-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.legend-list li { display: flex; gap: 10px; align-items: baseline; font-size: 15px; }
.legend-list .num { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; }
.legend-list .num.back { background: var(--muted); }
.pins td { padding: 6px 8px; vertical-align: middle; white-space: nowrap; }
.pins .pin-no { width: 34px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; background: color-mix(in srgb, var(--text) 6%, transparent); }
.pins .alt { white-space: normal; }
.pins .alt.left { text-align: right; }
.pin-name { display: inline-block; padding: 2px 8px; border-radius: 6px; font: 600 13px ui-monospace, Consolas, monospace; color: #fff; }
.pin-name.power { background: #d6342c; }
.pin-name.ground { background: #1f2329; }
.pin-name.gpio { background: #2f6fd6; }
.pin-name.debug { background: #7a5133; }
.pin-name.usb { background: #5b9e2f; }
.pin-fn { display: inline-block; margin: 2px 3px; padding: 1px 7px; border-radius: 6px; font: 12px ui-monospace, Consolas, monospace;
  background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }
.pin-fn.default { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.pin-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.pin-legend .pin-name { margin-right: 6px; }
@media (max-width: 860px) { .board-figure { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .marker { width: 20px; height: 20px; font-size: 11px; } }
.product-grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .product-grid.three { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .product-grid.three { grid-template-columns: 1fr; } }

/* 产品页：主推产品横排卡片、部件两列；面包屑 */
.product-grid.one { grid-template-columns: 1fr; }
.product-grid.two { grid-template-columns: repeat(2, 1fr); }
.product-card.wide { display: grid; grid-template-columns: minmax(220px, 2fr) 3fr; }
.product-card.wide .media { aspect-ratio: auto; min-height: 320px; }
.product-card.wide .body { justify-content: center; padding: 28px; }
.product-card.wide h3 { font-size: 26px; }
.product-card.wide p { flex: none; font-size: 16px; }
.product-card.wide .chips { margin: 4px 0 8px; }
.tag.part { background: var(--accent-soft); color: var(--accent); }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 22px 0 -8px; font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
@media (max-width: 760px) {
  .product-card.wide { grid-template-columns: 1fr; }
  .product-card.wide .media { min-height: 0; aspect-ratio: 4 / 3; }
}
@media (max-width: 560px) { .product-grid.two { grid-template-columns: 1fr; } }

/* ---------------- 登录入口、购买 / 联系弹窗、下载页 ---------------- */
.nav-login { margin-left: auto; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600; white-space: nowrap; }
.nav-login:hover { border-color: var(--accent); color: var(--accent); }
.nav-login + .lang { margin-left: 8px; }
.contact-dialog { border: 1px solid var(--border); border-radius: var(--radius); padding: 0; max-width: min(440px, calc(100vw - 32px)); background: var(--panel); color: var(--text); box-shadow: 0 24px 60px rgba(0, 0, 0, .25); }
.contact-dialog::backdrop { background: rgba(10, 14, 20, .45); }
.contact-body { padding: 24px; display: grid; gap: 12px; }
.contact-body h2 { margin: 0; }
.contact-body p { margin: 0; }
.contact-body .qr { width: 220px; max-width: 100%; justify-self: center; border-radius: 12px; border: 1px solid var(--border); background: #fff; }
.contact-body .muted { color: var(--muted); }
.contact-body .btn { justify-content: center; }
.download-group { display: grid; gap: 10px; }
.download-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; align-items: center; padding: 16px 18px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.download-item h3 { margin: 0; font-size: 17px; }
.download-item p { margin: 0; color: var(--muted); font-size: 14px; }
.download-item .meta { font-size: 13px; color: var(--muted); }
@media (max-width: 560px) { .download-item { grid-template-columns: 1fr; } .nav-login { padding: 5px 10px; } }
