/* =====================================================================
   ARE 旋转关节测试平台 · 网页选配下单系统 — 样式表
   作者 : 寇豆码 (Kou)   日期 : 2026-09-14   版本 : V1.0.0
   零外部依赖：不使用任何 CDN 字体/图标，全部使用系统字体与内联 SVG。
   ===================================================================== */

/* ---------- 设计令牌 ---------- */
:root {
  --brand: #F36C21;
  --brand-dark: #d9560f;
  --brand-soft: #fff3ec;
  --brand-line: #ffd9c2;

  --ink: #1a1f36;
  --ink-2: #3a4160;
  --ink-3: #6b7391;
  --ink-4: #9aa1b8;

  --bg: #f4f5f8;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --line: #e6e8ef;
  --line-2: #eef0f5;

  --ok: #12a150;
  --ok-soft: #e9f8ef;
  --warn: #b7791f;
  --warn-soft: #fff8e6;
  --warn-line: #f3d999;
  --info: #1f6fb8;
  --info-soft: #eaf3fb;
  --info-line: #bcdcf6;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-1: 0 1px 2px rgba(26, 31, 54, .06), 0 2px 8px rgba(26, 31, 54, .05);
  --shadow-2: 0 6px 20px rgba(26, 31, 54, .10);
  --shadow-3: 0 14px 40px rgba(26, 31, 54, .16);
  --shadow-brand: 0 6px 18px rgba(243, 108, 33, .24);

  --topbar-h: 68px;
  --rail-h: 60px;
  --sidebar-w: 232px;
  --summary-w: 312px;

  --font: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC",
          "Source Han Sans SC", "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* ---------- 基础重置 ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 15px;
  min-height: 100vh;
  overflow-x: hidden;
}
h1, h2, h3, h4, p, ol, ul, figure { margin: 0; }
img { max-width: 100%; display: block; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* =====================================================================
   顶部导航
   ===================================================================== */
.topbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 20px;
  height: var(--topbar-h);
  padding: 0 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(26, 31, 54, .04), 0 4px 18px rgba(26, 31, 54, .04);
}
.topbar__brand { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.topbar__logo { display: inline-flex; }
.topbar__title { font-size: 17px; font-weight: 800; letter-spacing: .2px; }
.topbar__subtitle { font-size: 11.5px; color: var(--ink-4); letter-spacing: .3px; }

/* 顶栏版本号 */
.topbar__ver {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand, #F36C21);
  background: rgba(243, 108, 33, .10);
  border: 1px solid rgba(243, 108, 33, .28);
  border-radius: 999px;
  padding: 3px 9px;
  letter-spacing: .4px;
  white-space: nowrap;
}

/* 步骤图标导航 */
.steprail {
  flex: 1 1 auto; display: flex; align-items: center; gap: 4px;
  overflow-x: auto; scrollbar-width: none;
  padding: 4px 2px;
}
.steprail::-webkit-scrollbar { display: none; }
.steprail__item {
  flex: 0 0 auto; border: 1px solid transparent; background: transparent;
  display: flex; align-items: center; gap: 7px;
  padding: 6px 11px 6px 7px; border-radius: 999px;
  color: var(--ink-3); transition: all .18s ease; white-space: nowrap;
}
.steprail__num {
  width: 24px; height: 24px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: var(--line); color: var(--ink-3); transition: all .18s ease;
}
.steprail__label { font-size: 12.5px; font-weight: 600; }
.steprail__item.is-done { color: var(--ink-2); }
.steprail__item.is-done .steprail__num { background: var(--ok-soft); color: var(--ok); }
.steprail__item.is-active { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-dark); }
.steprail__item.is-active .steprail__num { background: var(--brand); color: #fff; box-shadow: var(--shadow-brand); }
.steprail__item.is-locked { opacity: .45; cursor: not-allowed; }

/* 顶栏操作区：新增「设置」等按钮后需要横向排列并留出间距 */
.topbar__actions { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }

/* 通用按钮 */
.btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  padding: 9px 16px; border-radius: 10px; font-weight: 600; font-size: 13.5px;
  transition: all .16s ease; display: inline-flex; align-items: center; gap: 7px;
}
.btn:hover { border-color: var(--ink-4); }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: var(--shadow-brand); }
.btn--primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn--dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn--dark:hover { background: #2a3152; border-color: #2a3152; }
.btn--ghost { background: transparent; }
.btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.btn--block { width: 100%; justify-content: center; }

/* =====================================================================
   三栏布局
   ===================================================================== */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--summary-w);
  gap: 22px;
  max-width: 1560px;
  margin: 0 auto;
  padding: 22px;
  align-items: start;
}

