/* ===========================================================================
 * 自动卸胶装置 · 客户版交互站点
 * 设计系统：工业沉稳 · 信息密度可控 · PC / 手机双端
 * --------------------------------------------------------------------------- */

:root {
  /* —— 主色（深空蓝） —— */
  --c-ink-900: #0f1a2b;
  --c-ink-800: #1a2740;
  --c-ink-700: #283655;
  --c-ink-600: #3a4868;
  --c-ink-500: #55668a;
  --c-ink-400: #7e8cab;
  --c-ink-300: #aab4ca;
  --c-ink-200: #d4dae6;
  --c-ink-100: #e8ecf3;
  --c-ink-50:  #f4f6fa;

  /* —— 琥珀强调（CTA / 链接） —— */
  --c-amber-700: #92400e;
  --c-amber-600: #b45309;
  --c-amber-500: #d97706;
  --c-amber-100: #fef3c7;
  --c-amber-50:  #fffbeb;

  /* —— 状态色 —— */
  --c-ok-700: #065f46;
  --c-ok-500: #10b981;
  --c-ok-50:  #ecfdf5;
  --c-warn-700: #9a3412;
  --c-warn-500: #f97316;
  --c-warn-50:  #fff7ed;
  --c-danger-600: #dc2626;
  --c-danger-50:  #fef2f2;
  --c-info-700: #1d4ed8;
  --c-info-500: #3b82f6;
  --c-info-50:  #eff6ff;
  --c-violet-600: #7c3aed;
  --c-violet-50:  #f5f3ff;

  /* —— 语义别名 —— */
  --bg: var(--c-ink-50);
  --bg-page: var(--c-ink-50);
  --bg-card: #ffffff;
  --bg-muted: var(--c-ink-100);
  --bg-elevated: var(--c-ink-100);
  --bg-subtle: #fbfcfe;
  --text: var(--c-ink-900);
  --text-soft: var(--c-ink-700);
  --text-muted: var(--c-ink-500);
  --text-faint: var(--c-ink-400);
  --border: var(--c-ink-200);
  --border-strong: var(--c-ink-300);
  --accent: var(--c-amber-600);
  --accent-hover: var(--c-amber-700);
  --accent-soft: var(--c-amber-50);
  --accent-ring: rgba(180, 83, 9, 0.18);

  /* —— 圆角 / 阴影 / 节奏 —— */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(15, 26, 43, 0.05);
  --shadow-sm: 0 1px 3px rgba(15, 26, 43, 0.06), 0 1px 2px rgba(15, 26, 43, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 26, 43, 0.08), 0 2px 4px rgba(15, 26, 43, 0.04);
  --shadow-lg: 0 12px 28px rgba(15, 26, 43, 0.10), 0 4px 8px rgba(15, 26, 43, 0.06);

  --nav-h: 56px;
  --bottom-nav-h: 60px;
  --content-max: 1100px;
  --content-pad-x: 16px;

  --font: "PingFang SC", "Microsoft YaHei", "HarmonyOS Sans", "Helvetica Neue", system-ui, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Menlo", "Consolas", monospace;
}

/* —— 基础 reset —— */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  color-scheme: light only;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  background-color: var(--c-ink-50);
  background-image:
    radial-gradient(1200px 400px at 80% -120px, rgba(180, 83, 9, 0.05), transparent),
    radial-gradient(1000px 400px at -10% 100px, rgba(29, 78, 216, 0.04), transparent);
  background-attachment: fixed;
  min-height: 100dvh;
  padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 8px);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

p { margin: 0 0 0.6em; }
p:last-child { margin-bottom: 0; }

h1, h2, h3, h4, h5 { margin: 0; line-height: 1.35; color: var(--text); }

a {
  color: var(--accent);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s;
}
a:hover { color: var(--accent-hover); }

code, kbd {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--c-info-50);
  color: var(--c-info-700);
  padding: 1px 6px;
  border-radius: var(--r-xs);
  border: 1px solid #d6e4ff;
  white-space: nowrap;
}

strong { font-weight: 600; }

::selection { background: var(--accent-ring); color: var(--text); }

/* ===========================================================================
 * 顶栏
 * --------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 10px var(--content-pad-x);
  padding-top: max(10px, env(safe-area-inset-top));
}

.site-header-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.site-logo {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--c-ink-800), var(--c-ink-600));
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.site-title { flex: 1; min-width: 0; }

.site-title h1 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.site-title p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-xs);
  white-space: nowrap;
  transition: all 0.15s;
}
.back-link::before {
  content: "←";
  font-size: 14px;
  opacity: 0.7;
}
.back-link:hover {
  color: var(--accent);
  border-color: var(--accent-ring);
  background: var(--accent-soft);
}

/* —— PC 顶栏导航 —— */
.desktop-nav {
  display: none;
  gap: 4px;
  margin-left: auto;
}
.desktop-nav a {
  position: relative;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.15s;
}
.desktop-nav a:hover {
  color: var(--text);
  background: var(--bg-elevated);
}
.desktop-nav a.active {
  color: var(--accent);
  background: var(--accent-soft);
}

/* ===========================================================================
 * 主区
 * --------------------------------------------------------------------------- */
main {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 20px var(--content-pad-x) 32px;
}

/* —— 页面 Hero —— */
.page-hero {
  margin: 4px 0 28px;
}
.page-hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.page-hero .eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.page-hero h2 {
  margin: 12px 0 8px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.page-hero .lead {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-soft);
  max-width: 720px;
}
.page-hero .lead strong { color: var(--text); }

/* —— Section —— */
.section {
  margin: 0 0 36px;
  scroll-margin-top: calc(var(--nav-h) + 12px);
}
.section + .section { margin-top: 36px; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.section-head .sec-num {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-ring);
  padding: 3px 10px;
  border-radius: var(--r-pill);
  letter-spacing: 0.04em;
}
.section-head h3 {
  flex: 1;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.section-head .sec-aside {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--text-muted);
}

.section h3 + p,
.section-head + p { color: var(--text-soft); }

