/* ==========================================================================
   电气一二次元件三维教学系统 —— 样式表
   ========================================================================== */

/* ---------------------------------------------------------------- *
 *  配色令牌
 *  默认：浅色（白底）主题；[data-theme="dark"] 为深色主题。
 *  切换只改 <html data-theme>，三维视口会跟随重建背景与布光。
 * ---------------------------------------------------------------- */
:root {
  color-scheme: light;

  --bg: #f4f6fa;
  --bg-soft: #eaeff6;
  --panel: #ffffff;
  --panel-2: #f6f9fc;
  --panel-3: #edf1f7;
  --line: #d6dee9;
  --line-soft: #e7ecf3;
  --line-strong: #b6c2d3;

  --text: #16212e;
  --text-dim: #4c5b6d;
  --muted: #67788c;

  --accent: #0b7fb5;
  --accent-bright: #0e9dc9;
  --primary: #c9600f;
  --ok: #0e8c5a;
  --warn: #a9740a;
  --danger: #cb3c36;

  /* 强调色块上的前景文字 */
  --on-accent: #ffffff;
  --on-primary: #ffffff;
  --on-ok: #ffffff;

  /* 半透明叠加的基色：浅色主题用深色，深色主题用白色 */
  --tint: 18, 34, 56;
  --scrim: rgba(18, 34, 56, 0.32);
  --viewport-bg: radial-gradient(circle at 50% 38%, #ffffff 0%, #dde5ef 72%);

  /* 悬浮玻璃层（视口 HUD）与顶栏 / 页脚 */
  --glass: rgba(255, 255, 255, 0.84);
  --glass-bar: rgba(255, 255, 255, 0.9);
  --panel-fade: rgba(255, 255, 255, 0);

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 26px rgba(22, 40, 64, 0.10);
  --topbar-h: 66px;
  --footer-h: 36px;
}

[data-theme="dark"] {
  color-scheme: dark;

  --bg: #080c13;
  --bg-soft: #0d1421;
  --panel: #111a28;
  --panel-2: #16202f;
  --panel-3: #1c2839;
  --line: #223048;
  --line-soft: #1a2536;
  --line-strong: #33486a;

  --text: #dbe5f2;
  --text-dim: #9fb0c6;
  --muted: #6d8099;

  --accent: #4cc9f0;
  --accent-bright: #6ee7ff;
  --primary: #ff8a4c;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;

  --on-accent: #06131d;
  --on-primary: #1b0e05;
  --on-ok: #06231a;

  --tint: 255, 255, 255;
  --scrim: rgba(0, 0, 0, 0.3);
  --viewport-bg: radial-gradient(circle at 50% 38%, #16202f 0%, #080c13 72%);

  --glass: rgba(10, 16, 25, 0.78);
  --glass-bar: rgba(12, 18, 28, 0.9);
  --panel-fade: rgba(17, 26, 40, 0);

  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

/* 主题切换过渡（避免整页跳变） */
body,
.topbar,
.sidebar,
.infopanel,
.footer,
.tool,
.tab,
.chip {
  transition: background-color 0.22s ease, border-color 0.22s ease, color 0.22s ease;
}

* {
  box-sizing: border-box;
}

.is-hidden {
  display: none !important;
}

/* ============================== 元件管理 ==============================
   左列表右表单。字段用两列栅格，长文本（工作原理、结构组成等）占满整行。 */
.admin {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.admin__list {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 8px;
  max-height: 64vh;
  overflow-y: auto;
}
.admin__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  line-height: 1.4;
}
.admin__item:hover {
  background: var(--scrim);
}
.admin__item.is-active {
  background: var(--scrim);
  font-weight: 600;
}
.admin__item b {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin__item span {
  flex: none;
  font-size: 11px;
  color: var(--muted);
}
.admin__pane {
  min-width: 0;
}
.admin__msg {
  margin-bottom: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  border: 1px solid var(--line-soft);
  background: var(--scrim);
  color: var(--text-dim);
}
.admin__msg.is-ok {
  border-color: rgba(52, 211, 153, 0.45);
  color: #0e8c5a;
}
.admin__msg.is-err {
  border-color: rgba(239, 68, 68, 0.45);
  color: #c0392b;
}
.admin__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}
.admin__field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.admin__field--wide {
  grid-column: 1 / -1;
}
.admin__field label {
  font-size: 12px;
  color: var(--muted);
}
.admin__field label i {
  font-style: normal;
  color: #e2574c;
}
.admin__field small {
  font-size: 11px;
  color: var(--text-dim);
}
.admin__field input,
.admin__field select,
.admin__field textarea {
  width: 100%;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
.admin__field textarea {
  min-height: 76px;
  resize: vertical;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
}
.admin__field input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.admin__actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.tool--danger {
  border-color: rgba(239, 68, 68, 0.4);
  color: #c0392b;
}
@media (max-width: 1120px) {
  .admin {
    grid-template-columns: 1fr;
  }
  .admin__list {
    max-height: 220px;
  }
  .admin__grid {
    grid-template-columns: 1fr;
  }
}

/* 信息面板里的供应商联系：一个元件可能有品牌厂家 + 授权代理多家，
   电话做成可点复制（与页脚共用同一套 data-copy 逻辑）。 */
.suppliers {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.supplier {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--scrim);
  padding: 10px 12px;
}
.supplier__head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.supplier__role {
  flex: none;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  color: var(--muted);
}
.supplier__row {
  display: flex;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.85;
}
.supplier__row .k {
  flex: none;
  width: 44px;
  color: var(--muted);
}
.supplier__tel {
  font: inherit;
  font-size: 12.5px;
  padding: 0;
  border: 0;
  border-bottom: 1px dashed currentColor;
  background: none;
  color: var(--accent);
  cursor: pointer;
}
.supplier__note {
  margin: 6px 0 0;
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.65;
}

/* ============================== 选型计算 ==============================
   左参数右结果。结果按「① 计算电流 → ② 断路器 → ③ 电缆 → ④ 互感器」
   分块，每块里公式单独成行、便于照着核算。 */
.calc {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.calc__form {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 16px;
}
.calc__form h3 {
  margin: 0 0 14px;
  font-size: 14px;
}
.calc__grid {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-bottom: 16px;
}
.calc__field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.calc__field > span {
  font-size: 12px;
  color: var(--muted);
}
.calc__field input,
.calc__field select {
  width: 100%;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
.calc__field small {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.55;
}
.calc__hint {
  margin: 10px 0 0;
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.65;
}
.calc__result {
  min-width: 0;
}
.calc__block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.calc__block h4 {
  margin: 0 0 10px;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.calc__block h4 em {
  flex: none;
  font-style: normal;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11.5px;
  background: var(--scrim);
  border: 1px solid var(--line-soft);
  color: var(--muted);
}
.calc__formula {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.7;
  background: var(--scrim);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  margin: 0 0 9px;
  overflow-x: auto;
  white-space: nowrap;
}
.calc__pick {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 7px;
  font-size: 13px;
}
.calc__pick b {
  font-size: 18px;
  color: var(--accent);
}
.calc__pick span {
  color: var(--muted);
  font-size: 12px;
}
.calc__why {
  margin: 9px 0 0;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.7;
}
.calc__ok {
  color: #0e8c5a;
}
.calc__warn {
  color: #c0392b;
  font-weight: 600;
}
.calc__link {
  cursor: pointer;
  border-bottom: 1px dashed currentColor;
}
@media (max-width: 1120px) {
  .calc {
    grid-template-columns: 1fr;
  }
}

/* 统一的元件图形符号渲染样式（描边继承父元素 currentColor） */
.svg-symbol {
  fill: none;
  stroke: currentColor;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(1100px 620px at 18% -10%, rgba(76, 201, 240, 0.10), transparent 60%),
    radial-gradient(900px 520px at 92% 8%, rgba(255, 138, 76, 0.08), transparent 62%),
    var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.62;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.2px;
}

p {
  margin: 0;
}

button {
  font-family: inherit;
  cursor: pointer;
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--line-strong);
  background-clip: content-box;
}

/* ============================== 启动遮罩 ============================== */
.boot {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--bg);
  color: var(--text-dim);
  transition: opacity 0.5s ease, visibility 0.5s;
}
.boot.is-hidden {
  opacity: 0;
  visibility: hidden;
}
.boot__ring {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 3px solid rgba(76, 201, 240, 0.18);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ================================ 顶栏 ================================ */
.topbar {
  height: var(--topbar-h);
  flex: none;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 20px;
  background: var(--glass-bar);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
  position: relative;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.brand__logo {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(140deg, rgba(76, 201, 240, 0.22), rgba(255, 138, 76, 0.18));
  border: 1px solid rgba(76, 201, 240, 0.35);
  color: var(--accent);
}
.brand__logo svg {
  width: 22px;
  height: 22px;
}
.brand__text {
  min-width: 0;
}
.brand__text h1 {
  font-size: 15.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand__text p {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 11px;
  background: rgba(var(--tint), 0.03);
  border: 1px solid var(--line-soft);
  margin-left: auto;
}
.tab {
  border: none;
  background: transparent;
  color: var(--text-dim);
  padding: 7px 15px;
  border-radius: 8px;
  font-size: 13px;
  transition: all 0.18s;
  white-space: nowrap;
}
.tab:hover {
  color: var(--text);
  background: rgba(var(--tint), 0.05);
}
.tab.is-active {
  color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-bright));
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(76, 201, 240, 0.28);
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 268px;
  padding: 0 12px;
  height: 38px;
  border-radius: 10px;
  background: rgba(var(--tint), 0.04);
  border: 1px solid var(--line-soft);
  transition: border-color 0.2s, background 0.2s;
}
.search:focus-within {
  border-color: rgba(76, 201, 240, 0.55);
  background: rgba(76, 201, 240, 0.06);
}
.search svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
  flex: none;
}
.search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}
.search input::placeholder {
  color: var(--muted);
}

/* ================================ 视图 ================================ */
.view {
  display: none;
  flex: 1;
  min-height: 0;
}
.view.is-active {
  display: grid;
}

.view--lab {
  grid-template-columns: 272px minmax(0, 1fr) 392px;
}

/* ============================== 赞助与支持 ==============================
   独立模块。上面是赞助单位卡片墙，下面是广告位。
   卡片的品牌色走 --accent：顶边色条与名称着色共用它。 */
.sponsor-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.sponsor-card {
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent, var(--accent));
  border-radius: var(--radius);
  background: var(--panel);
}
.sponsor-card__logo {
  height: 56px;
  margin-bottom: 11px;
  border-radius: var(--radius-sm);
  background: var(--scrim);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.5px;
}
.sponsor-card__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.sponsor-card h4 {
  margin: 0 0 5px;
  font-size: 14px;
  color: var(--accent, var(--text));
}
.sponsor-card__slogan {
  flex: 1;
  margin: 0;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.65;
}
.sponsor-card__row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  font-size: 12.5px;
}
.sponsor-card__row .k {
  flex: none;
  width: 40px;
  color: var(--muted);
}
.sponsor-card__tel {
  font: inherit;
  font-size: 12.5px;
  padding: 0;
  border: 0;
  border-bottom: 1px dashed currentColor;
  background: none;
  color: var(--accent);
  cursor: pointer;
}

/* 广告位：没填 image 时是虚线占位框（把位置和尺寸写出来），填了就出图 */
.ad-wall {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ad-slot {
  min-height: 96px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--scrim);
  display: grid;
  place-items: center;
  gap: 3px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
.ad-slot img {
  max-width: 100%;
  border-radius: var(--radius-sm);
}
.ad-slot span {
  font-size: 11px;
  color: var(--text-dim);
}

/* ============================== 左侧元件库 ============================== */
.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.sidebar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 16px 11px;
}
.sidebar__head h2 {
  font-size: 13px;
  letter-spacing: 1.4px;
  color: var(--text-dim);
  text-transform: uppercase;
}
.badge {
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 20px;
  background: rgba(76, 201, 240, 0.13);
  color: var(--accent);
  border: 1px solid rgba(76, 201, 240, 0.28);
}

.filters {
  display: flex;
  gap: 6px;
  padding: 0 12px 12px;
}
.filter {
  flex: 1;
  padding: 7px 6px;
  font-size: 12.5px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-soft);
  background: rgba(var(--tint), 0.02);
  color: var(--text-dim);
  transition: all 0.18s;
}
.filter:hover {
  border-color: rgba(76, 201, 240, 0.4);
  color: var(--text);
}
.filter.is-active {
  color: var(--text);
  border-color: transparent;
  background: linear-gradient(135deg, rgba(76, 201, 240, 0.22), rgba(76, 201, 240, 0.08));
  box-shadow: inset 0 0 0 1px rgba(76, 201, 240, 0.45);
}

.complist {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: rgba(var(--tint), 0.022);
  cursor: pointer;
  transition: all 0.16s;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--card-accent, var(--accent));
  opacity: 0.35;
  transition: opacity 0.16s;
}
.card:hover {
  background: rgba(76, 201, 240, 0.07);
  border-color: rgba(76, 201, 240, 0.22);
  transform: translateX(2px);
}
.card.is-active {
  background: linear-gradient(90deg, rgba(76, 201, 240, 0.16), rgba(76, 201, 240, 0.03));
  border-color: rgba(76, 201, 240, 0.45);
}
.card.is-active::before {
  opacity: 1;
}
.card__symbol {
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--scrim);
  border: 1px solid var(--line-soft);
  color: var(--card-accent, var(--accent));
}
.card__symbol svg {
  width: 30px;
  height: 30px;
}
.card__body {
  min-width: 0;
  flex: 1;
}
.card__name {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card__sub {
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card__tag {
  font-size: 10.5px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(var(--tint), 0.06);
  color: var(--text-dim);
  flex: none;
}

.list-empty {
  padding: 28px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
}

.card__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex: none;
}
.card__cat {
  font-size: 10px;
  line-height: 1.6;
  padding: 0 6px;
  border-radius: 5px;
  color: var(--c, var(--accent));
  background: rgba(var(--tint), 0.06);
  border: 1px solid rgba(var(--tint), 0.1);
  white-space: nowrap;
}

.list-group {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  letter-spacing: 0.8px;
  color: var(--muted);
  padding: 14px 7px 6px;
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, var(--panel) 72%, var(--panel-fade));
}
.list-group__dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  flex: none;
}
.list-group__name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-group__num {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 10.5px;
  padding: 0 6px;
  border-radius: 20px;
  background: rgba(var(--tint), 0.06);
  flex: none;
}