/* ---------- 左侧进度 ---------- */
.sidebar {
  position: sticky; top: calc(var(--topbar-h) + 22px);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-1);
  padding: 18px 16px; align-self: start;
}
.sidebar__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.sidebar__eyebrow { font-size: 12px; font-weight: 700; color: var(--ink-3); letter-spacing: .6px; text-transform: uppercase; }
.sidebar__count { font-size: 12.5px; color: var(--ink-3); }
.sidebar__count b { color: var(--brand); font-size: 15px; }

.steplist { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.steplist__item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  border: none; background: transparent; text-align: left;
  padding: 9px 10px; border-radius: 10px; color: var(--ink-2);
  transition: all .16s ease; position: relative;
}
.steplist__item::before {
  content: ""; position: absolute; left: 21px; top: 32px; bottom: -4px; width: 2px;
  background: var(--line); z-index: 0;
}
.steplist__item:last-child::before { display: none; }
.steplist__dot {
  position: relative; z-index: 1; flex: 0 0 auto;
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11.5px; font-weight: 700;
  background: var(--surface); border: 1.6px solid var(--line); color: var(--ink-4);
  transition: all .16s ease;
}
.steplist__text { display: flex; flex-direction: column; min-width: 0; }
.steplist__name { font-size: 13.5px; font-weight: 600; }
.steplist__meta { font-size: 11px; color: var(--ink-4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.steplist__item:hover:not(.is-locked) { background: var(--surface-2); }
.steplist__item.is-active { background: var(--brand-soft); color: var(--brand-dark); }
.steplist__item.is-active .steplist__dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.steplist__item.is-done .steplist__dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.steplist__item.is-locked { opacity: .5; cursor: not-allowed; }

.sidebar__foot { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.progressbar { height: 7px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.progressbar > span { display: block; height: 100%; width: 10%; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), #ff9b5e); transition: width .35s ease; }
.sidebar__hint { font-size: 11.5px; color: var(--ink-4); margin-top: 9px; line-height: 1.5; }

/* =====================================================================
   中间内容区
   ===================================================================== */
.content { min-width: 0; display: flex; flex-direction: column; gap: 18px; padding-bottom: 90px; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-1); overflow: hidden;
}
.card__head { padding: 20px 24px 0; }
.card__eyebrow { font-size: 12px; font-weight: 700; color: var(--brand); letter-spacing: .8px; }
.card__title { font-size: 22px; font-weight: 800; margin-top: 5px; letter-spacing: .2px; }
.card__desc { font-size: 13.5px; color: var(--ink-3); margin-top: 7px; max-width: 78ch; }
.card__body { padding: 20px 24px 24px; }

/* 步骤头部横幅 (图文并茂) */
.hero {
  position: relative; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow-1);
  background: var(--ink);
}
.hero__img { width: 100%; height: 200px; object-fit: cover; opacity: .82; }
.hero__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(20,25,45,.88) 0%, rgba(20,25,45,.55) 46%, rgba(20,25,45,.14) 100%);
  display: flex; flex-direction: column; justify-content: center; padding: 0 28px;
}
.hero__eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 1.4px; color: #ffb98c; text-transform: uppercase; }
.hero__title { color: #fff; font-size: 26px; font-weight: 800; margin-top: 6px; }
.hero__desc { color: rgba(255,255,255,.82); font-size: 13.5px; margin-top: 8px; max-width: 60ch; }
.hero__step { position: absolute; top: 16px; right: 20px; color: #fff; font-size: 12.5px; font-weight: 700;
  background: rgba(243,108,33,.92); padding: 5px 12px; border-radius: 999px; }

/* ---------- 配置组 ---------- */
.group { margin-top: 18px; }
.group:first-child { margin-top: 4px; }
.group__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.group__title { font-size: 14.5px; font-weight: 700; color: var(--ink); }
.group__req { font-size: 11px; font-weight: 700; color: var(--brand); background: var(--brand-soft);
  border: 1px solid var(--brand-line); padding: 2px 8px; border-radius: 999px; }
.group__tools { margin-left: auto; display: flex; gap: 8px; }
.group__link { background: none; border: none; color: var(--info); font-size: 12.5px; font-weight: 600;
  padding: 2px 4px; border-radius: 6px; }
.group__link:hover { text-decoration: underline; }
.group__sub { font-size: 12.5px; color: var(--ink-4); margin: -6px 0 12px; }

/* ---------- 选项卡 ---------- */
.opts { display: grid; gap: 12px; }
.opts--1 { grid-template-columns: 1fr; }
.opts--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.opts--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.opts--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.opts--auto { grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); }