.section h4 {
  margin: 22px 0 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.subsection-anchor { scroll-margin-top: calc(var(--nav-h) + 16px); }

.muted { color: var(--text-muted); font-size: 13px; }

/* ===========================================================================
 * 元信息条 / Lead meta（首页用）
 * --------------------------------------------------------------------------- */
.meta-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.meta-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--c-amber-500));
}
.meta-list { display: grid; gap: 8px; }
.meta-list dt {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.meta-list dd {
  margin: 0;
  font-size: 14px;
  color: var(--text-soft);
}
.meta-list dd strong { color: var(--text); }

@media (min-width: 720px) {
  .meta-list {
    grid-template-columns: max-content 1fr;
    column-gap: 24px;
    row-gap: 10px;
    align-items: baseline;
  }
}

/* ===========================================================================
 * 导航卡（首页大入口）
 * --------------------------------------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 640px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
}

.nav-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 16px 16px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: inherit;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.nav-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 100% 0%, rgba(180, 83, 9, 0.06), transparent 60%);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.nav-card:hover {
  border-color: var(--accent-ring);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  color: inherit;
  text-decoration: none;
}
.nav-card:hover::before { opacity: 1; }

.nav-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.nav-card-chapter {
  display: inline-block;
  padding: 3px 0;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--mono);
  letter-spacing: 0.03em;
  color: var(--accent);
  line-height: 1.3;
  white-space: nowrap;
}

.nav-card-go {
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1;
  color: var(--text-faint);
  transition: color 0.15s, transform 0.15s;
}

.nav-card:hover .nav-card-go {
  color: var(--accent);
  transform: translateX(2px);
}

.nav-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.nav-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted);
  flex: 1;
}

/* ===========================================================================
 * KPI / 规格 stat 卡片
 * --------------------------------------------------------------------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 720px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 960px) {
  .stat-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
}

.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow-xs);
}
.stat .label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.stat .value {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
}
.stat .unit { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-left: 3px; }

/* ===========================================================================
 * 信息框（tip / warn / danger）
 * --------------------------------------------------------------------------- */
.info-box {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 18px 14px 22px;
  margin: 0 0 16px;
  box-shadow: var(--shadow-xs);
  font-size: 14px;
  color: var(--text-soft);
}
.info-box::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
  background: var(--accent);
}
.info-box.tip { background: var(--accent-soft); border-color: var(--c-amber-100); }
.info-box.tip::before { background: var(--accent); }

.info-box.warn { background: var(--c-warn-50); border-color: #fed7aa; }
.info-box.warn::before { background: var(--c-warn-500); }
.info-box.warn ul li::marker { color: var(--c-warn-500); }

.info-box.danger { background: var(--c-danger-50); border-color: #fecaca; }
.info-box.danger::before { background: var(--c-danger-600); }

.info-box.info { background: var(--c-info-50); border-color: #dbeafe; }
.info-box.info::before { background: var(--c-info-500); }

.info-box p { margin: 0 0 6px; }
.info-box p:last-child { margin-bottom: 0; }
.info-box strong { color: var(--text); }
.info-box ul { margin: 6px 0 0; padding-left: 1.2em; }
.info-box ul li { margin-bottom: 4px; }

.info-box-label {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.info-box-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: stepc;
  display: grid;
  gap: 8px;
}
.info-box-steps > li {
  counter-increment: stepc;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-soft);
}
.info-box-steps > li::before {
  content: counter(stepc);
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.info-box-steps > li strong { color: var(--text); }
.info-box-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.info-box-note::before {
  content: "延伸阅读";
  color: var(--text-faint);
  font-weight: 600;
}

/* ===========================================================================
 * 表格
 * --------------------------------------------------------------------------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-xs);
}
.table-wrap::-webkit-scrollbar { height: 6px; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
thead th {
  background: var(--bg-subtle);
  font-weight: 600;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}
tbody th {
  background: var(--bg-subtle);
  font-weight: 600;
  font-size: 13px;
  color: var(--text-soft);
  white-space: nowrap;
  width: 28%;
}
tbody tr:hover td { background: rgba(180, 83, 9, 0.025); }
tbody tr:last-child td { border-bottom: none; }
tr.row-warn td { background: var(--c-warn-50); }
tr.row-warn:hover td { background: var(--c-warn-50); }

table a:not(.tag):not(.table-go) {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-ring);
  border-radius: var(--r-pill);
  white-space: nowrap;
}
table a:not(.tag):not(.table-go)::after {
  content: "↗";
  font-size: 11px;
  opacity: 0.7;
}
table a:not(.tag):not(.table-go):hover {
  background: #fff;
  border-color: var(--accent);
  text-decoration: none;
}

th.th-go,
td.td-go {
  width: 44px;
  padding-left: 8px;
  padding-right: 12px;
  text-align: center;
  vertical-align: middle;
}

table a.table-go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  font-weight: 400;
  color: var(--text-faint);
  background: transparent;
  border: none;
  border-radius: var(--r-sm);
  transition: color 0.15s, background 0.15s;
}

table a.table-go::after {
  content: none;
}

table a.table-go:hover {
  color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}

/* ===========================================================================
 * 正文链 / 按钮风格
 * --------------------------------------------------------------------------- */
main p a:not(.tag):not(.btn):not(.link-go),
main li a:not(.tag):not(.btn):not(.link-go),
main dd a:not(.tag):not(.btn):not(.link-go) {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 9px;
  margin: 0 1px;
  font-size: 0.92em;
  font-weight: 500;
  line-height: 1.45;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-ring);
  border-radius: var(--r-pill);
  vertical-align: baseline;
  transition: all 0.15s;
}
main p a:not(.tag):not(.btn):not(.link-go)::after,
main li a:not(.tag):not(.btn):not(.link-go)::after,
main dd a:not(.tag):not(.btn):not(.link-go)::after {
  content: "→";
  font-size: 0.85em;
  opacity: 0.7;
}
main p a:not(.tag):not(.btn):not(.link-go):hover,
main li a:not(.tag):not(.btn):not(.link-go):hover,
main dd a:not(.tag):not(.btn):not(.link-go):hover {
  background: #fff;
  border-color: var(--accent);
  color: var(--accent-hover);
  box-shadow: var(--shadow-xs);
}
main p a strong, main li a strong, main dd a strong { color: inherit; font-weight: 600; }

.info-box a:not(.tag):not(.btn) {
  color: var(--accent);
  font-weight: 500;
  white-space: nowrap;
}

.link-go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  background: var(--bg-card);
  border: 1px solid var(--accent-ring);
  box-shadow: var(--shadow-sm);
  transition: all 0.18s;
}
.link-go::after { content: "→"; font-size: 1.1em; transition: transform 0.2s; }
.link-go:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-hover);
  box-shadow: var(--shadow-md);
}
.link-go:hover::after { transform: translateX(3px); }
.link-go--block { display: flex; width: 100%; max-width: 360px; margin: 28px auto 0; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-xs);
  transition: all 0.15s;
}
.btn:hover {
  border-color: var(--accent-ring);
  color: var(--accent);
  background: var(--accent-soft);
}
.btn.btn-primary {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.btn.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }

/* ===========================================================================
 * 内嵌目录（toc-inline）
 * --------------------------------------------------------------------------- */
.toc-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 24px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
  overflow-x: auto;
  scrollbar-width: none;
}
.toc-inline::-webkit-scrollbar { display: none; }
.toc-inline a {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 5px 12px;
  border-radius: var(--r-xs);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  transition: all 0.15s;
}
.toc-inline a:hover { color: var(--accent); background: var(--accent-soft); }
.toc-inline a.active {
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-ring);
}

/* ===========================================================================
 * 流程节点图（workflow-flow）
 * --------------------------------------------------------------------------- */
