/* ============================================================
   探物志 · 上海非遗交互数字平台
   视觉方向：Organic（有机数字展陈）
   砂色主表面 / 苔绿结构 / 赭石·陶土仅用于可操作与错误 / 深松墨
   ============================================================ */

:root {
  --sand: #E8DCC7;
  --sand-deep: #DECFB4;
  --sand-light: #F1E8D6;
  --moss: #606C38;
  --sage: #8B9D83;
  --sage-light: #A9B8A0;
  --ochre: #C08E3A;
  --terracotta: #C66B3D;
  --ink: #2B3327;
  --ink-soft: #4A5344;
  --ink-faint: #7A8172;
  --paper: rgba(241, 232, 214, 0.92);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --shadow-soft: 0 10px 30px rgba(43, 51, 39, 0.14);
  --shadow-lift: 0 18px 44px rgba(43, 51, 39, 0.22);
  --serif: "Noto Serif SC", "Songti SC", "STSong", serif;
  --sans: "PingFang SC", "Microsoft YaHei", sans-serif;
  --t-fast: 220ms;
  --t-med: 380ms;
  --t-slow: 500ms;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--sand);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* 纸面颗粒：SVG feTurbulence，≤3% 不透明度 */
#grain {
  position: fixed; inset: 0; z-index: 2000; pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}

#app { min-height: 100vh; display: flex; flex-direction: column; }

/* 全站法务信息：固定于纸面底边，始终可查但不争夺内容层级 */
.site-legal {
  position: fixed;
  left: 50%;
  bottom: 8px;
  z-index: 70;
  transform: translateX(-50%);
  padding: 2px 10px;
  border-bottom: 1px solid rgba(96, 108, 56, 0.28);
  background: rgba(232, 220, 199, 0.76);
  color: var(--ink-faint);
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: 0.06em;
  white-space: nowrap;
  pointer-events: none;
  transition: color var(--t-med) ease, border-color var(--t-med) ease;
}
.site-legal a { color: inherit; pointer-events: auto; }
.site-legal:hover { color: var(--moss); border-color: rgba(96, 108, 56, 0.58); }

h1, h2, h3, .serif { font-family: var(--serif); font-weight: 600; }

button {
  font-family: var(--sans); cursor: pointer; border: none; background: none;
  color: inherit; font-size: inherit;
}
button:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--terracotta); outline-offset: 3px; border-radius: 6px;
}

a { color: var(--moss); text-decoration: none; }
a:hover { color: var(--terracotta); }

/* ---------- 通用组件 ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 30px; border-radius: 999px;
  font-size: 16px; letter-spacing: 0.06em;
  transition: transform var(--t-fast) ease, box-shadow var(--t-fast) ease, background var(--t-fast) ease;
  user-select: none;
}
.btn-primary {
  background: var(--terracotta); color: var(--sand-light);
  box-shadow: 0 6px 18px rgba(198, 107, 61, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(198, 107, 61, 0.45); }
.btn-ghost {
  color: var(--ink); border-bottom: 1.5px solid var(--moss);
  border-radius: 0; padding: 4px 2px; letter-spacing: 0.08em;
}
.btn-ghost:hover { color: var(--terracotta); border-color: var(--terracotta); }
.btn-moss {
  background: var(--moss); color: var(--sand-light);
  box-shadow: 0 6px 18px rgba(96, 108, 56, 0.3);
}
.btn-moss:hover { transform: translateY(-2px); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none !important; }

.tag {
  display: inline-block; padding: 1px 9px; border-radius: 999px;
  font-size: 11px; letter-spacing: 0.1em; line-height: 1.9;
  vertical-align: middle; white-space: nowrap;
}
.tag-review { background: rgba(192, 142, 58, 0.16); color: #8A6420; border: 1px solid rgba(192, 142, 58, 0.45); }
.tag-verified { background: rgba(96, 108, 56, 0.14); color: var(--moss); border: 1px solid rgba(96, 108, 56, 0.46); }
.tag-pending { background: rgba(139, 157, 131, 0.18); color: var(--moss); border: 1px solid rgba(139, 157, 131, 0.55); }
.tag-err { background: rgba(198, 107, 61, 0.14); color: var(--terracotta); border: 1px solid rgba(198, 107, 61, 0.5); }
.tag-ai { margin-right: 4px; background: rgba(192,142,58,0.14); color: #7A5A1C; border: 1px solid rgba(192,142,58,0.46); }

.muted { color: var(--ink-faint); }
.small { font-size: 13px; }

/* 旧印章样式保留给历史内容；全站品牌入口统一使用透明猫头 Logo。 */
.seal {
  width: 44px; height: 44px; border-radius: 8px;
  background: var(--ink); color: var(--sand);
  display: inline-grid; place-items: center;
  font-family: var(--serif); font-size: 15px; font-weight: 600; line-height: 1;
  writing-mode: horizontal-tb; letter-spacing: 0.08em; text-indent: 0.08em;
  box-shadow: inset 0 0 0 1.5px rgba(232, 220, 199, 0.5), 0 4px 10px rgba(43,51,39,0.25);
  flex: none;
}

.brand-logo {
  width: 44px; height: 44px; flex: none; display: block;
  object-fit: contain; user-select: none; -webkit-user-drag: none;
  filter: drop-shadow(0 3px 6px rgba(43, 51, 39, 0.16));
}

/* 小蕉猫剪影（纯 CSS） */
.cat { position: relative; width: 34px; height: 26px; flex: none; }
.cat::before { /* 身体+头 */
  content: ""; position: absolute; left: 3px; bottom: 0;
  width: 26px; height: 20px; background: var(--ink);
  border-radius: 46% 46% 42% 42% / 60% 60% 40% 40%;
}
.cat::after { /* 尾巴 */
  content: ""; position: absolute; right: -2px; bottom: 2px;
  width: 12px; height: 14px; border: 3.5px solid var(--ink);
  border-left: none; border-bottom: none; border-radius: 0 12px 0 0;
  transform: rotate(18deg);
}
.cat .ears { position: absolute; left: 5px; top: 0; width: 22px; height: 9px; }
.cat .ears::before, .cat .ears::after {
  content: ""; position: absolute; top: 0;
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-bottom: 9px solid var(--ink);
}
.cat .ears::before { left: 0; transform: rotate(-14deg); }
.cat .ears::after { right: 0; transform: rotate(14deg); }
.cat .eyes { position: absolute; left: 9px; top: 11px; width: 14px; height: 4px; z-index: 2; }
.cat .eyes::before, .cat .eyes::after {
  content: ""; position: absolute; width: 4px; height: 4px; border-radius: 50%;
  background: #E9B949; box-shadow: 0 0 5px rgba(233, 185, 73, 0.9);
}
.cat .eyes::before { left: 0; }
.cat .eyes::after { right: 0; }

/* 顶部导航 */
.topnav {
  position: absolute; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px 42px;
}
.topnav .brand { display: flex; align-items: center; gap: 14px; }
.topnav .brand .name { font-family: var(--serif); font-size: 15px; letter-spacing: 0.14em; color: var(--ink); }
.topnav nav { display: flex; gap: 34px; font-size: 14px; letter-spacing: 0.12em; }
.topnav nav a { color: var(--ink-soft); position: relative; padding: 4px 0; }
.topnav nav a.active { color: var(--ink); }
.topnav nav a.active::after {
  content: ""; position: absolute; left: 20%; right: 20%; bottom: -4px;
  border-bottom: 2px solid var(--terracotta);
}
.topnav nav a:hover { color: var(--terracotta); }
.topnav nav { align-items: center; }
.admin-entry-link { opacity: 0.68; }
.admin-mode-link { color: var(--terracotta) !important; }
.admin-nav-logout {
  color: var(--ink-faint); font-size: 12px; letter-spacing: 0.08em;
  border: 1px solid rgba(96,108,56,0.34); border-radius: 999px; padding: 3px 10px;
}
.admin-nav-logout:hover { color: var(--terracotta); border-color: var(--terracotta); }

/* 视图容器与过渡 */
.view { flex: 1; display: flex; flex-direction: column; animation: viewIn var(--t-med) ease both; }
@keyframes viewIn { from { opacity: 0; } to { opacity: 1; } }
.route-mount { display: contents; }

/* ---------- 首页 ---------- */

.home { position: relative; min-height: 100vh; overflow: hidden; }

/* t01/t02 亮度分层背景（assets/bg 与 assets/bg2 的 layer-*.webp，manifest 驱动） */
.bg-stack { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; contain: layout paint style; }
.bg-stack.bg-fixed { position: fixed; } /* 长页面（地图页）铺满视口 */
.bg-layer {
  position: absolute; inset: -3%; width: 106%; height: 106%;
  object-fit: cover; transform: scale(1.04);
  user-select: none;
  /* 后景保留墨色的空气感，前景保留原图细节；避免统一 blur 造成整张图发糊。 */
  transform-origin: center;
  transition: filter 520ms ease;
}
.bg-layer[data-role="wash"] { filter: blur(1.35px) saturate(.86); opacity: .82; }
.bg-layer[data-role="mid"] { filter: blur(.82px) saturate(.92); opacity: .88; }
.bg-layer[data-role="dark"] { filter: blur(.34px) saturate(.98); }
.bg-layer[data-role="gold"] { filter: none; opacity: .98; }
.bg-layer[data-role="detail"] { filter: none; opacity: 1; }
.bg-layer.is-bg-moving { will-change: transform; }
.bg-layer.is-bg-transitioning { will-change: transform, opacity; }
.bg-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(100deg,
    rgba(232, 220, 199, 0.9) 0%,
    rgba(232, 220, 199, 0.72) 30%,
    rgba(232, 220, 199, 0.28) 55%,
    rgba(232, 220, 199, 0) 78%);
}
/* 顶部导航/工具栏可读性纱罩（地图页） */
.bg-scrim-top {
  background: linear-gradient(180deg,
    rgba(241, 232, 214, 0.78) 0%,
    rgba(241, 232, 214, 0.34) 30%,
    rgba(241, 232, 214, 0) 58%);
}

.home .hero-copy {
  position: relative; z-index: 10;
  max-width: 620px; padding: 20vh 0 0 9vw;
}
.home h1 {
  font-size: clamp(30px, 3.8vw, 48px); line-height: 1.5;
  letter-spacing: 0.05em; color: var(--ink);
}
@media (min-width: 900px) { .home h1 { white-space: nowrap; } }
.home .lede { margin: 26px 0 40px; max-width: 420px; color: var(--ink-soft); font-size: 16px; }
.home .cta-row { display: flex; align-items: center; gap: 30px; flex-wrap: wrap; }
.home .hero-stats {
  display: flex; gap: 40px; color: var(--ink-soft); font-size: 13.5px;
}
.home .hero-stats b { font-family: var(--serif); font-size: 24px; color: var(--ink); margin-right: 6px; font-weight: 600; }
.home .cat-hint {
  position: absolute; left: 42px; bottom: 34px; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  color: var(--ink-faint); font-size: 12px; letter-spacing: 0.12em;
}
.home .cat-hint .cat-hint-logo { width: 42px; height: 42px; }

/* 「点击任意键继续」：主行动召唤，屏幕中心偏下、呼吸光晕 */
.press-hint {
  position: absolute; left: 50%; top: 53%; transform: translate(-50%, -50%);
  z-index: 12; margin: 0; white-space: nowrap;
  color: var(--ink); font-size: 17px; letter-spacing: 0.42em; text-indent: 0.42em;
  text-shadow:
    0 0 8px rgba(241, 232, 214, 0.95),
    0 0 22px rgba(241, 232, 214, 0.85),
    0 1px 2px rgba(241, 232, 214, 0.9);
  animation: hintPulse 2.4s ease-in-out infinite;
  pointer-events: none; user-select: none;
}
@keyframes hintPulse {
  0%, 100% { opacity: 0.55; transform: translate(-50%, -50%) scale(0.985); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* 统计块：数字行 + 下方左对齐的从属说明 */
.home .hero-block { position: relative; z-index: 10; padding-left: 9vw; margin-top: 6vh; }
.home .stats-note {
  margin: 10px 0 0; font-size: 12px; color: var(--ink-faint); letter-spacing: 0.05em;
  text-shadow: 0 0 6px rgba(241, 232, 214, 0.8);
}

/* 墨晕画布（inkbloom）：叠于分层背景/scrim 之上、UI 之下 */
.bg-bloom { position: absolute; inset: 0; width: 100%; height: 100%; }
.home-particle-field {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; mix-blend-mode: multiply;
  opacity: 0.86; filter: saturate(0.92);
}

/* 跨页转场：旧背景在路由切换期间提升为全屏 ghost，与新页 base 层交叉淡融 */
.bg-ghost { position: fixed !important; inset: 0; z-index: 60; pointer-events: none; will-change: opacity; }

/* 转场通用淡出：UI 先行淡出；reduced-motion 时整页交叉淡入淡出 */
.ui-fade { opacity: 0 !important; transition: opacity 240ms ease !important; }
.page-xfade { opacity: 0; transition: opacity 240ms ease; }

/* map_enter：自首页穿越转场进入地图页时的淡入标记 */
.view.map_enter { animation: viewIn var(--t-slow) ease both; }

/* ---------- 地图页 ---------- */

.explore { position: relative; min-height: 100vh; display: flex; flex-direction: column; }
.explore .topnav { position: relative; z-index: 10; }
.explore .stage-wrap { position: relative; z-index: 10; flex: 1; padding: 0 0 26px; }
.explore.is-map-mode { height: 100vh; height: 100svh; min-height: 560px; overflow: hidden; }
.explore.is-map-mode .topnav { position: absolute; top: 0; left: 0; right: 0; z-index: 50; }
.explore.is-map-mode .stage-wrap {
  position: absolute; inset: 0; display: block; min-height: 0; padding: 0; overflow: hidden;
}
.explore.is-map-mode .toolbar {
  position: absolute; top: 96px; left: 0; right: 0; z-index: 30;
}
.explore.is-map-mode .map-holder { position: absolute; inset: 0; }
.explore.is-map-mode .map-view,
.explore.is-map-mode .map3d-wrap { position: absolute; inset: 0; width: auto; height: auto; min-height: 0; }
.explore.is-map-mode .map3d-wrap { border-radius: 0; }
.explore.is-map-mode .map-caption {
  position: absolute; left: 0; right: 0; bottom: 38px; z-index: 5; margin: 0;
}
.explore.is-map-mode .map-legend {
  position: absolute; left: 0; right: 0; bottom: 10px; z-index: 5; margin: 0;
}
.explore .toolbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  min-height: 52px; box-sizing: border-box; padding: 0 3vw 14px;
}
.explore .toolbar input[type="search"] {
  background: var(--paper); border: 1.5px solid var(--sage); border-radius: 999px;
  padding: 9px 18px; font-size: 14px; width: 230px; color: var(--ink); font-family: var(--sans);
}
.explore .toolbar input[type="search"]:focus { outline: none; border-color: var(--moss); }
.explore .toolbar select {
  background: var(--paper); border: 1.5px solid var(--sage); border-radius: 999px;
  padding: 9px 14px; font-size: 14px; color: var(--ink); font-family: var(--sans);
}
.seg { display: inline-flex; background: rgba(139,157,131,0.18); border-radius: 999px; padding: 3px; }
.seg button { padding: 6px 18px; border-radius: 999px; font-size: 13.5px; color: var(--ink-soft); letter-spacing: 0.1em; }
.seg button.on { background: var(--moss); color: var(--sand-light); }
.map-zoom-controls { display: inline-flex; gap: 4px; padding: 3px; border-radius: 999px; background: rgba(241,232,214,.55); }
.map-zoom-controls button { padding: 6px 10px; border-radius: 999px; color: var(--ink-soft); font: inherit; font-size: 11px; }
.map-zoom-controls button:hover, .map-zoom-controls button:focus-visible { color: var(--terracotta); background: rgba(241,232,214,.82); outline: none; }
.map-search-results {
  position: absolute; z-index: 44; top: 142px; left: 3vw; width: min(410px, calc(100vw - 6vw));
  max-height: min(58vh, 520px); overflow-y: auto; padding: 8px;
  border: 1px solid rgba(96,108,56,.28); border-radius: 8px;
  background: rgba(241,232,214,.97); box-shadow: var(--shadow-lift); backdrop-filter: blur(8px);
}
.map-search-results[hidden] { display: none; }
.map-search-result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px 9px; color: var(--ink-soft); font-size: 12px; }
.map-search-result-head button { color: var(--ink-faint); font-size: 11px; }
.map-search-result {
  width: 100%; min-height: 48px; display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: center; gap: 12px; padding: 9px 10px; border-top: 1px solid rgba(96,108,56,.15);
  color: var(--ink); text-align: left;
}
.map-search-result:hover, .map-search-result:focus-visible { background: rgba(139,157,131,.15); outline: none; }
.map-search-result span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-search-result small { color: var(--moss); font-size: 11px; white-space: nowrap; }

.map-stage { position: relative; width: 100%; max-width: 1080px; margin: 0 auto; }
.map-stage svg { width: 100%; height: auto; display: block; }

/* 三维地图：无框嵌入背景画（透明渲染底 + 无卡片边框），全宽边到边 */
.map3d-wrap {
  position: relative; width: 100%; height: min(68vh, 700px); min-height: 400px;
  transform-origin: right center;
  transition: transform 520ms cubic-bezier(0.24, 0.78, 0.3, 1);
  isolation: isolate;
  overflow: hidden;
  border-radius: 28px;
  background:
    radial-gradient(ellipse at 82% 48%, rgba(139,157,131,0.10), transparent 42%),
    linear-gradient(to top, rgba(232,220,199,0.20), rgba(232,220,199,0.06) 24%, transparent 58%);
}
.map3d-wrap::before,
.map3d-wrap::after {
  content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none;
}
.map3d-wrap::before {
  background:
    linear-gradient(to top, rgba(232,220,199,0.20) 0%, rgba(232,220,199,0.10) 17%, transparent 45%),
    radial-gradient(ellipse at 21% 84%, rgba(212,220,207,0.28), transparent 43%);
  mix-blend-mode: screen;
}
.map3d-wrap::after {
  inset: auto -4% 0; height: 42%;
  background:
    radial-gradient(ellipse at 28% 100%, rgba(232,220,199,0.20), transparent 64%),
    linear-gradient(to top, rgba(232,220,199,0.16), transparent 76%);
  filter: blur(10px);
  opacity: .76;
}
.map-view { position: relative; min-height: 400px; }
.map-view.is-district-focus .map3d-wrap { transform: translateY(2vh) scale(0.94); }
.map-view.is-district-focus.has-project-detail .map3d-wrap { transform: translateY(2vh) scale(0.86); }
.map-view.is-district-focus > .map-caption,
.map-view.is-district-focus > .map-legend { opacity: 0; pointer-events: none; }
.map3d-canvas { position: relative; z-index: 1; display: block; width: 100%; height: 100%; }
.map3d-loading {
  position: absolute; inset: 0; z-index: 8; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
  color: var(--ink-faint); letter-spacing: 0.14em; font-size: 13px;
  background: radial-gradient(ellipse at center, rgba(241,232,214,0.5), transparent 68%);
}
.map-loading-silhouette {
  width: min(42vw, 300px); aspect-ratio: 1.55; opacity: 0.32;
  border-radius: 61% 39% 58% 42% / 45% 56% 44% 55%;
  background:
    radial-gradient(circle at 27% 34%, rgba(96,108,56,0.38) 0 9%, transparent 10%),
    radial-gradient(circle at 69% 62%, rgba(192,142,58,0.28) 0 8%, transparent 9%),
    linear-gradient(138deg, rgba(96,108,56,0.22), rgba(139,157,131,0.62));
  filter: blur(0.4px); animation: mapLoadBreath 2.4s ease-in-out infinite alternate;
}
@keyframes mapLoadBreath { to { opacity: 0.52; transform: translateY(-4px) scale(1.015); } }
.map3d-loading .btn-ghost { background: rgba(241,232,214,0.78); }
.map-anchor-overflow {
  position: absolute; left: 50%; bottom: 18px; z-index: 36; transform: translateX(-50%);
  padding: 7px 13px; border-radius: 999px; color: var(--ink-faint); font-size: 12px;
  background: rgba(241,232,214,0.86); box-shadow: var(--shadow-soft); pointer-events: none;
}
.map-anchor-overflow.is-action { pointer-events: auto; border: 1px solid rgba(96,108,56,.28); }
.map-anchor-overflow.is-action:not(:disabled):hover,
.map-anchor-overflow.is-action:not(:disabled):focus-visible { color: var(--moss); background: rgba(241,232,214,.97); border-color: var(--moss); }
.map-anchor-overflow.is-action:disabled { cursor: default; }
.craft-list-more { display: block; margin: 22px auto 8px; }
.map3d-focus-overlay { position: absolute; inset: 0; z-index: 20; }
.map-heritage-marker-layer { position: absolute; inset: 0; z-index: 18; pointer-events: none; }
.map-heritage-marker-layer[hidden] { display: none; }
.map-heritage-marker {
  position: absolute; left: 0; top: 0; width: 32px; height: 39px;
  transform: translate3d(var(--map-x, 0), var(--map-y, 0), 0) translate(-50%, -92%);
  display: grid; place-items: center; pointer-events: none; user-select: none; color: var(--paper);
  filter: drop-shadow(0 7px 8px rgba(43,51,39,.24)); transition: opacity var(--t-fast) ease;
}
.map-heritage-marker-icon {
  position: absolute; inset: 0; background: #718064;
  -webkit-mask: url("../assets/地图,图钉,标记,标点.png") center / contain no-repeat;
  mask: url("../assets/地图,图钉,标记,标点.png") center / contain no-repeat;
}
.map-heritage-marker.is-folded .map-heritage-marker-icon::before,
.map-heritage-marker.is-folded .map-heritage-marker-icon::after {
  content: ""; position: absolute; inset: 0; z-index: -1; background: #718064;
  -webkit-mask: url("../assets/地图,图钉,标记,标点.png") center / contain no-repeat;
  mask: url("../assets/地图,图钉,标记,标点.png") center / contain no-repeat;
  opacity: .34;
}
.map-heritage-marker.is-folded .map-heritage-marker-icon::before { transform: translate(-4px, 2px) scale(.92); }
.map-heritage-marker.is-folded .map-heritage-marker-icon::after { transform: translate(4px, 3px) scale(.88); opacity: .22; }
.map3d-wrap .slip-panel { z-index: 45; }
.focus-bar { display: flex; align-items: center; gap: 18px; padding: 10px 3vw 14px; }
/* 平面兜底地图的转场进场：轻微放大落定 */
.map-stage.enter-pop { animation: enterPop var(--t-slow) cubic-bezier(0.2, 0.8, 0.3, 1) both; }
@keyframes enterPop { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }
.map-stage.model-ready { aspect-ratio: 100 / 68; min-height: 500px; overflow: hidden; border-radius: 28px; background: radial-gradient(ellipse at 50% 48%, rgba(241,232,214,0.68), rgba(139,157,131,0.07) 65%, transparent 82%); }
.map-stage.model-ready svg, .map-stage.model-ready + .map-caption, .map-stage.model-ready + .map-caption + .map-legend { display: none; }
.model-map-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }
.model-map-hint { position: absolute; left: 22px; bottom: 18px; z-index: 4; padding: 6px 12px; border: 1px solid rgba(96,108,56,0.28); border-radius: 999px; background: rgba(241,232,214,0.78); color: var(--ink-faint); font-size: 11.5px; letter-spacing: 0.08em; pointer-events: none; }
.model-map-tooltip { position: absolute; z-index: 5; min-width: 128px; padding: 9px 12px; border: 1px solid rgba(192,142,58,0.55); border-radius: 12px; background: rgba(241,232,214,0.92); box-shadow: var(--shadow-soft); opacity: 0; transform: translateY(-100%); transition: opacity var(--t-fast) ease; pointer-events: none; }
.model-map-tooltip strong, .model-map-tooltip span { display: block; }
.model-map-tooltip strong { color: var(--ink); font-family: var(--serif); font-size: 14px; letter-spacing: 0.08em; }
.model-map-tooltip span { margin-top: 2px; color: var(--ink-faint); font-size: 11px; }

.district { cursor: pointer; transition: opacity var(--t-med) ease, filter var(--t-med) ease, transform var(--t-med) ease; }
.district .tile {
  fill: rgba(139, 157, 131, 0.16); stroke: rgba(96, 108, 56, 0.4); stroke-width: 0.35;
  transition: fill var(--t-med) ease, stroke var(--t-med) ease;
}
.district .dname { fill: var(--ink-faint); font-size: 2.6px; font-family: var(--sans); letter-spacing: 0.06em; }
.district .dcount { fill: var(--ink-faint); font-size: 1.9px; font-family: var(--sans); }
.district.live { cursor: pointer; }
.district.live .tile { fill: rgba(96, 108, 56, 0.3); stroke: var(--moss); stroke-width: 0.5; }
.district.live .dname { fill: var(--ink); }
.district:hover .tile, .district.hover .tile { fill: rgba(96, 108, 56, 0.45); stroke: var(--terracotta); }
.district:hover, .district.hover { transform: translateY(-1.6px); filter: drop-shadow(0 6px 8px rgba(43,51,39,0.3)); }
.map-stage.dimmed .district:not(.hover) { opacity: 0.35; }
.district.focused .tile { fill: rgba(96, 108, 56, 0.22); stroke: var(--terracotta); stroke-width: 0.6; }
.map-stage.focusing .district:not(.focused) { opacity: 0.22; }
.map-stage.focusing .district:not(.focused) .dname,
.map-stage.focusing .district:not(.focused) .dcount,
.map-stage.focusing .district:not(.focused) .dots { opacity: 0; }