.opt {
  position: relative; display: flex; gap: 12px; align-items: flex-start;
  border: 1.6px solid var(--line); background: var(--surface-2);
  border-radius: var(--radius-sm); padding: 13px 14px; cursor: pointer;
  transition: all .16s ease; min-height: 60px;
}
.opt:hover { border-color: #cfd4e2; background: #fff; }
.opt.is-checked { border-color: var(--brand); background: var(--brand-soft); box-shadow: var(--shadow-brand); }
.opt.is-disabled { opacity: .5; cursor: not-allowed; background: var(--line-2); border-style: dashed; }
.opt__ctrl { flex: 0 0 auto; margin-top: 2px; }
.opt__ctrl input { width: 17px; height: 17px; accent-color: var(--brand); cursor: inherit; }
.opt__ctrl input[type="checkbox"] { border-radius: 4px; }
.opt__body { min-width: 0; flex: 1 1 auto; }
.opt__title { font-size: 13.8px; font-weight: 650; color: var(--ink); display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.opt__desc { font-size: 12.3px; color: var(--ink-3); margin-top: 3px; line-height: 1.5; }
.opt__thumb { flex: 0 0 auto; width: 64px; height: 52px; border-radius: 8px; object-fit: cover;
  border: 1px solid var(--line); background: var(--line-2); }

/* 标签 */
.tag { font-size: 10.5px; font-weight: 800; letter-spacing: .3px; padding: 2px 7px; border-radius: 999px;
  border: 1px solid transparent; white-space: nowrap; }
.tag--rec { background: var(--brand); color: #fff; }
.tag--def { background: #e8eaf2; color: var(--ink-2); }
.tag--hi { background: #eae4ff; color: #5b3fd6; border-color: #d6caff; }
.tag--opt { background: var(--info-soft); color: var(--info); border-color: var(--info-line); }
.tag--std { background: var(--ok-soft); color: var(--ok); border-color: #c4ecd3; }
.tag--new { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }

/* ---------- 输入控件 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 12.8px; font-weight: 650; color: var(--ink-2); display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.field__hint { font-size: 11.8px; color: var(--ink-4); }
.field input[type="text"], .field input[type="number"], .field select, .field textarea {
  border: 1.6px solid var(--line); background: #fff; border-radius: 10px;
  padding: 10px 12px; font-size: 14px; transition: all .16s ease; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); outline: none;
  box-shadow: 0 0 0 3px rgba(243,108,33,.14); }
.field input[type="color"] { width: 100%; height: 42px; padding: 3px; border: 1.6px solid var(--line);
  border-radius: 10px; background: #fff; cursor: pointer; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }

/* ---------- 提示条 ---------- */
.notes { display: flex; flex-direction: column; gap: 9px; margin-top: 14px; }
.note {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 12.8px; line-height: 1.6; padding: 11px 14px; border-radius: 10px;
  border: 1px solid var(--info-line); background: var(--info-soft); color: #14507f;
}
.note--warn { border-color: var(--warn-line); background: var(--warn-soft); color: #8a5a09; }
.note--ok { border-color: #c4ecd3; background: var(--ok-soft); color: #0d7a3c; }
.note--brand { border-color: var(--brand-line); background: var(--brand-soft); color: #b3490c; }
.note__icon { flex: 0 0 auto; font-weight: 800; }

/* ---------- 折叠分组 (第四步功能) ---------- */
.acc { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.acc + .acc { margin-top: 10px; }
.acc__head {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  background: #fff; border: none; padding: 13px 16px; transition: background .16s ease;
}
.acc__head:hover { background: var(--surface-2); }
.acc__icon { width: 30px; height: 30px; border-radius: 8px; flex: 0 0 auto; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-dark); font-size: 15px; }
.acc__title { font-size: 14px; font-weight: 700; }
.acc__count { font-size: 11.5px; color: var(--ink-4); margin-left: 2px; }
.acc__chev { margin-left: auto; color: var(--ink-4); transition: transform .2s ease; font-size: 12px; }
.acc.is-open .acc__chev { transform: rotate(180deg); }
.acc__panel { padding: 14px 16px 16px; border-top: 1px solid var(--line-2); display: none; }
.acc.is-open .acc__panel { display: block; }

/* 功能项列表 */
.fnlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: 8px; }
.fn {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 9px;
  border: 1.4px solid var(--line); background: #fff; cursor: pointer; transition: all .15s ease;
}
.fn:hover { border-color: #cfd4e2; }
.fn.is-checked { border-color: var(--brand); background: var(--brand-soft); }
.fn input { width: 16px; height: 16px; accent-color: var(--brand); flex: 0 0 auto; }
.fn__label { font-size: 13px; font-weight: 600; }
.fn__badge { margin-left: auto; font-size: 10.5px; font-weight: 800; color: var(--ok); }
.fn__thumb { width: 40px; height: 30px; border-radius: 6px; object-fit: cover; border: 1px solid var(--line); }
.fn__desc {
  width: 100%; margin-left: 26px; font-size: 11.5px; color: var(--ink-4);
  line-height: 1.35; margin-top: 2px;
}

/* ---------- 步骤底部动作条 ---------- */
.actions {
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 20px; box-shadow: var(--shadow-1); position: sticky; bottom: 12px;
}
.actions__progress { font-size: 12.5px; color: var(--ink-4); }
.actions__right { display: flex; gap: 10px; margin-left: auto; }

/* =====================================================================
   右侧摘要面板
   ===================================================================== */
.summary {
  position: sticky; top: calc(var(--topbar-h) + 22px);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-1);
  display: flex; flex-direction: column; max-height: calc(100vh - var(--topbar-h) - 44px);
}
.summary__head { padding: 16px 18px 12px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 10px; }
.summary__head h2 { font-size: 15px; font-weight: 800; }
.summary__badge { margin-left: auto; font-size: 11.5px; font-weight: 800; color: #fff; background: var(--ink);
  padding: 4px 10px; border-radius: 999px; }
.summary__body { padding: 14px 18px; overflow-y: auto; flex: 1 1 auto; }
.summary__body::-webkit-scrollbar { width: 6px; }
.summary__body::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }

.sumsec + .sumsec { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.sumsec__title { font-size: 11.5px; font-weight: 800; letter-spacing: .6px; color: var(--ink-4);
  text-transform: uppercase; margin-bottom: 9px; }
.sumrow { display: flex; gap: 10px; align-items: baseline; font-size: 12.8px; padding: 4px 0; }
.sumrow__k { flex: 0 0 40%; color: var(--ink-3); }
.sumrow__v { flex: 1 1 auto; color: var(--ink); font-weight: 600; text-align: right; word-break: break-word; }
.sumrow__v.is-empty { color: var(--ink-4); font-weight: 400; }
.sumpills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { font-size: 11.5px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line);
  color: var(--ink-2); padding: 3px 9px; border-radius: 999px; }
.pill--brand { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-dark); }

.summary__price { margin: 0 18px; padding: 13px 15px; border-radius: 11px; background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: space-between; }
.summary__price span { font-size: 12.5px; color: rgba(255,255,255,.72); }
.summary__price strong { font-size: 17px; color: #ffb98c; letter-spacing: 1px; }
.summary__foot { padding: 12px 18px 16px; }
.summary__note { font-size: 11.2px; color: var(--ink-4); line-height: 1.5; }

/* =====================================================================
   移动端底部条 + 抽屉
   ===================================================================== */
.bottombar {
  display: none; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 70;
}
.bottombar__toggle {
  width: 100%; display: flex; align-items: center; gap: 10px;
  background: var(--ink); color: #fff; border: none; border-radius: 14px;
  padding: 13px 16px; box-shadow: var(--shadow-3); font-weight: 700;
}
.bottombar__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); flex: 0 0 auto;
  box-shadow: 0 0 0 4px rgba(243,108,33,.24); }
.bottombar__label { font-size: 13.5px; }
.bottombar__model { margin-left: auto; font-size: 12px; color: #ffb98c; }
.bottombar__chev { font-size: 11px; color: rgba(255,255,255,.6); }

.drawer { position: fixed; inset: 0; z-index: 90; }
.drawer__mask { position: absolute; inset: 0; background: rgba(20,25,45,.45); backdrop-filter: blur(2px); }
.drawer__panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 82vh; background: var(--surface);
  border-radius: 20px 20px 0 0; box-shadow: var(--shadow-3); display: flex; flex-direction: column;
  animation: slideUp .24s ease;
}
@keyframes slideUp { from { transform: translateY(24px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
.drawer__head { display: flex; align-items: center; padding: 16px 18px 12px; border-bottom: 1px solid var(--line-2); }
.drawer__head h2 { font-size: 16px; font-weight: 800; }
.drawer__head .btn { margin-left: auto; }
.drawer__body { padding: 14px 18px 8px; overflow-y: auto; flex: 1 1 auto; }
.drawer .summary__price { margin: 10px 18px 20px; }

/* =====================================================================
   最终配置单 (步骤 10)
   ===================================================================== */
.final { display: flex; flex-direction: column; gap: 16px; }
.final__banner {
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); position: relative; background: var(--ink);
}
.final__banner img { width: 100%; height: 176px; object-fit: cover; opacity: .72; }
.final__banner-txt { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; padding: 0 26px; }
.final__banner-txt h3 { color: #fff; font-size: 22px; font-weight: 800; }
.final__banner-txt p { color: rgba(255,255,255,.82); font-size: 13px; margin-top: 6px; }

.final__toolbar { display: flex; gap: 10px; flex-wrap: wrap; }

.qtable { width: 100%; border-collapse: collapse; font-size: 13px; }
.qtable caption { text-align: left; font-size: 13.5px; font-weight: 800; color: var(--ink);
  padding: 0 0 8px; }
.qtable th, .qtable td { border: 1px solid var(--line); padding: 9px 11px; text-align: left; vertical-align: top; }
.qtable thead th { background: var(--ink); color: #fff; font-weight: 700; font-size: 12.5px; }
.qtable tbody tr:nth-child(even) { background: var(--surface-2); }
.qtable td.k { font-weight: 650; color: var(--ink-2); white-space: nowrap; width: 1%; }
.qtable td.tagcell { white-space: nowrap; }
.qtable-wrap { overflow-x: auto; }
.qgroup { margin-top: 12px; }

/* =====================================================================
   Toast
   ===================================================================== */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(10px);
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 600;
  padding: 11px 20px; border-radius: 999px; box-shadow: var(--shadow-3);
  z-index: 120; opacity: 0; transition: opacity .2s ease, transform .2s ease; pointer-events: none;
}
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* =====================================================================
   响应式
   ===================================================================== */
@media (max-width: 1220px) {
  :root { --sidebar-w: 208px; --summary-w: 280px; }
  .layout { gap: 16px; padding: 18px; }
}

/* 平板：隐藏右侧固定摘要，启用底部抽屉 */
@media (max-width: 1024px) {
  .layout { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .summary { display: none; }
  .bottombar { display: block; }
  .content { padding-bottom: 84px; }
}

/* 移动端：隐藏左侧栏，顶部步骤横向滚动 */
@media (max-width: 760px) {
  :root { --topbar-h: auto; }
  .layout { grid-template-columns: 1fr; padding: 12px; gap: 12px; }
  .sidebar { display: none; }
  .topbar { flex-wrap: wrap; padding: 10px 14px; gap: 10px; }
  .topbar__brand { flex: 1 1 100%; }
  .topbar__title { font-size: 15.5px; }
  .topbar__subtitle { font-size: 10.5px; }
  .topbar__actions { display: none; }
  .steprail { flex: 1 1 100%; order: 3; padding-bottom: 2px; }
  .card__head { padding: 16px 16px 0; }
  .card__body { padding: 16px; }
  .card__title { font-size: 19px; }
  .hero__img { height: 156px; }
  .hero__overlay { padding: 0 18px; }
  .hero__title { font-size: 20px; }
  .hero__desc { font-size: 12.3px; }
  .hero__step { top: 12px; right: 12px; font-size: 11.5px; }
  .opts--2, .opts--3, .opts--4, .opts--auto { grid-template-columns: 1fr; }
  .fnlist { grid-template-columns: 1fr; }
  .actions { position: static; flex-wrap: wrap; gap: 10px; padding: 14px; }
  .actions__progress { order: 3; flex: 1 1 100%; }
  .actions__right { margin-left: 0; flex: 1 1 100%; }
  .actions__right .btn { flex: 1 1 auto; justify-content: center; }
}

/* 打印：只输出配置单 */
@media print {
  .topbar, .sidebar, .bottombar, .drawer, .actions, .final__toolbar, .toast, .summary { display: none !important; }
  .layout { display: block; padding: 0; }
  body { background: #fff; }
  .card { border: none; box-shadow: none; }
}

/* =====================================================================
   登录鉴权门 (V1.1.0)
   ===================================================================== */
body.is-locked { overflow: hidden; }
body.is-locked .topbar,
body.is-locked .layout,
body.is-locked .bottombar,
body.is-locked .drawer { visibility: hidden; }

.logingate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: auto;
}

.logingate__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1100px 620px at 12% 8%, rgba(243, 108, 33, .30), transparent 60%),
    radial-gradient(900px 560px at 88% 96%, rgba(31, 111, 184, .26), transparent 62%),
    linear-gradient(155deg, #151a2e 0%, #232a44 46%, #1a1f36 100%);
}

.logincard {
  position: relative;
  width: 100%;
  max-width: 428px;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow-3);
  overflow: hidden;
  animation: loginIn .32s cubic-bezier(.2, .8, .3, 1) both;
}

@keyframes loginIn {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

.logingate.is-shake .logincard { animation: loginShake .34s ease-in-out; }
@keyframes loginShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-9px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(3px); }
}

.logincard__brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 26px 28px 20px;
  background: linear-gradient(180deg, var(--brand-soft), var(--surface));
  border-bottom: 1px solid var(--line-2);
}
.logincard__logo {
  flex: 0 0 auto;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: #fff;
  border-radius: 13px;
  box-shadow: var(--shadow-1);
}
.logincard__title { margin: 0; font-size: 18px; font-weight: 800; color: var(--ink); letter-spacing: .2px; }
.logincard__sub { margin: 4px 0 0; font-size: 12.3px; color: var(--ink-3); }

/* 登录界面版本号 */
.logincard__ver {
  display: inline-block;
  margin-left: 8px;
  vertical-align: middle;
  font-size: 11px;
  font-weight: 700;
  color: #F36C21;
  background: rgba(243, 108, 33, .10);
  border: 1px solid rgba(243, 108, 33, .28);
  border-radius: 999px;
  padding: 2px 8px;
  letter-spacing: .3px;
}

.logincard__body { padding: 22px 28px 26px; }

.loginfield { display: block; margin-bottom: 15px; }
.loginfield__label { display: block; font-size: 12.6px; font-weight: 700; color: var(--ink-2); margin-bottom: 7px; }
.loginfield__wrap { position: relative; display: block; }
.loginfield__input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font-size: 14.6px;
  color: var(--ink);
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
  box-sizing: border-box;
  font-family: inherit;
}
.loginfield__wrap .loginfield__input { padding-right: 62px; }
.loginfield__input::placeholder { color: var(--ink-4); }
.loginfield__input:focus {
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 3.5px rgba(243, 108, 33, .13);
}
.loginfield__eye {
  position: absolute;
  top: 50%; right: 7px;
  transform: translateY(-50%);
  height: 32px;
  padding: 0 11px;
  font-size: 12.4px;
  color: var(--ink-3);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}
.loginfield__eye:hover { color: var(--brand); background: var(--brand-soft); }

.logincheck {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 16px;
  font-size: 12.8px;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}
.logincheck input { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; margin: 0; }

.loginerror {
  margin: 0 0 12px;
  padding: 9px 12px;
  font-size: 12.8px;
  color: #b3261e;
  background: #fdecea;
  border: 1px solid #f5c6c2;
  border-radius: 9px;
}

.loginbtn {
  width: 100%;
  height: 48px;
  font-size: 15.4px;
  font-weight: 800;
  letter-spacing: 3px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: var(--shadow-brand);
  transition: transform .12s, box-shadow .18s, opacity .18s;
  font-family: inherit;
}
.loginbtn:hover { transform: translateY(-1px); box-shadow: 0 9px 24px rgba(243, 108, 33, .32); }
.loginbtn:active { transform: translateY(0); }
.loginbtn:disabled { opacity: .72; cursor: default; transform: none; }

.logintip {
  margin: 15px 0 0;
  font-size: 11.8px;
  line-height: 1.65;
  color: var(--ink-4);
  text-align: center;
}

/* 离线浏览提示：无服务端时由 js/auth.js 显示（默认隐藏） */
.loginoffline {
  margin: 14px 0 0;
  padding: 11px 12px;
  font-size: 12.4px;
  line-height: 1.6;
  text-align: center;
  color: var(--ink-3);
  background: var(--surface-2);
  border: 1px dashed var(--line-2);
  border-radius: 9px;
}
.loginoffline__tip { margin: 0 0 9px; }
.loginoffline__btn {
  min-width: 96px;
  height: 34px;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
  background: #fff;
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  transition: background .16s, color .16s;
}
.loginoffline__btn:hover { background: var(--brand); color: #fff; }

.logincard__foot {
  padding: 13px 28px;
  font-size: 11.6px;
  color: var(--ink-4);
  text-align: center;
  background: var(--surface-2);
  border-top: 1px solid var(--line-2);
}

/* 顶栏当前用户 */
.topbar__user {
  font-size: 12.4px;
  color: var(--ink-3);
  white-space: nowrap;
  padding-right: 2px;
}

@media (max-width: 760px) {
  .logingate { padding: 16px; align-items: flex-start; }
  .logincard { margin-top: 6vh; }
  .logincard__brand { padding: 22px 20px 16px; }
  .logincard__body { padding: 18px 20px 22px; }
  .logincard__foot { padding: 12px 20px; }
  .topbar__user { display: none; }
  .topbar__ver { font-size: 10px; padding: 2px 7px; }
}

@media print {
  .logingate { display: none !important; }
}

.lb {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 9999;
  background: rgba(12, 16, 22, 0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.lb__img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  cursor: default;
}
.lb__close {
  position: absolute;
  top: 20px;
  right: 24px;
  padding: 8px 16px;
  font-size: 14px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  cursor: pointer;
}
.lb__close:hover { background: rgba(255, 255, 255, 0.24); }

/* =====================================================================
   旋转基准版 · 测试功能表（18 项）表格化展示
   ===================================================================== */
.baseline-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.baseline-feature-group {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.baseline-feature-group__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
}
.baseline-feature-group__icon {
  font-size: 18px;
  line-height: 1;
}
.baseline-feature-group__title {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
}
.baseline-feature-group__count {
  font-size: 12px;
  color: #6b7280;
}
.baseline-feature-group__body {
  padding: 12px;
  flex: 1;
}
.baseline-feature-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.baseline-feature-table__row td {
  padding: 8px 6px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.baseline-feature-table__row:last-child td { border-bottom: none; }
.baseline-feature-table__code {
  width: 40px;
  color: #4b5563;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.baseline-feature-table__name { color: #1f2937; }
.baseline-feature-table__check { width: 72px; text-align: right; }
.baseline-feature-table__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.baseline-feature-table__tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: #e2efda;
  color: #375623;
}
.baseline-feature-table__row:not(.is-checked) .baseline-feature-table__tag {
  background: #f3f4f6;
  color: #9ca3af;
}
.baseline-feature-table__row.is-checked .baseline-feature-table__code,
.baseline-feature-table__row.is-checked .baseline-feature-table__name { color: #1f2937; }

/* 许用弯矩载荷展示框 */
.baseline-bending {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 120px;
  text-align: center;
}
.baseline-bending__label {
  font-size: 12px;
  color: #6b7280;
}
.baseline-bending__value {
  font-size: 32px;
  font-weight: 700;
  color: #1f2937;
  line-height: 1;
}
.baseline-bending__value--empty {
  font-size: 28px;
  color: #9ca3af;
}
.baseline-bending__unit {
  font-size: 13px;
  color: #4b5563;
}
.baseline-bending__hint {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 4px;
}

@media (max-width: 640px) {
  .baseline-feature-grid { grid-template-columns: 1fr; }
  .baseline-bending__value { font-size: 26px; }
}

/* =====================================================================
   管理员后台 · 用户管理 / 登录历史（V1.3.0 新增）
   遮罩与卡片沿用 .lb / .logincard 的视觉语言，配色全部取自设计令牌。
   ===================================================================== */
.adm-mask {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 9998;
  background: rgba(12, 16, 22, 0.72);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow: auto;
}
/* hidden 属性必须能压过下面的 display 规则 */
.adm-mask[hidden], .adm-pane[hidden], .adm-form[hidden], .adm-toast[hidden] { display: none !important; }

.adm-panel {
  position: relative;
  width: 100%;
  max-width: 1080px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---------- 头部 ---------- */
.adm-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line-2);
  background: linear-gradient(180deg, var(--brand-soft), var(--surface));
}
.adm-title { font-size: 19px; font-weight: 800; letter-spacing: .2px; }
.adm-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.adm-close {
  flex: 0 0 auto;
  width: 32px; height: 32px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-3);
  border-radius: 8px;
  font-size: 18px;
  line-height: 1;
  transition: all .16s ease;
}
.adm-close:hover { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- 页签 ---------- */
.adm-tabs {
  display: flex;
  gap: 6px;
  padding: 12px 24px 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.adm-tab {
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  color: var(--ink-3);
  font-size: 13.5px;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 10px 10px 0 0;
  margin-bottom: -1px;
  transition: all .16s ease;
}
.adm-tab:hover { color: var(--ink-2); background: var(--surface-2); }
.adm-tab.is-active {
  color: var(--brand-dark);
  background: var(--brand-soft);
  border-color: var(--brand-line);
  box-shadow: inset 0 -2px 0 var(--brand);
}

.adm-body { padding: 18px 24px 22px; min-height: 240px; }
.adm-pane { display: block; }

/* ---------- 工具条 / 统计 ---------- */
.adm-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.adm-stat { font-size: 12px; color: var(--ink-3); margin-left: auto; }

/* ---------- 新增 / 编辑表单 ---------- */
.adm-form {
  border: 1px solid var(--brand-line);
  background: var(--brand-soft);
  border-radius: var(--radius-sm);
  padding: 14px 16px 16px;
  margin-bottom: 14px;
}
.adm-form__title { font-size: 14px; font-weight: 700; color: var(--brand-dark); margin-bottom: 10px; }
.adm-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.adm-form__ops { display: flex; gap: 10px; margin-top: 14px; }

/* ---------- 表格 ---------- */
.adm-tablewrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: auto;
  max-height: 52vh;
  background: var(--surface);
}
.adm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.adm-table thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 12px; font-weight: 700; letter-spacing: .3px;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.adm-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-2);
  color: var(--ink-2);
  vertical-align: middle;
}
.adm-table tbody tr:hover { background: var(--surface-2); }
.adm-table tbody tr:last-child td { border-bottom: none; }
.adm-mono { font-family: var(--mono); font-size: 12.5px; }
.adm-time { font-family: var(--mono); font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.adm-reason { color: var(--ink-3); font-size: 12.5px; }
.adm-empty { text-align: center; color: var(--ink-4); padding: 26px 12px !important; }
.adm-ops { white-space: nowrap; }
.adm-link {
  border: none;
  background: transparent;
  color: var(--info);
  font-size: 12.5px;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 6px;
}
.adm-link:hover { background: var(--info-soft); text-decoration: underline; }
.adm-link--danger { color: #c0392b; }
.adm-link--danger:hover { background: #fdecea; }

/* 结果徽章：成功 / 失败 */
.adm-ok { background: var(--ok-soft); color: var(--ok); border-color: #c4ecd3; }
.adm-fail { background: #fdecea; color: #c0392b; border-color: #f7c9c4; }
.adm-tag--admin { background: var(--brand); color: #fff; }

/* ---------- 筛选区 ---------- */
.adm-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  margin-bottom: 14px;
}
.adm-filters .btn { height: 40px; justify-content: center; }

/* ---------- 分页 ---------- */
.adm-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 14px;
}
.adm-pager__info { font-size: 12.5px; color: var(--ink-3); min-width: 160px; text-align: center; }

/* ---------- 面板内提示条 ---------- */
.adm-toast {
  margin: 0 24px 18px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.8px;
  line-height: 1.6;
  border: 1px solid #c4ecd3;
  background: var(--ok-soft);
  color: #0d7a3c;
}
.adm-toast--bad { border-color: #f7c9c4; background: #fdecea; color: #a5281a; }

@media (max-width: 720px) {
  .adm-mask { padding: 16px 10px; }
  .adm-body { padding: 14px 14px 18px; }
  .adm-head { padding: 16px 16px 14px; }
  .adm-tabs { padding: 10px 14px 0; }
  .adm-toast { margin: 0 14px 14px; }
  .adm-stat { margin-left: 0; }
}

/* =====================================================================
   首屏收敛配套 · 开机自检覆盖层 / 连接状态提示条（V1.9.2 阶段 0 止血）
   目标：断网或弱网时不允许白屏，始终给出可操作的下一步。
   z-index 必须高于登录门（.logingate 9999），否则自检层会被登录门盖住。
   ===================================================================== */
.bootgate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
}
.bootgate[hidden] { display: none; }
.bootgate__card {
  max-width: 460px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 32px 28px 26px;
  text-align: center;
}
.bootgate__spin {
  width: 38px;
  height: 38px;
  margin: 0 auto 16px;
  border: 3px solid var(--line-2);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: cpq-spin 0.9s linear infinite;
}
@keyframes cpq-spin { to { transform: rotate(360deg); } }
.bootgate__title { margin: 0 0 8px; font-size: 18px; font-weight: 700; color: var(--ink); }
.bootgate__desc { margin: 0 0 20px; font-size: 13.5px; line-height: 1.7; color: var(--ink-3); }
.bootgate__acts { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.bootgate__btn {
  min-width: 104px;
  padding: 9px 18px;
  font-size: 13.5px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
}
.bootgate__btn:hover { border-color: var(--brand-line); color: var(--brand-dark); }
.bootgate__btn.is-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.bootgate__btn.is-primary:hover { background: var(--brand-dark); color: #fff; }

/* 已登录但后端不可达：顶部非阻断提示条（不遮挡选配主界面） */
.connbar {
  position: fixed;
  left: 0; right: 0; top: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 9px 16px;
  background: var(--warn-soft);
  border-bottom: 1px solid var(--warn-line);
  color: #8a5a12;
  font-size: 13px;
  line-height: 1.6;
}
.connbar__btn {
  padding: 4px 14px;
  font-size: 12.5px;
  border-radius: 8px;
  border: 1px solid var(--warn-line);
  background: #fff;
  color: #8a5a12;
  cursor: pointer;
}
.connbar__btn:disabled { opacity: .6; cursor: default; }