.flow-track {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 0 0 20px;
}
.flow-node {
  position: relative;
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.flow-node:hover {
  border-color: var(--accent-ring);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  color: inherit;
  text-decoration: none;
}
.flow-node:hover .num { box-shadow: var(--shadow-sm); transform: scale(1.04); }
.flow-node .num { transition: transform 0.15s, box-shadow 0.15s; }
.flow-node .num {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--c-amber-500));
  box-shadow: var(--shadow-xs);
}
.flow-node .body { flex: 1; min-width: 0; }
.flow-node .title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.flow-node .title { font-size: 15px; font-weight: 600; color: var(--text); }
.flow-node .badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--bg-elevated);
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.flow-node .desc { font-size: 13px; color: var(--text-soft); margin: 0 0 8px; }
.flow-node .parts {
  font-size: 12px;
  color: var(--text-muted);
}
.flow-node .parts strong { color: var(--text-soft); font-weight: 600; }
.flow-node + .flow-node::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 32px;
  width: 2px;
  height: 14px;
  background: var(--border-strong);
}

@media (min-width: 960px) {
  .flow-track.flow-track--row {
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
  }
  .flow-track.flow-track--row .flow-node {
    flex-direction: column;
    text-align: center;
    align-items: center;
    padding: 16px 14px;
    border-radius: var(--r-md);
  }
  .flow-track.flow-track--row .flow-node .body { width: 100%; }
  .flow-track.flow-track--row .flow-node .title-row { justify-content: center; }
  .flow-track.flow-track--row .flow-node + .flow-node::before {
    top: 50%;
    left: -8px;
    width: 16px;
    height: 2px;
    transform: translateY(-50%);
    background: var(--border-strong);
  }
  .flow-track.flow-track--row .flow-node + .flow-node::after {
    content: "▸";
    position: absolute;
    top: 50%;
    left: -6px;
    transform: translate(-100%, -50%);
    color: var(--border-strong);
    font-size: 10px;
  }
}

/* ===========================================================================
 * 步进 / Tabs（流程详细面板 / HMI 切换）
 * --------------------------------------------------------------------------- */
.stepper { margin-bottom: 20px; }
.step-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 12px;
  margin: 0 -2px;
  scrollbar-width: none;
}
.step-tabs::-webkit-scrollbar { display: none; }
.step-tab {
  flex: 0 0 auto;
  min-width: 88px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  box-shadow: var(--shadow-xs);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: all 0.15s;
}
.step-tab .num {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-faint);
  font-family: var(--mono);
}
.step-tab:hover { border-color: var(--accent-ring); color: var(--text); }
.step-tab:hover .num { color: var(--accent); }
.step-tab.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-hover);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.step-tab.active .num { color: var(--accent); }

.step-panel {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.step-panel.active { display: block; }
.step-panel h4 {
  margin: 0 0 10px;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.step-panel h4 .stage-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-ring);
  border-radius: var(--r-pill);
}
.step-panel p { font-size: 14px; line-height: 1.7; color: var(--text-soft); }
.step-panel .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 500;
  font-family: var(--mono);
  color: var(--text-soft);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: all 0.15s;
}
.tag:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.tag.accent {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-ring);
  font-weight: 600;
}

/* ===========================================================================
 * 搜索栏 / 筛选 chips
 * --------------------------------------------------------------------------- */
.search-bar {
  position: sticky;
  top: calc(var(--nav-h) + env(safe-area-inset-top, 0px));
  z-index: 50;
  margin: 0 0 14px;
  padding: 8px 0;
  background: linear-gradient(180deg, var(--bg) 70%, transparent);
}
.search-wrap { position: relative; }
.search-bar input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-bar input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring);
}
.search-bar input::placeholder { color: var(--text-faint); }
.search-wrap::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 16px; height: 16px;
  transform: translateY(-50%);
  background: no-repeat center / 16px url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237e8cab' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>");
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.chip {
  padding: 7px 14px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  box-shadow: var(--shadow-xs);
  transition: all 0.15s;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

/* ===========================================================================
 * 阶段块（器件页 catalog）
 * --------------------------------------------------------------------------- */
.cat-block {
  margin: 0 0 32px;
  scroll-margin-top: calc(var(--nav-h) + 12px);
}
.cat-block-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
}
.cat-block-head .sec-num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--c-amber-500));
  font-family: var(--mono);
}
.cat-block-head .stage-title {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.cat-block-head .range-badge {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-family: var(--mono);
}

/* —— 器件卡 details —— */
.sensor-list { display: grid; gap: 8px; }
.sensor-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.sensor-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.sensor-card[open] {
  border-color: var(--accent-ring);
  box-shadow: var(--shadow-sm);
}
.sensor-card summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  user-select: none;
}
.sensor-card summary::-webkit-details-marker { display: none; }
.sensor-card summary::after {
  content: "▾";
  margin-left: auto;
  color: var(--text-faint);
  font-size: 12px;
  transition: transform 0.2s;
  align-self: center;
}
.sensor-card[open] summary::after { transform: rotate(180deg); color: var(--accent); }