.dots circle { fill: var(--ink); opacity: 0.75; }
.flat-heritage-marker { opacity: .72; pointer-events: none; filter: sepia(.25) saturate(.68) hue-rotate(24deg); }

.map-caption {
  text-align: center; color: var(--ink-faint); font-size: 12.5px; letter-spacing: 0.08em; margin-top: 10px;
  padding: 0 3vw; text-shadow: 0 0 8px rgba(241, 232, 214, 0.9), 0 0 3px rgba(241, 232, 214, 0.9);
}
.map-legend {
  display: flex; justify-content: center; gap: 26px; flex-wrap: wrap;
  margin-top: 12px; padding: 0 3vw; font-size: 12.5px; color: var(--ink-soft);
  text-shadow: 0 0 8px rgba(241, 232, 214, 0.9), 0 0 3px rgba(241, 232, 214, 0.9);
}
.map-legend .li { display: inline-flex; align-items: center; gap: 8px; }
.map-legend .swatch { width: 16px; height: 16px; border-radius: 5px; display: inline-block; }
.map-legend .swatch.live { background: rgba(96,108,56,0.4); border: 1px solid var(--moss); }
.map-legend .swatch.empty { background: rgba(139,157,131,0.16); border: 1px solid rgba(96,108,56,0.4); }
.map-legend .dot-demo { display: inline-flex; gap: 2.5px; }
.map-legend .dot-demo i { width: 4px; height: 4px; border-radius: 50%; background: var(--ink); opacity: 0.75; }

/* 竹简浮层 */
.slip-panel {
  position: absolute; z-index: 40; min-width: 230px; max-width: min(310px, calc(100% - 24px));
  max-height: min(42vh, 320px); overflow-y: auto; pointer-events: none;
  background: linear-gradient(105deg, #EFE4CC, #E7D9BB);
  border: 1px solid rgba(96, 108, 56, 0.45);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lift);
  padding: 14px 6px;
  transform-origin: left center;
  animation: slipIn var(--t-med) cubic-bezier(0.2, 0.9, 0.3, 1.1) both;
}
@keyframes slipIn { from { opacity: 0; transform: scaleX(0.35) translateY(6px); } to { opacity: 1; transform: none; } }
.slip-panel h4 { font-size: 13px; color: var(--moss); letter-spacing: 0.2em; padding: 0 14px 8px; font-weight: 600; }
.slip-panel .slip-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 14px; text-align: left; font-size: 14.5px; color: var(--ink);
  border-left: 3px solid transparent;
}
.slip-panel .slip-item + .slip-item { border-top: 1px solid rgba(96,108,56,0.14); }
.slip-panel .slip-item .cn { font-family: var(--serif); letter-spacing: 0.05em; }
.slip-panel .slip-empty { margin: 2px 14px 7px; color: var(--ink-soft); font-size: 13px; line-height: 1.65; }
.slip-panel .slip-note { padding: 6px 14px 0; font-size: 11px; color: var(--ink-faint); }

/* 地区近景（空间地台） */
.district-focus {
  position: absolute; inset: 148px 3vw 30px; z-index: 30;
  display: flex; align-items: stretch; gap: 28px;
  animation: viewIn var(--t-slow) ease both;
}
.district-focus.is-exiting {
  pointer-events: none;
  animation: focusShellOut 340ms cubic-bezier(0.55, 0, 0.82, 0.24) both;
}
@keyframes focusShellOut { from { opacity: 1; } to { opacity: 0; } }
.district-story {
  position: relative; z-index: 52; width: min(31vw, 390px); flex: 0 0 min(31vw, 390px);
  max-height: min(66vh, 660px); overflow-y: auto;
  padding: 24px 24px 22px;
  border: 1px solid rgba(96,108,56,0.35); border-radius: 24px;
  background: rgba(232,220,199,0.93); box-shadow: var(--shadow-lift);
  backdrop-filter: blur(7px);
  will-change: transform, opacity;
  animation: districtStoryIn 520ms cubic-bezier(0.16,0.84,0.26,1) both;
}
.map-view > .district-story { position: absolute; top: 56%; left: 3vw; transform: translateY(-50%); }
@keyframes districtStoryIn {
  from { opacity: 0; transform: translateX(-56px) translateY(-50%) scale(0.985); }
  to { opacity: 1; transform: translateX(0) translateY(-50%) scale(1); }
}
@keyframes districtStoryOut {
  from { opacity: 1; transform: translateX(0) translateY(-50%) scale(1); }
  to { opacity: 0; transform: translateX(-48px) translateY(-50%) scale(0.985); }
}
.district-story.is-exiting,
.district-focus.is-exiting .district-story {
  pointer-events: none;
  animation: districtStoryOut 320ms cubic-bezier(0.55, 0, 0.82, 0.24) both;
}
.district-story-kicker { margin-top: 0; color: var(--terracotta); font-size: 11px; letter-spacing: 0.24em; }
.district-story h2 { margin: 6px 0 8px; font-size: clamp(38px, 4.2vw, 52px); line-height: 1.08; color: var(--ink); letter-spacing: 0; }
.district-story-back { margin: 3px 0 10px; }
.district-story-scope { margin: 1px 0 5px; color: var(--ink-soft); font-size: 11.5px; line-height: 1.65; }
.district-story-count { color: var(--moss); font-size: 12.5px; margin-bottom: 20px; }
.district-story-section { padding: 14px 0; border-top: 1px solid rgba(96,108,56,0.22); }
.district-story-section summary { cursor: pointer; color: var(--ink); font-size: 14px; letter-spacing: 0; list-style-position: outside; }
.district-story-section[open] summary { margin-bottom: 7px; color: var(--moss); }
.district-story-section p { color: var(--ink-soft); font-size: 13px; line-height: 1.8; }
.district-story-pending { color: var(--ink-faint) !important; }
.district-story-source { display: inline-block; margin: 8px 0 6px; color: var(--moss); font-size: 11px; border-bottom: 1px solid rgba(96,108,56,0.35); }
.district-story-tip { margin-top: 6px; padding: 11px 13px; border-radius: 16px; background: rgba(96,108,56,0.12); color: var(--moss); font-size: 12px; line-height: 1.7; }
.district-story-discovery { margin-top: 12px; padding: 14px; border: 1px solid rgba(192,142,58,.3); border-radius: 8px; background: rgba(255,255,255,.32); }
.district-story-discovery h3 { color: var(--terracotta); font-size: 13px; }
.district-story-discovery > p { margin-top: 7px; color: var(--ink-soft); font-size: 12px; line-height: 1.7; }
.district-story-links { display: grid; margin-top: 10px; }
.district-story-links button { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid rgba(96,108,56,.16); color: var(--ink); text-align: left; }
.district-story-links button:hover { color: var(--terracotta); }
.district-story-links small { flex: none; color: var(--moss); font-size: 10.5px; }

/* 地区内项目档案：选择墨点后才出现，正文局部滚动，行动按钮始终可见 */
.project-story {
  position: absolute; z-index: 54; top: 56%; right: 3vw; transform: translateY(-50%);
  width: min(31vw, 390px); max-height: min(66vh, 660px);
  display: flex; flex-direction: column; overflow: hidden;
  padding: 24px 24px 20px;
  border: 1px solid rgba(96,108,56,0.35); border-radius: 24px;
  background: rgba(232,220,199,0.95); box-shadow: var(--shadow-lift);
  backdrop-filter: blur(7px);
  will-change: transform, opacity;
  animation: projectStoryIn 480ms cubic-bezier(0.16,0.84,0.26,1) both;
}
@keyframes projectStoryIn {
  from { opacity: 0; transform: translateX(56px) translateY(-50%) scale(0.985); }
  to { opacity: 1; transform: translateX(0) translateY(-50%) scale(1); }
}
@keyframes projectStoryOut {
  from { opacity: 1; transform: translateX(0) translateY(-50%) scale(1); }
  to { opacity: 0; transform: translateX(48px) translateY(-50%) scale(0.985); }
}
.project-story.is-exiting {
  pointer-events: none;
  animation: projectStoryOut 300ms cubic-bezier(0.55, 0, 0.82, 0.24) both;
}
.project-story-close { align-self: flex-end; color: var(--ink-faint); font-size: 12px; padding: 2px 0 5px; }
.project-story-close:hover { color: var(--terracotta); }
.project-story-kicker { color: var(--terracotta); font-size: 11px; letter-spacing: 0.24em; }
.project-story h2 { margin: 6px 0 4px; font-size: clamp(24px, 2.4vw, 36px); color: var(--ink); letter-spacing: 0.06em; }
.project-story-meta { color: var(--moss); font-size: 12.5px; margin-bottom: 14px; }
.project-story-scroll {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding-right: 8px; scrollbar-gutter: stable;
}
.district-story,
.project-story-scroll,
.slip-panel {
  scrollbar-width: thin;
  scrollbar-color: rgba(96,108,56,0.42) transparent;
}
.district-story::-webkit-scrollbar,
.project-story-scroll::-webkit-scrollbar,
.slip-panel::-webkit-scrollbar { width: 6px; }
.district-story::-webkit-scrollbar-track,
.project-story-scroll::-webkit-scrollbar-track,
.slip-panel::-webkit-scrollbar-track { background: transparent; }
.district-story::-webkit-scrollbar-thumb,
.project-story-scroll::-webkit-scrollbar-thumb,
.slip-panel::-webkit-scrollbar-thumb {
  min-height: 34px; border-radius: 999px;
  background: linear-gradient(to bottom, rgba(139,157,131,0.24), rgba(96,108,56,0.62), rgba(192,142,58,0.42));
  border: 1px solid rgba(241,232,214,0.68);
}
.district-story::-webkit-scrollbar-thumb:hover,
.project-story-scroll::-webkit-scrollbar-thumb:hover,
.slip-panel::-webkit-scrollbar-thumb:hover { background: rgba(96,108,56,0.72); }
.project-story-section { padding: 13px 0; border-top: 1px solid rgba(96,108,56,0.22); }
.project-story-section h3 { margin-bottom: 8px; color: var(--ink); font-size: 14px; letter-spacing: 0.12em; }
.project-story-section p { color: var(--ink-soft); font-size: 13px; line-height: 1.8; }
.project-story-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.project-story-gallery figure { min-width: 0; }
.project-story-gallery img { width: 100%; aspect-ratio: 4 / 3; display: block; object-fit: cover; border-radius: 16px; border: 1px solid rgba(96,108,56,0.28); }
.project-story-gallery figcaption { margin-top: 4px; color: var(--ink-faint); font-size: 10.5px; line-height: 1.45; }
.project-story-action {
  flex: none; display: flex; justify-content: center;
  padding-top: 14px; border-top: 1px solid rgba(96,108,56,0.22);
}
.project-story-action .btn { width: auto; min-width: 190px; }
.district-focus .project-story { top: 0; right: 0; bottom: 0; max-height: none; }
.district-focus.has-project-detail .flat-focus-map { transform: translateX(-6vw) scale(0.70); }
.flat-focus-map { flex: 1; min-width: 0; display: flex; transform: translateX(2vw) scale(1.06); transition: transform var(--t-med) ease; }
.focus-platform {
  position: relative; flex: 1; width: 100%; max-width: 940px;
  border-radius: 48% 52% 46% 54% / 58% 56% 44% 42%;
  background: radial-gradient(ellipse at 50% 42%, rgba(96,108,56,0.2), rgba(96,108,56,0.07) 62%, transparent 78%);
  border: 1.5px dashed rgba(96, 108, 56, 0.4);
}
.focus-platform .platform-label {
  position: absolute; top: 8%; left: 50%; transform: translateX(-50%);
  font-family: var(--serif); font-size: 20px; letter-spacing: 0.3em; color: var(--moss);
}
.focus-platform .platform-note {
  position: absolute; bottom: 5%; left: 50%; transform: translateX(-50%);
  font-size: 11.5px; color: var(--ink-faint); white-space: nowrap;
}
.focus-head { display: flex; align-items: center; gap: 18px; padding-bottom: 12px; }
.craft-anchor { position: absolute; transform: translate(-50%, -100%); z-index: 2; }
.map3d-focus-overlay .craft-anchor {
  transition: opacity var(--t-fast) ease;
  will-change: left, top, opacity;
}
.craft-anchor.is-entering .craft-anchor-hit { animation: mapAnchorReveal 360ms cubic-bezier(.18,.82,.3,1) var(--anchor-delay, 0ms) both; }
@keyframes mapAnchorReveal { from { opacity: 0; filter: blur(3px); transform: translateY(8px) scale(.96); } to { opacity: 1; filter: none; transform: none; } }
.map3d-focus-overlay .craft-anchor::after {
  content: "";
  position: absolute; z-index: -1; left: 50%; top: calc(100% + 1px);
  width: 58px; height: 12px; transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(43,51,39,0.22), rgba(43,51,39,0) 72%);
  filter: blur(1px); pointer-events: none;
}
.craft-anchor-hit { position: relative; width: 132px; display: flex; flex-direction: column; align-items: center; color: var(--ink); }
.craft-anchor-hit:focus-visible { outline: 2px solid var(--terracotta); outline-offset: 4px; border-radius: 18px; }
.craft-anchor-visual { position: relative; display: block; width: 112px; height: 76px; }
.craft-anchor canvas { position: absolute; z-index: 0; left: 50%; top: 50%; display: block; transform: translate(-50%, -50%); pointer-events: none; }
.craft-anchor-visual img {
  position: absolute; z-index: 1; left: 10px; top: 6px; width: 92px; height: 64px;
  display: block; object-fit: cover; border-radius: 16px;
  border: 2px solid rgba(232,220,199,0.9); box-shadow: 0 6px 18px rgba(43,51,39,0.2);
  filter: sepia(0.12) saturate(0.92); transition: transform var(--t-med) ease, border-color var(--t-med) ease;
}
.craft-anchor.is-hovered .craft-anchor-visual img { transform: translateY(-3px) scale(1.04); border-color: var(--terracotta); }
.craft-anchor.is-hovered { z-index: 8; }
.craft-anchor .anchor-name {
  position: static; transform: none; margin-top: 5px; white-space: nowrap;
  font-family: var(--serif); font-size: 14px; letter-spacing: 0.1em; color: var(--ink);
  background: var(--paper); padding: 2px 12px; border-radius: 999px;
  border: 1px solid rgba(96,108,56,0.3);
}
.craft-card,
.community-overview-image-card,
.admin-documentary-item { content-visibility: auto; contain-intrinsic-size: auto 180px; }
.cluster-tip {
  position: absolute; z-index: 45; max-width: 300px; pointer-events: none;
  background: var(--paper); border: 1px solid rgba(96,108,56,0.4);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lift); padding: 14px 18px;
  animation: viewIn var(--t-fast) ease both;
}
.cluster-tip h4 { font-size: 16px; margin-bottom: 4px; }
.cluster-tip .cat-line { font-size: 12px; color: var(--moss); margin-bottom: 8px; }
.cluster-tip p { font-size: 13px; color: var(--ink-soft); line-height: 1.7; }

/* 列表模式 */
.craft-list { max-width: 860px; margin: 0 auto; padding: 0 3vw 60px; width: 100%; }
.craft-list .district-group { margin-bottom: 34px; }
.craft-list .district-group h3 {
  font-size: 18px; letter-spacing: 0.15em; color: var(--moss);
  border-bottom: 1.5px solid rgba(96,108,56,0.35); padding-bottom: 8px; margin-bottom: 14px;
}
.craft-card {
  display: flex; gap: 18px; align-items: center;
  background: var(--paper); border: 1px solid rgba(96,108,56,0.25);
  border-radius: var(--radius-lg); padding: 16px 20px; margin-bottom: 12px;
  box-shadow: 0 4px 14px rgba(43,51,39,0.08); cursor: pointer;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.craft-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-soft); }