/* 视口尺寸标注与网格比例读数 */
.chip--size {
  background: rgba(76, 201, 240, 0.08);
  border-color: rgba(76, 201, 240, 0.22);
  color: var(--text-dim);
  letter-spacing: 0.2px;
}
.chip--real {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.4);
  color: #0e8c5a;
}
[data-theme="dark"] .chip--real {
  color: #6ee7b7;
}

.hud__scale {
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
  color: var(--accent);
  /* 整段标尺说明作为一个整体换行，避免断在「网格 100」和「mm / 格」中间 */
  white-space: nowrap;
  display: inline-block;
}

/* 主题切换按钮：浅色下显示月亮（点击转深色），深色下显示太阳 */
.themebtn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 13px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text-dim);
  font-size: 12.5px;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.themebtn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(76, 201, 240, 0.09);
}
.themebtn__icon {
  width: 15px;
  height: 15px;
  flex: none;
}
.themebtn__icon--light {
  display: none;
}
[data-theme="dark"] .themebtn__icon--dark {
  display: none;
}
[data-theme="dark"] .themebtn__icon--light {
  display: block;
}
@media (max-width: 900px) {
  .themebtn span {
    display: none;
  }
  .themebtn {
    padding: 0 10px;
  }
}

/* ============================== 元件实物图 ============================== */
.stage {
  position: relative;
  min-width: 0;
  background: var(--viewport-bg);
}