.sensor-num {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  font-family: var(--mono);
  background: var(--bg-elevated);
  color: var(--text);
}
.sensor-num.cat-travel { background: #dbeafe; color: #1d4ed8; }
.sensor-num.cat-mag    { background: #d1fae5; color: #065f46; }
.sensor-num.cat-prox   { background: #e0e7ff; color: #3730a3; }
.sensor-num.cat-analog { background: #ede9fe; color: #6d28d9; }
.sensor-num.cat-arm    { background: #fed7aa; color: #9a3412; }
.sensor-num.cat-btn    { background: #fecaca; color: #991b1b; }
.sensor-num.cat-valve  { background: #fde68a; color: #92400e; }
.sensor-num.cat-pump   { background: var(--bg-elevated); color: var(--text-soft); }
.sensor-num.cat-out    { background: #f5d0fe; color: #86198f; }
.sensor-num.cat-hyd    { background: #fde68a; color: #92400e; }
.sensor-num.cat-pneu   { background: #cffafe; color: #155e75; }

.sensor-head { flex: 1; min-width: 0; }
.sensor-head h5 {
  margin: 0 0 3px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.sensor-head .meta {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
}

.sensor-body {
  padding: 14px 16px 16px 68px;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
}
.sensor-body dl { margin: 0; display: grid; gap: 10px; }
.sensor-body dt {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin: 0;
}
.sensor-body dd { margin: 3px 0 0; font-size: 14px; color: var(--text-soft); }
.sensor-body code { font-size: 12px; }
.sensor-body .hmi-note {
  margin: 10px 0 0;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--c-warn-700);
  background: var(--c-warn-50);
  border-left: 3px solid var(--c-warn-500);
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
}

@media (min-width: 640px) {
  .sensor-body dl { grid-template-columns: max-content 1fr; column-gap: 18px; row-gap: 8px; align-items: baseline; }
  .sensor-body dt { margin-top: 0; }
  .sensor-body .hmi-note { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .sensor-body { padding-left: 16px; padding-right: 16px; }
}

/* ===========================================================================
 * 线制接法卡（wiring 页）
 * --------------------------------------------------------------------------- */
.wire-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 16px 0;
}
@media (min-width: 720px) { .wire-grid { grid-template-columns: 1fr 1fr; } }

.wire-type-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-xs);
}
.wire-type-card h4 { margin: 0 0 12px; font-size: 14px; }
.wire-colors { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 10px; }
.wire-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 500;
  font-family: var(--mono);
}
.wire-pill::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.wire-pill.brown { background: #fef3e2; color: #7c2d12; border: 1px solid #fed7aa; }
.wire-pill.brown::before { background: #7c2d12; }
.wire-pill.blue { background: var(--c-info-50); color: var(--c-info-700); border: 1px solid #bfdbfe; }
.wire-pill.blue::before { background: var(--c-info-700); }
.wire-pill.black { background: #f1f3f8; color: var(--c-ink-900); border: 1px solid var(--border); }
.wire-pill.black::before { background: var(--c-ink-900); }

/* ===========================================================================
 * 液压站两机对比
 * --------------------------------------------------------------------------- */
.dual-machine {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 12px 0 16px;
}
@media (min-width: 720px) { .dual-machine { grid-template-columns: 1fr 1fr; } }
.machine-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
  box-shadow: var(--shadow-xs);
}
.machine-card h4 {
  margin: 0 0 10px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.machine-card h4::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.q-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
}
.q-cell {
  padding: 12px 8px;
  text-align: center;
  border-radius: var(--r-xs);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}
.q-cell .q-name { font-weight: 700; color: var(--text); font-size: 14px; letter-spacing: 0.02em; }
.q-cell .q-label { display: block; font-size: 10px; color: var(--text-muted); margin-top: 3px; font-family: var(--font); letter-spacing: 0.02em; }
.q-cell.empty { background: transparent; border-style: dashed; opacity: 0.5; }
.q-cell.diff { background: var(--accent-soft); border-color: var(--accent-ring); color: var(--accent); }
.q-cell.diff .q-name { color: var(--accent-hover); }

/* ===========================================================================
 * 触摸屏（HMI）页面
 * --------------------------------------------------------------------------- */
.hmi-tabs {
  display: flex;
  gap: 6px;
  margin: 0 0 16px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.hmi-tabs::-webkit-scrollbar { display: none; }
.hmi-tab {
  flex: 0 0 auto;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg-card);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  color: var(--text-muted);
  box-shadow: var(--shadow-xs);
  white-space: nowrap;
  transition: all 0.15s;
}
.hmi-tab:hover { color: var(--text); }
.hmi-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.hmi-panel { display: none; }
.hmi-panel.active { display: block; }
.hmi-panel h3 {
  margin: 0 0 8px;
  font-size: 18px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.hmi-shot {
  width: 100%;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  margin: 14px 0;
  background: #0a1426;
  padding: 8px;
}
.hmi-shot-caption {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-soft);
  margin: 0 0 8px;
}
.hmi-inline-thumb {
  display: inline-block;
  max-width: 280px;
  margin: 8px 0 0;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  vertical-align: top;
}

/* HMI 六屏缩略 overview */
.hmi-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 16px 0 24px;
}
@media (min-width: 640px) { .hmi-mini-grid { grid-template-columns: repeat(3, 1fr); } }
.hmi-mini {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px;
  box-shadow: var(--shadow-xs);
  color: inherit;
  transition: all 0.15s;
  text-align: center;
}
.hmi-mini:hover {
  border-color: var(--accent-ring);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  color: inherit;
  text-decoration: none;
}
.hmi-mini img {
  width: 100%;
  border-radius: var(--r-xs);
  background: #0a1426;
  padding: 4px;
  display: block;
  aspect-ratio: 16 / 10;
  object-fit: contain;
}
.hmi-mini .name {
  font-size: 13px;
  font-weight: 600;
  margin-top: 8px;
  color: var(--text);
}

/* ===========================================================================
 * 机构网格（结构页 第 4 节）
 * --------------------------------------------------------------------------- */
.org-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 16px 0;
}
@media (min-width: 640px) { .org-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .org-grid { grid-template-columns: repeat(3, 1fr); } }

.org-item {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-xs);
  transition: all 0.15s;
}
.org-item:hover {
  border-color: var(--accent-ring);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.org-item > .org-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.org-item > .org-title::before {
  content: "";
  width: 4px;
  height: 14px;
  background: var(--accent);
  border-radius: 2px;
}
.org-item p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-soft);
}
.org-item p strong { color: var(--text); font-weight: 600; }

/* ===========================================================================
 * 图片
 * --------------------------------------------------------------------------- */
.terminal-img,
.terminal-gallery img {
  width: 100%;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: #fff;
  margin: 10px 0;
  box-shadow: var(--shadow-sm);
}

.img-zoomable {
  cursor: zoom-in;
  transition: box-shadow 0.15s, transform 0.15s;
}
.img-zoomable:hover { box-shadow: var(--shadow-md); }
.img-zoomable:active { transform: scale(0.995); }

.hero-image .img-zoomable { margin: 0; }
.hmi-mini .img-zoomable { margin: 0; }

.img-retry-wrap {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
}
.hmi-mini.img-retry-wrap,
.hmi-mini .img-retry-wrap {
  display: block;
}
.img-retry-wrap .terminal-img,
.img-retry-wrap .hmi-shot,
.img-retry-wrap img {
  display: block;
  width: 100%;
}
.img-retry-wrap.is-failed img.img-load-failed {
  opacity: 0.28;
  filter: grayscale(0.2);
}
.img-retry-wrap.is-failed img.img-load-retrying {
  opacity: 0.45;
}
.img-retry-btn {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 0;
  padding: 12px;
  border: 1px dashed var(--border-strong, #c5ccd8);
  border-radius: var(--r-md);
  background: rgba(244, 246, 250, 0.92);
  color: var(--text-soft, #5a6478);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.img-retry-btn[hidden] { display: none; }
.img-retry-btn:active { transform: scale(0.99); }
.img-retry-sub {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent, #2563eb);
}
figure { margin: 16px 0; }
figcaption {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-muted);
  text-align: left;
}

.terminal-gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 12px 0 16px;
}
@media (min-width: 720px) {
  .terminal-gallery { grid-template-columns: 1fr 1fr; }
}
.terminal-gallery figure { margin: 0; }

.hero-image {
  position: relative;
  margin: 0 0 24px;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, #f8fafc, #eef2f7);
  box-shadow: var(--shadow-md);
}
.hero-image img {
  width: 100%;
  display: block;
  margin: 0;
}

/* ===========================================================================
 * 图片灯箱（点击放大）
 * --------------------------------------------------------------------------- */
body.lightbox-open { overflow: hidden; }

.img-lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  box-sizing: border-box;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, visibility 0.2s;
}
.img-lightbox.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.img-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 26, 43, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: zoom-out;
}

.img-lightbox-close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.img-lightbox-close:hover { background: rgba(255, 255, 255, 0.22); }

.img-lightbox-figure {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: min(1200px, 100%);
  max-height: calc(100dvh - 100px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.img-lightbox-img {
  max-width: 100%;
  max-height: calc(100dvh - 140px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-lg);
  background: #0a1426;
  touch-action: pan-x pan-y pinch-zoom;
}

.img-lightbox-cap {
  margin: 0;
  padding: 10px 14px;
  max-width: 100%;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  background: rgba(0, 0, 0, 0.35);
  border-radius: var(--r-sm);
}

.img-lightbox-hint {
  position: relative;
  z-index: 1;
  margin: 12px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.04em;
}

/* ===========================================================================
 * 滚动指示（顶部进度条）
 * --------------------------------------------------------------------------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--c-amber-500));
  z-index: 300;
  transition: width 0.05s linear;
  pointer-events: none;
  border-radius: 0 2px 2px 0;
}

/* ===========================================================================
 * 流程示意 ASCII（保留少量）
 * --------------------------------------------------------------------------- */
.flow-diagram {
  background: #0f1a2b;
  color: #cbd5e1;
  border-radius: var(--r-md);
  padding: 18px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre;
  box-shadow: var(--shadow-sm);
}

/* ===========================================================================
 * 底部固定 nav（手机 ·「更多」锚点浮层）
 * --------------------------------------------------------------------------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 12px rgba(15, 26, 43, 0.06);
  overflow: visible;
}

.bottom-nav-bar {
  display: flex;
  align-items: stretch;
  min-height: var(--bottom-nav-h);
}

.bottom-nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 4px;
  border: none;
  background: transparent;
  color: var(--text-faint);
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-tab .ico {
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.bottom-nav-tab .label { line-height: 1.2; }

.bottom-nav-tab.active,
.bottom-nav-more-btn.active {
  color: var(--accent);
}

.bottom-nav-tab.active .ico,
.bottom-nav-more-btn.active .ico {
  background: var(--accent-soft);
}

.bottom-nav-more-btn .more-ico { font-size: 16px; letter-spacing: -2px; }

/* 「更多」锚点浮层：紧贴按钮向上展开，无全屏遮罩 */
.bottom-nav-more-wrap {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  min-width: 0;
}

.bottom-nav-more-wrap .bottom-nav-more-btn {
  flex: 1;
  width: 100%;
}

.bottom-nav-popover {
  position: absolute;
  right: 4px;
  bottom: 100%;
  margin-bottom: 6px;
  z-index: 10;
  min-width: 168px;
  padding: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px) scale(0.96);
  transform-origin: bottom right;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.bottom-nav-popover::after {
  content: "";
  position: absolute;
  right: 22px;
  bottom: -5px;
  width: 10px;
  height: 10px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transform: rotate(45deg);
}

.bottom-nav-popover.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.bottom-nav-popover-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.bottom-nav-popover-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  aspect-ratio: 1;
  min-height: 0;
  padding: 8px 6px;
  border-radius: var(--r-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-popover-item .ico {
  flex-shrink: 0;
  font-size: 17px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--bg-card);
  box-shadow: var(--shadow-xs);
}

.bottom-nav-popover-item .label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bottom-nav-popover-item.active {
  border-color: var(--accent-ring);
  background: var(--accent-soft);
  color: var(--accent);
}

.bottom-nav-popover-item.active .ico {
  background: #fff;
}

/* ===========================================================================
 * 页脚
 * --------------------------------------------------------------------------- */
.site-footer {
  margin: 32px auto 0;
  padding: 20px var(--content-pad-x) 24px;
  max-width: var(--content-max);
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}
.site-footer .copy { font-size: 12px; color: var(--text-faint); line-height: 1.6; }

/* ===========================================================================
 * 空态
 * --------------------------------------------------------------------------- */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ===========================================================================
 * 响应式：PC
 * --------------------------------------------------------------------------- */
@media (min-width: 768px) {
  body { padding-bottom: 32px; font-size: 15.5px; }
  .bottom-nav { display: none; }
  .desktop-nav { display: flex; }
  .site-header { padding: 12px 28px; }
  main { padding: 32px 28px 56px; }
  .page-hero h2 { font-size: 32px; }
}

@media (min-width: 1024px) {
  main { padding: 36px 32px 64px; }
  .page-hero h2 { font-size: 36px; }
}

/* ===========================================================================
 * 移动端微调
 * --------------------------------------------------------------------------- */
@media (max-width: 480px) {
  body { font-size: 14.5px; }
  .page-hero h2 { font-size: 22px; }
  .page-hero .lead { font-size: 14px; }
  .section-head h3 { font-size: 17px; }
  .chip { padding: 6px 12px; font-size: 12px; }
  .hmi-tab { padding: 8px 12px; font-size: 12px; }
  .nav-card { padding: 16px; }
  .nav-card h3 { font-size: 15px; }
  .nav-card p { font-size: 12.5px; }
  .stat { padding: 12px 14px; }
  .stat .value { font-size: 15px; }
  .org-item { padding: 12px 14px; }
  th, td { padding: 8px 10px; }
}

/* ===========================================================================
 * 常见故障（faults.html）
 * --------------------------------------------------------------------------- */
.fault-toc-section {
  margin-bottom: 8px;
}

.fault-toc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0;
}

@media (min-width: 480px) {
  .fault-toc-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .fault-toc-grid { grid-template-columns: repeat(3, 1fr); }
}

.fault-toc-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.fault-toc-card:hover {
  border-color: var(--accent-ring);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  color: inherit;
}

.fault-toc-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: var(--shadow-sm);
}

.fault-toc-num {
  flex-shrink: 0;
  min-width: 40px;
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  line-height: 1.2;
}

.fault-toc-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fault-toc-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}

.fault-toc-card.active .fault-toc-title {
  color: var(--accent-hover);
}

.fault-toc-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.fault-toc-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-soft);
  background: var(--bg-muted);
  border-radius: var(--r-xs);
}

.fault-toc-card.active .fault-toc-badge {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.7);
}

.fault-toc-steps {
  font-size: 11px;
  color: var(--text-faint);
}

.fault-toc-arrow {
  flex-shrink: 0;
  font-size: 16px;
  color: var(--text-faint);
  opacity: 0.5;
  transition: opacity 0.15s, transform 0.15s;
}

.fault-toc-card:hover .fault-toc-arrow,
.fault-toc-card.active .fault-toc-arrow {
  opacity: 1;
  color: var(--accent);
  transform: translateX(2px);
}

.fault-block { scroll-margin-top: 72px; }

.fault-intro {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-soft);
}