.craft-card img { width: 118px; height: 88px; object-fit: cover; border-radius: var(--radius-sm); flex: none; }
.craft-card .cc-body h4 { font-size: 18px; margin-bottom: 2px; }
.craft-card .cc-body .meta { font-size: 12.5px; color: var(--moss); margin-bottom: 6px; }
.craft-card .cc-body p { font-size: 13px; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- 详情 + 工作台 ---------- */

.craft-page { height: 100vh; height: 100dvh; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.craft-head {
  display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap;
  padding: 96px 3.4vw 14px;
}
.craft-head h2 { font-size: clamp(24px, 2.6vw, 34px); letter-spacing: 0.08em; }
.craft-head .meta { color: var(--moss); font-size: 13.5px; letter-spacing: 0.08em; }
.craft-head .spacer { flex: 1; }

.craft-body {
  flex: 1 1 0; height: 0; min-height: 0; display: flex; gap: 22px;
  padding: 0 3.4vw 40px; overflow: hidden;
}

/* 左侧叠山面板 */
.reading-col {
  width: 38%; min-width: 320px; min-height: 0; height: 100%; max-height: 100%;
  display: flex; flex-direction: column; gap: 12px; overflow: hidden;
  transition: width var(--t-slow) cubic-bezier(0.3, 0.8, 0.3, 1), min-width var(--t-slow) cubic-bezier(0.3, 0.8, 0.3, 1);
}
.craft-body.playing .reading-col,
.craft-body.panels-collapsed .reading-col { width: 46px; min-width: 46px; overflow: hidden; }
.panel {
  background: var(--paper); border: 1px solid rgba(96, 108, 56, 0.3);
  border-radius: var(--radius-lg); box-shadow: 0 5px 16px rgba(43,51,39,0.09);
  overflow: hidden; display: flex; flex-direction: column;
  transition: flex var(--t-slow) cubic-bezier(0.3, 0.8, 0.3, 1), opacity var(--t-med);
}
.panel .panel-head {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 15px 22px; text-align: left; flex: none;
}
.panel .panel-head .pnum {
  font-family: var(--serif); color: var(--sage); font-size: 13px; letter-spacing: 0.1em;
}
.panel .panel-head h3 { font-size: 17px; letter-spacing: 0.14em; flex: 1; }
.panel .panel-head .chev { color: var(--sage); transition: transform var(--t-med); font-size: 12px; }
.panel.open { flex: 1 1 0; min-height: 0; }
.panel.open .panel-head .chev { transform: rotate(180deg); }
.panel:not(.open) { flex: 0 0 auto; }
.panel:not(.open) .panel-head { border-bottom: none; }
.panel .panel-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 2px 24px 22px; display: none; }
.panel.open .panel-body {
  display: block; flex: 1 1 0; min-height: 0; overflow-y: scroll;
  scrollbar-width: thin; scrollbar-color: rgba(96,108,56,0.56) rgba(139,157,131,0.12);
  animation: viewIn var(--t-med) ease both;
}
.panel.open .panel-body::-webkit-scrollbar { width: 8px; }
.panel.open .panel-body::-webkit-scrollbar-track { background: rgba(139,157,131,0.12); border-radius: 999px; }
.panel.open .panel-body::-webkit-scrollbar-thumb { background: rgba(96,108,56,0.56); border-radius: 999px; }
.panel.open .panel-body::-webkit-scrollbar-thumb:hover { background: var(--moss); }
.craft-body.playing .panel .panel-body,
.craft-body.playing .panel .pnum,
.craft-body.playing .panel .chev,
.craft-body.panels-collapsed .panel .panel-body,
.craft-body.panels-collapsed .panel .pnum,
.craft-body.panels-collapsed .panel .chev { display: none; }
.craft-body.playing .panel .panel-head,
.craft-body.panels-collapsed .panel .panel-head { writing-mode: vertical-rl; padding: 14px 12px; }
.craft-body.playing .panel,
.craft-body.panels-collapsed .panel { flex: none; }
.craft-body.playing .reading-col,
.craft-body.panels-collapsed .reading-col { gap: 8px; }

.panel .panel-body h5 { font-size: 13px; color: var(--moss); letter-spacing: 0.16em; margin: 16px 0 8px; }
.panel .panel-body p { margin-bottom: 12px; color: var(--ink-soft); font-size: 14px; }
.claim-item { padding: 10px 0; border-bottom: 1px dashed rgba(96,108,56,0.25); font-size: 13.5px; color: var(--ink-soft); }
.claim-item:last-child { border-bottom: none; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.chip {
  background: rgba(139,157,131,0.2); border: 1px solid rgba(96,108,56,0.3);
  padding: 3px 13px; border-radius: 999px; font-size: 12.5px; color: var(--ink);
}
.step-item { padding: 12px 0 12px 16px; border-left: 2.5px solid var(--sage); margin: 10px 0 10px 6px; }
.step-item .st-title { font-weight: 600; font-size: 14.5px; margin-bottom: 4px; }
.step-item .st-title .order { color: var(--terracotta); font-family: var(--serif); margin-right: 8px; }
.step-item .st-action { font-size: 13.5px; color: var(--ink-soft); margin-bottom: 6px; }
.step-item .st-meta { font-size: 12px; color: var(--ink-faint); margin-bottom: 6px; }
.ev-link {
  font-size: 12.5px; color: var(--moss); border-bottom: 1px solid rgba(96,108,56,0.5);
  padding-bottom: 1px; margin-right: 14px;
}
.ev-link:hover { color: var(--terracotta); border-color: var(--terracotta); }

/* 右侧工作台 */
.workbench-col {
  flex: 1; min-width: 0; position: relative;
  background: rgba(139, 157, 131, 0.1);
  border: 1px solid rgba(96, 108, 56, 0.28);
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column; overflow: hidden;
}
.wb-idle { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow-y: auto; padding: 34px; text-align: center; position: relative; }
.wb-idle .frame-wrap { position: relative; width: min(430px, 80%); }
.wb-idle .frame-wrap canvas { position: absolute; inset: -14%; width: 128%; height: 128%; pointer-events: none; }
.wb-idle .frame-wrap img {
  width: 100%; border-radius: var(--radius-md); display: block;
  box-shadow: var(--shadow-soft); filter: sepia(0.18) saturate(0.92);
}
.wb-idle h3 { font-size: 21px; margin: 30px 0 8px; letter-spacing: 0.1em; }
.wb-idle .note { max-width: 460px; font-size: 13px; color: var(--ink-faint); margin-bottom: 24px; }

/* 工作台进行态 */
.wb-play { flex: 1; display: flex; min-height: 0; }
.backpack {
  width: 208px; flex: none; border-right: 1px solid rgba(96,108,56,0.25);
  padding: 16px 14px; overflow-y: auto; background: rgba(241,232,214,0.55);
}
.backpack h4 { font-size: 13px; letter-spacing: 0.2em; color: var(--moss); margin-bottom: 12px; }
.backpack .bp-sec { margin-bottom: 18px; }
.backpack .bp-sec > .sec-label { font-size: 11.5px; color: var(--ink-faint); letter-spacing: 0.14em; margin-bottom: 7px; }
.bp-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  background: var(--paper); border: 1.5px solid rgba(96,108,56,0.3);
  border-radius: var(--radius-sm); padding: 8px 11px; margin-bottom: 7px;
  font-size: 13px; text-align: left; color: var(--ink);
  transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.bp-item:hover { transform: translateX(3px); }
.bp-item .resource-swatch {
  width: 10px; height: 10px; flex: none; border-radius: 3px;
  border: 1px solid rgba(43,51,39,.22); box-shadow: inset 0 0 0 1px rgba(255,255,255,.26);
}
.bp-item.is-unavailable { opacity: .38; filter: grayscale(.75); cursor: not-allowed; }
.bp-item.is-unavailable:hover { transform: none; }
.bp-item.selected { border-color: var(--terracotta); box-shadow: 0 3px 10px rgba(198,107,61,0.28); }
.bp-item .state-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.state-raw .state-dot { background: var(--sage); }
.state-mid .state-dot { background: var(--ochre); }
.state-ready .state-dot { background: var(--moss); }
.resource-implement .state-dot { background: var(--ink-faint); }
.bp-item .bp-state { margin-left: auto; font-size: 10.5px; color: var(--ink-faint); white-space: nowrap; }
.bp-item.state-mid .bp-state { color: #8A6420; }
.bp-item.state-ready .bp-state { color: var(--moss); }
.bp-legend { margin-top: 14px; font-size: 11px; color: var(--ink-faint); line-height: 2; }
.bp-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }

.wb-main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 22px; }
.wb-step-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.wb-step-bar .cur { font-family: var(--serif); font-size: 19px; line-height: 1.35; }
.wb-progress { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.wb-progress .pg { width: 22px; height: 5px; border-radius: 3px; background: rgba(96,108,56,0.22); }
.wb-progress .pg.done { background: var(--moss); }
.wb-progress .pg.now { background: var(--terracotta); }

.wb-canvas-area {
  flex: 1; min-height: 210px; position: relative;
  border-radius: var(--radius-md);
  background: radial-gradient(ellipse at center, rgba(241,232,214,0.85), rgba(222,207,180,0.5));
  border: 1.5px dashed rgba(96,108,56,0.35);
  display: flex; align-items: center; justify-content: center; gap: 26px;
  padding: 20px;
}
.wb-canvas-area.drop-target {
  border-color: var(--terracotta);
  background: radial-gradient(ellipse at center, rgba(255,249,233,.96), rgba(198,107,61,.16));
  box-shadow: 0 0 0 4px rgba(198,107,61,.1), inset 0 0 30px rgba(198,107,61,.12);
}
.slot {
  width: 132px; min-height: 96px; border-radius: var(--radius-md);
  border: 2px dashed rgba(96,108,56,0.45); background: rgba(241,232,214,0.6);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  font-size: 13px; color: var(--ink-faint); padding: 10px; text-align: center;
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.slot .slot-label { font-size: 11px; letter-spacing: 0.2em; color: var(--sage); }
.slot.filled { border-style: solid; border-color: var(--moss); color: var(--ink); background: var(--paper); }
.slot.conflict { border-color: var(--terracotta); background: rgba(198,107,61,0.12); animation: shake 420ms ease; }
.slot.ok-flash { border-color: var(--moss); background: rgba(96,108,56,0.12); }
@keyframes shake { 0%,100%{transform:none} 25%{transform:translateX(-5px)} 75%{transform:translateX(5px)} }
.slot .clear-slot { font-size: 11px; color: var(--ink-faint); text-decoration: underline; }
.slot.resource-slot { width: min(380px, 58%); min-height: 118px; align-items: flex-start; text-align: left; }
.slot.action-slot { width: min(220px, 36%); min-height: 118px; }
.selected-resource-list { display: flex; flex-wrap: wrap; gap: 7px; width: 100%; }
.selected-resource {
  padding: 4px 9px; border-radius: 999px; background: rgba(96,108,56,0.12);
  border: 1px solid rgba(96,108,56,0.34); color: var(--ink); font-size: 12px;
}
.selected-resource:hover { border-color: var(--terracotta); color: var(--terracotta); }
.action-palette {
  position: absolute; right: 14px; top: 14px; bottom: 14px; width: min(190px, 27%);
  display: flex; flex-direction: column; gap: 8px; overflow-y: auto; padding: 4px;
  z-index: 3;
}
.action-palette::before { content: '动作'; color: var(--moss); font-size: 11px; letter-spacing: .18em; margin: 0 4px 1px; }
.action-card {
  position: relative; display: flex; align-items: center; min-height: 42px; width: 100%;
  padding: 9px 12px; border: 1px solid rgba(96,108,56,.28); border-radius: 12px;
  background: rgba(255,252,242,.78); color: var(--ink); text-align: left; font-size: 12.5px;
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
  transition: transform var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast), filter var(--t-fast);
}
.action-card:active { cursor: grabbing; }
.action-card.is-pointer-dragging { cursor: grabbing; opacity: .5; }
.action-drag-ghost {
  position: fixed; z-index: 1200; left: 0; top: 0; width: min(190px, 34vw);
  transform: translate(-50%, -50%) rotate(-1.5deg); pointer-events: none;
  padding: 10px 14px; border: 1px solid rgba(198,107,61,.68); border-radius: 14px;
  background: rgba(232,220,199,.95); color: var(--ink); box-shadow: 0 14px 32px rgba(43,51,39,.24);
  backdrop-filter: blur(10px); font-size: 12.5px; text-align: left;
}
.action-card:hover, .action-card.selected { transform: translateX(-4px); border-color: var(--terracotta); box-shadow: 0 6px 16px rgba(198,107,61,.16); }
.action-card:hover::before, .action-card.selected::before {
  content: ''; position: absolute; left: -12px; top: 50%; width: 8px; height: 8px;
  border-left: 1.5px solid var(--terracotta); border-bottom: 1.5px solid var(--terracotta);
  transform: translateY(-50%) rotate(45deg);
}
.action-card:hover::after, .action-card.selected::after {
  content: ''; position: absolute; left: -10px; top: 50%; width: 10px; border-top: 1.5px solid var(--terracotta);
}
.action-drop-slot { width: min(176px, 28%); min-height: 108px; margin-left: auto; margin-right: min(205px, 29%); }
.action-drop-slot .slot-action-label { color: var(--ink); font-size: 12px; line-height: 1.5; }
.action-drop-slot .drop-hint { color: var(--ink-faint); font-size: 11px; }
.wb-object-gallery {
  flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 12px;
  min-height: 156px; padding: 4px; margin-right: min(198px, 29%);
}
.wb-object-gallery.empty { color: var(--ink-faint); font-size: 12px; }
.wb-preview-card {
  width: min(160px, 46%); min-width: 112px; border: 1px solid rgba(96,108,56,.22); border-radius: 14px;
  padding: 7px 8px 8px; background: rgba(255,252,242,.62); text-align: center;
}
.wb-preview-canvas { display: block; width: 100%; height: 108px; touch-action: none; cursor: grab; }
.wb-preview-canvas:active { cursor: grabbing; }
.wb-preview-label { display: block; color: var(--ink-soft); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-output-list { display: grid; gap: 6px; margin: 0 0 12px; }
.wb-output-chip { display: flex; align-items: center; gap: 7px; padding: 6px 7px; border-radius: 9px; background: rgba(255,252,242,.46); color: var(--ink-soft); font-size: 11px; }
.wb-output-chip.current { border: 1px solid rgba(198,107,61,.45); background: rgba(198,107,61,.1); color: var(--ink); }
.wb-output-chip .output-dot { width: 12px; height: 12px; flex: none; border-radius: 4px; }
.wb-dragging .wb-play > *:not(.wb-main) { opacity: .24; filter: grayscale(1); pointer-events: none; }
.wb-dragging .wb-main > *:not(.wb-canvas-area) { opacity: .3; filter: grayscale(1); }
.wb-dragging .wb-canvas-area { border-color: var(--terracotta); box-shadow: 0 0 0 4px rgba(198,107,61,.13), inset 0 0 34px rgba(198,107,61,.1); }
.wb-feedback { min-height: 30px; font-size: 13.5px; padding: 8px 4px 0; }
.wb-feedback.ok { color: var(--moss); }
.wb-feedback.err { color: var(--terracotta); }
.wb-actions { display: flex; align-items: center; gap: 16px; padding: 10px 0 2px; flex-wrap: wrap; }
.btn-quick-fill {
  padding: 8px 18px; border: 1px solid rgba(96,108,56,0.46); border-radius: 999px;
  background: rgba(232,220,199,0.72); color: var(--moss); font-size: 13px;
  transition: transform var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.btn-quick-fill:hover { transform: translateY(-1px); border-color: var(--terracotta); background: rgba(198,107,61,0.1); color: var(--terracotta); }
.wb-note { font-size: 11.5px; color: var(--ink-faint); margin-left: auto; max-width: 320px; }

/* 工作台 v3：共享物理桌面。桌面图直接作为工作区材质，不再显示色谱或“已选材料”框。 */
.bg-stack.wb-bg .bg-layer:not([data-role="detail"]) { opacity: 0 !important; }
.bg-stack.wb-bg .bg-layer[data-role="detail"] { inset: 0; width: 100%; height: 100%; transform: none; object-position: center; }
.bg-stack.wb-bg .bg-scrim { background: linear-gradient(180deg, rgba(232,220,199,.32), rgba(232,220,199,.05) 38%, transparent 68%); }
.craft-body.playing .workbench-col { background: rgba(74,87,70,.09); border-color: rgba(96,108,56,.32); }
.wb-play-physics .backpack {
  width: 220px; background: rgba(232,220,199,.84); backdrop-filter: blur(12px);
  box-shadow: 12px 0 32px rgba(43,51,39,.08); transition: opacity 280ms ease, filter 280ms ease;
}
.wb-play-physics .bp-sec { padding-bottom: 12px; border-bottom: 1px solid rgba(96,108,56,.16); }
.wb-play-physics .bp-sec:last-of-type { border-bottom: 0; }
.bp-empty, .bp-help { color: var(--ink-faint); font-size: 11px; line-height: 1.6; }
.bp-help { margin-top: 12px; }
.bp-item.is-carried { border-color: rgba(96,108,56,.45); background: rgba(139,157,131,.17); opacity: 1; }
.bp-item.is-carried:disabled { cursor: default; opacity: 1; }
.wb-play-physics .bp-item[data-drag-mode="pointer"] { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.wb-play-physics .bp-item[data-drag-mode="pointer"]:active { cursor: grabbing; }
.wb-play-physics .bp-item.is-pointer-dragging { opacity: .52; cursor: grabbing; }
.resource-drag-ghost::before {
  content: ''; display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%;
  background: var(--terracotta); box-shadow: 0 0 0 4px rgba(198,107,61,.14);
}
.wb-stage-layout {
  flex: 1; min-height: 300px; display: grid; grid-template-columns: minmax(0, 1fr) 218px;
  gap: 14px; align-items: stretch;
}
.wb-main.has-documentary .wb-stage-layout { grid-template-columns: minmax(0, 1fr) 190px minmax(220px, 28%); }
.wb-side-rail { min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(154px, 1fr); gap: 14px; }
.wb-side-rail.has-step-image { grid-template-rows: minmax(154px, 1fr) clamp(112px, 18vh, 152px); }
.wb-step-image {
  min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 11px;
  border: 1px solid rgba(96,108,56,.25); border-radius: 18px;
  background: rgba(232,220,199,.8); backdrop-filter: blur(12px); overflow: hidden;
}
.wb-step-image-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 2px 8px; }
.wb-step-image-heading p { color: var(--moss); font-size: 11px; letter-spacing: .16em; }
.wb-step-image-heading span { color: var(--ink-faint); font-size: 10px; font-variant-numeric: tabular-nums; }
.wb-step-image-media {
  position: relative; flex: 1; min-height: 70px; overflow: hidden; border-radius: 12px;
  border: 1px solid rgba(96,108,56,.2); background: rgba(212,184,149,.28);
}
.wb-step-image-zoom { position: relative; display: block; width: 100%; height: 100%; overflow: hidden; border-radius: inherit; }
.wb-step-image-zoom img { display: block; width: 100%; height: 100%; object-fit: contain; background: rgba(96,108,56,.09); transition: transform 320ms ease; }
.wb-step-image-zoom > span {
  position: absolute; right: 8px; bottom: 8px; padding: 4px 8px; border: 1px solid rgba(232,220,199,.5);
  border-radius: 999px; color: var(--sand-light); background: rgba(43,51,39,.72); font-size: 10px;
  opacity: .82; transition: opacity 240ms ease, transform 240ms ease;
}
.wb-step-image-zoom:hover img, .wb-step-image-zoom:focus-visible img { transform: scale(1.025); }
.wb-step-image-zoom:hover > span, .wb-step-image-zoom:focus-visible > span { opacity: 1; transform: translateY(-2px); }
.wb-step-image-zoom:focus-visible { outline: 2px solid var(--terracotta); outline-offset: -3px; }
.wb-step-image-media.is-empty { display: grid; place-items: center; padding: 16px; text-align: center; }
.wb-step-image-media.is-empty::before {
  content: ''; position: absolute; inset: 9px; border: 1px dashed rgba(96,108,56,.28); border-radius: 9px; pointer-events: none;
}
.wb-step-image-media.is-empty span { position: relative; color: var(--ink-faint); font-size: 11px; line-height: 1.55; }
.wb-step-image-media.is-error span { color: var(--terracotta); }
.wb-documentary {
  min-width: 0; padding: 12px; border: 1px solid rgba(96,108,56,.25); border-radius: 18px;
  background: rgba(232,220,199,.82); backdrop-filter: blur(12px); overflow: auto;
}
.wb-documentary-kicker { margin: 0 0 5px; color: var(--terracotta); font-size: 10px; letter-spacing: .16em; }
.wb-documentary h4 { margin: 0 0 9px; color: var(--moss); font-size: 14px; }
.wb-documentary-video { display: block; width: 100%; max-height: 220px; border-radius: 10px; background: #28332c; }
.wb-documentary-description { margin: 8px 0; color: var(--ink-soft); font-size: 11px; line-height: 1.5; }
.wb-table-surface {
  position: relative; min-width: 0; min-height: 300px; overflow: hidden;
  border: 1px solid rgba(96,108,56,.32); border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(232,220,199,.08), rgba(76,91,78,.14)),
    url('../assets/t工作台.png') center 64% / cover no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.28), 0 18px 42px rgba(43,51,39,.14);
  transition: border-color 280ms ease, box-shadow 280ms ease, filter 280ms ease;
  isolation: isolate;
}
.wb-table-surface::after {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse at 48% 72%, transparent 20%, rgba(32,43,36,.12) 100%);
  mix-blend-mode: multiply;
}
.wb-table-surface.drop-target {
  border-color: var(--terracotta);
  box-shadow: inset 0 0 0 3px rgba(198,107,61,.24), 0 0 42px rgba(198,107,61,.28);
}
.wb-table-surface.conflict { animation: shake 420ms ease; border-color: var(--terracotta); }
.wb-table-head {
  position: absolute; z-index: 4; left: 14px; top: 13px; right: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; pointer-events: none;
}
.wb-table-title, .wb-table-tip {
  padding: 5px 10px; border-radius: 999px; color: rgba(43,51,39,.76); font-size: 11px;
  background: rgba(232,220,199,.74); border: 1px solid rgba(96,108,56,.2); backdrop-filter: blur(8px);
}
.wb-table-title { color: var(--moss); letter-spacing: .12em; }
.wb-step-float {
  position: absolute; z-index: 5; left: 50%; top: 54px; width: min(570px, calc(100% - 72px));
  transform: translateX(-50%); pointer-events: none; text-align: center;
  padding: 10px 18px 11px; overflow: hidden;
  border: 1px solid rgba(96,108,56,.28); border-radius: 20px;
  background: rgba(232,220,199,.84); color: var(--ink-soft);
  box-shadow: 0 10px 28px rgba(43,51,39,.12); backdrop-filter: blur(10px);
  animation: wbStepGuideIn 420ms cubic-bezier(.2,.8,.25,1) both;
}
.wb-step-float::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .08;
  background-image: radial-gradient(rgba(96,108,56,.7) .55px, transparent .75px);
  background-size: 7px 7px; mix-blend-mode: multiply;
}
@keyframes wbStepGuideIn {
  from { opacity: 0; transform: translate(-50%, -12px) scale(.985); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
.wb-step-float-index { position: relative; color: var(--terracotta); font-size: 10.5px; letter-spacing: .2em; }
.wb-step-float h3 { position: relative; margin: 3px 0 4px; color: var(--moss); font-size: 20px; letter-spacing: .1em; }
.wb-step-float-copy { position: relative; font-size: 13px; line-height: 1.58; white-space: pre-wrap; }
.wb-step-float-copy strong { color: var(--ink); font-weight: 700; }
.wb-step-float-resources { position: relative; margin-top: 4px; color: var(--ink-faint); font-size: 11px; line-height: 1.5; }
.wb-step-float-resources strong { color: var(--moss); font-weight: 700; }
.wb-step-image-reveal {
  position: absolute; inset: 12px; z-index: 8; display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px; min-width: 0; min-height: 0; padding: 14px; overflow: hidden;
  border: 1px solid rgba(232,220,199,.5); border-radius: 18px;
  background: rgba(67,80,64,.94); box-shadow: 0 18px 44px rgba(43,51,39,.3); color: var(--sand-light);
  animation: wbStepImageRevealIn 360ms cubic-bezier(.2,.8,.25,1) both;
}
.wb-step-image-reveal strong { font-family: var(--serif); font-size: 17px; letter-spacing: .08em; }
.wb-step-image-reveal img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; border-radius: 12px; background: rgba(43,51,39,.26); }
.wb-step-image-reveal span { font-size: 11px; letter-spacing: .08em; opacity: .8; }
.wb-step-image-reveal:hover, .wb-step-image-reveal:focus-visible { border-color: var(--ochre); outline: none; }
.wb-step-image-reveal.is-closing { opacity: 0; transform: scale(.985); transition: opacity 240ms ease, transform 240ms ease; }
@keyframes wbStepImageRevealIn { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: scale(1); } }
.wb-table-canvas { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.wb-table-canvas.is-grabbing { cursor: grabbing; }
.wb-object-label {
  position: absolute; z-index: 6; display: block; max-width: 170px;
  transform: translate(-50%, calc(-100% - 10px)); pointer-events: none;
  padding: 5px 11px; white-space: nowrap;
  border: 1.5px solid color-mix(in srgb, var(--object-label-accent, var(--sage)) 62%, var(--sand));
  border-radius: 999px; background: rgba(67,80,64,.94); color: var(--sand);
  box-shadow: 0 5px 15px rgba(43,51,39,.28); backdrop-filter: blur(7px);
  font-size: 12px; font-weight: 700; line-height: 1.25; letter-spacing: .06em;
  text-shadow: 0 1px 2px rgba(43,51,39,.36);
  will-change: left, top;
}
.wb-object-label::after {
  content: ''; position: absolute; left: 50%; top: 100%; width: 1.5px; height: 11px;
  background: color-mix(in srgb, var(--object-label-accent, var(--sage)) 76%, var(--moss));
}
.wb-table-error { position: absolute; z-index: 5; inset: 50% auto auto 50%; transform: translate(-50%,-50%); color: var(--ink-faint); font-size: 12px; }
.wb-play-physics .action-palette {
  position: relative; inset: auto; width: auto; min-width: 0; padding: 12px 10px;
  display: flex; flex-direction: column; gap: 8px; overflow-y: auto;
  border: 1px solid rgba(96,108,56,.25); border-radius: 18px;
  background: rgba(232,220,199,.8); backdrop-filter: blur(12px);
  transition: opacity 280ms ease, filter 280ms ease;
}
.wb-play-physics .action-palette::before { display: none; }
.action-title { margin: 0 3px 2px; color: var(--moss); font-size: 11px; letter-spacing: .18em; }
.wb-play-physics .action-card { flex: none; padding-left: 31px; overflow: hidden; background: rgba(232,220,199,.72); }
.wb-play-physics .action-card:hover::before, .wb-play-physics .action-card.selected::before { left: 11px; }
.wb-play-physics .action-card:hover::after, .wb-play-physics .action-card.selected::after { left: 13px; }
.wb-play-physics .action-card:hover, .wb-play-physics .action-card.selected {
  transform: translateX(-6px); background: rgba(232,220,199,.96);
}
.wb-dragging .wb-play-physics .backpack,
.wb-dragging .wb-play-physics .wb-step-bar,
.wb-dragging .wb-play-physics .wb-actions,
.wb-dragging .wb-play-physics .wb-feedback,
.wb-dragging .wb-play-physics .action-palette,
.wb-dragging .wb-play-physics .wb-step-image { opacity: .2 !important; filter: grayscale(1) !important; }
.wb-dragging .wb-play-physics .wb-main > .wb-stage-layout { opacity: 1 !important; filter: none !important; }
.wb-dragging .wb-play-physics .wb-table-surface {
  opacity: 1 !important; filter: none !important; border-color: var(--terracotta);
  box-shadow: inset 0 0 0 3px rgba(198,107,61,.25), 0 0 48px rgba(198,107,61,.3);
}

/* 流程组合 */
.assembly { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 18px 22px; }
.assembly .as-grid { flex: 1; display: flex; gap: 22px; min-height: 0; }
.as-col { flex: 1; min-width: 0; overflow-y: auto; }
.as-col h4 { font-size: 13px; letter-spacing: 0.18em; color: var(--moss); margin-bottom: 10px; }
.step-card {
  background: var(--paper); border: 1.5px solid rgba(96,108,56,0.35);
  border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 9px;
  font-size: 13px; cursor: pointer; text-align: left; width: 100%; color: var(--ink);
  transition: transform var(--t-fast), border-color var(--t-fast), opacity var(--t-fast);
}
.step-card:hover { transform: translateX(3px); border-color: var(--moss); }
.step-card.used { opacity: 0.3; pointer-events: none; }
.step-card .sc-order-hint { color: var(--ink-faint); font-size: 11.5px; }
.order-slot {
  display: flex; align-items: center; gap: 10px; min-height: 48px;
  border: 2px dashed rgba(96,108,56,0.4); border-radius: var(--radius-sm);
  margin-bottom: 9px; padding: 6px 12px; font-size: 13px;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.order-slot .os-num { font-family: var(--serif); color: var(--sage); font-size: 15px; flex: none; width: 22px; }
.order-slot.filled { border-style: solid; border-color: var(--moss); background: var(--paper); }
.order-slot.wrong { border-color: var(--terracotta); background: rgba(198,107,61,0.1); }
.order-slot.right { border-color: var(--moss); background: rgba(96,108,56,0.1); }
.order-slot .os-remove { margin-left: auto; color: var(--ink-faint); font-size: 11px; text-decoration: underline; flex: none; }

/* 完成态 */
.wb-complete { flex: 1; display: flex; min-height: 0; }
.complete-stage { flex: 1; position: relative; min-width: 0; overflow: hidden; }
.complete-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; }
.complete-stage canvas:active { cursor: grabbing; }
.complete-stage .stage-tip {
  position: absolute; left: 18px; bottom: 14px; font-size: 11.5px; color: var(--ink-faint);
  background: var(--paper); padding: 3px 12px; border-radius: 999px; border: 1px solid rgba(96,108,56,0.25);
}
.complete-side {
  width: 250px; flex: none; border-left: 1px solid rgba(96,108,56,0.25);
  padding: 16px 14px; overflow-y: auto; background: rgba(241,232,214,0.55);
}
.complete-side h4 { font-size: 13px; letter-spacing: 0.2em; color: var(--moss); margin-bottom: 12px; }
.work-item { margin-bottom: 14px; cursor: pointer; }
.work-item img { width: 100%; border-radius: var(--radius-sm); display: block; border: 1.5px solid rgba(96,108,56,0.3); transition: border-color var(--t-fast), transform var(--t-fast); }
.work-item:hover img { border-color: var(--terracotta); transform: scale(1.02); }
.work-item .wi-cap { font-size: 11px; color: var(--ink-faint); margin-top: 4px; line-height: 1.6; }
.heritage-note {
  margin-bottom: 11px; padding: 11px 12px; border: 1px solid rgba(96,108,56,0.28);
  border-radius: 18px; background: rgba(232,220,199,0.78);
}
.heritage-note .hn-head { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.heritage-note .hn-head strong { min-width: 0; flex: 1; font-size: 12.5px; color: var(--moss); }
.heritage-note p { font-size: 11.5px; line-height: 1.7; color: var(--ink-soft); margin-bottom: 7px; }
.heritage-note .ev-link { font-size: 11px; }

/* 完成态：可拖拽/缩放的成品查看 */
.complete-stage .pz-wrap {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 900ms ease; touch-action: none;
}
.complete-stage .pz-wrap.show { opacity: 1; }
.complete-stage .pz-inner { will-change: transform; }
.complete-stage .pz-inner img {
  max-width: 74%; max-height: 74vh; border-radius: var(--radius-md);
  box-shadow: var(--shadow-lift); filter: sepia(0.15) saturate(0.95);
  user-select: none; -webkit-user-drag: none; display: block; margin: 0 auto;
}

/* ---------- 小蕉智能体 ---------- */
.agent-fab {
  position: fixed; right: 74px; bottom: -6px; z-index: 500;
  width: 184px; height: 226px;
  background: transparent; display: flex; align-items: center; justify-content: center;
  touch-action: none; overflow: visible;
  pointer-events: none;
  transition: transform var(--t-fast), box-shadow var(--t-fast), right 320ms cubic-bezier(0.3, 0.8, 0.3, 1);
}
.agent-fab:hover { transform: translateY(-3px) scale(1.025); }
.cat-mascot { position: relative; display: inline-block; flex: none; user-select: none; touch-action: none; }
.cat-mascot canvas { display: block; width: 100%; height: 100%; pointer-events: none; transition: transform 180ms ease; }
.cat-mascot-fab { width: 181px; height: 226px; filter: drop-shadow(0 9px 8px rgba(43,51,39,.2)); cursor: grab; pointer-events: none; }
.cat-mascot-hitbox { position: absolute; z-index: 2; display: block; pointer-events: auto; touch-action: none; cursor: inherit; }
.cat-mascot-fab canvas {
  position: absolute; left: 50%; bottom: -180px; width: 320px; height: 500px;
  margin-left: -160px; max-width: none; max-height: none;
}
.cat-mascot-fab[data-state="grabbed"] { cursor: grabbing; filter: drop-shadow(0 14px 12px rgba(43,51,39,.24)); }
.cat-mascot-head { width: 54px; height: 50px; margin: -8px -5px -6px -7px; }
.agent-fab .fab-label {
  display: none;
}
.mascot-bubble {
  position: fixed; z-index: 1510; width: min(268px, calc(100vw - 24px));
  padding: 11px 12px 10px; border: 1px solid rgba(96,108,56,.35); border-radius: 8px;
  color: var(--ink); background: rgba(232,220,199,.60); box-shadow: 0 10px 28px rgba(43,51,39,.16);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 180ms ease, visibility 180ms;
}
.mascot-bubble.is-visible { opacity: 1; visibility: visible; pointer-events: auto; }
.mascot-bubble p { margin: 0; font-size: 12.5px; line-height: 1.65; }
.mascot-bubble button {
  margin-top: 7px; padding: 3px 0; color: var(--terracotta); font-size: 11.5px;
  border-bottom: 1px solid rgba(198,107,61,.45);
}
.mascot-bubble button:hover, .mascot-bubble button:focus-visible { color: var(--moss); border-color: var(--moss); outline: none; }
.agent-panel {
  position: fixed; right: 0; top: 0; bottom: 0; z-index: 600;
  width: min(400px, 92vw);
  background: var(--sand-light); border-left: 1.5px solid rgba(96,108,56,0.35);
  box-shadow: -18px 0 50px rgba(43,51,39,0.2);
  display: flex; flex-direction: column;
  transform: translateX(105%); transition: transform var(--t-slow) cubic-bezier(0.3, 0.8, 0.3, 1);
  contain: layout paint style; will-change: transform;
}
.agent-panel.open { transform: none; }
.agent-panel .ap-head {
  display: flex; align-items: center; gap: 12px; padding: 18px 20px 12px;
  border-bottom: 1px solid rgba(96,108,56,0.25);
}
.agent-panel .ap-head h3 { font-size: 17px; letter-spacing: 0.1em; }
.ap-identity { min-width: 0; flex: 1; display: grid; gap: 5px; }
.ap-relationship { display: flex; align-items: center; gap: 9px; min-width: 0; }
.ap-relationship-dots { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.ap-relationship-dots i {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(139,157,131,.22); border: 1px solid rgba(96,108,56,.34);
  transition: background 360ms ease, border-color 360ms ease, transform 360ms ease, box-shadow 360ms ease;
}
.ap-relationship-dots i.is-awake {
  background: var(--terracotta); border-color: rgba(166,84,57,.66);
  box-shadow: 0 0 0 3px rgba(198,107,61,.1); transform: translateY(-1px);
}
.ap-relationship-dots i.is-awake:last-of-type { animation: relationshipBreath 3.6s ease-in-out infinite; }
.ap-relationship-text { overflow: hidden; color: var(--ink-faint); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.agent-panel .ap-close { color: var(--ink-faint); font-size: 18px; padding: 4px 8px; }
.ap-notice {
  margin: 12px 18px 0; padding: 10px 14px; border-radius: var(--radius-sm);
  background: rgba(192,142,58,0.13); border: 1px solid rgba(192,142,58,0.4);
  font-size: 12px; color: #7A5A1C; line-height: 1.7;
}
.ap-context { margin: 10px 18px 0; font-size: 11.5px; color: var(--ink-faint); line-height: 1.9; }
.ap-context b { color: var(--ink-soft); font-weight: 600; }
.ap-log { flex: 1; overflow-y: auto; padding: 14px 18px; contain: layout paint; }
.ap-msg { margin-bottom: 14px; max-width: 96%; content-visibility: auto; contain-intrinsic-size: auto 96px; }
.ap-msg.agent { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 9px; align-items: start; width: 100%; }
.ap-msg-body { min-width: 0; }
.ap-avatar {
  width: 36px; height: 36px; border-radius: 14px; flex: none;
  border: 1px dashed rgba(96,108,56,0.55); background: rgba(232,220,199,0.7);
}
.ap-avatar-jiao { position: relative; overflow: hidden; border-style: solid; }
.ap-avatar-jiao canvas { transform: scale(1.42); }
.ap-avatar-jiao img { width: 100%; height: 100%; padding: 2px; display: block; object-fit: contain; border-radius: inherit; }
.ap-avatar-jiao::after {
  content: ''; position: absolute; inset: 10px; border-radius: 50%;
  border: 1px solid rgba(96,108,56,0.28);
}
.ap-avatar-jiao.has-image::after { display: none; }
.ap-avatar-jiao.cat-mascot::after { display: none; }
.ap-msg .bubble {
  padding: 11px 15px; border-radius: var(--radius-md); font-size: 13.5px; line-height: 1.8;
}
.ap-msg.agent .bubble { background: var(--paper); border: 1px solid rgba(96,108,56,0.3); border-top-left-radius: 6px; }
.ap-msg.user { margin-left: auto; width: fit-content; max-width: 86%; }
.ap-msg.user .ap-msg-body { width: fit-content; margin-left: auto; }
.ap-msg.user .who { text-align: right; margin-right: 4px; }
.ap-msg.user .bubble { background: rgba(96,108,56,0.88); color: var(--sand-light); border-top-right-radius: 6px; }
.ap-msg .who { font-size: 11px; color: var(--ink-faint); margin-bottom: 4px; }
.ap-msg .refs { margin-top: 8px; }
.ap-kb-details {
  margin-top: 10px; border-top: 1px dashed rgba(96,108,56,0.35); color: var(--ink-soft);
}
.ap-kb-details summary {
  cursor: pointer; padding: 9px 0 3px; color: var(--moss); font-size: 12px;
  list-style-position: inside; user-select: none;
}
.ap-kb-details summary:hover { color: var(--terracotta); }
.ap-kb-content { padding: 5px 0 2px; }
.ap-kb-content > p + p { margin-top: 9px; }
.ap-exploration { margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(96,108,56,0.28); }
.ap-exploration-title { display: block; color: var(--moss); font-family: var(--serif); font-size: 14px; }
.ap-exploration-collapsed { padding-top: 8px; }
.ap-exploration-collapsed summary { cursor: pointer; color: var(--moss); font-size: 12px; }
.ap-answer-line { margin: 0 0 8px; }
.ap-answer-emphasis { color: var(--terracotta); font-weight: 700; }
.ap-explore-links { display: grid; margin-top: 7px; border-top: 1px solid rgba(96,108,56,0.18); }
.ap-explore-link {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center;
  width: 100%; min-height: 42px; padding: 8px 2px; border-bottom: 1px solid rgba(96,108,56,0.18);
  color: var(--ink); text-align: left;
}
.ap-explore-link strong { overflow-wrap: anywhere; font-size: 13px; font-weight: 600; }
.ap-explore-link span { color: var(--terracotta); font-size: 11px; white-space: nowrap; }
.ap-explore-link:hover strong, .ap-explore-link:focus-visible strong { color: var(--terracotta); }
.ap-explore-link:focus-visible { outline: 2px solid rgba(198,107,61,0.42); outline-offset: 2px; }
.ap-followups { display: grid; gap: 6px; margin-top: 12px; }
.ap-followup {
  width: 100%; padding: 7px 10px; border: 1px solid rgba(96,108,56,0.34); border-radius: 8px;
  color: var(--moss); background: rgba(139,157,131,0.08); font-size: 11.5px; line-height: 1.5; text-align: left;
}
.ap-followup:hover, .ap-followup:focus-visible { border-color: var(--terracotta); color: var(--terracotta); outline: none; }
.ap-input-row { display: flex; gap: 10px; padding: 14px 18px 18px; border-top: 1px solid rgba(96,108,56,0.25); }
.ap-input-row input {
  flex: 1; background: var(--paper); border: 1.5px solid var(--sage); border-radius: 999px;
  padding: 10px 18px; font-size: 13.5px; font-family: var(--sans); color: var(--ink);
}
.ap-input-row input:focus { outline: none; border-color: var(--moss); }
.ap-input-row .btn { padding: 9px 20px; font-size: 13.5px; }
.ap-quick { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 18px 6px; }
.ap-quick button {
  font-size: 11.5px; color: var(--moss); border: 1px solid rgba(96,108,56,0.4);
  border-radius: 999px; padding: 3px 12px; background: var(--paper);
}
.ap-quick button:hover { border-color: var(--terracotta); color: var(--terracotta); }
.ap-voice-controls {
  display: flex; align-items: center; flex-wrap: wrap; gap: 7px;
  padding: 10px 18px 2px; border-top: 1px solid rgba(96,108,56,0.16);
}
.ap-voice-note { flex: 1 1 100%; color: var(--ink-faint); font-size: 11px; line-height: 1.65; }
.ap-voice-status {
  flex: 1 1 100%; min-height: 23px; color: var(--ink-faint); font-size: 11.5px;
}
.ap-voice-status::before { content: '•'; display: inline-block; margin-right: 6px; color: var(--sage); }
.ap-voice-status[data-voice-state="WAKE_LISTENING"]::before,
.ap-voice-status[data-voice-state="LISTENING"]::before { color: var(--moss); animation: voiceBreath 3.6s ease-in-out infinite; }
.ap-voice-status[data-voice-state="ERROR"]::before { color: var(--terracotta); }
.ap-voice-feedback {
  flex: 1 1 100%; min-height: 18px; padding: 5px 8px; border-left: 2px solid rgba(96,108,56,0.35);
  color: var(--ink-faint); background: rgba(232,220,199,0.2); font-size: 11.5px; line-height: 1.5;
}
.ap-voice-feedback[hidden] { display: none; }
.ap-voice-feedback[data-tone="error"] { color: var(--terracotta); border-left-color: var(--terracotta); background: rgba(166,84,57,0.07); }
.ap-voice-transcript {
  flex: 1 1 100%; min-height: 18px; color: var(--ink); font-size: 12px; line-height: 1.5;
  padding: 5px 8px; border-left: 2px solid rgba(96,108,56,0.28); background: rgba(232,220,199,0.28);
}
.ap-voice-button {
  min-height: 36px; padding: 5px 11px; border: 1px solid rgba(96,108,56,0.35);
  border-radius: 999px; color: var(--moss); background: rgba(232,220,199,0.66); font-size: 11.5px;
}
.ap-voice-button:hover { border-color: var(--terracotta); color: var(--terracotta); }
.ap-stop-button { color: var(--terracotta); }
@keyframes voiceBreath { 0%, 100% { opacity: .48; } 50% { opacity: 1; } }
@keyframes relationshipBreath {
  0%, 100% { transform: translateY(-1px) scale(1); box-shadow: 0 0 0 3px rgba(198,107,61,.1); }
  50% { transform: translateY(-1px) scale(1.18); box-shadow: 0 0 0 5px rgba(198,107,61,.06); }
}
@media (prefers-reduced-motion: reduce) {
  .ap-relationship-dots i.is-awake:last-of-type { animation: none; }
  .ap-voice-status[data-voice-state="WAKE_LISTENING"]::before,
  .ap-voice-status[data-voice-state="LISTENING"]::before { animation: none; }
}

/* 小蕉提示气泡（非打断式） */
.jiao-toast {
  position: fixed; right: 100px; bottom: 34px; z-index: 550; max-width: 300px;
  background: var(--sand-light); border: 1.5px solid rgba(96,108,56,0.4);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lift); padding: 14px 16px;
  display: flex; gap: 12px; align-items: flex-start;
  animation: toastIn var(--t-med) cubic-bezier(0.2,0.9,0.3,1.15) both;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(0.94); } to { opacity: 1; transform: none; } }
.jiao-toast p { font-size: 13px; color: var(--ink-soft); flex: 1; }
.jiao-toast .jt-actions { display: flex; gap: 8px; margin-top: 8px; }
.jiao-toast .jt-actions button { font-size: 12px; color: var(--moss); text-decoration: underline; }
.jiao-toast .jt-dismiss { color: var(--ink-faint); font-size: 15px; line-height: 1; padding: 2px; }

/* ---------- 证据浮窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 800; background: rgba(43, 51, 39, 0.45);
  display: flex; align-items: center; justify-content: center; padding: 4vh 4vw;
  animation: fadeIn var(--t-fast) ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--sand-light); border-radius: var(--radius-lg);
  max-width: 760px; width: 100%; max-height: 88vh; overflow-y: auto;
  box-shadow: var(--shadow-lift); border: 1px solid rgba(96,108,56,0.3);
  animation: viewIn var(--t-med) ease both;
}
.modal .m-head { display: flex; align-items: center; gap: 14px; padding: 20px 26px 10px; }
.modal .m-head h3 { font-size: 19px; flex: 1; letter-spacing: 0.06em; }
.modal .m-close { font-size: 20px; color: var(--ink-faint); padding: 4px 10px; }
.modal .m-body { padding: 6px 26px 26px; }
.modal.step-image-modal { max-width: min(1100px, 92vw); overflow: hidden; }
.step-image-modal .m-body { display: grid; place-items: center; }
.step-image-lightbox { width: 100%; margin: 0; }
.step-image-lightbox img {
  display: block; width: 100%; max-height: 72vh; object-fit: contain; border-radius: var(--radius-md);
  background: rgba(96,108,56,.1);
}
.ev-block { border-top: 1px dashed rgba(96,108,56,0.3); padding: 16px 0; }
.ev-block:first-child { border-top: none; }
.ev-block img { width: 100%; border-radius: var(--radius-md); display: block; margin-bottom: 10px; }
.ev-block .tc {
  display: inline-block; font-size: 12px; color: var(--moss);
  background: rgba(96,108,56,0.1); border-radius: 999px; padding: 2px 12px; margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}
.ev-block blockquote {
  font-size: 13.5px; color: var(--ink-soft); line-height: 1.9;
  border-left: 3px solid var(--sage); padding-left: 14px; margin: 8px 0;
}
.ev-block .vis { font-size: 12.5px; color: var(--ink-faint); }

/* ---------- 数据护照 ---------- */
.passport { max-width: 1240px; margin: 0 auto; padding: 120px 3vw 80px; width: 100%; }
.passport h2 { font-size: 28px; letter-spacing: 0.1em; margin-bottom: 8px; }
.passport .sub { color: var(--ink-faint); font-size: 13.5px; margin-bottom: 26px; max-width: 720px; }
.passport table { width: 100%; border-collapse: collapse; background: var(--paper); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-soft); font-size: 13px; }
.passport th, .passport td { padding: 13px 14px; text-align: left; border-bottom: 1px solid rgba(96,108,56,0.18); vertical-align: top; }
.passport th { background: rgba(96,108,56,0.14); font-family: var(--serif); letter-spacing: 0.08em; font-size: 13px; color: var(--ink); white-space: nowrap; }
.passport tr:last-child td { border-bottom: none; }
.passport td .mono { font-size: 11.5px; color: var(--ink-faint); word-break: break-all; }
.passport .foot-note { margin-top: 18px; font-size: 12.5px; color: var(--ink-faint); line-height: 1.9; }
.kb-overview {
  margin: 0 0 28px; padding: 22px; border: 1px solid rgba(96,108,56,0.22);
  border-radius: var(--radius-lg); background: rgba(241,232,214,0.78); box-shadow: var(--shadow-soft);
}
.kb-overview-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.kb-overview h3 { font-size: 20px; letter-spacing: 0.08em; margin-bottom: 5px; }
.kb-overview-head p { max-width: 690px; color: var(--ink-faint); font-size: 12.5px; line-height: 1.8; }
.kb-total { min-width: 150px; text-align: right; }
.kb-total strong, .kb-stat strong { display: block; color: var(--terracotta); font-size: 28px; line-height: 1; font-variant-numeric: tabular-nums; }
.kb-total span, .kb-stat span { display: block; margin-top: 7px; color: var(--ink-soft); font-size: 12px; }
.kb-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.kb-stat { min-height: 116px; padding: 15px; border-radius: 12px; background: rgba(255,255,255,0.48); border: 1px solid rgba(96,108,56,0.15); }
.kb-stat.primary { background: rgba(198,107,61,0.07); border-color: rgba(198,107,61,0.2); }
.kb-stat small { display: block; margin-top: 9px; color: var(--ink-faint); font-size: 10.5px; line-height: 1.55; }
.kb-source-browser { margin-top: 20px; }
.kb-source-browser h4 { margin-bottom: 8px; font-size: 14px; letter-spacing: 0.08em; }
.kb-source-group { border-top: 1px solid rgba(96,108,56,0.18); }
.kb-source-group:last-child { border-bottom: 1px solid rgba(96,108,56,0.18); }
.kb-source-group summary { padding: 11px 2px; cursor: pointer; color: var(--moss); font-size: 12.5px; }
.kb-source-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 0 12px; }
.kb-source-list a { padding: 10px 12px; border-radius: 9px; background: rgba(255,255,255,0.48); border: 1px solid rgba(96,108,56,0.12); }
.kb-source-list a:hover { border-color: rgba(198,107,61,0.4); }
.kb-source-list b, .kb-source-list span { display: block; }
.kb-source-list b { color: var(--ink); font-size: 12px; line-height: 1.5; }
.kb-source-list span { margin-top: 3px; color: var(--ink-faint); font-size: 10.5px; }

/* 空状态 */
.empty-state { text-align: center; color: var(--ink-faint); padding: 40px 0; font-size: 13.5px; letter-spacing: 0.1em; }

/* 加载与错误 */
.loading { min-height: 100vh; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 16px; color: var(--ink-faint); letter-spacing: 0.2em; }
.loading .cat { animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 0%,100% { transform: scale(1); opacity: 0.85; } 50% { transform: scale(1.08); opacity: 1; } }

/* 返回按钮 */
.back-btn { color: var(--ink-soft); font-size: 13.5px; letter-spacing: 0.1em; display: inline-flex; align-items: center; gap: 6px; }
.back-btn:hover { color: var(--terracotta); }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .site-legal { bottom: 4px; font-size: 10px; }
  .topnav { padding: 18px 22px; }
  .topnav nav { gap: 18px; font-size: 13px; }
  .home .hero-copy { padding: 16vh 7vw 0; }
  .home .hero-stats { padding-left: 7vw; flex-wrap: wrap; gap: 20px; }
  .craft-body { flex-direction: column; }
  .reading-col, .craft-body.playing .reading-col { width: 100%; min-width: 0; height: min(42vh, 400px); flex: none; }
  .craft-body.playing .panel .panel-head { writing-mode: horizontal-tb; }
  .wb-play { flex-direction: column; }
  .backpack { width: 100%; border-right: none; border-bottom: 1px solid rgba(96,108,56,0.25); max-height: 190px; }
  .wb-complete { flex-direction: column; }
  .complete-side { width: 100%; border-left: none; border-top: 1px solid rgba(96,108,56,0.25); }
  .complete-stage { min-height: 320px; }
  .assembly .as-grid { flex-direction: column; }
  .wb-canvas-area { flex-wrap: wrap; }
  .action-palette { position: relative; inset: auto; order: 4; width: 100%; max-height: 92px; flex-direction: row; overflow-x: auto; overflow-y: hidden; }
  .action-palette::before { display: none; }
  .action-card { min-width: 150px; }
  .wb-object-gallery { margin-right: 0; min-height: 136px; }
  .action-drop-slot { margin: 0; width: min(190px, 48%); }
  .wb-stage-layout { grid-template-columns: 1fr; min-height: 420px; }
  .wb-side-rail { grid-template-rows: auto minmax(132px, 20vh); }
  .wb-play-physics .action-palette {
    position: relative; inset: auto; width: 100%; max-height: 100px;
    flex-direction: row; overflow-x: auto; overflow-y: hidden; order: 2;
  }
  .wb-play-physics .action-card { min-width: 160px; }
  .wb-table-surface { min-height: 300px; }
  .map-view.is-district-focus .map3d-wrap { transform: translateY(2vh) scale(0.90); }
  .map-view > .district-story { top: 58%; left: 16px; width: min(46vw, 330px); }
  .map-view > .project-story { top: 58%; right: 16px; width: min(46vw, 330px); }
  .map-view > .project-story { right: 16px; width: min(46vw, 330px); }
  .district-focus { inset: 124px 16px 24px; gap: 14px; }
  .district-focus .district-story { width: min(43vw, 310px); flex-basis: min(43vw, 310px); padding: 18px; }
  .district-story h2 { font-size: 34px; }
  .district-focus .project-story { right: 0; width: min(46vw, 330px); }
  .passport { overflow-x: auto; }
  .kb-overview { min-width: 680px; }
  .kb-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- 社区共建：地图投稿入口与模块化投稿表单 ---------- */
.tag-community { background: rgba(96,108,56,.14); color: var(--moss); border: 1px solid rgba(96,108,56,.42); }
.toolbar-contribute {
  flex: 0 0 auto; margin-left: auto; padding: 9px 18px; border-radius: 999px;
  background: var(--terracotta); color: var(--sand); box-shadow: 0 6px 16px rgba(198,107,61,.24);
  transition: transform var(--t-fast) ease, box-shadow var(--t-fast) ease;
}
.toolbar-contribute:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(198,107,61,.3); }
.toolbar-contribute[hidden] { display: none !important; }
.craft-anchor-placeholder, .craft-card-placeholder, .admin-card-placeholder {
  display: grid; place-items: center; color: var(--moss); background: rgba(139,157,131,.2);
  border: 1px solid rgba(96,108,56,.28); letter-spacing: .12em;
}
.craft-anchor-placeholder { position: absolute; left: 10px; top: 8px; width: 92px; height: 62px; border-radius: var(--radius-sm); font-size: 11px; }
.craft-card-placeholder { width: 118px; height: 88px; border-radius: var(--radius-sm); flex: none; font-size: 12px; }
.admin-card-placeholder { width: 100%; height: 158px; border-radius: var(--radius-md); }