/* 底衬：元件库现在只展示实物照片，图片按真实尺寸缩放后四周会留白，
   底衬保证留白与视口同色，不会出现块状色差。 */
.photo-backdrop {
  position: absolute;
  inset: 0;
  background: var(--viewport-bg);
  z-index: 1;
}

/* 实物参考图：尺寸由 JS 按元件真实外形尺寸算好后以像素写入 width/height，
   所以这里只负责居中（略高于几何中心）与等比内缩。
   z-index 压在 .hud(5) 之下，元件名浮层始终可读。 */
.photo {
  position: absolute;
  left: 50%;
  top: 47%;
  transform: translate(-50%, -50%);
  object-fit: contain;
  z-index: 2;
}

/* 没有实物图时的占位说明：直接告诉用户怎么补图 */
.photo-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  text-align: center;
  color: var(--muted);
  z-index: 2;
}
.photo-empty p {
  margin: 0;
  font-size: 14px;
}
.photo-empty span {
  font-size: 11.5px;
  color: var(--text-dim);
}

/* 比例说明：实物图是按真实尺寸缩放的，多大的元件就该占多大地方，
   但小元件受最小显示比例托底，必须把「已放大」写在明面上，不让它悄悄失真。 */
.photo-note {
  position: absolute;
  top: 16px;
  right: 18px;
  max-width: 44%;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--scrim);
  border: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
  text-align: right;
  z-index: 4;
}