.fault-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fault-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-xs);
}

.fault-step.is-wait {
  border-color: var(--accent-ring);
  background: var(--accent-soft);
}

.fault-step-n {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fault-step.is-wait .fault-step-n {
  background: var(--text-muted);
}

.fault-step-body p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
}

.fault-step-links {
  margin-top: 8px !important;
  font-size: 13px;
}

.fault-step-tag {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--r-xs);
}

.fault-step-tag.wait {
  background: rgba(217, 119, 6, 0.15);
  color: #b45309;
}

.fault-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-soft);
  background: var(--bg-muted);
  border-radius: var(--r-sm);
  border-left: 3px solid var(--accent);
}

.fault-badge {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
}

/* ===========================================================================
 * AI 助手页 · 固定视口，仅对话区滚动
 * --------------------------------------------------------------------------- */
html:has(body[data-page="assistant"]) {
  overflow: hidden;
  height: 100%;
}

body[data-page="assistant"] {
  overflow: hidden;
  height: 100dvh;
  height: 100svh;
  padding-bottom: 0;
  overscroll-behavior: none;
  background: #f4f6fa;
  background-image: none;
  color: var(--text);
}

body[data-page="assistant"] .assistant-header .site-title,
body[data-page="assistant"] #desktop-nav,
body[data-page="assistant"] .auth-user-bar {
  display: none !important;
}