.community-page { position: relative; min-height: 100vh; }
.community-page > .bg-stack { position: fixed; }
.community-shell { position: relative; z-index: 4; width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 124px 0 84px; }
.community-form { display: grid; gap: 20px; }
.community-intro-card, .community-form-section, .community-full-fields, .community-process-module, .community-success {
  padding: 28px; border-radius: var(--radius-lg); color: var(--ink);
  background: rgba(232,220,199,.94); border: 1px solid rgba(96,108,56,.27); box-shadow: var(--shadow-soft);
}
.community-intro-card { padding: 38px; background: linear-gradient(125deg, rgba(139,157,131,.94), rgba(232,220,199,.95) 72%); }
.community-import-card { display: grid; gap: 12px; padding: 22px 28px; border-radius: var(--radius-lg); color: var(--ink); background: rgba(244,235,211,.94); border: 1px dashed rgba(96,108,56,.42); }
.community-import-card h2 { font-family: var(--serif); font-size: 22px; }
.community-import-card p { color: var(--ink-soft); font-size: 13px; }
.community-import-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.community-import-file { position: relative; overflow: hidden; cursor: pointer; }
.community-import-file input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.community-import-schema { font-size: 12px !important; color: var(--ink-faint) !important; }
.community-import-status { min-height: 20px; color: var(--moss) !important; }
.community-import-status.error { color: var(--terracotta) !important; }
.community-star-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; grid-column: 1 / -1; }
.community-star-image-section { display: grid; gap: 10px; grid-column: 1 / -1; padding: 16px; border: 1px solid rgba(96,108,56,.2); border-radius: var(--radius-md); background: rgba(139,157,131,.08); }
.community-star-image-section > h3 { font-family: var(--serif); font-size: 19px; }
.community-star-image-section > p { color: var(--ink-faint); font-size: 12px; }
.community-image-role-guide { grid-column: 1 / -1; padding: 15px 18px; border-left: 3px solid var(--terracotta); background: rgba(198,107,61,.07); }
.community-image-role-guide strong { font-family: var(--serif); font-size: 18px; }
.community-image-role-guide p { margin-top: 4px; color: var(--ink-faint); font-size: 12px; }
.community-image-purpose-section { display: grid; gap: 12px; grid-column: 1 / -1; padding: 18px; border: 1px solid rgba(96,108,56,.2); border-radius: var(--radius-md); background: rgba(250,246,236,.46); }
.community-image-purpose-section.is-primary { border-color: rgba(198,107,61,.35); background: rgba(198,107,61,.055); }
.community-image-purpose-heading { display: flex; gap: 12px; align-items: flex-start; }
.community-image-purpose-heading > span { display: grid; width: 31px; height: 31px; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--olive); color: var(--paper); font: 600 11px/1 var(--sans); }
.community-image-purpose-heading h3 { font-family: var(--serif); font-size: 19px; }
.community-image-purpose-heading p { margin-top: 3px; color: var(--ink-faint); font-size: 12px; }
.community-main-image-preview { display: grid; grid-template-columns: minmax(120px, 210px) 1fr; gap: 14px; align-items: center; }
.community-main-image-preview img { width: 100%; height: 126px; object-fit: cover; border-radius: var(--radius-sm); }
.community-main-image-preview > p { color: var(--ink-faint); font-size: 12px; }
.community-node-fallback { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px dashed rgba(96,108,56,.32); border-radius: var(--radius-sm); background: rgba(139,157,131,.08); }
.community-node-fallback img { width: 88px; height: 62px; object-fit: cover; border-radius: 6px; opacity: .84; }
.community-node-fallback p { margin-top: 3px; color: var(--ink-faint); font-size: 12px; }
.community-overview-drop { position: relative; display: grid; gap: 5px; place-items: center; min-height: 96px; padding: 18px; border: 1px dashed rgba(198,107,61,.55); border-radius: var(--radius-md); color: var(--moss); background: rgba(139,157,131,.12); text-align: center; cursor: pointer; grid-column: 1 / -1; }
.community-overview-drop span { color: var(--ink-faint); font-size: 12px; }
.community-image-file-input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.community-overview-drop.is-dragover { border-color: var(--terracotta); background: rgba(198,107,61,.12); }
.image-upload-progress { display: grid; gap: 6px; width: 100%; grid-column: 1 / -1; }
.image-upload-progress[hidden] { display: none; }
.image-upload-progress-copy { display: flex; justify-content: space-between; gap: 14px; color: var(--ink-soft); font-size: 12px; }
.image-upload-progress-value { flex: 0 0 auto; color: var(--moss); font-variant-numeric: tabular-nums; }
.image-upload-progress progress { width: 100%; height: 8px; overflow: hidden; border: 0; border-radius: 999px; background: rgba(96,108,56,.14); accent-color: var(--moss); }
.image-upload-progress progress::-webkit-progress-bar { background: rgba(96,108,56,.14); border-radius: 999px; }
.image-upload-progress progress::-webkit-progress-value { border-radius: 999px; background: linear-gradient(90deg, var(--sage), var(--moss)); transition: width 180ms ease; }
.image-upload-progress[data-state="success"] .image-upload-progress-copy { color: var(--moss); }
.image-upload-progress[data-state="error"] .image-upload-progress-copy, .image-upload-progress[data-state="error"] .image-upload-progress-value { color: var(--terracotta); }
.community-overview-images { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; grid-column: 1 / -1; }
.community-overview-image-card { padding: 14px; border: 1px solid rgba(96,108,56,.22); border-radius: var(--radius-md); background: rgba(212,184,149,.24); }
.community-overview-image-card img, .community-overview-image-empty { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius-sm); background: rgba(96,108,56,.1); }
.community-overview-image-empty { display: grid; place-items: center; color: var(--ink-faint); }
.graph-contribution-image-drop { margin-top: 10px; }
.graph-contribution-image-preview { display: block; width: 100%; max-height: 220px; margin-top: 10px; border-radius: var(--radius-sm); object-fit: contain; background: rgba(96,108,56,.08); }
.graph-contribution-image-preview[hidden] { display: none; }
.community-eyebrow { color: var(--terracotta); font-size: 12px; letter-spacing: .16em; margin-bottom: 6px; }
.community-intro-card h1, .community-success h1 { font-size: clamp(34px, 5vw, 58px); line-height: 1.18; margin-bottom: 10px; }
.community-intro-card > p:not(.community-eyebrow) { max-width: 700px; color: var(--ink-soft); }
.community-mode { display: flex; gap: 8px; margin-top: 24px; }
.community-mode button { padding: 9px 20px; border: 1px solid rgba(96,108,56,.35); border-radius: 999px; }
.community-mode button.active { background: var(--moss); border-color: var(--moss); color: var(--sand); }
.community-form-section h2, .community-full-fields::before, .community-process-module h2 { font-family: var(--serif); font-size: 24px; }
.community-full-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.community-full-fields::before { content: '完整资料'; grid-column: 1 / -1; }
.community-full-fields[hidden], .community-process-module[hidden] { display: none !important; }
.community-field-grid, .community-step-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.community-field { display: grid; gap: 7px; margin-top: 14px; color: var(--ink-soft); font-size: 13px; }
.community-field input, .community-field textarea, .admin-review-note textarea, .admin-submission-filter select {
  width: 100%; padding: 11px 13px; border: 1px solid rgba(96,108,56,.34); border-radius: var(--radius-sm);
  background: rgba(232,220,199,.72); color: var(--ink); font: inherit; line-height: 1.65; outline: none;
  transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}