.hud {
  position: absolute;
  pointer-events: none;
  z-index: 5;
}
.hud--title {
  top: 16px;
  left: 18px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  border-radius: 11px;
  background: var(--glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line-soft);
}
.hud__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}
.hud--title strong {
  font-size: 14.5px;
}
.chip {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  background: rgba(76, 201, 240, 0.13);
  color: var(--accent);
  border: 1px solid rgba(76, 201, 240, 0.3);
}

/* 视口底部浮层：提示文字在上、工具按钮在下，整体贴底居中。
   两者放在同一个 flex 列里，按钮换行时提示会自动上移，不会互相压住 */
.hud--bottom {
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 36px);
}

.hud--tools {
  display: flex;
  gap: 8px;
  padding: 8px;
  border-radius: 13px;
  background: var(--glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line-soft);
  pointer-events: auto;
  flex-wrap: wrap;
  justify-content: center;
}

.hud--tip {
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
}
.hud--tip em {
  color: var(--accent);
  font-style: normal;
}

.tool {
  border: 1px solid var(--line);
  background: rgba(var(--tint), 0.04);
  color: var(--text-dim);
  font-size: 12.5px;
  padding: 7px 14px;
  border-radius: 9px;
  transition: all 0.16s;
  white-space: nowrap;
}
.tool:hover:not(:disabled) {
  color: var(--text);
  border-color: rgba(76, 201, 240, 0.45);
  background: rgba(76, 201, 240, 0.1);
}
.tool:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.tool.is-on {
  color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-bright));
  border-color: transparent;
  font-weight: 600;
}
.tool--primary {
  color: var(--on-primary);
  background: linear-gradient(135deg, #ffb27a, var(--primary));
  border-color: transparent;
  font-weight: 600;
}
.tool--primary:hover:not(:disabled) {
  color: var(--on-primary);
  background: linear-gradient(135deg, #ffc496, #ff9b63);
  border-color: transparent;
}

/* ============================== 知识面板 ============================== */
.infopanel {
  background: var(--panel);
  border-left: 1px solid var(--line-soft);
  overflow-y: auto;
  min-height: 0;
}

.empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 40px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.empty__icon {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  border: 1px dashed var(--line-strong);
  background:
    linear-gradient(135deg, transparent 45%, var(--line-strong) 45%, var(--line-strong) 55%, transparent 55%),
    linear-gradient(45deg, transparent 45%, var(--line-strong) 45%, var(--line-strong) 55%, transparent 55%);
}

.info__head {
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, var(--accent-soft, rgba(76, 201, 240, 0.1)), transparent);
  position: relative;
}
.info__head::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 100%;
  background: var(--accent, var(--accent));
}
.info__cat {
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--accent, var(--accent));
  text-transform: uppercase;
  margin-bottom: 6px;
}
.info__head h2 {
  font-size: 21px;
  letter-spacing: 0.4px;
}
.info__en {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
  letter-spacing: 0.3px;
}
.info__tagline {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-dim);
  padding-left: 11px;
  border-left: 2px solid rgba(var(--tint), 0.12);
}