body[data-page="assistant"] .assistant-header-inner {
  gap: 10px;
}

body[data-page="assistant"] .assistant-back {
  flex-shrink: 0;
}

body[data-page="assistant"] .assistant-header-title {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}

body[data-page="assistant"] .assistant-header .assistant-conv-toggle {
  display: inline-flex;
  flex-shrink: 0;
  margin-left: auto;
}

body[data-page="assistant"] .assistant-header .site-title p {
  display: none;
}

body[data-page="assistant"] .assistant-main {
  position: fixed;
  top: calc(var(--nav-h) + env(safe-area-inset-top, 0px));
  left: 0;
  right: 0;
  bottom: 0;
  height: auto;
  max-width: none;
  margin: 0;
  padding: 6px 8px calc(8px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: row;
  gap: 8px;
  overflow: hidden;
}

body[data-page="assistant"] .bottom-nav {
  display: none !important;
}

body[data-page="assistant"] .back-to-top {
  display: none !important;
}

.assistant-conv-panel {
  flex-shrink: 0;
  width: 200px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
}

.assistant-conv-title-mobile,
.assistant-conv-close {
  display: none;
}

.assistant-drawer-mode {
  display: block;
  padding: 8px 8px 10px;
  border-bottom: 1px solid var(--border);
}

.assistant-tabs-drawer {
  margin: 0 8px;
}

.assistant-drawer-tools {
  display: block;
  padding: 8px 0 0;
  border-bottom: 1px solid var(--border);
}

.assistant-drawer-tools .assistant-model {
  margin: 0 8px 8px;
}

.assistant-drawer-footer {
  border-bottom: none;
  padding-bottom: 8px;
}

.assistant-drawer-section {
  flex-shrink: 0;
}

.assistant-drawer-label {
  margin: 0 0 6px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-soft);
  letter-spacing: 0.02em;
}

.assistant-conv-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 8px 6px;
}

.assistant-drawer-conversations {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.fact-correction-drawer {
  width: calc(100% - 16px);
  margin: 0 8px 8px;
}

.assistant-conv-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 8px 6px;
  border-bottom: 1px solid var(--border);
}

.assistant-conv-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
}

.assistant-conv-new {
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid transparent;
  border-radius: var(--r-xs);
  cursor: pointer;
  white-space: nowrap;
}

.assistant-conv-new:hover {
  border-color: var(--accent);
}

.assistant-conv-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 0;
  padding: 4px;
  list-style: none;
}

.assistant-conv-empty {
  padding: 12px 8px;
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.5;
}

.assistant-conv-item {
  display: flex;
  align-items: stretch;
  gap: 2px;
  margin-bottom: 2px;
}

.assistant-conv-item.is-active .assistant-conv-btn {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.assistant-conv-btn {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px;
  font-family: inherit;
  text-align: left;
  background: var(--bg-muted);
  border: 1px solid transparent;
  border-radius: var(--r-xs);
  cursor: pointer;
}

.assistant-conv-btn-title {
  width: 100%;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-conv-btn-time {
  font-size: 10px;
  color: var(--text-soft);
}

.assistant-conv-del {
  flex-shrink: 0;
  width: 28px;
  padding: 0;
  font-size: 16px;
  line-height: 1;
  color: var(--text-soft);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-xs);
  cursor: pointer;
}

.assistant-conv-del:hover {
  color: #c0392b;
  background: rgba(192, 57, 43, 0.08);
}

.assistant-conv-backdrop {
  display: none;
}

.assistant-conv-toggle {
  flex-shrink: 0;
  width: 36px;
  height: 32px;
  padding: 0;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
}

.assistant-conv-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
  font-family: inherit;
  color: var(--text-soft);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  cursor: pointer;
}

.assistant-conv-close:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.assistant-workspace {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.assistant-top {
  display: none;
}

.assistant-top-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.assistant-top-row .assistant-tabs {
  flex: 1;
  min-width: 0;
}

.assistant-model {
  flex-shrink: 0;
  display: inline-flex;
  padding: 2px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}

.assistant-model-btn {
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-soft);
  background: transparent;
  border: none;
  border-radius: calc(var(--r-sm) - 2px);
  cursor: pointer;
  white-space: nowrap;
}

.assistant-model-btn.is-active {
  color: var(--accent);
  background: var(--bg-card);
  box-shadow: var(--shadow-xs);
}

.assistant-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 0;
}

.assistant-tab {
  flex: 1;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-soft);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.assistant-tab:hover {
  border-color: var(--accent);
  color: var(--text);
}

.assistant-tab.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.assistant-panel[hidden] {
  display: none !important;
}

.assistant-chat {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.assistant-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 10px;
  background: #f4f6fa;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.assistant-msg {
  max-width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.55;
  border-radius: var(--r-md);
  white-space: pre-wrap;
  word-break: break-word;
}

.assistant-msg-user {
  align-self: flex-end;
  max-width: 88%;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.assistant-msg-assistant {
  align-self: stretch;
  width: 100%;
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.assistant-msg-system {
  align-self: center;
  max-width: 100%;
  font-size: 12px;
  color: var(--text-soft);
  background: transparent;
  padding: 4px 8px;
  text-align: center;
}

.assistant-msg-loading {
  opacity: 0.75;
  font-style: italic;
}

.assistant-input-row {
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
  background: #ffffff;
}

.assistant-input-row textarea {
  color-scheme: light;
  background: #ffffff;
  color: var(--text);
}

.assistant-status {
  flex-shrink: 0;
  min-height: 0;
  font-size: 11px;
  line-height: 1.3;
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 2px 2px;
}
}

.assistant-status.is-ok {
  color: #059669;
}

.assistant-status.is-busy {
  color: var(--accent);
}

.assistant-status.is-error {
  color: #dc2626;
  white-space: normal;
}

.assistant-guides-panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}

.assistant-input-row textarea {
  flex: 1;
  min-width: 0;
  min-height: 38px;
  max-height: 80px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.4;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  resize: none;
  background: var(--bg-card);
}