.community-field input:focus, .community-field textarea:focus, .admin-review-note textarea:focus, .admin-submission-filter select:focus {
  border-color: var(--terracotta); box-shadow: 0 0 0 3px rgba(198,107,61,.12);
}
.community-field small, .community-section-note { color: var(--ink-faint); font-size: 12px; }
.community-process-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.community-process-heading p { color: var(--ink-faint); font-size: 13px; }
.community-switch, .community-consent { display: flex; align-items: center; gap: 10px; color: var(--moss); }
.community-switch input, .community-consent input { accent-color: var(--moss); }
.community-steps { display: grid; gap: 18px; margin-top: 22px; padding-left: 22px; border-left: 2px solid rgba(198,107,61,.32); }
.community-step-card { position: relative; padding: 22px; border-radius: var(--radius-md); background: rgba(212,184,149,.3); border: 1px solid rgba(96,108,56,.2); }
.community-step-card::before { content: ''; position: absolute; left: -30px; top: 32px; width: 14px; height: 14px; border-radius: 50%; background: var(--terracotta); box-shadow: 0 0 0 6px rgba(198,107,61,.12); }
.community-step-heading { display: flex; justify-content: space-between; gap: 18px; align-items: start; }
.community-step-heading span { color: var(--terracotta); font-size: 11px; letter-spacing: .13em; }
.community-step-heading h3 { font-size: 21px; }
.community-remove-step { color: var(--terracotta); border-bottom: 1px solid currentColor; font-size: 12px; }
.community-add-step { display: none; margin-top: 18px; }
.community-process-module.is-enabled .community-add-step { display: inline-flex; }
.community-consent { align-items: flex-start; margin: 22px 0; color: var(--ink-soft); }
.community-consent input { margin-top: 6px; }
.community-honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.community-submit-actions { display: flex; justify-content: flex-end; align-items: center; gap: 14px; }
.community-submit-status { min-height: 26px; color: var(--moss); }
.community-submit-status.error { color: var(--terracotta); }
.community-success { min-height: 480px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.community-success .btn { margin-top: 24px; }
.community-note-idle { padding: 32px; }
.community-note-cover { width: min(520px, 90%); max-height: 340px; object-fit: cover; border-radius: var(--radius-lg); }

/* 知识星图社区共建：规范化表单复用社区投稿的字段语言。 */
.graph-contribution-form { width: min(720px, calc(100vw - 64px)); display: grid; gap: 4px; }
.graph-contribution-standard { margin-bottom: 8px; padding: 14px 16px; border-left: 3px solid var(--terracotta); border-radius: 0 12px 12px 0; background: rgba(198,107,61,.08); }
.graph-contribution-standard p { color: var(--ink); font-family: var(--serif); font-size: 18px; }
.graph-contribution-standard small { display: block; margin-top: 6px; color: var(--ink-soft); font-size: 12px; line-height: 1.7; }
.graph-contribution-form select { width: 100%; padding: 11px 13px; border: 1px solid rgba(96,108,56,.34); border-radius: var(--radius-sm); background: rgba(232,220,199,.72); color: var(--ink); font: inherit; }
.graph-contribution-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.graph-contribution-dependent { margin-top: 14px; padding: 14px 16px; border: 1px solid rgba(96,108,56,.2); border-radius: var(--radius-md); background: rgba(139,157,131,.08); }
.graph-contribution-dependent[hidden] { display: none; }
.graph-contribution-section-title { color: var(--moss); font-family: var(--serif); font-size: 17px; }
.graph-contribution-success { padding: 36px 8px; text-align: center; }
.graph-contribution-success h3 { font-family: var(--serif); font-size: 28px; }
.graph-contribution-success p { margin: 12px auto 22px; max-width: 500px; color: var(--ink-soft); line-height: 1.8; }

/* ---------- 管理员：社区投稿审核 ---------- */
.admin-submission-filter { min-width: 220px; }
.admin-graph-editor, .admin-content-editor { display: grid; gap: 14px; margin-bottom: 22px; padding: 24px; border: 1px solid rgba(96,108,56,.28); border-radius: var(--radius-lg); background: rgba(232,220,199,.94); }
.admin-graph-editor .admin-field, .admin-content-editor .admin-field { display: grid; gap: 7px; }
.admin-graph-editor input, .admin-graph-editor textarea, .admin-graph-editor select,
.admin-content-editor input, .admin-content-editor textarea { width: 100%; padding: 10px 12px; border: 1px solid rgba(96,108,56,.34); border-radius: var(--radius-sm); background: rgba(255,255,255,.32); font: inherit; }
.admin-content-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, .55fr); gap: 14px; }
.admin-claim-list { display: grid; gap: 10px; margin-top: 10px; }
.admin-claim-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 10px; }
.admin-graph-relations { display: grid; gap: 9px; }
.admin-graph-relation-row { display: grid; grid-template-columns: 110px minmax(180px, 1fr) minmax(240px, 1.35fr) auto; gap: 8px; align-items: start; }
.admin-documentary-editor { display: grid; gap: 12px; margin: 18px 0; padding: 16px; border: 1px solid rgba(96,108,56,.22); border-radius: var(--radius-md); background: rgba(232,220,199,.46); }
.admin-documentary-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 9px; }
.admin-documentary-source { display: grid; gap: 5px; padding: 6px; border: 1px solid rgba(96,108,56,.24); border-radius: 10px; background: rgba(255,255,255,.28); color: var(--ink); text-align: left; cursor: grab; }
.admin-documentary-source img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 7px; }
.admin-documentary-source span { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-documentary-drop { padding: 13px; border: 1px dashed rgba(96,108,56,.45); border-radius: 10px; color: var(--ink-faint); text-align: center; font-size: 12px; }
.admin-documentary-drop.is-over { border-color: var(--terracotta); background: rgba(198,107,61,.1); color: var(--terracotta); }
.admin-documentary-list { display: grid; gap: 9px; }
.admin-documentary-item { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 9px; border: 1px solid rgba(96,108,56,.2); border-radius: 10px; background: rgba(255,255,255,.24); }
.admin-documentary-item > img { width: 110px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 7px; }
.admin-documentary-placeholder { display: grid; place-items: center; min-height: 82px; border-radius: 7px; background: rgba(96,108,56,.12); color: var(--ink-faint); font-size: 11px; }
.admin-documentary-fields { display: grid; gap: 7px; }
.admin-documentary-fields input, .admin-documentary-fields textarea { width: 100%; padding: 8px 10px; border: 1px solid rgba(96,108,56,.25); border-radius: 7px; background: rgba(255,255,255,.45); font: inherit; }
.admin-documentary-time { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.admin-import-button { position: relative; overflow: hidden; cursor: pointer; }
.admin-import-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.admin-submission-summary { color: var(--ink-soft); font-size: 13px; margin-bottom: 7px; }
.admin-submission-list { display: grid; gap: 22px; }
.admin-submission-card { padding: 26px; border-radius: var(--radius-lg); background: rgba(232,220,199,.95); border: 1px solid rgba(96,108,56,.28); box-shadow: var(--shadow-soft); }
.admin-submission-heading { display: flex; justify-content: space-between; gap: 22px; margin-bottom: 20px; }
.admin-submission-heading h2 { font-size: 28px; }
.admin-submission-status { height: fit-content; padding: 5px 12px; border-radius: 999px; font-size: 12px; }
.admin-submission-status.is-pending { color: #8A6420; background: rgba(192,142,58,.16); }
.admin-submission-status.is-approved { color: var(--moss); background: rgba(96,108,56,.16); }
.admin-submission-status.is-rejected { color: var(--terracotta); background: rgba(198,107,61,.14); }
.admin-submission-meta { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 10px; margin-bottom: 20px; }
.admin-submission-meta > div { padding: 10px 12px; border-radius: var(--radius-sm); background: rgba(139,157,131,.13); }
.admin-submission-meta dt { color: var(--ink-faint); font-size: 11px; }
.admin-submission-meta dd { overflow-wrap: anywhere; }
.admin-submission-copy, .admin-submission-steps { margin: 16px 0; }
.admin-submission-copy h3, .admin-submission-steps > h3 { font-size: 17px; margin-bottom: 5px; }
.admin-submission-copy p { white-space: pre-wrap; }
.admin-submission-source { display: inline-block; margin: 8px 0; border-bottom: 1px solid currentColor; }
.admin-submission-cover { display: block; width: min(480px,100%); max-height: 300px; object-fit: cover; border-radius: var(--radius-md); margin: 14px 0; }
.admin-submission-gallery { margin: 18px 0; }
.admin-submission-gallery h3 { font-size: 17px; margin-bottom: 9px; }
.admin-submission-gallery > div { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.admin-submission-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid rgba(96,108,56,.22); }
.admin-submission-steps { display: grid; gap: 10px; }
.admin-submission-steps article { padding: 12px 15px; border-radius: var(--radius-sm); background: rgba(212,184,149,.25); }
.admin-review-note { display: grid; gap: 7px; margin-top: 18px; color: var(--ink-soft); font-size: 13px; }
.admin-review-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 14px; }
.admin-review-result { margin-top: 16px; color: var(--moss); }
.admin-review-result.is-rejected { color: var(--terracotta); }

@media (max-width: 780px) {
  .community-shell { width: min(100% - 24px, 1120px); padding-top: 108px; }
  .community-intro-card, .community-form-section, .community-full-fields, .community-process-module { padding: 20px 16px; }
  .community-full-fields, .community-field-grid, .community-step-grid { grid-template-columns: 1fr; }
  .community-process-heading, .community-step-heading, .community-submit-actions { align-items: flex-start; flex-direction: column; }
  .community-submit-actions { align-items: stretch; }
  .community-submit-actions .btn, .community-submit-actions .btn-ghost { justify-content: center; text-align: center; }
  .admin-submission-meta { grid-template-columns: 1fr 1fr; }
  .admin-submission-heading, .admin-review-actions { flex-direction: column; }
  .graph-contribution-form { width: min(100%, calc(100vw - 40px)); }
  .graph-contribution-grid { grid-template-columns: 1fr; }
}

/* ---------- 减少动态效果 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
  .view { animation: none; }
}

/* ---------- 工艺页：分层背景之上的内容叠层 ---------- */
.craft-page { position: relative; }
.craft-page .craft-head, .craft-page .craft-body { position: relative; z-index: 10; }
.craft-page .craft-head h2, .craft-page .craft-head .meta {
  text-shadow: 0 0 10px rgba(241, 232, 214, 0.9), 0 1px 2px rgba(241, 232, 214, 0.9);
}

/* ---------- 三维墨点模型（particlemodel.js） ---------- */
.pm-stage {
  position: relative; width: 100%; aspect-ratio: 4 / 3; min-height: 300px;
  border: 1px solid rgba(96, 108, 56, 0.22); border-radius: 14px;
  background: rgba(241, 232, 214, 0.35); overflow: hidden;
}
.pm-stage .pm-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: block; touch-action: none; cursor: grab;
}
.pm-stage .pm-canvas:active { cursor: grabbing; }
.pm-stage.pm-deferred {
  display: grid; place-items: center; overflow: hidden; isolation: isolate;
  background: radial-gradient(circle at 50% 42%, rgba(241,232,214,0.84), rgba(139,157,131,0.12));
}
.craft-loading-shell { min-height: 100vh; background: var(--sand-light); }
.craft-loading-card {
  min-height: calc(100vh - 92px); display: grid; place-content: center; justify-items: center;
  gap: 12px; color: var(--ink-faint); text-align: center; letter-spacing: 0.08em;
}
.craft-loading-card strong { color: var(--ink); font-family: var(--serif); font-size: clamp(22px, 2.8vw, 38px); }
.craft-loading-card span { font-size: 13px; }
.craft-loading-mark {
  width: 72px; height: 72px; border-radius: 48% 52% 62% 38% / 44% 41% 59% 56%;
  background: radial-gradient(circle at 36% 30%, rgba(241,232,214,0.72), transparent 20%), var(--moss);
  opacity: 0.5; animation: mapLoadBreath 1.8s ease-in-out infinite alternate;
}
.pm-preview-poster {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0.34; filter: blur(1.2px) saturate(0.72); z-index: -1;
}
.pm-deferred-copy { display: grid; justify-items: center; gap: 11px; padding: 28px; text-align: center; }
.pm-deferred-copy strong { font-family: var(--serif); font-size: clamp(20px, 2.2vw, 30px); letter-spacing: 0.08em; }
.pm-deferred-copy span { max-width: 36em; color: var(--ink-faint); font-size: 13px; line-height: 1.8; }
.pm-load-button { min-width: 150px; }
.pm-zoom-controls {
  position: absolute; right: 18px; bottom: 18px; z-index: 6;
  display: flex; gap: 6px; padding: 5px;
  border: 1px solid rgba(96,108,56,0.34); border-radius: 999px;
  background: rgba(232,220,199,0.88); box-shadow: 0 5px 16px rgba(43,51,39,0.12);
  backdrop-filter: blur(8px);
}
.pm-zoom-controls button {
  min-width: 48px; padding: 7px 11px; border: 0; border-radius: 999px;
  background: transparent; color: var(--moss); font-size: 12px;
  transition: color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.pm-zoom-controls button:hover:not(:disabled) { color: var(--terracotta); background: rgba(198,107,61,0.1); transform: translateY(-1px); }
.pm-zoom-controls button:focus-visible { outline: 2px solid var(--terracotta); outline-offset: 1px; }
.pm-zoom-controls button:disabled { opacity: 0.42; cursor: wait; }
.pm-loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--ink-faint); letter-spacing: 0.12em;
}
.pm-cap { font-size: 12px; color: var(--ink-faint); text-align: center; margin: 8px 0 0; letter-spacing: 0.06em; }
.wb-idle .pm-stage { width: min(680px, 96%); aspect-ratio: 3 / 2; min-height: 380px; }
.wb-idle .pm-stage .pm-canvas { filter: blur(0.45px); opacity: 0.9; }
.finish-model .pm-canvas { filter: contrast(1.08) saturate(1.04); }
.complete-side .pm-stage { min-height: 220px; margin-bottom: 4px; }
.complete-side > .pm-cap:first-child { margin-bottom: 14px; }

/* ---------- 工作台背景交叉淡融（craft ↔ workbench） ---------- */
.craft-page .bg-stack { transition: opacity 900ms ease; }
.bg-stack.wb-bg { opacity: 0; }
.bg-stack.wb-bg.show { opacity: 1; }
.bg-stack.dimmed { opacity: 0.18; }

/* ---------- 工作台期间重新展开阅读面板（布局区域，不丢工作台状态） ---------- */
.craft-body.playing.reading-open .reading-col {
  width: 34%; min-width: 300px; overflow: hidden; gap: 12px;
}
.craft-body.playing.reading-open .panel { flex: 0 0 auto; }
.craft-body.playing.reading-open .panel.open { flex: 1 1 0; }
.craft-body.playing.reading-open .panel .panel-head { writing-mode: horizontal-tb; padding: 15px 22px; }
.craft-body.playing.reading-open .panel .pnum,
.craft-body.playing.reading-open .panel .chev { display: inline; }
.craft-body.playing.reading-open .panel.open .panel-body { display: block; }
/* ---------- 收尾：完成作品（流程组合已移除） ---------- */
.wb-finishing { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.wb-finishing .finish-ready {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; padding: 30px;
}
.wb-finishing h3 { font-size: 20px; letter-spacing: 0.12em; margin-bottom: 10px; }
.wb-finishing .note { max-width: 440px; font-size: 13px; color: var(--ink-faint); margin: 12px 0 22px; }
.chip-ready { background: rgba(96, 108, 56, 0.16); border-color: rgba(96, 108, 56, 0.45); }
.btn-finish { font-size: 16px; padding: 13px 46px; letter-spacing: 0.24em; }

/* ---------- 完成态 v2：中央主舞台 + 侧栏（模型居中不被挤开） ---------- */
.finish-v2 { flex: 1; display: flex; min-height: 0; }
.finish-main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 18px 18px 14px; }
.finish-stage { position: relative; flex: 1; min-height: 420px; }
.finish-burst {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 3;
}
.finish-ceremony {
  position: absolute; inset: 0; z-index: 8; display: grid; place-content: center; justify-items: center;
  gap: 12px; overflow: hidden; pointer-events: none;
  background: radial-gradient(circle at 50% 48%, rgba(241,232,214,.88) 0 12%, rgba(232,220,199,.42) 34%, transparent 68%);
  animation: finishCeremonyIn 720ms cubic-bezier(.16,.82,.24,1) both;
  transition: opacity 720ms ease, filter 720ms ease;
}
.finish-ceremony.is-leaving { opacity: 0; filter: blur(8px); }
.finish-ceremony > strong { color: var(--moss); font-family: var(--serif); font-size: 15px; letter-spacing: .3em; text-indent: .3em; }
.finish-ceremony-seal {
  position: relative; z-index: 2; width: 62px; height: 62px; display: grid; place-items: center;
  border: 1px solid rgba(154,87,48,.72); color: var(--terracotta); font-family: var(--serif); font-size: 31px;
  background: rgba(241,232,214,.74); box-shadow: inset 0 0 0 5px rgba(198,107,61,.07), 0 12px 34px rgba(43,51,39,.12);
  transform: rotate(-3deg); animation: finishSeal 900ms 220ms cubic-bezier(.18,.88,.2,1.16) both;
}
.finish-ceremony-ring {
  position: absolute; left: 50%; top: 48%; width: 96px; aspect-ratio: 1; border-radius: 50%;
  border: 1px solid rgba(96,108,56,.4); transform: translate(-50%,-50%) scale(.25); opacity: 0;
  animation: finishRing 1.5s 180ms ease-out both;
}
.finish-ceremony-ring.ring-two { animation-delay: 470ms; border-color: rgba(192,142,58,.34); }
.finish-ceremony-motes { position: absolute; left: 50%; top: 48%; }
.finish-ceremony-motes i {
  --angle: calc(var(--i) * 30deg); position: absolute; width: 5px; height: 5px; border-radius: 50%;
  background: var(--ochre); opacity: 0; transform: rotate(var(--angle)) translateX(34px);
  animation: finishMote 1.45s calc(260ms + var(--i) * 28ms) ease-out both;
}
@keyframes finishCeremonyIn { from { opacity: 0; transform: scale(1.05); } to { opacity: 1; transform: scale(1); } }
@keyframes finishSeal { from { opacity: 0; transform: rotate(-8deg) scale(1.7); filter: blur(5px); } to { opacity: 1; transform: rotate(-3deg) scale(1); filter: none; } }
@keyframes finishRing { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.25); } 20% { opacity: .7; } 100% { opacity: 0; transform: translate(-50%,-50%) scale(4.8); } }
@keyframes finishMote { 0% { opacity: 0; transform: rotate(var(--angle)) translateX(34px) scale(.4); } 28% { opacity: .75; } 100% { opacity: 0; transform: rotate(var(--angle)) translateX(180px) translateY(72px) scale(.15); } }
.finish-model { position: absolute; inset: 0; transition: opacity 500ms ease; }
.finish-flat-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.finish-stage .pz-wrap {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 900ms ease; touch-action: none;
}
.finish-stage .pz-wrap.show { opacity: 1; }
.finish-stage .pz-inner { will-change: transform; }
.finish-stage .pz-inner img {
  max-width: 78%; max-height: 70vh; border-radius: var(--radius-md);
  box-shadow: var(--shadow-lift); filter: sepia(0.15) saturate(0.95);
  user-select: none; -webkit-user-drag: none; display: block; margin: 0 auto;
}
.finish-stage .stage-tip {
  position: absolute; left: 18px; bottom: 14px; z-index: 4; font-size: 11.5px; color: var(--ink-faint);
  background: var(--paper); padding: 3px 12px; border-radius: 999px; border: 1px solid rgba(96,108,56,0.25);
}
.finish-main .pm-cap { margin-top: 10px; }
.finish-v2 .complete-side { width: 280px; }