.info__block {
  padding: 15px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.info__block h3 {
  font-size: 12px;
  letter-spacing: 1.3px;
  color: var(--accent, var(--accent));
  text-transform: uppercase;
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.info__block h3 span {
  font-size: 10.5px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  font-weight: 400;
}
.info__block p {
  font-size: 13px;
  color: var(--text-dim);
  text-align: justify;
}

.info__block ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.info__block ul li {
  position: relative;
  padding-left: 16px;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 7px;
}
.info__block ul li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent, var(--accent));
  opacity: 0.7;
}
.info__block ul li:last-child {
  margin-bottom: 0;
}

/* 图形符号 */
.symbol-box {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--scrim);
  border: 1px solid var(--line-soft);
}
.symbol-box svg {
  width: 84px;
  height: 84px;
  flex: none;
  fill: none;
  stroke: var(--accent, var(--accent));
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.symbol-meta {
  min-width: 0;
}
.symbol-meta .k {
  font-size: 11px;
  color: var(--muted);
}
.symbol-meta .v {
  font-size: 15px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  color: var(--text);
  font-weight: 600;
}
.symbol-note {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--text-dim);
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: rgba(76, 201, 240, 0.06);
  border-left: 2px solid var(--accent, var(--accent));
  text-align: left;
}

