/* ============================================================
   灵鹿电竞 · 趣味单全屏工作区（js/fun-workspace.js 配套样式）
   视觉与主站 css/style.css 同源：半透明白卡 + 浅绿描边 + 绿调阴影。
   变量全部挂在 .fw-overlay 容器作用域，不写 :root，不污染主站。
   ============================================================ */

.fw-overlay, .fw-overlay * { box-sizing: border-box; letter-spacing: 0; }
.fw-overlay {
  /* 作用域变量：与主站同盘，但只在本模块容器内生效 */
  --ink: #2f4a35;
  --muted: #435747;
  --soft: #6d8a74;
  --line: rgba(99, 159, 112, 0.22);
  --green: #639f70;
  --green-2: #67a374;
  --green-dark: #2f5636;
  --fun-primary: linear-gradient(135deg, #5aa56f, #35744a);
  --fun-primary-shadow: 0 8px 18px rgba(53, 116, 74, 0.35);
  --fun-card: rgba(255, 255, 255, 0.86);
  --fun-card-border: rgba(99, 159, 112, 0.24);
  --fun-card-shadow: 0 4px 18px rgba(47, 86, 54, 0.07);
  --fun-badge: #d9f3df;
  --fun-badge-2: #e9f4e8;
  --fun-warn: #d9a227;
  --fun-warn-ink: #8a6a14;
  --fun-danger: #ef6f8e;
  --fun-danger-ink: #c7436c;
  --fun-focus-ring: 0 0 0 5px rgba(63, 128, 84, 0.1);
  position: fixed;
  inset: 0;
  z-index: 230;
  display: grid;
  place-items: center;
  padding: 16px;
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  color: var(--ink);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
.fw-overlay [hidden] { display: none !important; }
.fw-overlay h2, .fw-overlay h3, .fw-overlay p { margin: 0; }
.fw-overlay button, .fw-overlay input, .fw-overlay select { font: inherit; }
.fw-overlay button { cursor: pointer; }
.fw-overlay button:disabled { cursor: default; opacity: .48; }
.fw-overlay button:focus-visible,
.fw-overlay input:focus-visible,
.fw-overlay select:focus-visible,
.fw-overlay summary:focus-visible { outline: 3px solid rgba(99, 159, 112, 0.55); outline-offset: 2px; }

/* 浅绿氛围背板（替代原来的深色遮罩） */
.fw-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(235, 244, 234, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* 主窗口：半透明白大卡 */
.fw-window {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1480px, 100%);
  height: calc(100dvh - 32px);
  min-height: 0;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--fun-card-border);
  border-radius: 28px;
  box-shadow: 0 24px 70px rgba(47, 86, 54, 0.18);
  overflow: hidden;
}

/* ---------------- 头部：品牌 + 玩法切换 + 操作 ---------------- */
.fw-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 8px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
}
.fw-heading, .fw-header-actions, .fw-entry-actions { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fw-header-actions { flex-wrap: wrap; justify-content: flex-end; }
.fw-heading h2 { font-size: 20px; font-weight: 800; line-height: 1.4; min-width: 0; color: var(--ink); }
.fw-heading select {
  font: inherit;
  color: inherit;
  font-weight: 800;
  background: transparent;
  border: 0;
  max-width: min(260px, 100%);
  min-width: 0;
  padding: 6px 4px;
}

/* ---------------- 按钮体系 ---------------- */
/* 次级按钮：白底 + 绿边 + 绿字胶囊 */
.fw-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 7px 16px;
  border: 1px solid rgba(99, 159, 112, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--green-dark);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(47, 86, 54, 0.05);
  flex-shrink: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, filter 0.2s ease;
}
.fw-button:hover {
  background: #ffffff;
  border-color: rgba(99, 159, 112, 0.62);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(47, 86, 54, 0.12);
}
.fw-button.icon { width: 38px; padding: 7px; }
/* 窄屏省略号按钮：宽屏下隐藏，窄屏下代替文字按钮 */
.fw-more { display: none; }
.fw-header-actions { position: relative; }
.fw-more-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 176px;
  padding: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(47, 86, 54, 0.18);
}
.fw-more-menu[hidden] { display: none; }
.fw-more-menu button {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 11px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  text-align: left;
  line-height: 1.4;
  transition: background 0.15s ease;
}
.fw-more-menu button:hover { background: var(--fun-badge-2); }
.fw-more-menu button[hidden] { display: none; }
/* 宽屏（PC）下不显示省略号菜单，头部按钮全部以文字按钮平铺 */
@media (min-width: 761px) {
  .fw-more-menu { display: none !important; }
}
/* 主按钮：绿渐变 + 白字 + 绿阴影 + hover 上浮 */
.fw-button.primary {
  background: var(--fun-primary);
  color: #ffffff;
  border-color: transparent;
  box-shadow: var(--fun-primary-shadow);
  min-width: 136px;
}
.fw-button.primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 12px 26px rgba(53, 116, 74, 0.42);
}
.fw-button svg, .fw-overlay svg { flex-shrink: 0; }

/* ---------------- 分区2：档位标签 + 订单信息条（在滚动区内，随内容滚动，不再冻结在顶部） ---------------- */
.fw-orderbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  padding: 10px 20px;
  margin: -16px -20px 0;
  background: rgba(255, 255, 255, 0.6);
  border-bottom: 1px solid var(--line);
}
/* 档位标签行：整行排列，选中项为绿渐变胶囊 */
.fw-packs { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 100%; }
.fw-pack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 7px 16px;
  border: 1px solid rgba(99, 159, 112, 0.3);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.fw-pack:hover { transform: translateY(-1px); border-color: rgba(99, 159, 112, 0.55); box-shadow: 0 6px 14px rgba(47, 86, 54, 0.1); }
.fw-pack strong { font-size: 13px; font-weight: 800; line-height: 1.3; }
.fw-pack span { font-size: 11px; color: var(--soft); font-variant-numeric: tabular-nums; }
.fw-pack.active {
  background: var(--fun-primary);
  border-color: transparent;
  color: #ffffff;
  box-shadow: var(--fun-primary-shadow);
}
.fw-pack.active span { color: rgba(255, 255, 255, 0.85); }
.fw-pack:disabled { opacity: 0.48; cursor: default; transform: none; box-shadow: none; }
/* 原生下拉保留给逻辑层（只读锁定 / 外部赋值），视觉上隐藏 */
.fw-pack-select { display: none; }
/* 备注与订单信息同一行排列（窄屏自动换行） */
.fw-order-note { display: flex; align-items: center; gap: 10px; flex: 1 1 240px; min-width: 0; font-size: 13px; }
.fw-order-note > span { min-width: 0; overflow-wrap: anywhere; line-height: 1.5; }
.fw-order-note .fw-button { margin-left: 0; flex-shrink: 0; }
.fw-note-field { margin-top: 18px; }
.fw-order-date, .fw-save-state { font-size: 12px; color: var(--soft); }
.fw-save-state { margin-left: auto; white-space: nowrap; }
.fw-save-state { margin-left: auto; white-space: nowrap; }