/* ---------- 完成品 → 全屏知识图谱 ---------- */
.heritage-graph-open { overflow: hidden; }
.heritage-graph-overlay {
  position: fixed; inset: 0; z-index: 1200; overflow: hidden; color: var(--ink);
  background: radial-gradient(ellipse at 50% 46%, #718274 0%, #5d705f 48%, #455749 100%);
  isolation: isolate;
}
.heritage-graph-overlay::before {
  content: ''; position: absolute; inset: 0; z-index: -1; opacity: .15; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
}
.heritage-graph-wash {
  position: absolute; inset: -20%; z-index: -1; pointer-events: none; opacity: .7;
  background: radial-gradient(ellipse at 50% 52%, rgba(232,220,199,.18), transparent 44%), radial-gradient(ellipse at 14% 8%, rgba(232,220,199,.22), transparent 36%), radial-gradient(ellipse at 92% 85%, rgba(96,108,56,.2), transparent 36%);
  filter: blur(24px);
}
.heritage-graph-header {
  position: absolute; z-index: 4; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start;
  padding: 26px 34px 0; pointer-events: none;
  transition: transform 420ms cubic-bezier(.2,.8,.25,1);
}
.heritage-graph-heading, .heritage-graph-close { pointer-events: auto; }
.heritage-graph-heading { color: var(--paper); }
.heritage-graph-kicker { display: block; color: var(--terracotta); font-size: 12px; letter-spacing: .15em; }
.heritage-graph-heading h1 { margin: 7px 0 3px; font-family: var(--serif); font-size: clamp(26px, 3.4vw, 48px); font-weight: 500; letter-spacing: .03em; }
.heritage-graph-subtitle { margin: 0; color: rgba(241,232,214,.72); font-size: 13px; }
.heritage-graph-close {
  border: 1px solid rgba(241,232,214,.42); border-radius: 999px; padding: 10px 16px; color: var(--paper);
  background: rgba(241,232,214,.55); font: inherit; font-size: 12px; cursor: pointer;
}
.heritage-graph-close:hover, .heritage-graph-close:focus-visible { border-color: var(--terracotta); color: var(--terracotta); outline: none; }
.heritage-graph-stage { position: absolute; inset: 92px 0 0; overflow: hidden; }
.heritage-graph-canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.heritage-graph-canvas:active { cursor: grabbing; }
.heritage-graph-label {
  position: absolute; z-index: 2; top: 0; left: 0; pointer-events: none; white-space: nowrap;
  padding: 5px 10px; border: 1px solid rgba(232,220,199,.34); border-radius: 999px;
  color: var(--ink); background: rgba(232,220,199,.68); box-shadow: 0 8px 26px rgba(43,51,39,.13); font-size: 12px;
  backdrop-filter: blur(9px); transition: border-color var(--t-med), background var(--t-med), box-shadow var(--t-med);
}
.heritage-graph-label.root, .heritage-graph-label.branch-center { padding: 8px 14px; border-color: rgba(232,220,199,.58); background: rgba(232,220,199,.86); box-shadow: 0 10px 34px rgba(43,51,39,.18); font-size: 15px; }
.heritage-graph-label.portal { color: var(--moss); border-color: rgba(96,108,56,.46); }
.heritage-graph-label.is-disabled { color: var(--ink-faint); border-style: dashed; opacity: .65; }
.heritage-graph-trail {
  position: absolute; z-index: 5; left: 34px; bottom: 24px; display: flex; align-items: center; gap: 8px;
  color: rgba(241,232,214,.68); font-size: 12px; pointer-events: none;
}
.heritage-graph-trail .is-current { color: var(--paper); font-weight: 600; }
.heritage-graph-trail-sep { color: var(--terracotta); }
.heritage-graph-hint { position: absolute; z-index: 3; left: 50%; bottom: 24px; transform: translateX(-50%); margin: 0; color: rgba(241,232,214,.55); font-size: 11px; }
.heritage-graph-info {
  position: absolute; z-index: 5; top: 132px; right: 32px; width: min(320px, 28vw); min-height: 170px; padding: 20px;
  border: 1px solid rgba(232,220,199,.38); border-radius: 24px; background: rgba(232,220,199,.78); box-shadow: 0 22px 64px rgba(43,51,39,.2); backdrop-filter: blur(16px);
}
.heritage-graph-info-head h3 { margin: 7px 0 10px; font-family: var(--serif); font-size: 25px; font-weight: 500; }
.heritage-graph-info > p { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.8; }
.heritage-graph-info > .is-muted { color: var(--ink-faint); }
.heritage-graph-info-note { margin-top: 12px !important; padding-top: 12px; border-top: 1px solid rgba(96,108,56,.18); font-size: 12px !important; }
.heritage-graph-overview-image { display: block; width: 100%; max-height: 190px; object-fit: cover; border-radius: var(--radius-md); margin: 12px 0 14px; }
.heritage-graph-image-gallery { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(118px, 72%); gap: 9px; overflow-x: auto; padding: 2px 0 8px; scroll-snap-type: x proximity; }
.heritage-graph-image-card { margin: 0; scroll-snap-align: start; }
.heritage-graph-image-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; border: 1px solid rgba(96,108,56,.25); }
.heritage-graph-image-card figcaption { margin-top: 5px; color: var(--ink-faint); font-size: 10px; line-height: 1.35; }
.heritage-graph-label.overview-node.map-project { font-size: 13px; opacity: .96; }
.heritage-graph-label.overview-node.graph-supplement { font-size: 10px; opacity: .68; }
.heritage-graph-type { color: var(--terracotta); font-size: 11px; }
.heritage-graph-root-button, .heritage-graph-back-button { width: 100%; justify-content: center; margin-top: 15px; }
.heritage-graph-contribute-button { width: 100%; justify-content: center; margin-top: 10px; border-color: rgba(198,107,61,.42); color: var(--terracotta); }
.heritage-graph-community-knowledge { display: grid; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(96,108,56,.2); }
.heritage-graph-community-knowledge h4 { color: var(--moss); font-size: 13px; letter-spacing: .08em; }
.heritage-graph-community-knowledge article { padding: 9px 10px; border-radius: 10px; background: rgba(96,108,56,.08); }
.heritage-graph-community-knowledge article p { color: var(--ink-soft); font-size: 12px; line-height: 1.6; }
.heritage-graph-community-knowledge article a { display: block; margin-top: 5px; color: var(--moss); font-size: 10.5px; text-decoration: underline; text-underline-offset: 3px; }
.heritage-graph-community-knowledge article small { display: block; margin-top: 4px; color: var(--ink-faint); font-size: 9.5px; }
.heritage-graph-source { display: block; margin-top: 15px; color: var(--ink-faint); font-size: 10px; line-height: 1.5; }
.heritage-graph-entry {
  position: absolute; z-index: 4; left: 50%; bottom: 16px; transform: translateX(-50%); padding: 10px 18px;
  border: 1px solid rgba(192,142,58,.55); border-radius: 999px; color: var(--ink); background: rgba(232,220,199,.75);
  font: inherit; font-size: 12px; cursor: pointer; box-shadow: 0 8px 28px rgba(43,51,39,.1);
}
.heritage-graph-entry:hover, .heritage-graph-entry:focus-visible { border-color: var(--terracotta); color: var(--terracotta); outline: none; }
.graph-page { height: 100vh; height: 100svh; min-height: 560px; overflow: hidden; }
.graph-page > .topnav {
  position: fixed; z-index: 1300; top: 0; left: 0; right: 0;
  background: rgba(232,220,199,.96); border-bottom: 1px solid rgba(96,108,56,.22);
  box-shadow: 0 12px 30px rgba(43,51,39,.12); backdrop-filter: blur(12px);
  transform: translateY(-100%); transition: transform 420ms cubic-bezier(.2,.8,.25,1);
  will-change: transform;
}
.graph-page > .topnav.is-expanded { transform: translateY(0); }
.graph-page.is-nav-expanded .heritage-graph-header { transform: translateY(var(--graph-nav-height, 96px)); }
.graph-nav-fold-toggle {
  position: absolute; top: 100%; left: 50%; min-width: 68px; padding: 7px 16px 8px;
  transform: translateX(-50%); border: 1px solid rgba(96,108,56,.28); border-top: 0;
  border-radius: 0 0 18px 18px; color: var(--moss); background: rgba(232,220,199,.88);
  box-shadow: 0 9px 24px rgba(43,51,39,.13); backdrop-filter: blur(10px);
  font: inherit; font-size: 11px; letter-spacing: .14em; cursor: pointer;
}
.graph-nav-fold-toggle:hover, .graph-nav-fold-toggle:focus-visible { color: var(--terracotta); outline: none; }
.graph-nav-fold-toggle:focus-visible { box-shadow: 0 0 0 3px rgba(198,107,61,.14), 0 9px 24px rgba(43,51,39,.13); }
.heritage-graph-page-shell { top: 0; z-index: 1100; }
.graph-nav-link { position: relative; isolation: isolate; }
.graph-nav-link::before, .graph-nav-link::after {
  content: ''; position: absolute; z-index: -1; top: 50%; left: 50%; border: 1px solid rgba(255,255,255,.48);
  border-radius: 50%; transform: translate(-50%,-50%); pointer-events: none;
}
.graph-nav-link::before { width: 30px; height: 30px; }
.graph-nav-link::after { width: 42px; height: 42px; opacity: .48; }
.heritage-graph-zoom {
  position: absolute; z-index: 6; left: 50%; bottom: 50px; display: flex; gap: 7px; transform: translateX(-50%);
}
.heritage-graph-zoom button, .heritage-graph-keyboard-list button {
  border: 1px solid rgba(232,220,199,.48); border-radius: 999px; padding: 7px 11px;
  color: var(--ink); background: rgba(241,232,214,.78); font: inherit; font-size: 11px; cursor: pointer;
}
.heritage-graph-zoom button:focus-visible, .heritage-graph-keyboard-list button:focus-visible { outline: 2px solid var(--terracotta); outline-offset: 2px; }
.heritage-graph-keyboard-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 112px; overflow: auto; margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(96,108,56,.18); }
.heritage-graph-keyboard-list > span { flex-basis: 100%; color: var(--ink-faint); font-size: 10px; letter-spacing: .08em; }
@media (prefers-reduced-motion: reduce) {
  .heritage-graph-label, .heritage-graph-header, .graph-page > .topnav { transition: none; }
}

/* The assistant stays on its own compositor layer. Resizing #app here forced
   every WebGL canvas to resize and was the main source of open-panel jank. */
body.agent-open .agent-fab { right: calc(min(400px, 92vw) + 74px); }
body.agent-open .jiao-toast { right: calc(min(400px, 92vw) + 100px); }
.jiao-toast { transition: right 320ms cubic-bezier(0.3, 0.8, 0.3, 1); }
.ap-thinking { color: var(--ink-faint); font-size: 12.5px; letter-spacing: 0.08em; }

/* ---------- 站内管理员：用户界面原位编辑 ---------- */
.admin-editable-module { position: relative; }
.admin-module-tools {
  position: absolute; top: 8px; right: 8px; z-index: 80;
  display: flex; gap: 6px; padding: 4px;
  border: 1px solid rgba(96,108,56,0.28); border-radius: 999px;
  background: rgba(232,220,199,0.94); box-shadow: 0 6px 18px rgba(43,51,39,0.12);
  opacity: 0.34; transition: opacity var(--t-med) ease, transform var(--t-med) ease;
}
.admin-editable-module:hover > .admin-module-tools,
.admin-editable-module.is-admin-editing > .admin-module-tools { opacity: 1; transform: translateY(-2px); }
.admin-module-tools button {
  min-width: 48px; padding: 4px 10px; border-radius: 999px;
  color: var(--moss); font-size: 12px; letter-spacing: 0.06em;
}
.admin-module-tools .admin-module-save { background: var(--moss); color: var(--sand-light); }
.admin-module-tools .admin-module-cancel { color: var(--terracotta); }
.admin-inline-input {
  min-width: 2em; outline: none; border-radius: 8px;
  box-shadow: inset 0 -2px 0 var(--terracotta); background: rgba(232,220,199,0.5);
  cursor: text; white-space: pre-wrap;
}
.admin-save-toast {
  position: fixed; left: 50%; bottom: 42px; z-index: 2300; transform: translateX(-50%);
  padding: 10px 20px; border-radius: 999px; background: var(--moss); color: var(--sand-light);
  box-shadow: var(--shadow-soft); font-size: 13px;
}
.admin-save-toast.error { background: var(--terracotta); }
.site-legal.admin-editable-module { pointer-events: auto; padding-right: 70px; }
.site-legal .admin-module-tools { top: -35px; right: 0; }
.craft-head.admin-editable-module { padding-right: 150px; }
.craft-head > .admin-module-tools { top: 6px; right: 8px; }
.craft-summary-editable { padding: 6px 0; }
.district-story-heading, .project-story-heading { position: relative; padding-right: 76px; }
.district-story-heading > .admin-module-tools, .project-story-heading > .admin-module-tools { top: 0; right: 0; }

/* ---------- 管理页面：横向工序签条 + 结构化编排 ---------- */
.admin-page { position: relative; min-height: 100vh; }
.admin-page > .bg-stack { position: fixed; }
.admin-page > main { position: relative; z-index: 4; }
body:has(.admin-page) .agent-fab,
body:has(.admin-page) .agent-panel,
body:has(.admin-page) .mascot-bubble,
body:has(.admin-page) .gesture-toggle { display: none !important; }
.admin-kicker { color: var(--terracotta); font-size: 12px; letter-spacing: 0.16em; margin-bottom: 6px; }
.admin-login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 120px 24px 60px; }
.admin-login-card {
  width: min(470px, 100%); padding: 38px; border-radius: var(--radius-lg);
  background: rgba(232,220,199,0.94); border: 1px solid rgba(96,108,56,0.3); box-shadow: var(--shadow-lift);
}
.admin-login-card h1 { font-size: clamp(28px, 4vw, 42px); line-height: 1.2; margin-bottom: 12px; }
.admin-login-lede { color: var(--ink-soft); margin-bottom: 24px; }
.admin-login-card label, .admin-field { display: grid; gap: 7px; margin-bottom: 18px; }
.admin-login-card label > span, .admin-field > label { color: var(--ink-soft); font-size: 13px; }
.admin-field-help { margin: -2px 0 0; color: var(--ink-faint); font-size: 12px; line-height: 1.55; }
.admin-save-status {
  align-self: center; white-space: nowrap; font-size: 12px; line-height: 1;
  transition: color 220ms ease, opacity 220ms ease;
}
.admin-save-status.is-saved { color: var(--moss); }
.admin-save-status.is-dirty { color: var(--ochre); }
.admin-save-status.is-saving { color: var(--ink-soft); }
.admin-save-status.is-error { color: var(--terracotta); }
.admin-heading-actions [aria-disabled="true"] { opacity: .55; pointer-events: none; }
.admin-material-transform-section { min-width: 0; }
.admin-material-transform-list { display: grid; gap: 10px; margin-top: 14px; }
.admin-material-transform-head,
.admin-material-transform-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 26px minmax(0, 1fr) 82px;
  gap: 8px; align-items: center;
}
.admin-material-transform-head { color: var(--ink-soft); font-size: 12px; padding: 0 2px; }
.admin-material-transform-head span:nth-child(2) { grid-column: 3; }
.admin-transform-arrow { color: var(--terracotta); text-align: center; font-size: 18px; }
.admin-inherited-material {
  min-height: 46px; display: flex; flex-direction: column; justify-content: center;
  padding: 7px 12px; border: 1px solid rgba(96,108,56,0.25); border-radius: var(--radius-sm);
  background: rgba(139,157,131,0.13);
}
.admin-inherited-material small { margin-top: 2px; color: var(--moss); font-size: 11px; }
.admin-material-flow-help {
  margin: 0 0 2px; padding: 9px 12px; border-left: 3px solid rgba(96,108,56,.45);
  color: var(--ink-soft); background: rgba(139,157,131,.08); font-size: 12px; line-height: 1.65;
}
.admin-held-material-label {
  min-height: 42px; display: flex; align-items: center; padding: 8px 12px;
  border: 1px dashed rgba(96,108,56,.28); border-radius: var(--radius-sm);
  color: var(--ink-soft); background: rgba(241,232,214,.42); font-size: 12px;
}
.admin-material-toggle {
  min-width: 74px; min-height: 38px; padding: 6px 9px; border: 1px solid rgba(96,108,56,.3);
  border-radius: var(--radius-sm); color: var(--moss); background: rgba(241,232,214,.78);
  font: inherit; font-size: 12px; cursor: pointer;
}
.admin-material-toggle:hover, .admin-material-toggle:focus-visible { border-color: var(--terracotta); outline: none; }
.admin-material-transform-row.is-held .admin-transform-arrow { opacity: .35; }
.admin-row-spacer { width: 42px; }
.admin-login-card input, .admin-field input, .admin-field textarea,
.admin-resource-row input, .admin-operation-row > input {
  width: 100%; border: 1px solid rgba(96,108,56,0.34); border-radius: var(--radius-sm);
  background: rgba(241,232,214,0.86); color: var(--ink); padding: 11px 13px;
  font: inherit; outline: none; transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}