/* 结构列表 */
.struct {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.struct__item {
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-soft);
  background: rgba(var(--tint), 0.02);
  cursor: pointer;
  transition: all 0.16s;
}
.struct__item:hover,
.struct__item.is-on {
  border-color: var(--accent, var(--accent));
  background: rgba(76, 201, 240, 0.09);
  transform: translateX(3px);
}
.struct__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 7px;
}
.struct__name::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent, var(--accent));
  flex: none;
}
.struct__desc {
  font-size: 12.5px;
  color: var(--text-dim);
  margin-top: 3px;
  padding-left: 13px;
}

/* 参数表 */
.params {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.params tr {
  border-bottom: 1px dashed var(--line-soft);
}
.params tr:last-child {
  border-bottom: none;
}
.params td {
  padding: 7px 0;
  vertical-align: top;
  color: var(--text-dim);
}
.params td:first-child {
  width: 40%;
  color: var(--text);
  font-weight: 500;
  padding-right: 10px;
}

/* 外形尺寸 */
.info__dims {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: rgba(var(--tint), 0.035);
  border-left: 2px solid var(--accent);
  font-size: 12px;
  line-height: 1.5;
}
.info__dims-k {
  flex: none;
  color: var(--muted);
  letter-spacing: 0.6px;
}
.info__dims-v {
  color: var(--text-dim);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11.5px;
}

/* 标准规范 */
.standards {
  display: flex;
  flex-direction: column;
  gap: 6px;
  counter-reset: std;
}
.standards li {
  position: relative;
  padding: 7px 10px 7px 30px;
  border-radius: var(--radius-sm);
  background: rgba(var(--tint), 0.025);
  border-left: 2px solid rgba(76, 201, 240, 0.45);
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.55;
  counter-increment: std;
}
.standards li::before {
  content: counter(std);
  position: absolute;
  left: 9px;
  top: 8px;
  width: 15px;
  height: 15px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  color: var(--accent);
  background: rgba(76, 201, 240, 0.12);
}

/* 注意事项 */
.info__block--warn h3 {
  color: var(--warn);
}
.info__block--warn ul li::before {
  background: var(--warn);
}
.info__block--warn {
  background: rgba(251, 191, 36, 0.035);
}

/* 关联元件 */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.rel {
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(var(--tint), 0.03);
  color: var(--text-dim);
  transition: all 0.16s;
}
.rel:hover {
  color: var(--accent);
  border-color: rgba(76, 201, 240, 0.5);
  background: rgba(76, 201, 240, 0.1);
}

/* ============================== 通用页面 ============================== */
.page {
  grid-column: 1 / -1;
  overflow-y: auto;
  padding: 26px 30px 60px;
  min-height: 0;
}
.page__head {
  max-width: 1180px;
  margin: 0 auto 20px;
}
.page__head--row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.page__head h2 {
  font-size: 21px;
  margin-bottom: 6px;
}
.page__head p {
  font-size: 13px;
  color: var(--text-dim);
  max-width: 900px;
}
.muted {
  color: var(--muted);
}

/* ============================== 一次系统图 ============================== */
.diagram {
  max-width: 1180px;
  margin: 0 auto;
  border-radius: var(--radius);
  border: 1px solid var(--line-soft);
  background:
    linear-gradient(180deg, rgba(76, 201, 240, 0.04), transparent 40%),
    var(--panel);
  padding: 10px;
  overflow: auto;
}
.diagram svg {
  display: block;
  width: 100%;
  height: auto;
  min-width: 780px;
}

.dnode {
  cursor: pointer;
}
.dnode .dnode__box {
  fill: var(--panel-2);
  stroke: var(--line-strong);
  stroke-width: 1.4;
  transition: all 0.18s;
}
.dnode:hover .dnode__box {
  fill: rgba(76, 201, 240, 0.16);
  stroke: var(--accent);
}
.dnode__tag {
  fill: var(--accent);
  font-size: 11px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-weight: 700;
}
.dnode__label {
  fill: var(--text-dim);
  font-size: 11.5px;
}
.dnode:hover .dnode__label {
  fill: var(--text);
}
.dsym {
  fill: none;
  stroke: var(--text-dim);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.dnode:hover .dsym {
  stroke: var(--accent);
}
.dwire {
  stroke: var(--line-strong);
  stroke-width: 2.4;
  stroke-linecap: round;
  fill: none;
}
.dwire--bus {
  stroke: #ffb066;
  stroke-width: 6;
}
.dwire--comm {
  stroke: var(--accent-bright);
  stroke-width: 2;
  stroke-dasharray: 9 6;
  opacity: 0.75;
}

/* 图纸切换标签 */
.diagram-tabs {
  max-width: 1180px;
  margin: 0 auto 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.dtool {
  border: 1px solid var(--line);
  background: rgba(var(--tint), 0.03);
  color: var(--text-dim);
  font-size: 13px;
  padding: 8px 18px;
  border-radius: 10px;
  transition: all 0.16s;
}
.dtool:hover {
  color: var(--text);
  border-color: rgba(76, 201, 240, 0.45);
  background: rgba(76, 201, 240, 0.09);
}
.dtool.is-active {
  color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-bright));
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(76, 201, 240, 0.25);
}
.dwire--ground {
  stroke: #9ab52f;
  stroke-width: 2;
}
.dsource {
  fill: var(--panel-3);
  stroke: var(--line-strong);
}
.dline-label {
  fill: var(--muted);
  font-size: 11px;
}

.diagram-legend {
  max-width: 1180px;
  margin: 14px auto 0;
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-dim);
}
.diagram-legend span {
  display: flex;
  align-items: center;
  gap: 7px;
}
.lg {
  width: 22px;
  height: 3px;
  border-radius: 2px;
  display: inline-block;
}
.lg--line { background: var(--line-strong); }
.lg--bus { background: #ffb066; height: 6px; }
.lg--ground { background: #9ab52f; }

/* ============================== 倒闸操作 ============================== */
.ops {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.ops__tasks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line-soft);
}
.ops__task {
  text-align: left;
  padding: 12px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: rgba(var(--tint), 0.025);
  color: var(--text-dim);
  font-size: 13px;
  transition: all 0.16s;
}
.ops__task small {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 3px;
}
.ops__task:hover {
  background: rgba(76, 201, 240, 0.08);
  color: var(--text);
}
.ops__task.is-active {
  background: linear-gradient(135deg, rgba(76, 201, 240, 0.2), rgba(76, 201, 240, 0.04));
  border-color: rgba(76, 201, 240, 0.45);
  color: var(--text);
}

.ops__main {
  padding: 18px 20px 22px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line-soft);
}
.ops__main h3 {
  font-size: 17px;
}
.ops__goal {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 6px;
}
.ops__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}
.ops__count {
  font-size: 12.5px;
  color: var(--text-dim);
  margin-right: auto;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.hint {
  font-size: 12.5px;
  color: var(--warn);
  background: rgba(251, 191, 36, 0.07);
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  margin-bottom: 12px;
}
.hint.is-hidden {
  display: none;
}

.chips--pool {
  margin-bottom: 16px;
}
.op-chip {
  font-size: 12.5px;
  text-align: left;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(var(--tint), 0.03);
  color: var(--text-dim);
  transition: all 0.16s;
  max-width: 100%;
}
.op-chip:hover:not(:disabled) {
  border-color: rgba(76, 201, 240, 0.5);
  background: rgba(76, 201, 240, 0.1);
  color: var(--text);
}
.op-chip:disabled {
  opacity: 0.28;
  cursor: default;
}

.ops__steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.op-step {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-soft);
  background: rgba(var(--tint), 0.02);
  font-size: 13px;
  animation: slideIn 0.25s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: none; }
}
.op-step__no {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 700;
  background: rgba(76, 201, 240, 0.16);
  color: var(--accent);
}
.op-step.is-ok {
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.07);
}
.op-step.is-ok .op-step__no {
  background: rgba(52, 211, 153, 0.2);
  color: var(--ok);
}
.op-step.is-bad {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.08);
}
.op-step.is-bad .op-step__no {
  background: rgba(248, 113, 113, 0.2);
  color: var(--danger);
}
.op-step__text {
  flex: 1;
}
.op-step__tip {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.ops__msg {
  margin-top: 12px;
  font-size: 13px;
}

.ops__rules {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}
.ops__rules h4 {
  font-size: 12px;
  letter-spacing: 1.3px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.ops__rules ul {
  margin: 0;
  padding-left: 18px;
  font-size: 12.5px;
  color: var(--text-dim);
}
.ops__rules li {
  margin-bottom: 6px;
}

/* ============================== 知识自测 ============================== */
.quiz__actions {
  display: flex;
  gap: 9px;
}
.quiz__list {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.quiz__item {
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line-soft);
}
.quiz__q {
  display: flex;
  gap: 11px;
  font-size: 14.5px;
  margin-bottom: 13px;
}
.quiz__no {
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  background: rgba(76, 201, 240, 0.14);
  color: var(--accent);
}
.quiz__opts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-soft);
  background: rgba(var(--tint), 0.02);
  cursor: pointer;
  transition: all 0.16s;
  font-size: 13.5px;
  color: var(--text-dim);
}
.opt:hover {
  border-color: rgba(76, 201, 240, 0.42);
  background: rgba(76, 201, 240, 0.06);
  color: var(--text);
}
.opt input {
  display: none;
}
.opt__key {
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 700;
  border: 1px solid var(--line);
  color: var(--muted);
  transition: all 0.16s;
}
.opt.is-disabled {
  cursor: default;
}
.opt.is-picked {
  border-color: rgba(76, 201, 240, 0.55);
  background: rgba(76, 201, 240, 0.1);
  color: var(--text);
}
.opt.is-picked .opt__key {
  background: var(--accent);
  border-color: transparent;
  color: var(--on-accent);
}
.opt.is-right {
  border-color: rgba(52, 211, 153, 0.6);
  background: rgba(52, 211, 153, 0.12);
  color: var(--text);
}
.opt.is-right .opt__key {
  background: var(--ok);
  border-color: transparent;
  color: var(--on-ok);
}
.opt.is-wrong {
  border-color: rgba(248, 113, 113, 0.6);
  background: rgba(248, 113, 113, 0.1);
  color: var(--text);
}
.opt.is-wrong .opt__key {
  background: var(--danger);
  border-color: transparent;
  color: #2a0808;
}
.quiz__exp {
  margin-top: 13px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(76, 201, 240, 0.06);
  border-left: 2px solid var(--accent);
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.7;
}
.quiz__exp b {
  color: var(--accent);
}
.quiz__result {
  max-width: 1180px;
  margin: 0 auto 16px;
  padding: 18px 22px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(76, 201, 240, 0.14), rgba(255, 138, 76, 0.08));
  border: 1px solid rgba(76, 201, 240, 0.32);
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.quiz__result.is-hidden {
  display: none;
}
.score {
  font-size: 34px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.score small {
  font-size: 14px;
  color: var(--muted);
}

/* ================================ 页脚 ================================ */
.footer {
  flex: none;
  height: var(--footer-h);
  padding: 0 20px;
  display: flex;
  align-items: center;
  background: var(--glass-bar);
  border-top: 1px solid var(--line-soft);
  position: relative;
  z-index: 15;
}
.footer__inner {
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  font-size: 12px;
}
.footer__org {
  color: var(--muted);
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.footer__contact {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: none;
  white-space: nowrap;
  color: var(--text-dim);
}
.footer__label {
  color: var(--muted);
  letter-spacing: 0.5px;
}
.footer__contact b {
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.5px;
}
.footer__tel {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.5px;
  letter-spacing: 0.6px;
  padding: 2px 11px;
  border-radius: 20px;
  border: 1px solid rgba(76, 201, 240, 0.32);
  background: rgba(76, 201, 240, 0.09);
  color: var(--accent);
  transition: all 0.16s;
}
.footer__tel:hover {
  background: rgba(76, 201, 240, 0.2);
  border-color: var(--accent);
}
.footer__tel.is-copied {
  color: var(--ok);
  border-color: rgba(52, 211, 153, 0.6);
  background: rgba(52, 211, 153, 0.16);
}

/* ================================ 响应式 ================================ */
@media (max-width: 1360px) {
  .view--lab {
    grid-template-columns: 240px minmax(0, 1fr) 350px;
  }
  .search {
    width: 210px;
  }
}

@media (max-width: 1120px) {
  body {
    overflow: auto;
    height: auto;
  }
  .topbar {
    height: auto;
    flex-wrap: wrap;
    padding: 10px 14px;
    gap: 12px;
  }
  .tabs {
    order: 3;
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
  }
  .search {
    margin-left: auto;
    width: 180px;
  }
  .view {
    flex: none;
  }
  .view--lab {
    grid-template-columns: 1fr;
  }
  .stage {
    height: 58vh;
    min-height: 380px;
  }
  .sidebar {
    max-height: 260px;
    border-right: none;
    border-bottom: 1px solid var(--line-soft);
  }
  .infopanel {
    border-left: none;
  }
  .ops {
    grid-template-columns: 1fr;
  }
  .footer {
    height: auto;
    padding: 8px 14px;
  }
  .footer__inner {
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
  }
  .footer__org {
    display: none;
  }
}