.assistant-input-row textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.assistant-icon-btn {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  font-family: inherit;
  color: var(--text-soft);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
}

.assistant-icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.assistant-send {
  flex-shrink: 0;
  height: 38px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--r-md);
  cursor: pointer;
}

.assistant-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.assistant-photo-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px 0;
  max-width: 920px;
  margin: 0 auto;
  width: 100%;
}

.assistant-photo-wrap {
  position: relative;
  flex-shrink: 0;
}

#assistant-photo {
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
}

.assistant-photo-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  z-index: 30;
  min-width: 132px;
  padding: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
}

.assistant-photo-menu[hidden] {
  display: none !important;
}

.assistant-photo-menu-item {
  display: block;
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: transparent;
  border: none;
  border-radius: calc(var(--r-md) - 2px);
  cursor: pointer;
}

.assistant-photo-menu-item:hover,
.assistant-photo-menu-item:focus {
  background: var(--accent-soft);
  color: var(--accent);
  outline: none;
}

.assistant-photo-chip {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #f4f6fa;
}

.assistant-photo-chip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.assistant-photo-chip button {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.assistant-msg-user .assistant-msg-photo {
  display: block;
  max-width: 160px;
  max-height: 120px;
  margin-top: 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.assistant-guides-intro {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-soft);
}

.assistant-guides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}

.fact-correction-trigger {
  margin-left: auto;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid #b45309;
  border-radius: var(--r-pill);
  background: #fef3c7;
  color: #92400e;
  cursor: pointer;
  white-space: nowrap;
}

@media (max-width: 640px) {
  body[data-page="assistant"] .assistant-main {
    padding: 4px 6px calc(6px + env(safe-area-inset-bottom, 0px));
  }

  body[data-page="assistant"] .site-header {
    padding-top: max(6px, env(safe-area-inset-top));
    padding-bottom: 6px;
  }

  body[data-page="assistant"] #assistant-clear {
    display: none;
  }

  body[data-page="assistant"] #assistant-photo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .assistant-tabs-drawer .assistant-tab {
    padding: 8px 10px;
    font-size: 13px;
  }
}

.guide-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  text-align: left;
  font-family: inherit;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.guide-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.guide-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.guide-card-desc {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-soft);
}

.guide-card-tag {
  align-self: flex-start;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.nav-card-accent {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--accent-soft) 100%);
}

.nav-card-featured {
  box-shadow: var(--shadow-md);
  border-width: 2px;
}

/* —— 首页 AI 名片卡 —— */
.home-ai-banner {
  position: relative;
  display: block;
  margin: 0 0 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.07) 0%, transparent 42%),
    linear-gradient(135deg, var(--c-ink-800) 0%, var(--c-ink-700) 52%, #3a3228 100%);
  border: 1px solid rgba(180, 83, 9, 0.4);
  border-radius: var(--r-lg);
  color: #fff;
  text-decoration: none;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.home-ai-banner::after {
  content: "";
  position: absolute;
  right: -20px;
  bottom: -20px;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(180, 83, 9, 0.16) 0%, transparent 70%);
  pointer-events: none;
}

.home-ai-banner:hover {
  color: #fff;
  transform: translateY(-2px);
  border-color: var(--c-amber-500);
  box-shadow: 0 16px 32px rgba(15, 26, 43, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.home-ai-banner-badge {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  padding: 5px 11px 6px 13px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.2;
  color: var(--c-ink-900);
  background: linear-gradient(135deg, #fde68a 0%, var(--c-amber-500) 100%);
  border-radius: calc(var(--r-lg) - 1px) 0 var(--r-xs) 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.home-ai-banner-body {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
  padding: 26px 14px 14px;
  min-width: 0;
}

.home-ai-banner-avatar {
  grid-row: 1;
  align-self: center;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--c-amber-700);
  background: linear-gradient(180deg, #fff 0%, var(--c-ink-100) 100%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--r-sm);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.home-ai-banner-info {
  grid-column: 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.home-ai-banner-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.home-ai-banner-desc {
  font-size: 12.5px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.9);
}

.home-ai-banner-meta {
  margin-top: 1px;
  font-size: 10.5px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.52);
  font-family: var(--mono);
  letter-spacing: 0.01em;
}

.home-ai-banner-action {
  grid-column: 3;
  align-self: center;
  flex-shrink: 0;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--c-amber-100);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(253, 230, 138, 0.28);
  border-radius: var(--r-xs);
  white-space: nowrap;
}

@media (min-width: 640px) {
  .home-ai-banner-body {
    column-gap: 14px;
    padding: 28px 16px 16px;
  }

  .home-ai-banner-avatar {
    width: 52px;
    height: 52px;
    font-size: 16px;
  }

  .home-ai-banner-title {
    font-size: 18px;
  }

  .home-ai-banner-desc {
    font-size: 13px;
  }
}

tbody tr.row-highlight td {
  background: var(--accent-soft);
  font-weight: 600;
}

tbody tr.row-highlight td:first-child {
  color: var(--accent);
}

.bottom-nav-tab-accent .ico {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: var(--r-xs);
  font-weight: 800;
  font-size: 12px;
}

.bottom-nav-tab-accent.active .ico,
.bottom-nav-tab-accent.active {
  color: var(--accent);
}

@media (min-width: 768px) {
  body[data-page="assistant"] .assistant-header-inner {
    max-width: none;
    width: 100%;
    padding-left: 20px;
    padding-right: 20px;
  }

  body[data-page="assistant"] .assistant-main {
    left: 0;
    right: 0;
    transform: none;
    max-width: none;
    padding: 10px 20px calc(12px + env(safe-area-inset-bottom, 0px));
    gap: 12px;
  }

  body[data-page="assistant"] .assistant-header .assistant-conv-toggle {
    display: none;
  }

  .assistant-conv-panel {
    display: flex;
    width: 260px;
  }

  .assistant-conv-title-mobile,
  .assistant-conv-close {
    display: none;
  }

  .assistant-guides-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
  }
}

@media (min-width: 1200px) {
  body[data-page="assistant"] .assistant-header-inner {
    padding-left: 28px;
    padding-right: 28px;
  }

  body[data-page="assistant"] .assistant-main {
    padding: 12px 28px calc(14px + env(safe-area-inset-bottom, 0px));
    gap: 16px;
  }

  .assistant-conv-panel {
    width: 300px;
  }

  .assistant-messages {
    padding: 14px 18px;
  }

  .assistant-msg {
    font-size: 15px;
    line-height: 1.6;
  }

  .assistant-input-row textarea {
    min-height: 42px;
    max-height: 120px;
    padding: 10px 12px;
    font-size: 15px;
  }

  .assistant-guides-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
  }

  .guide-card {
    padding: 12px 14px;
  }
}