.admin-login-card input:focus, .admin-field input:focus, .admin-field textarea:focus,
.admin-resource-row input:focus, .admin-operation-row > input:focus {
  border-color: var(--terracotta); box-shadow: 0 0 0 3px rgba(198,107,61,0.12);
}
.admin-login-card .btn { width: 100%; justify-content: center; }
.admin-login-error { min-height: 25px; color: var(--terracotta); font-size: 13px; }
.admin-return-link { display: inline-block; margin-top: 18px; color: var(--moss); font-size: 13px; }
.admin-dashboard, .admin-process-page { padding: 130px 5vw 70px; width: min(1500px, 100%); margin: 0 auto; }
.admin-page-heading { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 30px; }
.admin-page-heading h1 { font-size: clamp(30px, 4vw, 52px); line-height: 1.2; }
.admin-page-heading p { color: var(--ink-soft); max-width: 720px; }
.admin-heading-actions, .admin-card-actions, .admin-order-tools { display: flex; align-items: center; gap: 16px; }
.admin-review-toggle { display: inline-flex; align-items: center; gap: 7px; color: var(--moss); font-size: 12px; white-space: nowrap; }
.admin-review-toggle input { accent-color: var(--moss); }
.admin-review-toggle .admin-save-status { color: var(--ink-faint); }
.admin-brand-panel {
  display: grid; grid-template-columns: minmax(280px, 1fr) auto auto; align-items: center; gap: 28px;
  margin: 0 0 24px; padding: 24px 26px; border: 1px solid rgba(96,108,56,.28); border-radius: var(--radius-lg);
  color: var(--ink); background: rgba(232,220,199,.88); box-shadow: var(--shadow-soft);
}
.admin-brand-copy { display: grid; justify-items: start; gap: 7px; }
.admin-brand-copy h2 { font-size: 26px; }
.admin-brand-copy > p:not(.admin-kicker):not(.admin-brand-status) { max-width: 620px; color: var(--ink-soft); font-size: 13px; line-height: 1.7; }
.admin-brand-choose { margin-top: 4px; cursor: pointer; }
.admin-brand-file-input { position: fixed; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.admin-brand-previews { display: flex; align-items: center; gap: 14px; }
.admin-brand-previews figure { margin: 0; text-align: center; }
.admin-brand-previews figcaption { margin-top: 7px; color: var(--ink-faint); font-size: 11px; }
.admin-brand-preview {
  position: relative; width: 112px; height: 112px; display: grid; place-items: center; overflow: hidden;
  border: 1px solid rgba(96,108,56,.3); border-radius: 24px;
  background-color: rgba(232,220,199,.72);
  background-image: linear-gradient(45deg, rgba(139,157,131,.12) 25%, transparent 25%), linear-gradient(-45deg, rgba(139,157,131,.12) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(139,157,131,.12) 75%), linear-gradient(-45deg, transparent 75%, rgba(139,157,131,.12) 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0; background-size: 16px 16px;
}
.admin-brand-preview img { position: relative; z-index: 1; width: 92px; height: 92px; object-fit: contain; }
.admin-brand-preview img.is-empty { opacity: 0; }
.admin-brand-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 18px; color: var(--ink-faint); font-size: 11px; line-height: 1.5; }
.admin-brand-preview:has(img:not(.is-empty)) .admin-brand-empty { display: none; }
.admin-brand-status { min-height: 18px; color: var(--ink-faint); font-size: 11px; }
.admin-brand-status.is-saving { color: var(--moss); }
.admin-brand-status.is-success { color: var(--moss); font-weight: 600; }
.admin-brand-status.is-error { color: var(--terracotta); }
.admin-brand-panel > .btn { justify-content: center; white-space: nowrap; }
.admin-image-drop {
  position: relative; min-height: 86px; display: grid; place-content: center; gap: 5px; min-width: min(100%, 220px);
  padding: 14px 18px; border: 1px dashed rgba(96,108,56,.46); border-radius: var(--radius-md);
  color: var(--moss); background: rgba(139,157,131,.1); text-align: center; cursor: pointer;
  transition: border-color var(--t-med), background var(--t-med), transform var(--t-med);
}
.admin-image-drop:hover, .admin-image-drop:focus-visible, .admin-image-drop.is-dragover { border-color: var(--terracotta); background: rgba(198,107,61,.1); outline: none; transform: translateY(-1px); }
.admin-image-drop strong { font-size: 13px; }
.admin-image-drop span { color: var(--ink-faint); font-size: 11px; }
.admin-image-drop.is-compact { min-height: 70px; grid-template-columns: auto auto; align-items: center; column-gap: 9px; }
.admin-upload-file-input, .admin-image-drop input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.admin-maintenance-tools { margin-bottom: 20px; border: 1px solid rgba(96,108,56,.24); border-radius: var(--radius-md); background: rgba(212,184,149,.22); }
.admin-maintenance-tools summary { display: flex; justify-content: space-between; gap: 16px; padding: 15px 18px; color: var(--moss); cursor: pointer; }
.admin-maintenance-tools summary span { color: var(--ink-faint); font-size: 12px; font-weight: 400; }
.admin-maintenance-tools-body { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 0 18px 18px; }
.admin-project-search { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.admin-project-search input { flex: 1; min-height: 46px; padding: 10px 14px; border: 1px solid rgba(96,108,56,.3); border-radius: var(--radius-md); color: var(--ink); background: rgba(232,220,199,.88); font: inherit; outline: none; }
.admin-project-search input:focus { border-color: var(--terracotta); box-shadow: 0 0 0 3px rgba(198,107,61,.1); }
.admin-project-search-status { flex: 0 0 auto; color: var(--ink-faint); font-size: 12px; }
.admin-bulk-toolbar {
  display: flex; align-items: center; gap: 18px; margin: 0 0 20px; padding: 12px 16px;
  border-top: 1px solid rgba(96,108,56,.28); border-bottom: 1px solid rgba(96,108,56,.28);
  color: var(--ink-soft); background: rgba(232,220,199,.48);
}
.admin-bulk-select-all { display: inline-flex; align-items: center; gap: 8px; color: var(--moss); font-size: 13px; cursor: pointer; }
.admin-bulk-select-all input, .admin-craft-select input { accent-color: var(--moss); }
.admin-bulk-select-all:has(input:disabled) { cursor: default; opacity: .55; }
.admin-bulk-summary { margin-right: auto; color: var(--ink-faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.admin-danger-button {
  padding: 8px 14px; border: 1px solid rgba(198,107,61,.55); border-radius: var(--radius-sm);
  color: var(--terracotta); background: rgba(198,107,61,.07); font: inherit; font-size: 12px;
}
.admin-danger-button:hover:not(:disabled), .admin-danger-button:focus-visible { color: var(--sand-light); background: var(--terracotta); outline: none; }
.admin-danger-button:disabled { opacity: .42; cursor: not-allowed; }
.admin-craft-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.admin-craft-card {
  position: relative; display: grid; grid-template-columns: 180px 1fr; gap: 22px; min-height: 190px;
  padding: 16px; border-radius: var(--radius-lg); background: rgba(232,220,199,0.92);
  border: 1px solid rgba(96,108,56,0.25); box-shadow: var(--shadow-soft);
  transition: border-color var(--t-med), background var(--t-med), box-shadow var(--t-med);
}
.admin-craft-card.is-selected { border-color: var(--terracotta); background: rgba(232,220,199,.98); box-shadow: 0 0 0 3px rgba(198,107,61,.11), var(--shadow-soft); }
.admin-craft-card.is-protected { border-color: rgba(96,108,56,.34); }
.admin-craft-select {
  position: absolute; z-index: 2; top: 12px; right: 14px; display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 8px; border: 1px solid rgba(96,108,56,.24); border-radius: var(--radius-sm);
  color: var(--ink-soft); background: rgba(232,220,199,.92); font-size: 11px; cursor: pointer;
}
.admin-craft-select:has(input:disabled) { color: var(--moss); cursor: default; }
.admin-craft-card > div h2 { padding-right: 82px; }
.admin-craft-card img { width: 100%; height: 158px; object-fit: cover; border-radius: var(--radius-md); filter: saturate(0.78); }
.admin-craft-card h2 { font-size: 24px; margin: 8px 0 20px; }
.admin-card-meta { color: var(--ink-faint); font-size: 12px; }
.admin-craft-card .btn { padding: 8px 18px; font-size: 13px; }
.admin-step-tabs {
  display: flex; align-items: stretch; gap: 8px; overflow-x: auto; padding: 6px 2px 16px;
  scrollbar-color: var(--sage) transparent;
}
.admin-step-tab, .admin-step-add {
  flex: 0 0 auto; min-width: 150px; padding: 12px 18px; border-radius: var(--radius-md);
  border: 1px solid rgba(96,108,56,0.28); background: rgba(232,220,199,0.84); color: var(--ink-soft);
  transition: transform var(--t-med) ease, background var(--t-med) ease;
}
.admin-step-tab:hover, .admin-step-add:hover { transform: translateY(-2px); }
.admin-step-tab.active { background: var(--moss); color: var(--sand-light); border-color: var(--moss); }
.admin-step-add { min-width: 128px; display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--moss); }
.admin-step-add svg, .admin-add-row svg, .admin-icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.admin-step-editor {
  margin-top: 8px; padding: 28px; border-radius: var(--radius-lg);
  background: rgba(232,220,199,0.94); border: 1px solid rgba(96,108,56,0.28); box-shadow: var(--shadow-soft);
}
.admin-editor-heading { display: flex; align-items: start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.admin-editor-heading h2 { font-size: 30px; }
.admin-resource-columns { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .85fr); gap: 22px; margin: 26px 0; }
.admin-resource-columns > section, .admin-operations {
  padding: 20px; border-radius: var(--radius-md); background: rgba(212,184,149,0.28); border: 1px solid rgba(96,108,56,0.2);
}
.admin-guide-section, .admin-visual-section {
  margin: 22px 0; padding: 20px; border-radius: var(--radius-md);
  background: rgba(212,184,149,0.22); border: 1px solid rgba(96,108,56,0.2);
}
.admin-step-image-editor {
  margin: 22px 0; padding: 20px; border-radius: var(--radius-md);
  background: rgba(212,184,149,.22); border: 1px solid rgba(96,108,56,.2);
}
.admin-step-image-actions { display: flex; align-items: center; gap: 10px; }
.admin-step-image-input { position: fixed; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.admin-step-image-empty {
  min-height: 150px; display: grid; place-content: center; gap: 5px; text-align: center;
  border: 1px dashed rgba(96,108,56,.34); border-radius: var(--radius-md); background: rgba(232,220,199,.42);
}
.admin-step-image-empty strong { color: var(--moss); font-size: 14px; }
.admin-step-image-empty span, .admin-step-image-meta span { color: var(--ink-faint); font-size: 11px; }
.admin-step-image-preview {
  display: grid; grid-template-columns: minmax(180px, 320px) minmax(0, 1fr) auto; align-items: center; gap: 18px;
  padding: 12px; border: 1px solid rgba(96,108,56,.24); border-radius: var(--radius-md); background: rgba(232,220,199,.5);
}
.admin-step-image-preview img { display: block; width: 100%; height: 180px; object-fit: contain; border-radius: 12px; background: rgba(96,108,56,.09); }
.admin-step-image-meta { min-width: 0; display: grid; gap: 5px; }
.admin-step-image-meta strong { overflow: hidden; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.admin-step-image-remove { color: var(--terracotta); border-bottom: 1px solid rgba(198,107,61,.48); font-size: 12px; }
.admin-step-image-status { min-height: 18px; margin: 8px 2px 0; color: var(--ink-faint); font-size: 11px; }
.admin-step-image-status.is-uploading { color: var(--moss); }
.admin-step-image-status.is-error { color: var(--terracotta); }
.admin-cover-editor { display: grid; gap: 12px; padding-top: 6px; }
.admin-image-role-guide { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.admin-image-role-guide article { display: grid; gap: 5px; min-height: 126px; padding: 15px; border: 1px solid rgba(96,108,56,.18); border-radius: var(--radius-md); background: rgba(139,157,131,.065); }
.admin-image-role-guide article.is-primary { border-color: rgba(198,107,61,.34); background: rgba(198,107,61,.06); }
.admin-image-role-guide span { color: var(--terracotta); font: 700 10px/1.2 var(--sans); letter-spacing: .08em; }
.admin-image-role-guide strong { font-family: var(--serif); font-size: 17px; }
.admin-image-role-guide p { color: var(--ink-faint); font-size: 11px; line-height: 1.6; }
.admin-overview-editor { display: grid; gap: 10px; }
.admin-image-fallback { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: center; padding: 10px; border: 1px dashed rgba(96,108,56,.3); border-radius: var(--radius-md); background: rgba(139,157,131,.08); }
.admin-image-fallback img { width: 120px; height: 78px; object-fit: cover; border-radius: var(--radius-sm); opacity: .82; }
.admin-image-fallback p { margin-top: 4px; color: var(--ink-faint); font-size: 11px; }
.heritage-graph-main-image, .heritage-graph-fallback-image { margin: 0; }
.heritage-graph-main-image figcaption, .heritage-graph-fallback-image figcaption, .heritage-graph-image-role { margin-top: 6px; color: var(--ink-faint); font: 600 10px/1.5 var(--sans); letter-spacing: .04em; }
.heritage-graph-fallback-image figcaption { color: var(--olive); }
.heritage-graph-node-images { display: grid; gap: 7px; }
.heritage-graph-node-images h4 { font-family: var(--serif); font-size: 15px; }
.admin-cover-editor-grid { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(260px, 1.2fr); gap: 16px; align-items: stretch; }
.admin-cover-editor-grid > div:last-child { display: grid; align-content: center; gap: 10px; }
.admin-cover-preview { position: relative; min-height: 180px; overflow: hidden; border: 1px solid rgba(96,108,56,.22); border-radius: var(--radius-md); background: rgba(139,157,131,.1); }
.admin-cover-preview img { display: block; width: 100%; height: 210px; object-fit: cover; }
.admin-cover-preview .admin-step-image-remove { position: absolute; right: 12px; bottom: 12px; padding: 7px 11px; border: 1px solid rgba(198,107,61,.42); border-radius: var(--radius-sm); background: rgba(232,220,199,.92); }
.admin-cover-placeholder { min-height: 180px; display: grid; place-items: center; color: var(--ink-faint); font-size: 13px; }
.admin-maintenance-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; align-items: start; }
.admin-maintenance-nav { position: sticky; top: 112px; display: grid; gap: 8px; padding: 18px; border: 1px solid rgba(96,108,56,.26); border-radius: var(--radius-lg); background: rgba(212,184,149,.78); box-shadow: var(--shadow-soft); }
.admin-maintenance-nav button { width: 100%; padding: 10px 11px; border-radius: var(--radius-sm); color: var(--ink-soft); text-align: left; transition: color var(--t-fast), background var(--t-fast); }
.admin-maintenance-nav button:hover, .admin-maintenance-nav button:focus-visible { color: var(--moss); background: rgba(139,157,131,.16); outline: none; }
.admin-maintenance-facts { display: grid; gap: 6px; margin-top: 10px; padding-top: 12px; border-top: 1px solid rgba(96,108,56,.2); color: var(--ink-faint); font-size: 11px; line-height: 1.5; }
.admin-maintenance-workspace { min-width: 0; }
.admin-process-workspace { margin-bottom: 22px; scroll-margin-top: 110px; }
.admin-content-editor, .admin-graph-editor { scroll-margin-top: 110px; }
.admin-workspace-heading { display: flex; justify-content: space-between; gap: 18px; margin: 0 4px 10px; }
.admin-workspace-heading h2 { font-size: 25px; }
.admin-workspace-heading p { color: var(--ink-faint); font-size: 12px; }
.admin-guide-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-guide-editor {
  min-height: 116px; padding: 15px 16px; border: 1px solid rgba(96,108,56,0.34);
  border-radius: var(--radius-sm); background: rgba(241,232,214,0.86); color: var(--ink);
  line-height: 1.85; white-space: pre-wrap; outline: none;
  transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}
.admin-guide-editor:empty::before { content: attr(data-placeholder); color: var(--ink-faint); pointer-events: none; }
.admin-guide-editor:focus { border-color: var(--terracotta); box-shadow: 0 0 0 3px rgba(198,107,61,0.12); }
.admin-guide-editor strong { color: var(--moss); font-weight: 750; text-decoration: underline; text-decoration-color: rgba(198,107,61,.42); text-underline-offset: 3px; }
.admin-visual-list { display: grid; gap: 9px; margin-top: 14px; }
.admin-visual-row {
  display: grid; grid-template-columns: minmax(120px, 1fr) minmax(150px, .75fr) minmax(140px, 1fr) 52px;
  align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: rgba(241,232,214,.58); border: 1px solid rgba(96,108,56,.16);
}
.admin-visual-row strong { font-size: 13px; }
.admin-visual-row select {
  width: 100%; padding: 9px 11px; border: 1px solid rgba(96,108,56,.3); border-radius: var(--radius-sm);
  color: var(--ink); background: rgba(241,232,214,.92); font: inherit;
}
.admin-visual-row input[type="range"] { accent-color: var(--moss); }
.admin-visual-row output { color: var(--moss); font-size: 12px; font-variant-numeric: tabular-nums; }
.admin-resource-columns h3, .admin-operations h3 { font-size: 18px; margin-bottom: 12px; }
.admin-resource-list, .admin-operation-list { display: grid; gap: 9px; }
.admin-resource-row, .admin-operation-row { display: flex; align-items: center; gap: 9px; }
.admin-icon-button { flex: 0 0 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: var(--terracotta); border: 1px solid rgba(198,107,61,0.34); }
.admin-add-row { display: flex; align-items: center; gap: 7px; width: fit-content; color: var(--moss); padding: 7px 4px; }
.admin-section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; margin-bottom: 12px; }
.admin-section-heading p { color: var(--ink-faint); font-size: 12px; }
.admin-section-heading > div:has(> .admin-save-status) { display: flex; align-items: center; gap: 12px; }
.admin-operation-row > input { flex: 1; }
.admin-correct-action { display: flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 12px; color: var(--ink-soft); }
.admin-correct-action input { accent-color: var(--moss); }
.admin-delete-step { margin-top: 26px; color: var(--terracotta); border-bottom: 1px solid currentColor; }
.admin-process-link { margin-right: 12px; color: var(--terracotta); }

@media (max-width: 1050px) {
  .admin-craft-grid { grid-template-columns: 1fr; }
  .admin-resource-columns { grid-template-columns: 1fr; }
  .admin-page-heading { align-items: start; flex-direction: column; }
  .admin-brand-panel { grid-template-columns: 1fr auto; }
  .admin-brand-panel > .btn { grid-column: 1 / -1; }
  .admin-maintenance-layout { grid-template-columns: 1fr; }
  .admin-maintenance-nav { position: static; grid-template-columns: repeat(3, minmax(0,1fr)); }
  .admin-maintenance-nav .admin-kicker, .admin-maintenance-facts { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .admin-image-role-guide { grid-template-columns: 1fr; }
  .admin-image-role-guide article { min-height: 0; }
  .community-main-image-preview { grid-template-columns: 1fr; }
  .admin-brand-panel { grid-template-columns: 1fr; padding: 20px 16px; }
  .admin-brand-previews { justify-content: space-between; }
  .admin-brand-preview { width: min(38vw, 128px); height: min(38vw, 128px); }
  .admin-bulk-toolbar { align-items: flex-start; flex-wrap: wrap; }
  .admin-bulk-summary { flex-basis: 100%; order: 3; }
  .admin-material-transform-head { display: none; }
  .admin-material-transform-row { grid-template-columns: minmax(0, 1fr) 24px 82px; }
  .admin-material-transform-row > :first-child { grid-column: 1 / -1; }
  .admin-material-transform-row > :nth-child(3) { grid-column: 1 / 3; }
  .admin-visual-row { grid-template-columns: 1fr 70px; }
  .admin-visual-row select, .admin-visual-row input[type="range"] { grid-column: 1 / -1; }
  .admin-step-image-preview { grid-template-columns: 1fr; }
  .admin-step-image-preview img { height: 210px; }
  .admin-step-image-remove { width: fit-content; }
  .admin-cover-editor-grid { grid-template-columns: 1fr; }
  .admin-project-search, .admin-maintenance-tools summary { align-items: flex-start; flex-direction: column; }
  .admin-project-search-status { align-self: flex-end; }
  .admin-maintenance-nav { grid-template-columns: 1fr; }
  .admin-maintenance-nav .admin-kicker, .admin-maintenance-facts { grid-column: auto; }
}

@media (max-width: 900px) {
  body.agent-open .agent-fab { right: 74px; }
  .finish-v2 { flex-direction: column; }
  .finish-stage { min-height: 320px; }
  .finish-v2 .complete-side { width: 100%; border-left: none; border-top: 1px solid rgba(96,108,56,0.25); }
  .craft-body.playing.reading-open .reading-col { width: 100%; min-width: 0; }
  .topnav nav { gap: 12px; }
  .admin-dashboard, .admin-process-page { padding: 112px 18px 60px; }
  .admin-craft-card { grid-template-columns: 110px 1fr; gap: 14px; }
  .admin-craft-card img { height: 120px; }
  .admin-card-actions, .admin-heading-actions { align-items: flex-start; flex-direction: column; gap: 8px; }
  .admin-step-editor { padding: 20px 16px; }
  .admin-editor-heading, .admin-section-heading { align-items: flex-start; flex-direction: column; }
  .admin-content-fields { grid-template-columns: 1fr; }
  .admin-operation-row { align-items: stretch; flex-wrap: wrap; }
  .admin-operation-row > input { min-width: calc(100% - 50px); }
  .heritage-graph-info { top: auto; right: 14px; bottom: 52px; left: 14px; width: auto; min-height: 0; padding: 14px 16px; }
  .heritage-graph-info-head h3 { margin: 4px 0 5px; font-size: 20px; }
  .heritage-graph-info > p { max-height: 76px; overflow: auto; font-size: 12px; line-height: 1.55; }
  .heritage-graph-info-note, .heritage-graph-source { display: none; }
}

@media (max-width: 680px) {
  .heritage-graph-header { padding: 18px 18px 0; }
  .heritage-graph-heading h1 { font-size: 28px; }
  .heritage-graph-stage { inset: 90px 0 132px; }
  .heritage-graph-trail { left: 18px; bottom: 18px; }
  .heritage-graph-hint { display: none; }
  .heritage-graph-entry { bottom: 12px; }
}

/* ============================================================
   手势系统样式（隔空手势探索）
   视觉方向：水墨玉石，使用现有 :root 令牌
   ============================================================ */

/* ---- 隔空指针（CSS-only DOM cursor） ---- */
.air-cursor {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  width: 28px;
  height: 28px;
  margin-left: -14px;
  margin-top: -14px;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.18s ease;
  will-change: transform, left, top;
}
.air-cursor.is-visible { opacity: 0.85; }
.air-cursor.is-pinching { transform: scale(0.65); }
.air-cursor.is-hovering { transform: scale(1.18); }

.air-cursor-inner {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--moss);
  opacity: 0.9;
  transition: background 0.2s ease, inset 0.18s ease;
}
.air-cursor.is-pinching .air-cursor-inner {
  inset: 6px;
  background: var(--ochre);
}

.air-cursor-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid var(--sage);
  opacity: 0.45;
  transition: border-color 0.2s ease, opacity 0.2s ease, inset 0.18s ease;
}
.air-cursor.is-pinching .air-cursor-ring {
  inset: 2px;
  border-color: var(--terracotta);
  opacity: 0.6;
}
.air-cursor.is-hovering .air-cursor-ring {
  border-color: var(--moss);
  opacity: 0.7;
}
.air-cursor.is-longpress .air-cursor-ring { inset: -7px; border-color: var(--ochre); border-width: 3px; opacity: .86; }
.is-gesture-longpress { outline: 2px solid var(--ochre) !important; outline-offset: 3px; }

/* ---- 实时虚拟手：MediaPipe 21 点镜像骨架 ---- */
.gesture-hand-canvas {
  position: fixed; inset: 0; z-index: 1490; width: 100vw; height: 100vh; pointer-events: none;
  opacity: 0; transition: opacity .28s ease; filter: drop-shadow(0 8px 18px rgba(43,51,39,.12));
}
.gesture-hand-canvas.is-visible { opacity: .9; }
.gesture-hand-action {
  position: fixed; z-index: 1492; min-width: 128px; max-width: 180px; padding: 7px 11px;
  border: 1px solid rgba(139,157,131,.72); border-radius: 999px; color: var(--ink-soft);
  background: rgba(232,220,199,.84); box-shadow: var(--shadow-soft); backdrop-filter: blur(9px);
  font-size: 11px; pointer-events: none; opacity: 0; transform: translateY(5px);
  transition: opacity .22s ease, transform .22s ease, border-color .22s ease;
}
.gesture-hand-action.is-visible { opacity: .94; transform: translateY(0); }
.gesture-hand-action[data-action="longpress"] { border-color: var(--ochre); color: var(--ochre); }
.gesture-hand-action[data-action="palmpress"], .gesture-hand-action[data-action="zoomin"], .gesture-hand-action[data-action="zoomout"] { border-color: var(--terracotta); color: var(--terracotta); }
.gesture-live-guide {
  position: fixed; z-index: 1493; left: 20px; bottom: 22px; display: grid; gap: 5px; width: min(330px, calc(100vw - 40px));
  padding: 16px 18px; border: 1px solid rgba(139,157,131,.6); border-radius: 22px;
  color: var(--ink-soft); background: rgba(232,220,199,.9); box-shadow: var(--shadow-lift); backdrop-filter: blur(12px);
  opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .3s ease, transform .3s ease;
}
.gesture-live-guide.is-visible { opacity: .96; transform: translateY(0); pointer-events: auto; }
.gesture-live-guide strong { color: var(--ink); font-family: var(--serif); font-size: 17px; }
.gesture-live-guide span { font-size: 12px; line-height: 1.45; }
.gesture-live-guide button { justify-self: start; margin-top: 5px; padding: 6px 12px; border: 1px solid var(--sage); border-radius: 999px; color: var(--moss); background: transparent; font: inherit; font-size: 11px; cursor: pointer; }
.gesture-live-guide button:focus-visible { outline: 2px solid var(--terracotta); outline-offset: 2px; }

/* 确认反馈脉冲 */
.air-cursor-feedback {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px solid var(--sage);
  opacity: 0;
  animation: cursor-confirm 0.45s ease-out forwards;
}
@keyframes cursor-confirm {
  0%   { inset: -2px; opacity: 0.55; }
  100% { inset: -18px; opacity: 0; }
}

/* 错误反馈闪烁 */
.air-cursor.is-error .air-cursor-inner {
  background: var(--terracotta);
  animation: cursor-error-flash 0.35s ease-out;
}
@keyframes cursor-error-flash {
  0%, 100% { opacity: 0.9; }
  50%      { opacity: 0.35; }
}

/* ---- 手势开关 FAB ---- */
.gesture-toggle {
  position: fixed;
  z-index: 1500;
  bottom: 88px;
  right: 18px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--sage);
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.22s ease, border-color 0.22s ease, transform 0.18s ease;
  user-select: none;
  -webkit-user-select: none;
}
.gesture-toggle:hover { transform: scale(1.06); border-color: var(--moss); }
.gesture-toggle:active { transform: scale(0.96); }

.gesture-toggle-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-faint);
  transition: background 0.22s ease;
}
.gesture-toggle.is-enabled .gesture-toggle-dot { background: var(--moss); }
.gesture-toggle.is-active .gesture-toggle-dot {
  background: var(--moss);
  box-shadow: 0 0 6px var(--sage);
}
.gesture-toggle.is-error .gesture-toggle-dot { background: var(--terracotta); }

.gesture-toggle-icon {
  font-size: 15px;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.22s ease;
}
.gesture-toggle.is-enabled .gesture-toggle-icon { opacity: 1; }
.gesture-toggle-label {
  font-size: 9px;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.22s ease;
}
.gesture-toggle.is-enabled .gesture-toggle-label { opacity: 0.85; }
.gesture-toggle.is-active .gesture-toggle-icon,
.gesture-toggle.is-active .gesture-toggle-label { opacity: 0.85; }

/* ---- 手势状态指示器 ---- */
.gesture-status {
  position: fixed;
  z-index: 1499;
  bottom: 142px;
  right: 18px;
  max-width: 140px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  background: var(--paper);
  border: 1px solid var(--sage);
  font-size: 11px;
  color: var(--ink-soft);
  line-height: 1.4;
  text-align: right;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.28s ease, transform 0.28s ease;
  pointer-events: none;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.gesture-status.is-visible { opacity: 0.85; transform: translateY(0); }
.gesture-status.is-active { color: var(--moss); border-color: var(--moss); }
.gesture-status.is-error { color: var(--terracotta); border-color: var(--terracotta); }

/* ---- 手势权限对话框 ---- */
.gesture-permission-overlay,
.gesture-calibration-overlay,
.gesture-settings-overlay,
.gesture-help-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(43, 51, 39, 0.32);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.28s ease;
}
.gesture-permission-overlay.is-visible,
.gesture-calibration-overlay.is-visible,
.gesture-settings-overlay.is-visible,
.gesture-help-overlay.is-visible {
  opacity: 1;
}

.gesture-permission-card,
.gesture-calibration-card,
.gesture-settings-card,
.gesture-help-card {
  background: var(--sand-light);
  border-radius: var(--radius-lg);
  padding: 32px 28px 24px;
  max-width: 440px;
  width: calc(100vw - 40px);
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lift);
  border: 1px solid var(--sage);
}

.gesture-permission-card h2,
.gesture-calibration-card h2,
.gesture-settings-card h2,
.gesture-help-card h2 {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--ink);
  margin-bottom: 10px;
}

.gp-lead, .gh-lead {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 18px;
  line-height: 1.6;
}

.gp-section {
  margin-bottom: 16px;
}
.gp-section h3 {
  font-size: 14px;
  color: var(--moss);
  margin-bottom: 6px;
}
.gp-section ul, .gp-section li {
  font-size: 13px;
  color: var(--ink-soft);
  padding-left: 4px;
  margin-bottom: 4px;
  list-style: '— ';
}

.gp-note {
  font-size: 12px;
  color: var(--ink-faint);
  margin: 16px 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(139, 157, 131, 0.12);
}

.gp-actions, .gh-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

/* ---- 校准覆盖层 ---- */
.gesture-calibration-card {
  text-align: center;
}
.gcal-icon {
  font-size: 52px;
  margin-bottom: 10px;
  animation: gcal-wave 1.2s ease-in-out infinite;
}
@keyframes gcal-wave {
  0%, 100% { transform: rotate(0deg); }
  25%      { transform: rotate(-8deg); }
  75%      { transform: rotate(8deg); }
}
.gcal-hint {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 8px 0 16px;
}
.gcal-countdown {
  display: block;
  font-family: var(--serif);
  font-size: 40px;
  color: var(--moss);
  margin-bottom: 14px;
}
.gcal-skip { margin-top: 6px; }

/* ---- 设置面板 ---- */
.gs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.gs-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--sage);
  background: transparent;
  color: var(--ink-soft);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.gs-close:hover { background: rgba(139, 157, 131, 0.15); }

.gs-field {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(139, 157, 131, 0.2);
}
.gs-field label {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.gs-field input[type="range"] {
  width: calc(100% - 52px);
  accent-color: var(--moss);
  vertical-align: middle;
}
.gs-range-label {
  display: inline-block;
  width: 44px;
  text-align: right;
  font-size: 12px;
  color: var(--ink-faint);
  vertical-align: middle;
}

.gs-field-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: none;
}
.gs-field-check label { margin-bottom: 0; }
.gs-field-check input[type="checkbox"] {
  accent-color: var(--moss);
  width: 18px;
  height: 18px;
}

.gs-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

/* ---- 帮助覆盖层 ---- */
.gh-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.gh-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--sage);
  background: transparent;
  color: var(--ink-soft);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.gh-close:hover { background: rgba(139, 157, 131, 0.15); }

.gh-list { list-style: none; margin: 14px 0; }
.gh-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid rgba(139, 157, 131, 0.15);
}
.gh-item:last-child { border-bottom: none; }
.gh-icon {
  font-size: 26px;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
  line-height: 1;
}
.gh-body strong { font-size: 14px; color: var(--ink); display: block; margin-bottom: 2px; }
.gh-body p { font-size: 12px; color: var(--ink-soft); line-height: 1.5; }

.gh-tips {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(139, 157, 131, 0.1);
}
.gh-tips h3 { font-size: 13px; color: var(--moss); margin-bottom: 4px; }
.gh-tips li { font-size: 12px; color: var(--ink-soft); margin-bottom: 3px; list-style: '— '; padding-left: 4px; }

/* ---- 手势禁用时隐藏 ---- */
@media (prefers-reduced-motion: reduce) {
  .air-cursor,
  .gesture-toggle,
  .gesture-status,
  .gesture-permission-overlay,
  .gesture-calibration-overlay,
  .gesture-settings-overlay,
  .gesture-help-overlay { transition: none; }
  .gesture-hand-canvas, .gesture-hand-action, .gesture-live-guide { transition: none; }
  .air-cursor { transition: none; }
  .air-cursor-feedback { animation: none; display: none; }
  .gcal-icon { animation: none; }
}

/* ============================================================
   Phone layout system
   The mobile experience changes composition instead of shrinking desktop UI.
   ============================================================ */
.topnav-toggle { display: none; }
.wb-mobile-execute { display: none; }
.district-story-mobile-toggle { display: none; }

