/* =====================================================================
   纸盒里的奇妙建筑 · 3D互动美术课件 V1.0
   界面与视觉规范：暖白 / 浅灰底，湖蓝主色，活力橙与柔和黄为强调色
   ===================================================================== */

:root {
  --bg: #f5f2ea;
  --bg-2: #efeade;
  --panel: #ffffff;
  --panel-soft: #fbf9f4;
  --line: #e7e1d4;
  --line-2: #f0ece2;
  --ink: #2b2f33;
  --ink-2: #6d7278;
  --ink-3: #9aa0a6;
  --primary: #2f8fbf;
  --primary-d: #2476a3;
  --primary-l: #e6f2f8;
  --orange: #ef9142;
  --orange-l: #fdefe0;
  --yellow: #f2c95f;
  --ok: #4f9d76;
  --warn: #d9663f;
  --r-s: 9px;
  --r: 14px;
  --r-l: 20px;
  --sh-1: 0 1px 2px rgba(72, 58, 38, .05), 0 4px 14px rgba(72, 58, 38, .05);
  --sh-2: 0 2px 6px rgba(72, 58, 38, .06), 0 12px 34px rgba(72, 58, 38, .08);
  --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Source Han Sans SC", "Noto Sans SC", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  font-family: var(--font);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  background:
    radial-gradient(1200px 600px at 15% -10%, #ffffff 0%, rgba(255, 255, 255, 0) 60%),
    radial-gradient(900px 500px at 100% 0%, #f8f4e9 0%, rgba(248, 244, 233, 0) 55%),
    var(--bg);
  user-select: none;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ===================== 顶栏 ===================== */
.topbar {
  height: 64px;
  flex: 0 0 64px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  background: rgba(255, 255, 255, .82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  z-index: 30;
}

.brand { display: flex; align-items: center; gap: 11px; min-width: 250px; }

.brand-mark {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: linear-gradient(150deg, var(--primary), #4aa8cf);
  box-shadow: 0 4px 12px rgba(47, 143, 191, .28);
  display: grid; place-items: center;
  position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 5px;
  border: 1.5px dashed rgba(255, 255, 255, .55);
  border-radius: 7px;
}
.brand-mark span {
  color: #fff; font-size: 18px; font-weight: 700; letter-spacing: 0;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text b { font-size: 16.5px; letter-spacing: .4px; }
.brand-text i { font-style: normal; font-size: 11.5px; color: var(--ink-3); letter-spacing: .6px; }

.modtabs { display: flex; gap: 6px; flex: 1; justify-content: center; }

.modtab {
  display: flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 13px 0 9px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 10px;
  font-family: inherit; font-size: 14px; color: var(--ink-2);
  cursor: pointer;
  transition: background .16s, color .16s, border-color .16s, transform .16s;
  white-space: nowrap;
}
.modtab em {
  font-style: normal; width: 20px; height: 20px; border-radius: 6px;
  background: var(--line); color: var(--ink-2);
  font-size: 11.5px; font-weight: 700;
  display: grid; place-items: center;
  transition: background .16s, color .16s;
}
.modtab:hover { background: rgba(47, 143, 191, .08); color: var(--primary-d); }
.modtab.active {
  background: var(--primary); color: #fff;
  box-shadow: 0 4px 12px rgba(47, 143, 191, .26);
}
.modtab.active em { background: rgba(255, 255, 255, .24); color: #fff; }

.topbar-right { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  font-size: 17px; cursor: pointer; display: grid; place-items: center;
  font-family: inherit;
  transition: .16s;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }

/* ===================== 通用按钮 ===================== */
.btn {
  height: 38px; padding: 0 15px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-family: inherit; font-size: 14px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .08s;
  white-space: nowrap;
}
.btn:hover { border-color: #cfc7b6; background: var(--panel-soft); }
.btn:active { transform: translateY(1px); }
.btn.small { height: 33px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn.primary {
  background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: 0 3px 10px rgba(47, 143, 191, .24);
}
.btn.primary:hover { background: var(--primary-d); border-color: var(--primary-d); }
.btn.orange {
  background: var(--orange); border-color: var(--orange); color: #fff;
  box-shadow: 0 3px 10px rgba(239, 145, 66, .26);
}
.btn.orange:hover { background: #e58332; }
.btn.ghost { background: rgba(255, 255, 255, .6); }
.btn.flat { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.flat:hover { background: rgba(47, 143, 191, .08); color: var(--primary-d); }
.btn.on { background: var(--primary-l); border-color: #a9d2e5; color: var(--primary-d); font-weight: 600; }
.btn.danger:hover { border-color: #e7b6a4; color: var(--warn); background: #fdf2ee; }
.btn[disabled] { opacity: .42; pointer-events: none; }
.btn.block { width: 100%; }

/* ===================== 工作区 ===================== */
.workspace { position: relative; flex: 1; min-height: 0; }

.module {
  position: absolute; inset: 0;
  display: none;
  padding: 14px;
  gap: 14px;
  grid-template-columns: 264px minmax(0, 1fr) 312px;
}
.module.active { display: grid; }
#mod-museum.active { grid-template-columns: 250px minmax(0, 1fr) 336px; }
#mod-lab.active { grid-template-columns: 250px minmax(0, 1fr) 320px; }
#mod-challenge.active { grid-template-columns: minmax(0, 1fr) 340px; }
#mod-blueprint.active { grid-template-columns: minmax(0, 1fr) 360px; }
#mod-gallery.active { grid-template-columns: minmax(0, 1fr) 340px; }

/* ===================== 面板 ===================== */
.panel {
  background: rgba(255, 255, 255, .9);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  box-shadow: var(--sh-1);
  padding: 14px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex; flex-direction: column; gap: 14px;
  scrollbar-width: thin;
}
.panel::-webkit-scrollbar { width: 8px; }
.panel::-webkit-scrollbar-thumb { background: #ddd6c7; border-radius: 8px; }
.panel::-webkit-scrollbar-track { background: transparent; }

.pgroup { display: flex; flex-direction: column; gap: 10px; }
.pgroup + .pgroup { padding-top: 12px; border-top: 1px dashed var(--line); }

.pg-title {
  margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .5px;
  color: var(--ink-2); display: flex; align-items: center; gap: 7px;
}
.pg-title .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--primary); box-shadow: 0 0 0 3px rgba(47, 143, 191, .14);
}
.pg-title .more { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--ink-3); }

.tip { margin: 0; font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }
.tip b { color: var(--ink-2); }

/* ===================== 舞台 ===================== */
.stage {
  position: relative;
  background: #f8f5ee;
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  box-shadow: var(--sh-1);
  overflow: hidden;
  min-width: 0;
}
.stage .viewport { position: absolute; inset: 0; }
.stage .viewport canvas { display: block; width: 100% !important; height: 100% !important; touch-action: none; }

.stage-top {
  position: absolute; top: 12px; left: 12px; right: 12px;
  z-index: 6;
  display: flex; align-items: flex-start; gap: 8px;
  flex-wrap: wrap;
  pointer-events: none;
}
.stage-top > * { pointer-events: auto; }

.stage-empty {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; text-align: center;
  color: var(--ink-3); font-size: 13.5px;
  pointer-events: none; z-index: 3;
}
.stage-empty b {
  font-size: 17px; color: var(--ink-2); font-weight: 600;
  padding: 12px 26px;
  background: rgba(255, 255, 255, .8);
  border: 1px dashed #d8d0be;
  border-radius: 14px;
}
.stage-empty span { color: var(--ink-3); }

.toolgroup {
  display: flex; align-items: center; gap: 4px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px;
  box-shadow: var(--sh-1);
  backdrop-filter: blur(8px);
}
.toolgroup-sep { width: 1px; height: 22px; background: var(--line); margin: 0 3px; }

.tbtn {
  height: 32px; min-width: 34px; padding: 0 9px;
  border: none; background: transparent; border-radius: 8px;
  color: var(--ink-2); font-family: inherit; font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px; justify-content: center;
  transition: background .14s, color .14s;
  white-space: nowrap;
}
.tbtn:hover { background: rgba(47, 143, 191, .1); color: var(--primary-d); }
.tbtn.on { background: var(--primary); color: #fff; }
.tbtn.on:hover { background: var(--primary-d); color: #fff; }
.tbtn[disabled] { opacity: .35; pointer-events: none; }
.tbtn svg { width: 15px; height: 15px; display: block; }

.stage-bottom {
  position: absolute; left: 12px; right: 12px; bottom: 12px;
  z-index: 6;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 10px;
  pointer-events: none;
}
.stage-bottom > * { pointer-events: auto; }

.stage-hint {
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 13px;
  font-size: 13px; color: var(--ink-2);
  box-shadow: var(--sh-1);
  max-width: 56%;
}
.stage-hint b { color: var(--primary-d); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 9px;
  border-radius: 7px; font-size: 12px; font-weight: 600;
  background: var(--primary-l); color: var(--primary-d);
}
.badge.orange { background: var(--orange-l); color: #c96f26; }
.badge.ok { background: #e8f4ed; color: #37795c; }
.badge.warn { background: #fceee8; color: var(--warn); }
.badge.gray { background: var(--line-2); color: var(--ink-2); }

/* ===================== 材料瓷砖 ===================== */
.tile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }

.tile {
  position: relative;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #fdfbf6);
  border-radius: 11px;
  padding: 6px 3px 6px;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s, transform .1s;
  overflow: hidden;
}
.tile:hover { border-color: #bcd8e6; box-shadow: 0 6px 16px rgba(47, 143, 191, .12); transform: translateY(-1px); }
.tile:active { transform: translateY(0); }
.tile .ico { height: 34px; display: grid; place-items: center; margin-bottom: 2px; }
.tile .ico img { width: 36px; height: 36px; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(90,70,40,.12)); }
.tile .nm { font-size: 11.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .plus {
  position: absolute; top: 5px; right: 5px;
  width: 15px; height: 15px; border-radius: 5px;
  background: var(--primary-l); color: var(--primary-d);
  font-size: 12px; line-height: 15px; opacity: 0; transition: opacity .15s;
}
.tile:hover .plus { opacity: 1; }

/* ===================== 列表 / 卡片 ===================== */
.card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  padding: 12px;
}
.card + .card { margin-top: 8px; }
.card h4 { margin: 0 0 4px; font-size: 14.5px; }
.card p { margin: 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.55; }
.card.clickable { cursor: pointer; transition: .15s; }
.card.clickable:hover { border-color: #bcd8e6; box-shadow: 0 6px 16px rgba(47, 143, 191, .1); }
.card.sel { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(47, 143, 191, .14); }

.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--ink-3); font-size: 12.5px; }

.list { display: flex; flex-direction: column; gap: 7px; }
.list-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 11px;
  background: #fff; cursor: pointer; font-size: 13.5px;
  transition: .15s;
}
.list-item:hover { border-color: #bcd8e6; background: #fcfdfe; }
.list-item.sel { border-color: var(--primary); background: var(--primary-l); }
.list-item .idx {
  width: 22px; height: 22px; border-radius: 7px; flex: 0 0 22px;
  background: var(--line-2); color: var(--ink-2);
  font-size: 12px; font-weight: 700; display: grid; place-items: center;
}
.list-item.sel .idx { background: var(--primary); color: #fff; }
.list-item .txt { flex: 1; min-width: 0; }
.list-item .txt b { font-size: 13.5px; font-weight: 600; display: block; }
.list-item .txt i { font-style: normal; font-size: 11.5px; color: var(--ink-3); }

/* ===================== 表单控件 ===================== */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.field > span { font-size: 12.5px; color: var(--ink-2); }
.input, .textarea, select.input {
  width: 100%; height: 36px;
  border: 1px solid var(--line); border-radius: 9px;
  padding: 0 11px; font-family: inherit; font-size: 13.5px; color: var(--ink);
  background: var(--panel-soft);
  outline: none; transition: .15s;
  user-select: text;
}
.textarea { height: 68px; padding: 8px 11px; resize: none; line-height: 1.5; }
.input:focus, .textarea:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(47, 143, 191, .1); }

.seg {
  display: flex; gap: 3px; padding: 3px;
  background: var(--line-2); border-radius: 10px;
}
.seg button {
  flex: 1; height: 30px; border: none; border-radius: 8px;
  background: transparent; color: var(--ink-2);
  font-family: inherit; font-size: 13px; cursor: pointer; transition: .15s;
}
.seg button.on { background: #fff; color: var(--primary-d); font-weight: 600; box-shadow: 0 1px 4px rgba(72, 58, 38, .1); }

.swatches { display: flex; flex-wrap: wrap; gap: 7px; }
.swatch {
  width: 30px; height: 30px; border-radius: 9px;
  border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line);
  cursor: pointer; transition: .14s; position: relative;
}
.swatch:hover { transform: scale(1.08); }
.swatch.on { box-shadow: 0 0 0 2px var(--primary); transform: scale(1.06); }

.slider-row { display: flex; align-items: center; gap: 9px; }
.slider-row input[type=range] {
  flex: 1; -webkit-appearance: none; height: 4px; border-radius: 4px;
  background: var(--line); outline: none;
}
.slider-row input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 2px solid var(--primary); cursor: pointer;
  box-shadow: 0 1px 4px rgba(72, 58, 38, .2);
}
.slider-row .val { font-size: 12px; color: var(--ink-2); width: 46px; text-align: right; font-variant-numeric: tabular-nums; }

.checkline { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; padding: 5px 0; }
.checkline .ic { width: 17px; height: 17px; border-radius: 50%; flex: 0 0 17px; display: grid; place-items: center; font-size: 11px; margin-top: 1px; }
.checkline .ic.ok { background: #e8f4ed; color: #37795c; }
.checkline .ic.warn { background: #fceee8; color: var(--warn); }
.checkline .ic.info { background: var(--line-2); color: var(--ink-2); }

.kv { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; }
.kv b { font-weight: 600; font-variant-numeric: tabular-nums; }
.kv span { color: var(--ink-2); }

/* ===================== 状态条 ===================== */
.statusbar {
  height: 34px; flex: 0 0 34px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px;
  font-size: 12px; color: var(--ink-3);
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .6);
}
.status-right { display: flex; gap: 14px; }
.kbd-hint b { color: var(--ink-2); font-weight: 600; }

/* ===================== Toast ===================== */
.toast-layer {
  position: fixed; left: 50%; bottom: 64px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  z-index: 90; pointer-events: none;
}
.toast {
  padding: 10px 18px;
  background: rgba(43, 47, 51, .92);
  color: #fff; font-size: 13.5px;
  border-radius: 11px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  animation: toastIn .24s ease both;
}
.toast.ok { background: rgba(58, 122, 92, .95); }
.toast.warn { background: rgba(190, 88, 54, .95); }
.toast.out { animation: toastOut .3s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-6px); } }

/* ===================== Modal ===================== */
.modal-layer {
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: center; justify-content: center;
  background: rgba(40, 36, 30, .34);
  backdrop-filter: blur(3px);
  padding: 30px;
}
.modal-layer.show { display: flex; }
.modal {
  width: min(760px, 100%);
  max-height: 84vh;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(40, 30, 15, .28);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: modalIn .22s ease both;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line-2);
}
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-body { padding: 18px 20px; overflow-y: auto; font-size: 14px; }
.modal-body p { margin: 0 0 10px; }
.modal-foot { padding: 13px 20px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 9px; }
.modal-text { font-size: 14px; color: var(--ink-2); line-height: 1.7; }

/* 使用说明 */
.helpgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.helpgrid h4 { margin: 0 0 6px; font-size: 14px; color: var(--primary-d); }
.helpgrid ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); line-height: 1.75; }

/* ===================== 展签 / 博物馆 ===================== */
.exhibit-strip {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
}
.exhibit {
  border: 1px solid var(--line); border-radius: 12px; padding: 9px 10px;
  background: #fff; cursor: pointer; transition: .15s; position: relative;
}
.exhibit:hover { border-color: #bcd8e6; box-shadow: 0 6px 16px rgba(47,143,191,.1); }
.exhibit.sel { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(47,143,191,.14); background: #fbfdfe; }
.exhibit b { display: block; font-size: 13.5px; }
.exhibit i { font-style: normal; font-size: 11.5px; color: var(--ink-3); }

.qcard {
  background: var(--panel-soft);
  border-left: 3px solid var(--yellow);
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 12.8px; color: var(--ink-2); line-height: 1.6;
  margin-bottom: 7px;
}
.qcard b { color: var(--ink); font-weight: 600; }

/* ===================== 挑战关卡 ===================== */
.level-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.level-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-l);
  padding: 16px; display: flex; flex-direction: column; gap: 9px;
  position: relative; overflow: hidden;
}
.level-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--primary), #6cb8d6);
}
.level-card.l2::before { background: linear-gradient(90deg, var(--yellow), #f6d98b); }
.level-card.l3::before { background: linear-gradient(90deg, var(--orange), #f6b47a); }
.level-card h3 { margin: 4px 0 0; font-size: 16.5px; }
.level-card .lv { font-size: 11.5px; letter-spacing: 1px; color: var(--ink-3); font-weight: 700; }
.level-card p { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.level-card .goal { font-size: 12.5px; background: var(--panel-soft); border-radius: 9px; padding: 8px 10px; color: var(--ink-2); }

/* 施工图 */
.bp-sheet {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  padding: 10px; overflow: auto;
}
.bp-sheet img { width: 100%; display: block; border-radius: 8px; }

/* 展览馆作品卡 */
.work-card { display: flex; gap: 10px; align-items: center; }
.work-card img {
  width: 74px; height: 54px; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--line); background: var(--panel-soft);
}
.eval-row { display: flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 5px 0; }
.eval-row .lb { width: 62px; color: var(--ink-2); flex: 0 0 62px; }
.eval-row .opts { display: flex; gap: 4px; }
.eval-row .opts button {
  height: 26px; padding: 0 9px; border-radius: 7px; border: 1px solid var(--line);
  background: #fff; font-family: inherit; font-size: 11.5px; color: var(--ink-2); cursor: pointer;
}
.eval-row .opts button.on { background: var(--primary-l); border-color: #a9d2e5; color: var(--primary-d); font-weight: 600; }

.empty {
  text-align: center; padding: 26px 16px; color: var(--ink-3); font-size: 13px;
  border: 1px dashed var(--line); border-radius: var(--r);
}
.empty b { display: block; color: var(--ink-2); font-size: 14px; margin-bottom: 4px; }

.scroll-x { overflow-x: auto; }

/* ===================== 3D 标签 ===================== */
.wlabel-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 4; }
.wlabel {
  position: absolute; top: 0; left: 0;
  padding: 4px 11px;
  background: rgba(255, 255, 255, .93);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 12.5px; color: var(--ink);
  box-shadow: 0 2px 8px rgba(72, 58, 38, .09);
  white-space: nowrap;
  transition: opacity .2s;
}
.wlabel.primary { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.wlabel.dim { opacity: .55; }

/* 大屏 1920 适配：字号与间距略微放大 */
@media (min-width: 1700px) {
  body { font-size: 15.5px; }
  .module { padding: 16px; gap: 16px; grid-template-columns: 288px minmax(0, 1fr) 336px; }
  #mod-museum.active { grid-template-columns: 274px minmax(0, 1fr) 360px; }
  #mod-lab.active { grid-template-columns: 274px minmax(0, 1fr) 348px; }
  #mod-challenge.active { grid-template-columns: minmax(0, 1fr) 368px; }
  #mod-blueprint.active { grid-template-columns: minmax(0, 1fr) 390px; }
  #mod-gallery.active { grid-template-columns: minmax(0, 1fr) 368px; }
  .brand-text b { font-size: 17.5px; }
  .modtab { height: 40px; font-size: 14.5px; }
  .btn { height: 40px; font-size: 14.5px; }
}

/* 小屏（笔记本演示） */
@media (max-width: 1366px) {
  .module { grid-template-columns: 232px minmax(0, 1fr) 286px; }
  .brand { min-width: 200px; }
  .modtab { padding: 0 9px 0 7px; font-size: 13px; }
  .modtab em { width: 18px; height: 18px; font-size: 10.5px; }
}

@media (max-width: 1100px) {
  .modtabs { overflow-x: auto; justify-content: flex-start; }
  .module { grid-template-columns: 210px minmax(0, 1fr); }
  .module > .panel.right { display: none; }
}