@media (max-width: 767px) {
  body[data-page="assistant"] .assistant-main {
    flex-direction: column;
  }

  .assistant-conv-panel {
    display: none;
    position: fixed;
    top: calc(var(--nav-h) + env(safe-area-inset-top, 0px));
    left: 0;
    bottom: 0;
    width: min(300px, 88vw);
    z-index: 210;
    box-shadow: var(--shadow-md);
  }

  .assistant-conv-panel.is-open {
    display: flex;
  }

  .assistant-conv-title-desktop {
    display: none;
  }

  .assistant-conv-title-mobile,
  .assistant-conv-close {
    display: inline-flex;
  }

  .assistant-drawer-conversations {
    flex: 1;
    min-height: 120px;
    padding-top: 8px;
  }

  .assistant-conv-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.35);
  }

  .assistant-conv-backdrop[hidden] {
    display: none;
  }

  body[data-page="assistant"] .assistant-header .assistant-conv-toggle {
    width: 40px;
    height: 36px;
    font-size: 18px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer;
    align-items: center;
    justify-content: center;
  }
}

/* —— 回到顶部 —— */
.back-to-top {
  position: fixed;
  right: 14px;
  bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 14px);
  z-index: 190;
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  font-family: inherit;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.92);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.back-to-top:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
}

body[data-page="assistant"] .back-to-top {
  bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 72px);
}

@media (min-width: 900px) {
  .back-to-top {
    right: max(14px, calc(50% - var(--content-max) / 2 - 56px));
  }
}

@media (max-width: 640px) {
  body[data-page="assistant"] .assistant-main {
    padding-left: 6px;
    padding-right: 6px;
  }

  .assistant-send {
    padding: 0 12px;
  }
}

/* ===========================================================================
 * 登录 / 注册 / 管理后台
 * --------------------------------------------------------------------------- */
.auth-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--bg-page);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 28px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
}

.auth-brand {
  text-align: center;
  margin-bottom: 24px;
}

.auth-brand h1 {
  margin: 12px 0 6px;
  font-size: 22px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
}

.auth-field input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 16px;
  background: var(--bg-page);
}

.auth-hint {
  font-weight: 400;
  font-style: normal;
  color: var(--text-muted);
  font-size: 12px;
}

.auth-rules {
  font-size: 12px;
  margin: 0;
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
}

.auth-msg {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  font-size: 13px;
}

.auth-msg.is-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.auth-msg.is-ok {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.auth-msg.is-info {
  background: var(--accent-soft);
  color: var(--accent-hover);
  border: 1px solid var(--accent-ring);
}

.auth-foot {
  margin: 20px 0 0;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}

.auth-user-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
  font-size: 13px;
}

.auth-user-name {
  color: var(--text-muted);
  max-width: 8em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-user-link {
  background: none;
  border: none;
  padding: 4px 8px;
  font-size: 13px;
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
  border-radius: var(--r-xs);
}

.auth-user-link:hover {
  background: var(--accent-soft);
}

.admin-main {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 16px 48px;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th,
.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 12px;
}

.admin-ops {
  white-space: nowrap;
}

.admin-ops .btn-sm {
  padding: 4px 10px;
  font-size: 12px;
  margin-right: 6px;
}

.admin-btn-danger {
  color: #b91c1c;
  border-color: #fecaca;
}

.admin-btn-danger:hover {
  background: #fef2f2;
}

.admin-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 600;
}

.admin-badge-pending { background: #fef3c7; color: #92400e; }
.admin-badge-approved { background: #d1fae5; color: #065f46; }
.admin-badge-rejected { background: #fee2e2; color: #991b1b; }

.admin-logs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-log-item {
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 14px;
}

.admin-log-item header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: baseline;
  margin-bottom: 10px;
  font-size: 13px;
}

.admin-log-item time {
  color: var(--text-muted);
}

.admin-log-q,
.admin-log-a {
  margin: 0 0 8px;
  line-height: 1.5;
  word-break: break-word;
}

.admin-log-q span,
.admin-log-a span {
  display: inline-block;
  min-width: 1.5em;
  margin-right: 6px;
  font-weight: 700;
  color: var(--accent);
}

.admin-log-a span {
  color: var(--c-teal-600, #0d9488);
}

@media (max-width: 640px) {
  .auth-user-bar {
    display: flex;
    font-size: 12px;
    gap: 4px;
  }
  .auth-user-name {
    max-width: 4.5em;
  }
}

.auth-user-link[href="admin.html"] {
  font-weight: 700;
  color: #b45309;
}

.workflow-eight-list {
  margin: 0;
  padding-left: 1.25em;
  line-height: 1.65;
}
.workflow-eight-list li {
  margin-bottom: 14px;
}
.workflow-eight-list li:last-child {
  margin-bottom: 0;
}

/* --- 事实纠错弹窗 --- */
body.fact-modal-open { overflow: hidden; }

.fact-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.fact-modal[hidden] { display: none !important; }

.fact-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.fact-modal-panel {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 90dvh;
  overflow-y: auto;
  background: var(--bg-card, #fff);
  border-radius: var(--r-lg, 16px) var(--r-lg, 16px) 0 0;
  padding: 16px 18px 24px;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
}

@media (min-width: 640px) {
  .fact-modal { align-items: center; }
  .fact-modal-panel { border-radius: var(--r-lg, 16px); max-height: 85vh; }
}

.fact-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.fact-modal-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.fact-modal-close {
  border: none;
  background: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
}

.fact-modal-note {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 14px;
  line-height: 1.5;
}

.fact-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}

.fact-label select,
.fact-label textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 400;
}

.fact-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 14px;
}

.fact-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.fact-summary {
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 12px;
}

.fact-pre {
  font-size: 11px;
  line-height: 1.45;
  max-height: 240px;
  overflow: auto;
  background: #f8fafc;
  padding: 10px;
  border-radius: var(--r-sm);
  white-space: pre-wrap;
  word-break: break-word;
}

.fact-status {
  font-size: 13px;
  margin-top: 10px;
  min-height: 1.2em;
}

.fact-status.is-error { color: #b91c1c; }
.fact-status.is-ok { color: #047857; }
.fact-status.is-busy { color: var(--accent); }

/* ===========================================================================
 * 现场布置图 layout.html
 * --------------------------------------------------------------------------- */
.layout-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 16px;
}
.layout-preview figcaption {
  padding: 8px 12px 12px;
  font-size: 0.88rem;
}
.layout-pdf-wrap {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #f0f2f5;
  min-height: 480px;
}
.layout-pdf-frame {
  display: block;
  width: 100%;
  height: min(72vh, 820px);
  border: 0;
  background: #fff;
}
@media (max-width: 719px) {
  .layout-pdf-section { display: none; }
}

@media print {
  body { background: #fff; padding: 0; }
  .site-header, .bottom-nav, .bottom-nav-popover, .search-bar, .filter-chips, .step-tabs, .toc-inline, .fault-toc-section, .back-to-top { display: none; }
  main { max-width: none; padding: 0; }
  .sensor-card { break-inside: avoid; }
  .sensor-card[open] .sensor-body { display: block; }
}