@media (max-width: 680px) {
  :root {
    --mobile-gutter: 16px;
    --mobile-nav-height: calc(68px + env(safe-area-inset-top));
  }

  html { -webkit-text-size-adjust: 100%; }
  body { min-width: 0; }
  button, a, input, select, textarea, [role="button"] { -webkit-tap-highlight-color: transparent; }
  input, select, textarea, [contenteditable="true"] { font-size: 16px !important; }
  input, textarea, [contenteditable="true"] { scroll-margin-block: 22dvh; }

  /* Compact, accessible navigation */
  .topnav {
    min-height: var(--mobile-nav-height); align-items: center; padding:
      calc(10px + env(safe-area-inset-top)) var(--mobile-gutter) 10px;
  }
  .topnav .brand { min-width: 0; gap: 9px !important; }
  .topnav .brand-logo { width: 42px; height: 42px; flex: 0 0 42px; }
  .topnav .brand .name {
    max-width: min(64vw, 236px); overflow: hidden; font-size: 12px; line-height: 1.35;
    letter-spacing: .08em; text-overflow: ellipsis; white-space: nowrap;
  }
  .topnav-toggle {
    position: relative; z-index: 2; width: 44px; height: 44px; flex: 0 0 44px;
    display: grid; place-content: center; gap: 5px; border: 1px solid rgba(96,108,56,.3);
    border-radius: 50%; color: var(--ink); background: rgba(241,232,214,.78);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  }
  .topnav-toggle span { width: 18px; height: 1.5px; display: block; background: currentColor; transition: transform .2s ease, opacity .2s ease; }
  .topnav.menu-open .topnav-toggle span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  .topnav.menu-open .topnav-toggle span:nth-child(2) { opacity: 0; }
  .topnav.menu-open .topnav-toggle span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
  .topnav nav {
    position: absolute; top: calc(100% - 4px); right: var(--mobile-gutter); left: var(--mobile-gutter);
    display: grid; gap: 0; padding: 8px; border: 1px solid rgba(96,108,56,.3); border-radius: 18px;
    background: rgba(241,232,214,.96); box-shadow: var(--shadow-lift);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    opacity: 0; visibility: hidden; transform: translateY(-8px); pointer-events: none;
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
  }
  .topnav.menu-open nav, .topnav nav.is-open { opacity: 1 !important; visibility: visible !important; transform: none !important; pointer-events: auto !important; }
  .topnav nav a, .topnav nav .admin-nav-logout {
    min-height: 46px; display: flex; align-items: center; padding: 0 14px; border-radius: 12px;
    font-size: 14px; letter-spacing: .1em;
  }
  .topnav nav a.active { background: rgba(96,108,56,.11); }
  .topnav nav a.active::after { display: none; }
  .topnav nav .admin-nav-logout { width: 100%; border: 0; text-align: left; }

  /* Home becomes a vertically readable handscroll. */
  .home { min-height: 100svh; overflow-y: auto; }
  .home .hero-copy { width: auto; max-width: none; padding: calc(var(--mobile-nav-height) + 48px) 22px 0; }
  .home h1 { max-width: 9em; font-size: clamp(30px, 9.4vw, 40px); line-height: 1.32; }
  .home .lede { max-width: 92%; margin: 18px 0 24px; font-size: 15px; line-height: 1.8; }
  .home .cta-row .btn-ghost { min-height: 44px; display: inline-flex; align-items: center; }
  .home .hero-block { padding: 0 22px calc(116px + env(safe-area-inset-bottom)); margin-top: 30px; }
  .home .hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
  .home .hero-stats span { display: grid; align-content: start; gap: 3px; font-size: 11px; line-height: 1.45; }
  .home .hero-stats b { margin: 0; font-size: 22px; }
  .home .stats-note { max-width: calc(100% - 96px); line-height: 1.55; }
  .press-hint { top: auto; bottom: calc(78px + env(safe-area-inset-bottom)); font-size: 12px; letter-spacing: .24em; }
  .home .cat-hint { left: 16px; bottom: calc(14px + env(safe-area-inset-bottom)); min-height: 44px; }

  /* Map: one touchable stage with horizontal tools and bottom sheets. */
  .explore.is-map-mode { min-height: 520px; height: 100svh; }
  .explore.is-map-mode .toolbar {
    top: var(--mobile-nav-height); min-height: 58px; flex-wrap: nowrap; gap: 8px; overflow-x: auto;
    padding: 7px var(--mobile-gutter) 9px; scrollbar-width: none; overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
  }
  .explore.is-map-mode .toolbar::-webkit-scrollbar { display: none; }
  .explore .toolbar > * { flex: 0 0 auto; scroll-snap-align: start; }
  .explore .toolbar input[type="search"] { width: min(58vw, 230px); height: 44px; padding: 8px 15px; }
  .explore .toolbar select { height: 44px; padding: 7px 12px; }
  .seg, .map-zoom-controls { min-height: 44px; align-items: center; }
  .seg button, .map-zoom-controls button { min-width: 44px; min-height: 38px; padding: 7px 11px; }
  .map-search-results {
    top: calc(var(--mobile-nav-height) + 58px); left: var(--mobile-gutter); right: var(--mobile-gutter);
    width: auto; max-height: min(48svh, 440px); border-radius: 16px;
  }
  .map-search-result-head button, .project-story-close,
  .district-story-back { min-width: 44px; min-height: 44px; }
  .explore.is-map-mode .map-caption { bottom: calc(28px + env(safe-area-inset-bottom)); padding: 0 16px; font-size: 9px; }
  .explore.is-map-mode .map-legend { bottom: env(safe-area-inset-bottom); gap: 10px; font-size: 9px; }
  .map-heritage-marker { width: 44px; height: 48px; transform: translate(-50%, -86%); }
  .map-heritage-marker-icon { inset: auto; width: 25px; height: 31px; }
  .map-view.is-district-focus .map3d-wrap { transform: translateY(-8vh) scale(.86); }
  .map-view.is-district-focus.has-project-detail .map3d-wrap { transform: translateY(-12vh) scale(.8); }
  .map-view > .district-story, .district-focus .district-story, .project-story, .district-focus .project-story {
    position: fixed; z-index: 70; top: auto; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); left: 10px;
    width: auto; max-width: none; max-height: min(47svh, 430px); transform: none; border-radius: 24px;
  }
  .map-view > .district-story, .district-focus .district-story {
    max-height: 168px; padding: 13px 15px 14px; overflow: hidden;
    animation: mobileSheetIn .28s cubic-bezier(.2,.8,.25,1) both;
  }
  .map-view > .district-story.is-mobile-expanded, .district-focus .district-story.is-mobile-expanded {
    max-height: min(52svh, 460px); overflow-y: auto;
  }
  body:has(.map-view .district-story) .mascot-bubble,
  body:has(.map-view .project-story) .mascot-bubble { display: none; }
  body:has(.map-view .district-story) .agent-fab,
  body:has(.map-view .project-story) .agent-fab { display: none !important; }
  body:has(.craft-body.playing) .mascot-bubble { display: none; }
  body:has(.map-view .district-story) .gesture-toggle { bottom: calc(184px + env(safe-area-inset-bottom)); }
  body:has(.map-view .district-story) .gesture-status { bottom: calc(240px + env(safe-area-inset-bottom)); }
  @keyframes mobileSheetIn { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
  .district-story-heading { padding-right: 0; }
  .district-story-kicker { letter-spacing: .16em; }
  .district-story h2 { margin: 2px 0 3px; font-size: 25px; }
  .district-story-back { position: absolute; top: 10px; right: 13px; margin: 0; font-size: 11px; }
  .district-story-scope { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .district-story-count { margin-bottom: 5px; }
  .district-story-mobile-toggle {
    width: 100%; min-height: 40px; display: flex; align-items: center; justify-content: center;
    border-top: 1px solid rgba(96,108,56,.2); color: var(--moss); font-size: 12px;
  }
  .district-story.is-mobile-expanded .district-story-mobile-toggle {
    position: sticky; top: -13px; z-index: 3; background: rgba(232,220,199,.97);
  }
  .district-story-section { padding: 10px 0; }
  .project-story { animation: mobileSheetIn .28s cubic-bezier(.2,.8,.25,1) both; }
  .project-story-scroll { min-height: 0; }
  .project-story-action { position: sticky; bottom: 0; padding-bottom: 2px; }
  .project-story-action .btn { width: 100%; min-width: 0; min-height: 46px; }
  .craft-anchor-hit { width: 112px; min-height: 44px; }
  .craft-anchor-visual { width: 92px; height: 64px; }
  .map-anchor-overflow { bottom: calc(52px + env(safe-area-inset-bottom)); max-width: calc(100vw - 32px); white-space: nowrap; }

  /* Craft detail: scrollable narrative above a large touch workspace. */
  .craft-page { height: auto; min-height: 100dvh; overflow-x: hidden; overflow-y: auto; }
  .craft-head { min-height: 0; flex-wrap: wrap; gap: 8px 12px; padding: calc(14px + env(safe-area-inset-top)) 16px 12px; }
  .craft-head h2 { flex-basis: calc(100% - 64px); font-size: 24px; line-height: 1.25; }
  .craft-head .meta { order: 3; flex-basis: 100%; font-size: 12px; }
  .craft-head .btn, .craft-head button, .craft-head a { min-height: 44px; }
  .craft-head.admin-editable-module { padding-right: 16px; }
  .craft-body { flex: none; height: auto; min-height: calc(100dvh - 94px); flex-direction: column; overflow: visible; }
  .reading-col { width: 100%; min-width: 0; max-height: 42dvh; flex: none; overflow: auto; }
  .workbench-col { min-height: 58dvh; height: auto; flex: none; overflow: visible; }
  .craft-body.playing .reading-col, .craft-body.panels-collapsed .reading-col { width: 100%; min-width: 0; max-height: 54px; flex-direction: row; overflow-x: auto; overflow-y: hidden; }
  .craft-body.playing .panel, .craft-body.panels-collapsed .panel { min-width: max-content; }
  .craft-body.playing .panel .panel-head, .craft-body.panels-collapsed .panel .panel-head { min-height: 54px; writing-mode: horizontal-tb; padding: 10px 15px; }
  .craft-body.playing.reading-open .reading-col { width: 100%; max-height: 42dvh; flex-direction: column; overflow-y: auto; }
  .craft-body.playing.reading-open .panel { min-width: 0; }
  .workbench { min-height: 56dvh; }
  .action-palette { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; }
  .action-palette button { min-width: 76px; min-height: 44px; scroll-snap-align: start; }
  .wb-play-physics { display: block; overflow: visible; }
  .wb-play-physics .backpack {
    width: 100%; max-height: none; overflow: visible; padding: 12px 14px 8px;
    border-right: 0; border-bottom: 1px solid rgba(96,108,56,.25); box-shadow: none;
  }
  .wb-play-physics .backpack h4 { margin-bottom: 7px; }
  .wb-play-physics .backpack .bp-sec {
    display: flex; align-items: center; gap: 8px; margin: 0 0 7px; padding: 0 0 7px;
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: none;
  }
  .wb-play-physics .backpack .bp-sec::-webkit-scrollbar { display: none; }
  .wb-play-physics .backpack .bp-sec > .sec-label { min-width: 34px; margin: 0; flex: none; }
  .wb-play-physics .backpack .bp-item {
    width: auto; min-width: 132px; min-height: 44px; flex: 0 0 132px; margin: 0;
    scroll-snap-align: start; touch-action: pan-y !important;
  }
  .wb-play-physics .bp-help, .wb-play-physics .bp-legend { display: none; }
  .wb-play-physics .wb-main { overflow: visible; padding: 14px 12px calc(20px + env(safe-area-inset-bottom)); }
  .wb-play-physics .wb-stage-layout { display: flex; min-height: 0; flex-direction: column; gap: 12px; }
  .wb-play-physics .wb-table-surface { order: 1; min-height: 48svh; touch-action: pan-y; }
  .wb-play-physics .wb-table-canvas { touch-action: pan-y; cursor: default; }
  .wb-play-physics .wb-side-rail { order: 2; display: flex; min-height: 0; flex-direction: column; gap: 12px; }
  .wb-play-physics .action-palette {
    order: 1; min-height: 62px; max-height: none; padding: 8px; flex-direction: row;
    overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity;
  }
  .wb-play-physics .action-card { min-width: 142px; min-height: 46px; touch-action: pan-y !important; scroll-snap-align: start; }
  .wb-play-physics .wb-step-image { order: 2; min-height: 210px; }
  .wb-play-physics .wb-actions {
    position: sticky; z-index: 8; bottom: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    margin: 8px -4px 0; padding: 10px 4px calc(8px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, rgba(241,232,214,.98) 72%, rgba(241,232,214,.72), transparent);
  }
  .wb-play-physics .wb-actions > button { min-height: 46px; margin: 0; justify-content: center; }
  .wb-play-physics .wb-actions .wb-note { grid-column: 1 / -1; max-width: none; margin: 0; text-align: center; }
  .wb-mobile-execute { display: inline-flex; align-items: center; }
  .finish-v2 { min-height: calc(100dvh - 150px); }
  .finish-stage, .complete-stage { min-height: 44dvh; }
  .finish-v2 .complete-side, .complete-side { width: 100%; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .complete-stage .pz-inner img { max-width: 92%; max-height: 50dvh; }

  /* Agent and dialogs use keyboard-safe bottom sheets. */
  .agent-fab { right: 3px; bottom: calc(-40px + env(safe-area-inset-bottom)); transform: scale(.52); transform-origin: right bottom; }
  .agent-fab:hover { transform: translateY(-2px) scale(.54); }
  body.agent-open .agent-fab { right: 3px; }
  .agent-panel {
    top: auto; right: 0; bottom: 0; left: 0; width: auto; height: min(78dvh, 680px);
    padding-bottom: env(safe-area-inset-bottom); border-left: 0; border-top: 1px solid rgba(96,108,56,.3);
    border-radius: 26px 26px 0 0; transform: translateY(104%);
  }
  .agent-panel .ap-head { min-height: 58px; padding: 12px 16px; }
  .agent-panel .ap-close { width: 44px; height: 44px; }
  .agent-panel .ap-messages { overscroll-behavior: contain; }
  .agent-panel .ap-input-row { position: sticky; bottom: 0; padding-bottom: calc(10px + env(safe-area-inset-bottom)); background: rgba(241,232,214,.98); }
  .agent-panel .ap-input-row button { min-width: 64px; min-height: 44px; }
  .mascot-bubble {
    right: 76px !important; left: 12px !important; bottom: calc(10px + env(safe-area-inset-bottom)) !important;
    width: auto; max-height: 56px; overflow: hidden; padding: 6px 9px; border-radius: 14px;
  }
  .mascot-bubble p { overflow: hidden; font-size: 10.5px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
  .mascot-bubble button { min-height: 22px; margin-top: 1px; padding: 0; font-size: 9.5px; }
  .jiao-toast { right: 12px; bottom: calc(82px + env(safe-area-inset-bottom)); left: 12px; max-width: none; }
  .modal-mask { align-items: flex-end; padding: 0; }
  .modal { width: 100%; max-height: min(88dvh, 760px); border-radius: 26px 26px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .modal.step-image-modal { max-width: 100%; }
  .step-image-lightbox img { max-height: 68dvh; }
  .modal .m-head { position: sticky; top: 0; z-index: 2; padding: 14px 16px 8px; background: rgba(241,232,214,.97); }
  .modal .m-close { width: 44px; height: 44px; }
  .modal .m-body { padding: 6px 16px 20px; }

  /* Passport changes from a seven-column table into labelled evidence cards. */
  .passport { width: 100%; padding: calc(var(--mobile-nav-height) + 28px) 16px 62px; overflow: visible; }
  .passport h2 { font-size: 26px; }
  .kb-overview { min-width: 0 !important; padding: 16px; }
  .kb-overview-head { display: grid; gap: 14px; }
  .kb-total { min-width: 0; text-align: left; }
  .kb-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .kb-stat { min-height: 108px; padding: 13px; }
  .kb-stat:last-child { grid-column: 1 / -1; }
  .kb-source-list { grid-template-columns: 1fr; }
  .passport table, .passport tbody, .passport tr, .passport td { display: block; width: 100%; }
  .passport table { background: transparent; box-shadow: none; }
  .passport thead { display: none; }
  .passport tbody { display: grid; gap: 14px; }
  .passport tr { overflow: hidden; border: 1px solid rgba(96,108,56,.22); border-radius: 18px; background: rgba(241,232,214,.82); box-shadow: var(--shadow-soft); }
  .passport td { position: relative; min-height: 44px; padding: 13px 13px 13px 108px; border-bottom: 1px solid rgba(96,108,56,.14); }
  .passport td::before { content: attr(data-label); position: absolute; top: 14px; left: 13px; width: 82px; color: var(--moss); font-size: 11px; letter-spacing: .06em; }

  /* Community and administration: single-column, touch-first forms. */
  .community-shell { width: 100%; padding: calc(var(--mobile-nav-height) + 24px) 14px 64px; }
  .community-form { gap: 14px; }
  .community-intro-card, .community-form-section, .community-full-fields, .community-process-module,
  .community-success, .community-import-card { padding: 18px 16px; }
  .community-intro-card h1 { font-size: 30px; }
  .community-field-grid, .community-star-fields, .community-step-grid, .community-overview-images { grid-template-columns: 1fr; }
  .community-mode { width: 100%; }
  .community-mode button { flex: 1; min-height: 44px; }
  .community-import-actions > *, .community-submit-actions .btn { min-height: 44px; }
  .community-submit-actions { align-items: stretch; flex-direction: column; }
  .community-submit-actions .btn { width: 100%; justify-content: center; }

  .admin-login-wrap { padding: calc(var(--mobile-nav-height) + 24px) 14px 48px; }
  .admin-login-card { padding: 24px 18px; }
  .admin-dashboard, .admin-process-page { padding: calc(var(--mobile-nav-height) + 28px) 14px 60px; }
  .admin-page-heading { gap: 18px; margin-bottom: 22px; }
  .admin-page-heading h1 { font-size: 30px; }
  .admin-heading-actions, .admin-card-actions, .admin-order-tools { width: 100%; align-items: stretch; }
  .admin-heading-actions .btn, .admin-card-actions .btn { min-height: 44px; justify-content: center; }
  .admin-review-toggle { min-height: 44px; white-space: normal; }
  .admin-brand-panel { gap: 18px; }
  .admin-brand-panel > .btn { min-height: 44px; }
  .admin-bulk-toolbar { gap: 10px; padding: 12px 4px; }
  .admin-bulk-select-all, .admin-danger-button { min-height: 44px; }
  .admin-craft-card { grid-template-columns: 84px minmax(0,1fr); gap: 12px; padding: 12px; }
  .admin-craft-card img, .admin-card-placeholder { height: 92px; }
  .admin-craft-card h2 { padding-right: 0 !important; margin: 32px 0 10px; font-size: 20px; }
  .admin-craft-select { min-height: 38px; }
  .admin-step-tabs { margin-inline: -14px; padding-inline: 14px; scroll-snap-type: x mandatory; }
  .admin-step-tab, .admin-step-add { min-width: 132px; min-height: 48px; padding: 10px 13px; scroll-snap-align: start; }
  .admin-step-editor, .admin-content-editor, .admin-graph-editor { padding: 18px 14px; }
  .admin-guide-section, .admin-visual-section, .admin-step-image-editor,
  .admin-resource-columns > section, .admin-operations { padding: 15px 12px; }
  .admin-editor-heading h2 { font-size: 25px; }
  .admin-resource-row { align-items: stretch; }
  .admin-resource-row input { min-width: 0; }
  .admin-icon-button { flex-basis: 44px; height: 44px; }
  .admin-add-row, .admin-delete-step { min-height: 44px; }
  .admin-operation-row > input { min-width: calc(100% - 54px); }
  .admin-correct-action { min-height: 44px; }
  .admin-material-transform-row { grid-template-columns: minmax(0,1fr) 24px 86px; }
  .admin-material-toggle { min-height: 44px; }
  .admin-graph-relation-row, .admin-documentary-item { min-width: 0; }
  .admin-documentary-item { grid-template-columns: 82px minmax(0,1fr); }
  .admin-documentary-item > .admin-icon-button { grid-column: 2; justify-self: end; }

  /* Knowledge graph keeps the canvas visible while details become a sheet. */
  .heritage-graph-header { padding: calc(12px + env(safe-area-inset-top)) 14px 0; }
  .heritage-graph-heading { max-width: calc(100% - 58px); }
  .heritage-graph-heading h1 { overflow: hidden; font-size: 25px; text-overflow: ellipsis; white-space: nowrap; }
  .heritage-graph-subtitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .heritage-graph-close { width: auto; min-width: 76px; min-height: 44px; padding: 8px 12px; white-space: nowrap; }
  .heritage-graph-stage { inset: calc(78px + env(safe-area-inset-top)) 0 178px; }
  .heritage-graph-info { right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); left: 10px; max-height: 38dvh; overflow-y: auto; border-radius: 20px; }
  .heritage-graph-info > p { max-height: none; }
  .heritage-graph-entry { right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); left: auto; min-height: 44px; transform: none; }
  .heritage-graph-trail { left: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); max-width: calc(100% - 120px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .heritage-graph-zoom { top: auto; right: 10px; bottom: calc(188px + env(safe-area-inset-bottom)); }
  .heritage-graph-zoom button { width: 44px; height: 44px; }
  .heritage-graph-root-button, .heritage-graph-back-button, .heritage-graph-contribute-button { min-height: 44px; }

  /* Gesture controls remain available without covering primary actions. */
  .gesture-toggle { right: 10px; bottom: calc(66px + env(safe-area-inset-bottom)); width: 50px; height: 50px; }
  .gesture-status { right: 10px; bottom: calc(122px + env(safe-area-inset-bottom)); }
  .gesture-live-guide { right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); left: 10px; width: auto; padding: 13px 15px; }
  .gesture-live-guide button { min-height: 42px; padding: 8px 14px; }
  .gesture-permission-overlay, .gesture-calibration-overlay, .gesture-settings-overlay, .gesture-help-overlay { align-items: flex-end; }
  .gesture-permission-card, .gesture-calibration-card, .gesture-settings-card, .gesture-help-card {
    width: 100%; max-width: none; max-height: 88dvh; padding: 22px 18px calc(18px + env(safe-area-inset-bottom));
    border-right: 0; border-bottom: 0; border-left: 0; border-radius: 26px 26px 0 0;
  }
  .gp-actions, .gh-actions, .gs-actions { align-items: stretch; flex-direction: column; }
  .gp-actions button, .gh-actions button, .gs-actions button, .gs-close, .gh-close { min-height: 44px; }

  .site-legal { max-width: calc(100vw - 120px); left: 14px; bottom: calc(8px + env(safe-area-inset-bottom)); transform: none; font-size: 9px; }
}

@media (max-width: 420px) {
  .topnav .brand .name { max-width: 55vw; }
  .home .hero-copy { padding-top: calc(var(--mobile-nav-height) + 34px); }
  .home h1 { font-size: 30px; }
  .home .lede { font-size: 14px; }
  .home .hero-block { margin-top: 20px; }
  .home .hero-stats { gap: 5px; }
  .home .hero-stats b { font-size: 20px; }
  .passport td { padding-left: 94px; }
  .passport td::before { width: 68px; }
  .kb-stats { grid-template-columns: 1fr; }
  .kb-stat:last-child { grid-column: auto; }
  .admin-craft-card { grid-template-columns: 72px minmax(0,1fr); }
  .admin-craft-card img, .admin-card-placeholder { height: 82px; }
}

@media (max-height: 520px) and (orientation: landscape) and (max-width: 900px) {
  .topnav { --mobile-nav-height: calc(58px + env(safe-area-inset-top)); }
  .topnav .brand-logo { width: 36px; height: 36px; flex-basis: 36px; }
  .home { overflow-y: auto; }
  .agent-panel { height: 94dvh; }
  .map-view > .district-story, .district-focus .district-story, .project-story, .district-focus .project-story { max-height: 72dvh; }
}

/* 2026 visual refinement: layered Jiangnan constellation atmosphere. */
.heritage-graph-overlay {
  background:
    radial-gradient(ellipse at 52% 44%, #879a8d 0%, #74887b 42%, #5d7265 76%, #506458 100%);
}
.heritage-graph-overlay::before { opacity: .055; }
.heritage-graph-overlay::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: url('../assets/art-direction/constellation-cloud-v1.png') center / cover no-repeat;
  opacity: .2; mix-blend-mode: soft-light; filter: brightness(1.35) saturate(.62) contrast(.74);
}
.heritage-graph-wash { opacity: .52; filter: blur(36px); }
.heritage-graph-atmosphere { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.heritage-graph-atmosphere svg { width: 100%; height: 100%; }
.heritage-graph-orbit-lines,
.heritage-graph-coordinate-marks {
  fill: none; stroke: rgba(232,220,199,.16); stroke-width: 1; vector-effect: non-scaling-stroke;
}
.heritage-graph-orbit-lines { stroke: rgba(241,232,214,.22); stroke-dasharray: 2 10; animation: constellationTrace 30s linear infinite; }
.heritage-graph-coordinate-marks { stroke: rgba(192,142,58,.19); stroke-dasharray: 1 7; }
.heritage-graph-mist {
  position: absolute; display: block; border-radius: 50%; pointer-events: none;
  background:
    radial-gradient(ellipse at 28% 52%, rgba(232,220,199,.72), transparent 43%),
    radial-gradient(ellipse at 68% 45%, rgba(212,225,215,.66), transparent 48%),
    radial-gradient(ellipse at 48% 70%, rgba(241,232,214,.42), transparent 38%);
  filter: blur(30px); will-change: transform, opacity;
}
.mist-far {
  width: 86vw; height: 34vh; left: -24vw; top: 12vh; opacity: .22;
  animation: jiangnanMistFar 28s ease-in-out infinite alternate;
}
.mist-mid {
  width: 76vw; height: 32vh; right: -22vw; top: 37vh; opacity: .3;
  filter: blur(38px); animation: jiangnanMistMid 22s ease-in-out infinite alternate;
}
.mist-near {
  width: 88vw; height: 28vh; left: 8vw; bottom: -12vh; opacity: .38;
  filter: blur(46px); animation: jiangnanMistNear 17s ease-in-out infinite alternate;
}
.heritage-graph-stage { z-index: 1; }
.heritage-graph-header,
.heritage-graph-info,
.heritage-graph-trail,
.heritage-graph-hint,
.heritage-graph-zoom { z-index: 4; }
@keyframes constellationTrace { to { stroke-dashoffset: -200; } }
@keyframes jiangnanMistFar { to { transform: translate3d(10vw, 2vh, 0) scale(1.08); opacity: .3; } }
@keyframes jiangnanMistMid { to { transform: translate3d(-12vw, -3vh, 0) scale(1.12); opacity: .38; } }
@keyframes jiangnanMistNear { to { transform: translate3d(-6vw, -4vh, 0) scale(1.14); opacity: .48; } }

@media (max-width: 720px) {
  .heritage-graph-atmosphere { opacity: .78; }
  .heritage-graph-mist { filter: blur(24px); }
}
@media (prefers-reduced-motion: reduce) {
  .heritage-graph-orbit-lines, .heritage-graph-mist { animation: none; }
}