/* 实时同步状态胶囊：绿=已同步，黄=同步中/待同步，灰=离线 */
.fw-live .fw-save-state { display: none; }
.fw-live-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(99, 159, 112, 0.3);
  border-radius: 999px;
  background: var(--fun-badge-2);
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.fw-live-chip:hover { border-color: rgba(99, 159, 112, 0.62); background: var(--fun-badge); }
.fw-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(99, 159, 112, 0.18); }
.fw-live-chip[data-state="busy"] .fw-live-dot { background: var(--fun-warn); box-shadow: 0 0 0 3px rgba(217, 162, 39, 0.2); animation: fw-live-pulse 1s ease-in-out infinite alternate; }
.fw-live-chip[data-state="held"] .fw-live-dot { background: var(--fun-warn); box-shadow: 0 0 0 3px rgba(217, 162, 39, 0.2); }
.fw-live-chip[data-state="offline"] { color: var(--soft); background: #f3f5f3; border-color: rgba(109, 138, 116, 0.28); }
.fw-live-chip[data-state="offline"] .fw-live-dot { background: #a9b6ac; box-shadow: none; }
@keyframes fw-live-pulse { to { opacity: 0.35; } }

/* 只读同步：隐藏所有录入与修改入口，进度区照常显示 */
.fw-readonly .fw-entry > *,
.fw-readonly .fw-library,
.fw-readonly .fw-record-tools,
.fw-readonly .fw-preview,
.fw-readonly [data-action="undo"],
.fw-readonly [data-action="submit"],
.fw-readonly [data-action="edit-note"] { display: none !important; }
.fw-readonly .fw-entry::before {
  content: '只读查看中：进度会随对方的更新自动刷新';
  display: block;
  padding: 18px;
  border: 1px dashed rgba(99, 159, 112, 0.36);
  border-radius: 16px;
  background: var(--fun-badge-2);
  color: var(--soft);
  font-size: 13px;
  line-height: 1.7;
  text-align: center;
}

/* ---------------- 分区4：保底进度卡 ---------------- */
.fw-summary {
  padding: 16px 20px;
  background: var(--fun-card);
  border: 1px solid var(--fun-card-border);
  border-radius: 18px;
  box-shadow: var(--fun-card-shadow);
}
.fw-summary-head { margin-bottom: 6px; }
.fw-goto-records {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  transition: background 0.2s;
}
.fw-goto-records:hover { background: var(--fun-badge-2); }
.fw-total { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.fw-total > span, .fw-summary-tiles span { display: block; font-size: 12px; color: var(--soft); margin-bottom: 5px; }
/* 总金额 / 大数字：主站式渐变文字 */
.fw-total strong {
  font-size: 26px;
  font-weight: 900;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(90deg, #67a374, #2f5636);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.fw-total small { color: var(--soft); font-size: 13px; font-weight: 500; }
.fw-total-pct { margin-left: auto; font-size: 15px; font-weight: 800; color: var(--green); font-variant-numeric: tabular-nums; }
.fw-complete {
  color: #2f5636;
  background: var(--fun-badge);
  margin-left: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.fw-board-metrics { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; }
.fw-board-metrics summary { color: var(--soft); }
.fw-board-metrics p { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; line-height: 1.65; }
.fw-board-metrics b { font-weight: 700; text-align: right; overflow-wrap: anywhere; color: var(--ink); }
/* 进度条：整行填满卡片，浅绿轨道 + 主站绿渐变填充 */
.fw-progress { margin-top: 6px; }
.fw-progress [role="progressbar"] { width: 100%; height: 10px; border-radius: 999px; background: #dcecdf; overflow: hidden; }
.fw-progress [role="progressbar"] span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7cc297, #c7e491);
  transition: width 0.25s ease;
}
.fw-summary-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.fw-summary-tiles > div {
  padding: 9px 16px;
  min-width: 0;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(47, 86, 54, 0.05);
}
.fw-summary-tiles strong { font-size: 15px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fw-money-axis { display: flex; flex-direction: column; gap: 5px; min-width: 0; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 12px; line-height: 1.5; color: var(--soft); overflow-wrap: anywhere; }
.fw-money-axis strong { color: var(--green); font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.fw-money-axis small { color: var(--fun-warn-ink); font-size: 11px; }
.fw-summary .fw-breakdown { margin-top: 12px; padding-top: 6px; border-top: 1px dashed var(--line); }

/* ---------------- 主区域布局：整窗滚动 + 分区卡片堆叠 ---------------- */
.fw-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #f0f7ee;
}
/* 棋盘 / 展柜 / 图片棋盘的单子：左舞台右录入；纯数字单子只有录入卡 */
.fw-play { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; align-items: start; }
.fw-numeric .fw-play { display: block; }
.fw-stage {
  position: sticky;
  top: 0;
  min-width: 0;
  height: min(76vh, 940px);
  display: flex;
  flex-direction: column;
  overflow: auto;
  padding: 16px 18px;
  background: var(--fun-card);
  border: 1px solid var(--fun-card-border);
  border-radius: 18px;
  box-shadow: var(--fun-card-shadow);
}
.fw-entry {
  min-width: 0;
  padding: 16px 20px;
  background: var(--fun-card);
  border: 1px solid var(--fun-card-border);
  border-radius: 18px;
  box-shadow: var(--fun-card-shadow);
}
.fw-section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 26px; margin-bottom: 14px; }
.fw-section-title h3 { font-size: 15px; font-weight: 800; color: var(--ink); }
.fw-section-title > span { font-size: 12px; color: var(--soft); }

/* ---------------- 录入表单 ---------------- */
.fw-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 12px; }
.fw-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; font-size: 12px; color: var(--muted); }
.fw-field span { line-height: 1.5; font-weight: 700; }
.fw-field:first-child, .fw-field:has([data-f="ids"]), .fw-field[data-task-cell] { grid-column: 1 / -1; }
.fw-field input, .fw-field select {
  width: 100%;
  height: 40px;
  min-width: 0;
  border: 1px solid rgba(99, 159, 112, 0.3);
  background: #ffffff;
  color: var(--ink);
  padding: 7px 12px;
  border-radius: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.fw-field input:focus, .fw-field select:focus {
  outline: none;
  border-color: rgba(63, 128, 84, 0.65);
  box-shadow: var(--fun-focus-ring);
}
.fw-field input[type="number"] { font-variant-numeric: tabular-nums; }
.fw-field.fw-check { grid-column: 1 / -1; flex-direction: row-reverse; justify-content: flex-end; align-items: center; min-height: 36px; }
.fw-check input { width: 18px; height: 18px; accent-color: var(--green); }
.fw-money { color: var(--green); font-size: 11px; min-height: 14px; font-variant-numeric: tabular-nums; }

/* 当前格任务提示：绿系（原蓝色调换成主站绿） */
.fw-current-task {
  border-left: 3px solid var(--green);
  padding: 10px 14px;
  background: var(--fun-badge-2);
  border-radius: 0 12px 12px 0;
  margin-bottom: 18px;
}
.fw-current-task > span { display: block; font-size: 12px; color: var(--soft); margin-bottom: 6px; }
.fw-current-task strong { display: block; font-size: 14px; font-weight: 800; line-height: 1.65; color: var(--ink); }
.fw-current-task small { display: block; margin-top: 5px; font-size: 12px; color: var(--soft); }

/* ---------------- 录入卡底部：本局预览 + 快捷/撤销/提交 ---------------- */
.fw-entry-foot { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 12px; }
.fw-feedback { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.fw-preview { font-size: 13px; line-height: 1.5; font-weight: 700; color: var(--ink); }
.fw-status { font-size: 12px; line-height: 1.5; color: var(--green); }
.fw-status:empty { display: none; }
.fw-status.error { color: var(--fun-danger-ink); }
.fw-entry-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fw-entry-actions .fw-quicks { display: flex; flex-wrap: wrap; gap: 8px; }
.fw-entry-actions [data-action="undo"] { margin-left: auto; }
.fw-entry-actions .fw-button.primary { min-width: 150px; min-height: 44px; font-size: 15px; }

/* 快捷按钮：小白卡 + hover 上浮；danger 为炸单红 */
.fw-quicks { display: flex; flex-wrap: wrap; gap: 8px; }
.fw-quick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  font-size: 12px !important;
  font-weight: 700;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.fw-quick:hover {
  transform: translateY(-1px);
  border-color: rgba(99, 159, 112, 0.5);
  background: #ffffff;
  box-shadow: 0 6px 14px rgba(47, 86, 54, 0.1);
}
.fw-quick img { width: 26px; height: 26px; object-fit: contain; }
.fw-quick.danger { border-color: rgba(239, 111, 142, 0.5); color: var(--fun-danger-ink); background: #fff5f7; }
.fw-quick.danger:hover { border-color: var(--fun-danger); background: #fdeef3; box-shadow: 0 6px 14px rgba(199, 67, 108, 0.14); }
.fw-quick.rare { border-color: rgba(217, 162, 39, 0.5); background: #fffdf4; }

/* ---------------- 图片棋盘（大富翁游乐园 / 约会大作战） ---------------- */
.fw-map-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 40px; margin-bottom: 8px; }
.fw-map-toolbar strong { font-size: 14px; font-weight: 800; }
.fw-overlay[data-entry="LL005"] .fw-stage, .fw-overlay[data-entry="LL007"] .fw-stage { display: flex; flex-direction: column; overflow: hidden; }
.fw-map-scroll { flex: 1; min-height: 0; overflow: auto; display: flex; align-items: flex-start; justify-content: center; container-type: size; }
.fw-map { position: relative; flex-shrink: 0; }
.fw-map.park { width: min(100cqw, calc(100cqh * .9434)); }
.fw-map.date { width: min(100cqw, calc(100cqh * 1.3185)); }
.fw-map > img { display: block; width: 100%; height: auto; border-radius: 12px; }
.fw-map-scroll.zoomed { justify-content: flex-start; }
.fw-map-scroll.zoomed .fw-map { width: 100%; min-width: 780px; }
.fw-map-cell {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 13%;
  height: 13%;
  border: 2px solid transparent;
  border-radius: 8px;
  color: transparent;
  background: transparent;
  transition: box-shadow 0.18s, border-color 0.18s;
}
.fw-map.date .fw-map-cell { width: 11.4%; height: 14.8%; }
.fw-map-cell:hover, .fw-map-cell:focus-visible { border-color: var(--green); color: var(--green-dark); }
.fw-map-cell span { position: absolute; left: 2px; top: 1px; font-size: 10px; font-weight: 800; }
.fw-map-cell.passed { box-shadow: inset 0 0 0 2px rgba(99, 159, 112, 0.55); background: rgba(99, 159, 112, 0.1); }
.fw-map-cell.current {
  color: #fff;
  border: 3px solid #35744a;
  background: rgba(53, 116, 74, 0.1);
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px #35744a;
}
.fw-map-cell.current span { background: #35744a; padding: 2px 5px; left: -3px; top: -3px; border-radius: 4px; }
.fw-map-detail { flex-shrink: 0; min-height: 36px; margin-top: 10px !important; font-size: 13px; line-height: 1.65; color: var(--muted); }

/* ---------------- 展柜（展柜消消乐） ---------------- */
.fw-rack-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(210px, .95fr) minmax(220px, 1fr); gap: 24px; }
.fw-cabinet { min-width: 0; overflow-y: auto; }
.fw-slots {
  display: grid;
  grid-template-columns: repeat(var(--rack-cols, 3), minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  background: var(--fun-badge-2);
  border: 1px solid rgba(99, 159, 112, 0.28);
  border-radius: 16px;
}
.fw-slot {
  aspect-ratio: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid rgba(99, 159, 112, 0.2);
  box-shadow: 0 1px 3px rgba(47, 86, 54, 0.05);
  overflow: hidden;
  padding: 6px;
}
.fw-slot.filled { border-color: rgba(99, 159, 112, 0.45); background: #f6fbf4; }
.fw-slot img { width: 65%; height: 65%; object-fit: contain; }
.fw-slot > span:not(.fw-slot-number) { font-size: 11px; text-align: center; line-height: 1.3; max-width: 100%; overflow-wrap: anywhere; }
.fw-slot-number { font-size: 18px; color: #a9c2ae; font-variant-numeric: tabular-nums; }
.fw-rack-warning { color: var(--fun-warn-ink); font-size: 12px; line-height: 1.65; margin-top: 12px !important; }
.fw-library { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
/* 搜索框：主站同款胶囊 + focus-within 外发光环 */
.fw-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1.5px solid rgba(63, 128, 84, 0.2);
  border-radius: 999px;
  padding: 0 14px;
  flex-shrink: 0;
  box-shadow: 0 2px 14px rgba(47, 86, 54, 0.06);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.fw-search:focus-within {
  border-color: rgba(63, 128, 84, 0.65);
  box-shadow: var(--fun-focus-ring), 0 8px 22px rgba(47, 86, 54, 0.12);
}
.fw-search svg { color: var(--soft); }
.fw-search input { border: 0; min-width: 0; width: 100%; height: 38px; background: transparent; color: var(--ink); outline: none; }
.fw-search input::placeholder { color: var(--soft); }
.fw-library-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); align-content: start; gap: 8px; overflow: auto; margin-top: 12px; padding: 2px; min-height: 0; }
.fw-library-items button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(99, 159, 112, 0.18);
  border-radius: 12px;
  color: var(--ink);
  min-height: 100px;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.fw-library-items button:hover {
  border-color: var(--green);
  background: rgba(99, 159, 112, 0.09);
  box-shadow: 0 6px 14px rgba(47, 86, 54, 0.1);
}
.fw-library-items img { width: 45px; height: 45px; object-fit: contain; }
.fw-library-items button > span { font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }

/* ---------------- 本局草稿 ---------------- */
.fw-draft { margin-top: 18px; }
.fw-draft > .fw-field { margin-block: 12px; }
.fw-draft-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 0; border-bottom: 1px solid #e3efe4; font-size: 12px; }
.fw-draft-item > span { min-width: 0; overflow-wrap: anywhere; }
.fw-draft-item > div { display: flex; gap: 4px; align-items: center; flex-shrink: 0; }
.fw-draft-item b { display: block; min-width: 25px; text-align: center; font-variant-numeric: tabular-nums; }
.fw-draft-item button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--green-dark);
  transition: border-color 0.2s, background 0.2s;
}
.fw-draft-item button:hover { border-color: var(--green); background: var(--fun-badge-2); }
.fw-empty { color: var(--soft); font-size: 13px; line-height: 1.6; padding: 12px 0; }

/* ---------------- 分区5：进度记录卡 ---------------- */
.fw-records {
  padding: 16px 20px;
  background: var(--fun-card);
  border: 1px solid var(--fun-card-border);
  border-radius: 18px;
  box-shadow: var(--fun-card-shadow);
}
.fw-record {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 14px 14px;
  border-bottom: 1px solid var(--line);
  border-radius: 12px;
  transition: background 0.2s;
}
.fw-record:hover { background: rgba(99, 159, 112, 0.09); }
.fw-record-index {
  width: 28px;
  min-height: 28px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--fun-badge);
  color: #35744a;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.fw-record-body { min-width: 0; flex: 1; }
.fw-record-body > strong { font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }
.fw-record-deltas { display: flex; flex-wrap: wrap; gap: 10px; margin: 7px 0; color: var(--green); font-size: 13px; font-weight: 600; }
/* 结构化明细格（如古老的符号：带出金额 / 带出数字 / 被消除 / 留下） */
.fw-record-cells { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 8px 0; }
.fw-record-cells > div { min-width: 0; padding: 8px 12px; background: #f6fbf4; border: 1px solid var(--line); border-radius: 10px; }
.fw-record-cells span { display: block; font-size: 11px; color: var(--soft); margin-bottom: 3px; }
.fw-record-cells b { font-size: 14px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
/* 炸单行：淡红底 + 红色序号与标题 */
.fw-record-boom { background: #fdf3f5; }
.fw-record-boom:hover { background: #fcebee; }
.fw-record-boom .fw-record-index { background: #fbdfe6; color: var(--fun-danger-ink); }
.fw-record-boom .fw-record-body > strong { color: var(--fun-danger-ink); }
.fw-record-body details, .fw-rules-body details { font-size: 12px; color: var(--soft); line-height: 1.8; }
.fw-overlay summary { cursor: pointer; }
.fw-record-tools { display: flex; gap: 8px; }
.fw-record-tools button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--soft);
  border-radius: 999px;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.fw-record-tools button:hover { color: var(--green-dark); border-color: rgba(99, 159, 112, 0.5); background: var(--fun-badge-2); }
.fw-record-tools button[data-delete]:hover { color: var(--fun-danger-ink); border-color: rgba(239, 111, 142, 0.5); background: #fdeef3; }

/* ---------------- 规则卡：折叠在页面最底 ---------------- */
.fw-rules {
  padding: 14px 20px;
  background: var(--fun-card);
  border: 1px solid var(--fun-card-border);
  border-radius: 18px;
  box-shadow: var(--fun-card-shadow);
}
.fw-rules > summary { font-size: 15px; font-weight: 800; color: var(--ink); line-height: 1.6; }
.fw-rules-body { margin-top: 12px; max-width: 950px; line-height: 1.9; }
.fw-rules-body h3 { font-size: 14px; margin: 14px 0 6px; color: var(--muted); }
.fw-rules-body li { margin: 10px 0; font-size: 13px; color: var(--muted); }

/* ---------------- 纯数字单子（无棋盘）：明细并入保底进度卡 ---------------- */
.fw-breakdown p { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; padding: 12px 0; border-bottom: 1px solid #e3efe4; font-size: 13px; }
.fw-breakdown span { color: var(--soft); flex-shrink: 0; }
.fw-breakdown b { text-align: right; font-weight: 600; overflow-wrap: anywhere; }

/* ---------------- 工作区内嵌的共享棋盘 ---------------- */
.fw-stage .fc-board { max-width: 760px; margin: 0 auto; }
.fw-stage .fc-board-field { margin: 0; }
.fw-stage .fc-cell { border-radius: 6px; }
.fw-stage .fc-cell.pending { outline: 3px solid var(--green); outline-offset: -3px; }
.fw-stage .fc-board-head { margin-bottom: 14px; }
.fw-stage .fc-board.letter-board { margin-top: 24px; }
.fw-stage .fc-board.letter-board .fc-cell-letter { font-size: 20px; }
.fw-stage .fc-board.letter-board button:disabled { opacity: 1; }

/* 五子棋工具条 */
.fw-stone-tools { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; font-size: 13px; }
.fw-stone-tools .fw-button.armed { color: #ffffff; border-color: var(--fun-danger); background: var(--fun-danger); }
.fw-stone-help { flex-basis: 100%; font-size: 12px; color: var(--soft); }
.fw-stone-help summary { cursor: pointer; font-weight: 700; color: var(--green-dark); }
.fw-stone-help ol { margin: 8px 0 0; padding-left: 20px; line-height: 1.8; }
.fw-stone-tools select { height: 36px; border: 1px solid rgba(99, 159, 112, 0.3); border-radius: 999px; padding: 4px 10px; background: #ffffff; color: var(--ink); }

/* 干员通缉令：字母选择 */
.fw-letter-group { margin-bottom: 16px; }
.fw-letter-group strong { display: block; font-size: 12px; margin-bottom: 8px; overflow-wrap: anywhere; }
.fw-letter-group label { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12px; color: var(--muted); }
.fw-letter-group input {
  min-width: 0;
  width: 100%;
  max-width: 180px;
  border: 1px solid rgba(99, 159, 112, 0.3);
  border-radius: 10px;
  padding: 6px 10px;
  height: 34px;
  background: #ffffff;
  color: var(--ink);
}
.fw-letter-group > div { display: flex; gap: 6px; flex-wrap: wrap; }
.fw-letter-group button {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(99, 159, 112, 0.3);
  color: var(--ink);
  background: #ffffff;
  border-radius: 10px;
  font-weight: 700;
  transition: border-color 0.15s, background 0.15s;
}
.fw-letter-group button[aria-pressed="true"] { background: var(--fun-badge); color: #2f5636; border-color: var(--green); opacity: 1; }

/* ---------------- 弹窗层 ---------------- */
.fw-dialog-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(235, 244, 234, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.fw-dialog {
  width: min(540px, 100%);
  max-height: 85%;
  overflow: auto;
  border-radius: 22px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--fun-card-border);
  box-shadow: 0 24px 70px rgba(47, 86, 54, 0.22);
}
.fw-dialog p { font-size: 14px; line-height: 1.8; color: var(--soft); }
.fw-dialog p b { color: var(--fun-warn-ink); }
.fw-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

/* ---------------- 玩法选择面板（入口不带单号时先选玩法） ---------------- */
.fw-picker {
  position: relative;
  width: min(720px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 22px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--fun-card-border);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(47, 86, 54, 0.22);
}
.fw-picker-heading { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
.fw-picker-note { font-size: 12px; font-weight: 400; color: var(--fun-warn-ink); }
.fw-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
.fw-picker-grid button {
  min-height: 52px;
  padding: 10px 14px;
  border: 1px solid rgba(99, 159, 112, 0.24);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--green-dark);
  font-weight: 700;
  line-height: 1.4;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.fw-picker-grid button:hover {
  transform: translateY(-1px);
  border-color: rgba(99, 159, 112, 0.55);
  background: var(--fun-badge-2);
  box-shadow: 0 6px 14px rgba(47, 86, 54, 0.1);
}

/* 链接分享行：导出弹窗底部 */
.fw-share-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.6;
  color: var(--soft);
}
.fw-share-row .fw-button { flex-shrink: 0; }

/* 实时同步弹窗 */
.fw-live-field { margin-top: 16px; }
.fw-dialog p.fw-live-hint { margin-top: 8px; font-size: 12px; }
.fw-live-link { display: flex; gap: 10px; align-items: center; }
.fw-live-link input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
}
.fw-dialog p.fw-live-role { margin: 14px 0 4px; }
.fw-dialog p.fw-live-role b { color: var(--green-dark); }
.fw-live-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.6;
  color: var(--soft);
}
.fw-live-foot .fw-button { color: var(--fun-danger-ink); border-color: rgba(239, 111, 142, 0.34); }
.fw-live-foot .fw-button:hover { border-color: var(--fun-danger); background: #fff6f8; }
.fw-dialog p.fw-live-note { margin-top: 12px; font-size: 12px; color: var(--green); }
.fw-dialog p.fw-live-note:empty { display: none; }
.fw-dialog p.fw-live-note.error { color: var(--fun-danger-ink); }

/* 页面级轻提示（实时同步链接失效等，工作区未打开时使用） */
.fw-toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  z-index: 240;
  max-width: calc(100% - 32px);
  padding: 12px 20px;
  border: 1px solid rgba(99, 159, 112, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 32px rgba(47, 86, 54, 0.18);
  color: #2f4a35;
  font: 700 13px/1.5 "PingFang SC", "Microsoft YaHei", sans-serif;
  transform: translateX(-50%);
  animation: fw-toast-in 0.25s ease;
}
@keyframes fw-toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ---------------- 按单子导出 / 导入清单 ---------------- */
.fw-xorder-tip { font-size: 13px; color: var(--soft); line-height: 1.7; margin-bottom: 12px !important; }
.fw-xorder-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.fw-xorder-toolbar .fw-button { min-height: 34px; padding: 5px 14px; font-size: 12px; }
.fw-staff-count { color: var(--soft); font-size: 12px; }
.fw-staff-list { max-height: min(52vh, 460px); overflow-x: hidden; overflow-y: auto; margin-right: -6px; padding-right: 6px; }
.fw-dialog.fw-staff-dialog { display: flex; flex-direction: column; overflow: hidden; }
.fw-staff-dialog > * { flex-shrink: 0; }
.fw-staff-dialog > .fw-staff-list { flex: 1 1 auto; min-height: 150px; max-height: none; }
.fw-staff-list .fw-archive:first-child { padding-top: 4px; }
.fw-staff-tools { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.fw-staff-tools .fw-search { box-shadow: none; }
.fw-staff-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fw-staff-filters select {
  height: 34px;
  min-width: 0;
  max-width: 100%;
  border: 1px solid rgba(99, 159, 112, 0.3);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
  padding: 0 12px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.fw-staff-filters select:focus { outline: none; border-color: rgba(63, 128, 84, 0.65); box-shadow: var(--fun-focus-ring); }
.fw-staff-mine { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; padding: 0 4px; }
.fw-staff-mine input { width: 15px; height: 15px; accent-color: var(--green); cursor: pointer; }
.fw-staff-local { color: #3f6f9e; background: #e8f1fb; }
.fw-archive em { font-style: normal; }
.fw-archive em.fw-staff-old { color: var(--fun-warn-ink); font-weight: 700; }
.fw-staff-acts { display: flex; gap: 6px; flex-shrink: 0; }
.fw-archive .fw-staff-end { color: var(--soft); border-color: var(--line); font-weight: 600; }
.fw-archive .fw-staff-end:hover { color: var(--fun-danger-ink); border-color: rgba(239, 111, 142, 0.5); background: #fff6f8; }
.fw-archive .fw-staff-end.armed { color: #ffffff; border-color: var(--fun-danger); background: var(--fun-danger); }
.fw-archive .fw-staff-end:disabled { opacity: 0.6; cursor: wait; }
.fw-staff-more {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  border: 1px dashed rgba(99, 159, 112, 0.4);
  border-radius: 12px;
  background: transparent;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.fw-staff-more:hover { background: var(--fun-badge-2); }
.fw-staff-list .fw-empty { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.fw-staff-list .fw-empty .fw-button { min-height: 32px; padding: 4px 12px; font-size: 12px; }
.fw-xorder-count { font-size: 12px; color: var(--soft); font-variant-numeric: tabular-nums; }
.fw-xorder-list { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; padding: 2px; }
.fw-xorder {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.fw-xorder:hover { background: rgba(99, 159, 112, 0.09); border-color: rgba(99, 159, 112, 0.4); }
.fw-xorder input { width: 16px; height: 16px; accent-color: var(--green); flex-shrink: 0; cursor: pointer; }
.fw-xorder-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.fw-xorder-body strong { font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.fw-xorder-body > span { font-size: 11.5px; color: var(--soft); }
.fw-xorder-now, .fw-xorder-dup { margin-left: 8px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.fw-xorder-now { color: #35744a; background: var(--fun-badge); }
.fw-xorder-dup { color: var(--fun-warn-ink); background: #fdf3d7; }
.fw-archive { display: flex; justify-content: space-between; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--line); align-items: center; font-size: 12px; }
.fw-archive > div { min-width: 0; overflow-wrap: anywhere; }
.fw-archive strong { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 800; line-height: 1.5; }
.fw-archive span { color: var(--soft); line-height: 1.5; }
.fw-archive button {
  background: #ffffff;
  border: 1px solid rgba(99, 159, 112, 0.34);
  color: var(--green-dark);
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  flex-shrink: 0;
  transition: border-color 0.2s, background 0.2s;
}
.fw-archive button:hover { border-color: var(--green); background: var(--fun-badge-2); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1100px) {
  .fw-play { grid-template-columns: minmax(0, 1fr) 330px; }
  .fw-stage { padding: 14px 16px; }
  .fw-rack-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .fw-cabinet { overflow: visible; }
  .fw-slots { max-width: 360px; margin: 0 auto; }
  .fw-library-items { max-height: 320px; }
}
@media (max-width: 760px) {
  .fw-overlay { padding: 0; }
  .fw-window { height: 100dvh; width: 100%; border: 0; border-radius: 0; }
  /* 头部功能按钮在手机端收进省略号菜单（点击后以文字列表出现），只保留关闭按钮 */
  .fw-header { min-height: 52px; padding: 8px 14px; gap: 6px; flex-wrap: nowrap; }
  .fw-heading { gap: 6px; flex: 1; min-width: 0; }
  .fw-heading h2 { font-size: 16px; min-width: 0; }
  .fw-heading select { width: 100%; max-width: 140px; }
  .fw-header-actions { gap: 6px; flex-wrap: nowrap; }
  .fw-header-actions > .fw-button { display: none; }
  .fw-header-actions > .fw-more { display: inline-flex; width: 44px; min-height: 44px; padding: 8px; }
  .fw-header-actions > .fw-button[data-action="close"] { display: inline-flex; width: 44px; padding: 8px; }
  .fw-header-actions > .fw-button[data-action="close"] span { display: none; }
  /* 客服列表：iOS 输入框小于 16px 会自动放大页面；筛选下拉两两一行，按钮竖排在右侧以多显示几单 */
  .fw-staff-tools .fw-search input, .fw-staff-filters select { font-size: 16px; }
  .fw-staff-filters select { flex: 1 1 calc(50% - 8px); height: 38px; }
  .fw-staff-list .fw-archive { gap: 10px; padding: 12px 0; }
  .fw-staff-acts { flex-direction: column; }
  .fw-staff-acts button { padding: 6px 14px; }
  .fw-button { min-height: 44px; }
  .fw-button.icon { width: 44px; }
  .fw-orderbar { margin: -12px -12px 0; padding: 8px 14px; gap: 8px; }
  .fw-pack { flex: 1 1 calc(50% - 8px); align-items: center; padding: 8px 10px; }
  .fw-order-note { flex-basis: 100%; }
  .fw-order-date, .fw-save-state { display: none; }
  .fw-live-chip { height: 36px; }
  .fw-live-link input { height: 44px; font-size: 16px; }
  .fw-live-foot { flex-wrap: wrap; }
  .fw-body { padding: 12px 12px 18px; gap: 12px; }
  .fw-play { display: block; }
  .fw-stage { position: static; height: auto; overflow: visible; padding: 14px; margin-bottom: 12px; }
  .fw-entry { padding: 16px 14px; }
  .fw-total strong { font-size: 21px; }
  .fw-total small { font-size: 12px; }
  .fw-summary-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fw-record-cells { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fw-map-scroll { min-height: 0; flex: none; overflow: auto; container-type: inline-size; }
  .fw-map.park, .fw-map.date { width: 100%; }
  .fw-map-scroll.zoomed .fw-map { min-width: 680px; }
  .fw-map-cell { min-height: 32px; }
  .fw-map-detail { font-size: 12px; }
  .fw-rack-layout { grid-template-columns: 1fr; }
  .fw-slots { max-width: 420px; }
  .fw-library-items { max-height: 260px; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
  .fw-form { gap: 14px 12px; }
  .fw-field input, .fw-field select { height: 44px; font-size: 16px; }
  .fw-entry-actions { gap: 8px; }
  .fw-entry-actions .fw-button.primary { flex: 1; min-width: 0; }
  /* .fw-body 是滚动容器，弹窗层改用 fixed 才能始终盖住可视区 */
  .fw-dialog-layer { position: fixed; }
  .fw-picker-overlay { padding: 16px; }
  .fw-picker { padding: 16px; border-radius: 18px; max-height: calc(100dvh - 32px); }
  .fw-picker-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
  .fw-picker-grid button { min-height: 48px; padding: 8px 10px; font-size: 13px; }
  .fw-preview { font-size: 12px; }
  .fw-draft-item button { width: 40px; height: 40px; }
  .fw-records, .fw-rules { padding: 14px; }
  .fw-record { gap: 8px; }
  .fw-record-tools { flex-direction: column; }
  .fw-record-tools button { width: 40px; height: 40px; }
  .fw-breakdown p { gap: 12px; font-size: 12px; }
  .fw-stage .fc-board.letter-board { --fc-board-cols: 7 !important; }
  .fw-letter-group button { width: 40px; height: 40px; }
}

/* ---------------- 棋盘工作区：舞台列留给方形棋盘，滚动时吸顶 ---------------- */
.fw-board-workspace .fw-window { width: min(1680px, 100%); }
.fw-board-workspace .fw-stage { padding: 12px 14px; overflow: hidden; }
.fw-board-workspace .fc-board-head { flex-shrink: 0; align-items: center; flex-wrap: wrap; margin-bottom: 10px; min-height: 40px; font-size: 13px; }
.fw-board-controls { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.fw-board-scale { width: 42px; text-align: center; font-size: 12px; color: var(--soft); font-variant-numeric: tabular-nums; }
.fw-board-viewport { flex: 1; min-height: 0; min-width: 0; overflow: auto; container-type: size; overscroll-behavior: contain; }
.fw-board-workspace .fw-board-viewport .fc-board {
  width: min(100cqw, 100cqh);
  height: min(100cqw, 100cqh);
  max-width: none;
  margin: 0 auto;
  border-radius: 12px;
  grid-template-rows: repeat(var(--fc-board-cols, 10), minmax(0, 1fr));
}
.fw-board-workspace .fw-board-viewport.enlarged .fc-board { width: var(--board-zoom-width); height: var(--board-zoom-width); }
.fw-board-workspace .fc-board .fc-cell { min-height: 0; min-width: 0; aspect-ratio: auto; }
.fw-board-workspace .fw-stone-tools { margin: 18px 0 0; gap: 10px; }
.fw-board-workspace .fc-board.monopoly-board { gap: 4px; padding: 6px; background: rgba(233, 244, 232, 0.85); border-color: rgba(99, 159, 112, 0.28); }
.fw-board-workspace .fc-board.monopoly-board .fc-cell { padding: 3px; border-radius: 6px; }
.fw-board-workspace .fc-board.monopoly-board .fc-cell-name { font-size: 12px; line-height: 1.25; white-space: normal; overflow-wrap: anywhere; }
.fw-board-workspace .fc-board.monopoly-board .fc-cell-sub { font-size: 10px; }
.fw-board-workspace .fc-board-center { min-width: 0; min-height: 0; padding: 12px; border-radius: 12px; overflow: auto; border-color: rgba(99, 159, 112, 0.3); }
.fw-board-workspace .fc-center-rows { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fw-board-workspace .fc-center-row { min-width: 0; flex-wrap: wrap; gap: 2px 8px; }
.fw-board-workspace .fc-center-row b { overflow-wrap: anywhere; }
.fw-board-workspace[data-entry="LL016"] .fc-cell-icon { width: 78%; max-height: 72%; object-fit: contain; }
.fw-board-workspace[data-entry="LL016"] .fc-cell-no { position: absolute; top: 2px; left: 2px; }
.fw-board-workspace[data-entry="LL016"] .fc-cell-name { font-size: 11px; }
.fw-board-focus .fw-play { grid-template-columns: minmax(0, 1fr); }
.fw-board-focus .fw-entry { display: none; }
.fw-board-focus .fw-stage { position: static; height: calc(100dvh - 220px); }
.fw-board-focus [data-action="board-focus"] { color: var(--green-dark); background: var(--fun-badge); border-color: var(--green); }

/* 纯舞台模式（干员通缉令字母板）：只留棋盘与进度卡 */
.fw-solo-stage .fw-play { display: block; }
.fw-solo-stage .fw-entry, .fw-solo-stage .fw-records { display: none; }

/* ---------------- 点按计数（拯救老板等）：点一下加/减对应进度，文字在按钮里 ---------------- */
.fw-tap { display: flex; gap: 8px; align-items: stretch; }
.fw-tap-main {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(99, 159, 112, 0.34);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--green-dark);
  text-align: left;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.fw-tap-main:hover { border-color: var(--green); background: var(--fun-badge); box-shadow: 0 6px 14px rgba(47, 86, 54, 0.1); }
.fw-tap-main:active { transform: scale(0.97); }
.fw-tap-main b { font-size: 13px; font-weight: 800; white-space: nowrap; }
.fw-tap-main small { font-size: 11px; color: var(--soft); white-space: nowrap; }
.fw-tap-count { margin-left: auto; font-style: normal; font-size: 12px; font-weight: 800; color: var(--soft); white-space: nowrap; }
.fw-tap-main.has-count .fw-tap-count { color: var(--green-dark); }
.fw-tap-minus {
  width: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  color: var(--soft);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.fw-tap-minus:hover { color: var(--fun-danger-ink); border-color: rgba(239, 111, 142, 0.5); background: #fff6f8; }
.fw-tap-minus:active { transform: scale(0.97); }

/* ---------------- 三角洲课程表：课程卡板 ---------------- */
.fw-course-empty { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; color: var(--soft); font-size: 13px; line-height: 1.7; }
.fw-course-day + .fw-course-day { margin-top: 14px; }
.fw-course-day h4 { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; font-weight: 800; color: var(--green-dark); }
.fw-course-daydone { font-size: 11px; color: #ffffff; background: var(--green); border-radius: 999px; padding: 1px 8px; }
.fw-course-daylock { font-size: 11px; font-weight: 700; color: var(--soft); }
.fw-course-day.is-locked { opacity: 0.62; }
.fw-course-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fw-course-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-height: 92px;
  padding: 12px 12px 10px;
  border: 1.5px solid rgba(99, 159, 112, 0.3);
  border-radius: 14px;
  background: linear-gradient(160deg, #ffffff, #f2f8f1);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 2px 8px rgba(47, 86, 54, 0.05);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.fw-course-card:hover { transform: translateY(-2px); border-color: rgba(99, 159, 112, 0.6); box-shadow: 0 8px 18px rgba(47, 86, 54, 0.12); }
.fw-course-card .fw-course-period { font-size: 10px; font-weight: 800; color: var(--soft); letter-spacing: 0.4px; }
.fw-course-card b { font-size: 14px; font-weight: 800; }
.fw-course-card small { font-size: 11px; color: var(--soft); line-height: 1.5; }
.fw-course-card em { margin-top: auto; font-style: normal; font-size: 12px; font-weight: 800; color: var(--green-dark); }
.fw-course-card.kind-auto { border-style: solid; background: linear-gradient(160deg, #ffffff, #eef5ff); border-color: rgba(96, 141, 214, 0.34); }
.fw-course-card.kind-auto em { color: #3f6bb5; }
.fw-course-card.kind-tea { border-style: dashed; }
.fw-course-card.done { background: var(--fun-primary); border-color: transparent; color: #ffffff; box-shadow: var(--fun-primary-shadow); }
.fw-course-card.done .fw-course-period, .fw-course-card.done small, .fw-course-card.done em { color: rgba(255, 255, 255, 0.88); }
.fw-course-card.locked { opacity: 0.55; }
.fw-course-card.locked:hover { transform: none; box-shadow: 0 2px 8px rgba(47, 86, 54, 0.05); }
.fw-course-foot { margin-top: 14px; }
.fw-course-hint { font-size: 12px; color: var(--soft); line-height: 1.6; }
.fw-course-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.fw-course-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 9px 12px;
  border: 1px solid rgba(99, 159, 112, 0.3);
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.fw-course-chip:hover { border-color: var(--green); }
.fw-course-chip.picked { border-color: var(--green); background: var(--fun-badge); }
.fw-course-chip b { font-size: 13px; font-weight: 800; }
.fw-course-chip small { font-size: 11px; color: var(--soft); }
.fw-course-red { margin-top: 14px; }

/* ---------------- 皇帝的毒药：互动卡板 ---------------- */
.fw-poison-tip { margin: -6px 0 12px; font-size: 12px; color: var(--soft); line-height: 1.6; }
.fw-poison-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.fw-poison-card {
  position: relative;
  aspect-ratio: 3 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(99, 159, 112, 0.32);
  border-radius: 12px;
  background: linear-gradient(160deg, #ffffff, #eef6ec);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(47, 86, 54, 0.06);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.fw-poison-card:hover { transform: translateY(-2px); border-color: rgba(99, 159, 112, 0.6); box-shadow: 0 8px 18px rgba(47, 86, 54, 0.12); }
.fw-poison-no { position: absolute; top: 6px; left: 8px; font-size: 11px; font-weight: 800; color: var(--soft); }
.fw-poison-face { font-size: 22px; font-weight: 900; }
.fw-poison-card.picked { border-color: var(--green); background: var(--fun-badge); box-shadow: 0 0 0 2px rgba(99, 159, 112, 0.35), 0 8px 18px rgba(47, 86, 54, 0.12); }
.fw-poison-card.picked .fw-poison-face::after { content: '毒'; color: var(--green-dark); font-size: 22px; font-weight: 900; }
.fw-poison-card.hidden-card { background: repeating-linear-gradient(135deg, #dcebdd, #dcebdd 8px, #cfe2d0 8px, #cfe2d0 16px); border-style: dashed; }
.fw-poison-card.hit { border-color: var(--fun-danger); background: #fdeef3; }
.fw-poison-card.hit .fw-poison-face { color: var(--fun-danger-ink); }
.fw-poison-card.miss { border-color: var(--line); background: #f4f6f2; }
.fw-poison-card.miss .fw-poison-face { color: var(--soft); }
.fw-poison-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
@media (max-width: 760px) {
  .fw-poison-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------------- 冷宫：青石宫道 / 朱墙 / 宣纸奏折 ----------------
   所有工作区覆盖限定 LL102；地图仍使用原来的房间、墙体与迷雾状态。 */
.fw-overlay[data-entry="LL102"] {
  --palace-red: #c23b22;
  --palace-gold: #d4af37;
  --palace-bronze: #876b34;
  --palace-paper: #f8f1e3;
  --palace-serif: "STKaiti", "KaiTi", "SimSun", serif;
  font-family: var(--palace-serif);
  --ink: #1a1a1a;
  --muted: #514a3b;
  --soft: #6d6046;
  --line: #b9a47766;
  --green: #876b34;
  --green-dark: #53411f;
  --fun-primary: linear-gradient(160deg, #a83b2b, #79271f);
  --fun-primary-shadow: inset 0 2px 0 #ffffff33, inset 0 -2px 0 #46191266, 0 2px 4px #0000004d;
  --fun-card-border: #b9a477;
  --fun-badge: #e8ddbd;
  --fun-badge-2: #eee1c3;
  --fun-danger: #c23b22;
  --fun-danger-ink: #a13120;
  --fun-warn-ink: #8c3d23;
  --fun-focus-ring: 0 0 0 3px #876b3440;
}
.fw-overlay[data-entry="LL102"] .fw-backdrop {
  background: repeating-linear-gradient(91deg, #e3b47c05 0 1px, transparent 1px 8px),
    repeating-linear-gradient(88deg, transparent 0 28px, #120c0a30 29px 32px, transparent 34px 90px),
    linear-gradient(115deg, #482d27, #291c19 48%, #39241e);
}
.fw-overlay[data-entry="LL102"] .fw-window { border-radius: 8px; border-color: #b39a634d; background: #2b2420; box-shadow: 0 10px 30px #000000cc, inset 0 1px #e3bd7730; }
.fw-overlay[data-entry="LL102"] .fw-header { padding-block: 14px; background: linear-gradient(180deg, #352b25, #29231f); border-bottom: 1px solid #b39a6329; }
.fw-overlay[data-entry="LL102"] .fw-heading { font-family: var(--palace-serif); }
.fw-overlay[data-entry="LL102"] .fw-heading h2 { color: #ead9b4; font-weight: 500; text-shadow: 0 2px 3px #a7823038; }
.fw-overlay[data-entry="LL102"] .fw-heading select option { color: #1a1a1a; background: #f8f1e3; }
.fw-overlay[data-entry="LL102"] .fw-body {
  background: repeating-linear-gradient(92deg, #d2af7803 0 1px, transparent 1px 7px), linear-gradient(115deg, #2d2722, #211e1c 55%, #2b2420);
}
.fw-overlay[data-entry="LL102"] .fw-orderbar { padding-block: 14px; gap: 14px 18px; background: transparent; border-color: #b39a6329; color: #c8bca4; }
.fw-overlay[data-entry="LL102"] :is(.fw-order-date, .fw-save-state) { color: #b3a994; }
.fw-overlay[data-entry="LL102"] :is(.fw-button, .fw-pack, .fw-quick) {
  border-radius: 5px; border-color: transparent; background: transparent; box-shadow: none;
}
.fw-overlay[data-entry="LL102"] :is(.fw-header, .fw-orderbar) .fw-button { color: #d6c7a8; }
.fw-overlay[data-entry="LL102"] :is(.fw-header, .fw-orderbar) .fw-button:hover { background: #d4af370c; color: #f4dfac; box-shadow: 0 4px 12px #00000020; transform: none; }
.fw-overlay[data-entry="LL102"] .fw-pack { padding: 9px 18px; border-radius: 2px; color: #c8bca4; }
.fw-overlay[data-entry="LL102"] .fw-pack strong { font: 500 16px/1.4 var(--palace-serif); }
.fw-overlay[data-entry="LL102"] .fw-pack span { color: #b5aa96; }
.fw-overlay[data-entry="LL102"] .fw-pack:hover { background: #d4af3709; transform: none; }
.fw-overlay[data-entry="LL102"] .fw-pack.active { background: linear-gradient(0deg, #d4af3715, transparent); color: #f0d593; box-shadow: inset 0 -1px #d4af3799; }
.fw-overlay[data-entry="LL102"] .fw-pack.active span { color: #d8c49c; }
.fw-overlay[data-entry="LL102"] .fw-pack.active:disabled { opacity: 1; }
.fw-overlay[data-entry="LL102"] :is(.fw-button.primary, .fw-quick.danger) {
  background: var(--fun-primary); background-color: #852c22; color: #fff0cf; border: 1px solid #68251d;
  border-radius: 5px; box-shadow: var(--fun-primary-shadow); font-family: var(--palace-serif);
  transition: background-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.fw-overlay[data-entry="LL102"] :is(.fw-button.primary, .fw-quick.danger):hover { background: #9a3527; box-shadow: inset 0 2px 0 #ffffff33, inset 0 -2px 0 #46191266, 0 4px 8px #0000004d; transform: none; filter: none; }
.fw-overlay[data-entry="LL102"] :is(.fw-button.primary, .fw-quick.danger):active { transform: translateY(1px); box-shadow: inset 0 2px 3px #46191266, 0 1px 2px #00000040; }
.fw-overlay[data-entry="LL102"] .fw-quick.danger { font-size: 13px !important; font-weight: 500; }
.fw-overlay[data-entry="LL102"] .fw-quick.danger img { width: 19px; height: 19px; filter: brightness(0) invert(1); opacity: .8; }
.fw-overlay[data-entry="LL102"] .fw-more-menu { background: #f8f1e3; border-color: #b39a634d; box-shadow: 0 12px 30px #00000040; }
.fw-overlay[data-entry="LL102"] :is(button, input, select, summary):focus-visible { outline: 2px solid #a77b24; outline-offset: 3px; }
.fw-overlay[data-entry="LL102"] .fw-stage { padding: 18px; border: none; border-radius: 0; background: transparent; box-shadow: none; }
.fw-overlay[data-entry="LL102"] .fw-entry {
  position: relative;
  margin-block: 8px;
  padding: 30px 28px;
  border: none;
  border-radius: 3px;
  background: repeating-linear-gradient(93deg, #876b3403 0 1px, transparent 1px 6px), linear-gradient(90deg, #ba9e6521, transparent 9%, transparent 92%, #ba9e651a), #f8f1e3;
  box-shadow: 0 16px 36px #00000030, inset 0 1px #fffaf1, inset 0 -1px #cab990;
}
/* 轴头不占用点击区域，也不覆盖只读状态的提示伪元素。 */
.fw-overlay[data-entry="LL102"] .fw-entry::after {
  content: ""; position: absolute; inset: -5px -6px; pointer-events: none; border-radius: 4px;
  background: linear-gradient(180deg, #8a7858, #494034 45%, #302b26 75%, #62533b) top / 100% 6px no-repeat,
    linear-gradient(180deg, #8a7858, #494034 45%, #302b26 75%, #62533b) bottom / 100% 6px no-repeat;
}
.fw-overlay[data-entry="LL102"] .fw-section-title h3 { font: 500 21px/1.4 var(--palace-serif); color: #735c32; text-shadow: 0 1px 2px #aa873921; }
.fw-overlay[data-entry="LL102"] .fw-entry-head { padding-bottom: 16px; margin-bottom: 22px; border-bottom: 1px solid #b9a47755; }
.fw-overlay[data-entry="LL102"] .fw-entry-title { display: flex; align-items: center; gap: 12px; }
.fw-overlay[data-entry="LL102"] .fw-entry-title::before {
  content: ""; flex: 0 0 21px; height: 25px; border-radius: 2px; transform: rotate(-3deg);
  background: linear-gradient(90deg, transparent 42%, #f8f1e3bb 42% 49%, transparent 49%) center / 11px 15px no-repeat,
    repeating-linear-gradient(0deg, transparent 0 4px, #f8f1e3bb 4px 5px) center / 12px 15px no-repeat, #a43d2c;
  box-shadow: inset 0 0 0 2px #a43d2c, inset 0 0 0 3px #f8f1e377, 0 1px 2px #6b2d1926;
}
.fw-overlay[data-entry="LL102"] .fw-form { gap: 22px; }
.fw-overlay[data-entry="LL102"] .fw-field { gap: 5px; }
.fw-overlay[data-entry="LL102"] .fw-field > span { font-weight: 500; line-height: 1.8; }
.fw-overlay[data-entry="LL102"] .fw-field:has([data-f="special"]) { grid-column: 1 / -1; }
.fw-overlay[data-entry="LL102"] .fw-field:has([data-f="red"]) { grid-column: 1 / -1; }
.fw-overlay[data-entry="LL102"] .fw-field:has([data-f="special"]) > span { color: #a13120; }
.fw-overlay[data-entry="LL102"] .fw-field :is(input, select) {
  width: 55%; min-width: 140px; max-width: 100%; height: 46px; padding: 6px 12px; border: none; border-bottom: 1px solid #923d2c99;
  border-radius: 0; background: transparent; color: #1a1a1a; box-shadow: none; font-size: 23px; font-family: var(--palace-serif);
}
.fw-overlay[data-entry="LL102"] .fw-field :is(input, select):focus { border-bottom-color: #923d2c; box-shadow: 0 1px 0 #923d2c; outline: none; }
.fw-overlay[data-entry="LL102"] .fw-money { color: #765925; }
.fw-overlay[data-entry="LL102"] .fw-entry-foot { margin-top: 24px; padding-top: 18px; border-top: 1px solid #b9a47740; gap: 20px; }
.fw-overlay[data-entry="LL102"] .fw-preview { font-weight: 500; line-height: 1.8; }
.fw-overlay[data-entry="LL102"] .fw-entry-actions .fw-button.primary { flex: 1; }
.fw-overlay[data-entry="LL102"] .fw-entry-actions .fw-quicks { flex: 1 1 100%; }
.fw-overlay[data-entry="LL102"] .fw-entry-actions .fw-quick { min-height: 42px; padding-inline: 10px; }
.fw-overlay[data-entry="LL102"] .fw-entry-actions [data-action="undo"] { margin-left: 0; }
.fw-overlay[data-entry="LL102"] :is(.fw-summary, .fw-records, .fw-rules) {
  border: none; border-top: 1px solid #b9a47755; border-radius: 0; background: #f8f1e3; box-shadow: none;
}
.fw-overlay[data-entry="LL102"] .fw-summary-tiles > div { border: none; border-left: 1px solid #b9a477; border-radius: 0; background: transparent; box-shadow: none; }
.fw-overlay[data-entry="LL102"] .fw-total strong { color: #1a1a1a; background: none; }
.fw-overlay[data-entry="LL102"] .fw-progress [role="progressbar"] { background: #d9ccad; }
.fw-overlay[data-entry="LL102"] .fw-progress [role="progressbar"] span { background: linear-gradient(90deg, #876b34, #d4af37); }
.fw-overlay[data-entry="LL102"] .fw-complete { color: #233d37; border-radius: 3px; }
.fw-maze { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.fw-overlay[data-entry="LL102"] .fw-maze .fw-section-title { flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.fw-overlay[data-entry="LL102"] .fw-maze h3 { display: flex; align-items: center; gap: 12px; color: #dfcca0; font-size: 25px; text-shadow: 0 2px 5px #d4af3721; }
.fw-maze h3::before { content: ""; width: 13px; height: 19px; border: 1px solid #e4ab7b80; background: #a33325; box-shadow: inset 0 0 0 2px #a33325, inset 0 0 0 3px #e4ab7b55; border-radius: 2px; transform: rotate(-4deg); }
.fw-overlay[data-entry="LL102"] .fw-maze-mode { font: 500 14px/1.5 var(--palace-serif); color: #baa782; text-shadow: 0 1px 3px #d4af371a; }
.fw-overlay[data-entry="LL102"] .fw-maze-tip {
  margin: 0 0 18px; padding: 10px 14px; border-left: 1px solid #b39a6366;
  background: linear-gradient(90deg, #c9b2810d, transparent);
  font-size: 12px; color: #bcb3a1; line-height: 1.9;
}
.fw-maze-scroll {
  flex: 1; min-height: 0; overflow: auto; display: flex; padding: 12px;
  border: none; border-radius: 3px;
  background: repeating-linear-gradient(94deg, #c9b68904 0 1px, transparent 1px 9px), linear-gradient(135deg, #3d332766, #17120f33); container-type: size;
  box-shadow: inset 0 2px 18px #00000038;
}
.fw-maze-grid {
  display: grid; gap: 0; box-sizing: border-box; width: min(100cqw, 100cqh, 600px); aspect-ratio: 1; margin: auto;
  position: relative; isolation: isolate;
  border: 8px solid #462c25; border-radius: 2px; overflow: hidden;
  background: radial-gradient(ellipse at 40% 45%, #1a1f2b, #0c0f16 85%);
  box-shadow: 0 -2px 0 #a28e5966, 0 0 0 1px #b39a634d, 0 10px 30px #000000cc;
}
/* 整幅低频水墨纹理连续铺底，避免每个迷雾格生成独立色块。 */
.fw-maze.night .fw-maze-grid::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: .1;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 600'%3E%3Cfilter id='ink'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.008 .018' numOctaves='3' seed='7'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='600' height='600' filter='url(%23ink)' opacity='.65'/%3E%3C/svg%3E") center / 100% 100%;
  mix-blend-mode: screen;
  mask-image: radial-gradient(ellipse, #000000 25%, transparent 72%);
}
.fw-maze-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  padding: 0;
  --wall-thickness: clamp(6px, 19%, 15px);
  --east-wall: 0px;
  --south-wall: 0px;
  --wall-face: #692e2a;
  --wall-dark: #281917;
  --wall-e-shadow: inset 0 0 0 transparent;
  --wall-s-shadow: inset 0 0 0 transparent;
  border: 0 solid transparent;
  box-sizing: border-box;
  border-radius: 0;
  background: none;
  font: inherit;
}
/* 墙体用独立材质层占据真实阻挡边；不添加格子、不改变点击与通路。 */
.fw-maze-cell.wall-e { --east-wall: var(--wall-thickness); --wall-e-shadow: inset -3px 0 5px #00000066; }
.fw-maze-cell.wall-s { --south-wall: var(--wall-thickness); --wall-s-shadow: inset 0 -4px 6px #00000099; }
.fw-maze-cell.room {
  --stone: #7b8278; --stone-light: #868c7e;
  background:
    linear-gradient(180deg, #d4af3766 0 1px, transparent 1px) right top / var(--east-wall) 100% no-repeat,
    linear-gradient(90deg, #d4af374d 0 1px, #946350 1px 24%, var(--wall-face) 28% 70%, var(--wall-dark) 100%) right top / var(--east-wall) 100% no-repeat,
    linear-gradient(180deg, #d4af3766 0 1px, #946350 1px 24%, var(--wall-face) 28% 65%, var(--wall-dark) 100%) left bottom / 100% var(--south-wall) no-repeat,
    linear-gradient(45deg, #00000006 25%, transparent 25% 75%, #00000006 75%) 0 0 / 44px 22px,
    linear-gradient(45deg, #ffffff04 25%, transparent 25% 75%, #ffffff04 75%) 22px 11px / 44px 22px,
    linear-gradient(125deg, var(--stone-light), var(--stone));
  box-shadow: var(--wall-e-shadow), var(--wall-s-shadow);
}
.fw-maze-cell.room.visited::before {
  content: ""; position: absolute; width: 24%; height: 30%; left: 38%; top: 35%; pointer-events: none;
  background: radial-gradient(ellipse at 25% 32%, #4e454570 0 18%, transparent 23%), radial-gradient(ellipse at 76% 68%, #4e454570 0 18%, transparent 23%);
  transform: rotate(-25deg); opacity: .65;
}
.fw-maze-cell.start::after, .fw-maze-cell.exit::after {
  content: ""; position: absolute; inset: 10% 23% 22% 13%; pointer-events: none;
  border: 2px solid #ab8645; border-top-width: 4px;
  background: linear-gradient(90deg, transparent 46%, #171c17 47% 53%, transparent 54%), repeating-linear-gradient(90deg, #ffffff07 0 1px, transparent 1px 5px), linear-gradient(135deg, #714536, #412d26);
  box-shadow: 0 -3px 0 #3e4236, inset 2px 0 3px #ffd79a26, inset -3px -2px 4px #24151066;
  filter: drop-shadow(0 4px 6px #00000080);
}
.fw-maze-cell.start::after {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M11 15V10a5 5 0 0 1 10 0v5' fill='none' stroke='%23b19251' stroke-width='3'/%3E%3Crect x='7' y='14' width='18' height='12' rx='2' fill='%239b793c'/%3E%3Cpath d='M9 16h5m5 7h4' stroke='%23795032' stroke-width='2'/%3E%3Ccircle cx='16' cy='19' r='2' fill='%23312a21'/%3E%3Cpath d='M16 19v4' stroke='%23312a21' stroke-width='2'/%3E%3C/svg%3E") center / 70% 70% no-repeat,
    linear-gradient(90deg, #624638 47%, #302820 48% 52%, #624638 53%);
}
.fw-maze-cell.exit::after {
  border-color: #9a7c45;
  background: radial-gradient(circle at 35% 52%, #f1d888 0 1px, #b38a35 1px 3px, #311e1470 3px 4px, transparent 4px),
    radial-gradient(circle at 65% 52%, #f1d888 0 1px, #b38a35 1px 3px, #311e1470 3px 4px, transparent 4px),
    linear-gradient(90deg, transparent 47%, #241210 48% 52%, transparent 53%),
    repeating-linear-gradient(90deg, #18090718 0 1px, transparent 1px 7px),
    linear-gradient(135deg, #8b3b2e, #57231e);
}
.fw-maze-cell b {
  position: absolute;
  left: 50%;
  bottom: calc(var(--south-wall) + 2px);
  z-index: 3;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
  color: #d4b875;
  background: transparent;
  border: none;
  text-shadow: 0 0 5px #000000, 0 1px 1px #000000;
  filter: drop-shadow(0 4px 6px #00000080);
  padding: 1px 3px;
  font-family: var(--palace-serif);
  pointer-events: none;
  white-space: nowrap;
}
.fw-maze-cell.exit b { color: #ffe9b0; }
.fw-maze-guifei {
  position: relative; z-index: 4; width: 112%; min-width: 38px; max-width: 100px; aspect-ratio: 1; height: auto; overflow: visible;
  filter: drop-shadow(0 4px 6px #00000080); pointer-events: none;
}
/* 灯光只叠加颜色，不扩大 lit 判定，也不显示雾下门牌与墙向。 */
.fw-maze-cell:has(.fw-maze-guifei) { z-index: 3; }
.fw-maze-cell.room:has(.fw-maze-guifei)::before {
  width: auto; height: auto; inset: -135%; transform: none; opacity: 1;
  background: radial-gradient(ellipse at 55% 55%, #ffe4a178 0%, #efc87840 24%, #d9a9471c 46%, transparent 70%);
  border: none; border-radius: 50%; filter: blur(10px); pointer-events: none;
}
.fw-maze-cell:has(.fw-maze-guifei)::after { opacity: .2; }
.fw-maze-cell:has(.fw-maze-guifei) b { z-index: 5; }
.fw-maze-cell.room.can { cursor: pointer; }
.fw-maze-cell.room.can:hover { box-shadow: var(--wall-e-shadow), var(--wall-s-shadow), inset 0 0 16px #ffe2a04d; }
.fw-overlay[data-entry="LL102"] .fw-maze-cell:focus-visible { outline: 2px solid #fff0b5; outline-offset: -3px; z-index: 3; }
.fw-overlay[data-entry="LL102"] .fw-maze-foot {
  margin: 14px 0 0; padding: 12px 16px; border: none; border-top: 1px solid #b39a633b; border-radius: 2px;
  background: linear-gradient(180deg, #37322b80, #29262255);
  font: 500 15px/1.8 var(--palace-serif); font-variant-numeric: tabular-nums; color: #dfcca0;
  text-shadow: 0 -1px 0 #00000080; box-shadow: 0 3px 10px #00000012;
}
/* 黑夜档：迷雾 */
.fw-maze.night .fw-maze-scroll { background: repeating-linear-gradient(94deg, #c9b68904 0 1px, transparent 1px 9px), linear-gradient(135deg, #26222555, #17121033); }
.fw-maze.night .fw-maze-grid { border-color: #352820; }
.fw-maze.night .fw-maze-cell.lit.room { --stone: #586962; --stone-light: #69766c; --wall-face: #532c28; --wall-dark: #1f1817; }
.fw-maze.night .fw-maze-cell.dim.room { --stone: #4b5863a6; --stone-light: #58636cad; --wall-face: #322725; --wall-dark: #191717; }
.fw-maze.night .fw-maze-cell.dim.visited::before { opacity: .85; filter: brightness(1.8); }
.fw-maze.night .fw-maze-cell.fog { z-index: 1; background: transparent; border-color: transparent; box-shadow: none; }
.fw-maze.night .fw-maze-cell.fog::before {
  content: ""; position: absolute; inset: -4px;
  background: radial-gradient(ellipse, #1a1f2bf2 30%, #1a1f2bcc 65%, #1a1f2b00 100%); opacity: .85;
  box-shadow: 0 0 12px 4px #1a1f2bcc; filter: blur(4px); pointer-events: none;
}
.fw-maze.night .fw-maze-cell.room:has(.fw-maze-guifei)::before {
  inset: -190%;
  background: radial-gradient(ellipse, #ffe5a159 0%, #e8bd653b 22%, #d8a74414 48%, transparent 74%),
    radial-gradient(ellipse, #1a1f2b00 30%, #1a1f2b26 52%, #1a1f2b80 80%, #1a1f2b00 100%);
  box-shadow: 0 0 40px 20px #ffc86426;
  filter: blur(14px);
}
.fw-maze.night .fw-maze-cell.fog :is(b, svg), .fw-maze.night .fw-maze-cell.fog::after { visibility: hidden; }
@media (min-width: 761px) and (max-height: 600px) {
  .fw-overlay[data-entry="LL102"] .fw-stage { position: static; height: 620px; }
}
@media (max-width: 760px) {
  .fw-overlay[data-entry="LL102"] .fw-window { border-radius: 0; }
  .fw-overlay[data-entry="LL102"] .fw-stage { padding: 4px 0 12px; }
  .fw-overlay[data-entry="LL102"] .fw-entry { margin: 10px 8px 16px; padding: 22px 16px; }
  .fw-overlay[data-entry="LL102"] .fw-maze h3 { font-size: 21px; }
  .fw-overlay[data-entry="LL102"] .fw-maze-tip { padding: 9px 11px; }
  .fw-overlay[data-entry="LL102"] .fw-maze-foot { padding: 8px 10px; font-size: 13px; }
  .fw-overlay[data-entry="LL102"] .fw-header { padding-block: 8px; }
  .fw-overlay[data-entry="LL102"] .fw-pack { padding: 8px; }
  .fw-overlay[data-entry="LL102"] .fw-entry-actions .fw-quick { font-size: 13px; }
  .fw-maze-scroll { flex: none; padding: 8px; container-type: normal; }
  .fw-maze-grid { width: 100%; }
  .fw-maze-cell b { font-size: 9px; padding: 0 1px; }
}

/* ---------------- 展柜拖拽与动效 ---------------- */
.fw-cabinet { position: relative; }
.fw-library-items button { cursor: grab; user-select: none; }
.fw-library-items button:active { cursor: grabbing; }
.fw-library-items img, .fw-library-items svg { touch-action: none; user-select: none; -webkit-user-drag: none; }
.fw-drag-source { opacity: .4; }
.fw-slots { transition: border-color 0.15s, background-color 0.15s; }
.fw-slots.drag-over { border-color: var(--green); background: var(--fun-badge); }
.fw-slot.drop-target { outline: 3px solid var(--green); outline-offset: -3px; background: #f2f9f1; }
.fw-drag-ghost {
  position: fixed;
  z-index: 10;
  pointer-events: none;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -75%);
  background: #ffffff;
  border: 2px solid var(--green);
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(47, 86, 54, 0.2);
}
.fw-drag-ghost img { width: 52px; height: 52px; object-fit: contain; }
.fw-rack-effect { position: absolute; z-index: 2; width: 72px; height: 72px; margin: -36px; pointer-events: none; display: grid; place-items: center; animation: fw-effect-life .7s linear both; }
.fw-rack-effect b { position: relative; color: #2f5636; background: #f4fff8; padding: 2px 6px; border-radius: 6px; font-size: 19px; animation: fw-effect-count .65s ease-out both; }
.fw-rack-effect.cancel b { animation-delay: .18s; }
.fw-effect-ring { position: absolute; inset: 4px; border: 3px solid var(--green); border-radius: 50%; animation: fw-effect-ring .6s ease-out both; }
.fw-rack-effect.cancel .fw-effect-ring { border-color: var(--fun-danger); animation-delay: .14s; }
.fw-effect-item { position: absolute; inset: 4px; display: grid; place-items: center; animation: fw-effect-pair .44s ease-in both; }
.fw-effect-item img { width: 100%; height: 100%; object-fit: contain; }
.fw-effect-item.first { --pair-x: -32px; --pair-angle: -16deg; }
.fw-effect-item.second { --pair-x: 32px; --pair-angle: 16deg; }
@keyframes fw-effect-life { 0%, 90% { opacity: 1; } 100% { opacity: 0; } }
@keyframes fw-effect-pair { 0% { transform: translateX(var(--pair-x)) rotate(var(--pair-angle)) scale(.9); opacity: 1; } 50% { transform: translateX(0) rotate(0) scale(1.1); opacity: 1; } 100% { transform: scale(.1); opacity: 0; } }
@keyframes fw-effect-ring { 0% { transform: scale(.3); opacity: 0; } 25% { opacity: .85; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes fw-effect-count { 0% { opacity: 0; transform: translateY(4px) scale(.8); } 25%, 65% { opacity: 1; } 100% { opacity: 0; transform: translateY(-32px) scale(1); } }

@media (max-width: 1000px) and (min-width: 761px) {
  .fw-board-workspace .fw-play { grid-template-columns: minmax(0, 1fr) 330px; }
  .fw-board-workspace .fw-stage { padding: 10px; }
  .fw-board-workspace .fc-board-head { gap: 6px; }
  .fw-board-workspace .fc-center-rows { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .fw-board-workspace .fw-stage { height: auto; padding: 10px; }
  .fw-board-workspace .fw-board-viewport { flex: none; height: calc(100vw - 48px); max-height: 70dvh; }
  .fw-board-workspace .fc-board-head { font-size: 12px; gap: 4px; }
  .fw-board-controls { gap: 2px; }
  .fw-board-controls .fw-button.icon { width: 44px; min-height: 44px; }
  .fw-board-scale { width: 32px; font-size: 11px; }
  .fw-board-workspace .fc-center-rows { grid-template-columns: minmax(0, 1fr); }
  .fw-board-workspace .fc-center-pos { font-size: 18px; }
  .fw-board-workspace .fc-board-center { padding: 6px; }
  .fw-board-focus .fw-stage { height: calc(100dvh - 140px); }
  .fw-board-focus .fw-board-viewport { flex: 1; height: auto; max-height: none; }
}
@media (prefers-reduced-motion: reduce) { .fw-overlay * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
