/* ============================================================
   趣味单进度计算器（js/fun-calculator.js 配套样式）
   合并方式二选一：
     A. 把本文件放进站点 css/ 目录，在 index.html 里加一行 <link>
     B. 把本文件内容整段追加到站点 css/style.css 末尾
   样式自带颜色值（与主站同盘：#639f70 / #2f5636 / 半透明白卡 + 绿阴影），
   不读写 :root 变量，两种方式效果一致，也不会污染主站全局样式。
   ============================================================ */

/* 详情区入口按钮：视口固定，贴在“返回单名列表”下方；主站 pill 风格 */
.menu-detail-calc {
  position: fixed;
  top: 164px;
  right: max(46px, calc((100vw - 750px) / 2 + 14px));
  z-index: 96;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  color: #ffffff;
  background: linear-gradient(135deg, #5aa56f, #35744a);
  border: 1.5px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(53, 116, 74, 0.35);
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s;
}
.menu-detail-calc[hidden] { display: none; }
.menu-detail-calc:hover {
  filter: brightness(1.06);
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(53, 116, 74, 0.42);
}
.menu-detail-calc:focus-visible { outline: 3px solid rgba(99, 159, 112, 0.55); outline-offset: 2px; }
/* 详情长图滚出视口时，跟着“返回单名列表”一起隐藏（站点用 .controls-hidden 控制） */
.menu-panel.controls-hidden .menu-detail-calc { display: none; }

/* 弹层 */
.fun-calc {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}
.fun-calc[hidden] { display: none; }
.fun-calc-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(235, 244, 234, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.fun-calc-box {
  position: relative;
  width: min(1080px, 100%);
  max-height: min(88vh, 920px);
  display: flex;
  flex-direction: column;
  background: rgba(246, 251, 244, 0.96);
  border: 1px solid rgba(99, 159, 112, 0.24);
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(47, 86, 54, 0.2);
  overflow: hidden;
}
.fun-calc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  background: linear-gradient(135deg, #eef7ec, #d9f3df);
  border-bottom: 1px solid rgba(99, 159, 112, 0.22);
}
.fun-calc-eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: #67a374;
  letter-spacing: 0.5px;
}
/* 弹层标题：主站式渐变文字 */
.fun-calc-head h3 {
  margin-top: 3px;
  font-size: 21px;
  font-weight: 900;
  line-height: 1.2;
  background: linear-gradient(90deg, #67a374, #2f5636);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.fun-calc-close {
  flex: none;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 22px;
  line-height: 1;
  color: #52785b;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(99, 159, 112, 0.24);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.fun-calc-close:hover { background: #ffffff; color: #2f5636; box-shadow: 0 4px 12px rgba(47, 86, 54, 0.12); }

/* 两栏：左边档位+总览+录入，右边对局记录 */
.fun-calc-body {
  padding: 18px 24px 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 348px;
  gap: 22px;
  align-items: stretch;
}
.fun-calc-main { min-width: 0; }
.fun-calc-side {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 14px 14px 12px;
  background: #e9f4e8;
  border: 1px solid rgba(99, 159, 112, 0.22);
  border-radius: 18px;
}
.fun-calc-side .fun-calc-listwrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
/* 记录多时右栏自己滚，不带着左栏一起滚 */
.fun-calc-side .fun-calc-list {
  flex: 1 1 auto;
  min-height: 120px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  margin-bottom: 12px;
}
/* 右栏较窄：标题独占一行，增减标签换到第二行，避免标题被挤成一列一字 */
.fun-calc-side .fc-row-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 8px;
  align-items: start;
}
.fun-calc-side .fc-row-title { grid-column: 1; grid-row: 1; }
.fun-calc-side .fc-row-del { grid-column: 2; grid-row: 1; }
.fun-calc-side .fc-row-delta { grid-column: 1 / -1; grid-row: 2; }
.fun-calc-label {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 800;
  color: #52785b;
}

/* 档位 */
.fun-calc-packs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.fun-calc-pack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 6px;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(99, 159, 112, 0.22);
  border-radius: 14px;
  box-shadow: 0 1px 4px rgba(47, 86, 54, 0.05);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.fun-calc-pack strong { font-size: 19px; font-weight: 800; color: #2f5636; }
.fun-calc-pack span { font-size: 11.5px; color: #6d8a74; }
.fun-calc-pack:hover {
  border-color: rgba(99, 159, 112, 0.55);
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(47, 86, 54, 0.15);
}
.fun-calc-pack.active {
  background: linear-gradient(135deg, #5aa56f, #35744a);
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(53, 116, 74, 0.35);
}
.fun-calc-pack.active strong,
.fun-calc-pack.active span { color: #ffffff; }

/* 进度总览 */
.fun-calc-summary {
  padding: 16px 18px 14px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(99, 159, 112, 0.22);
  border-radius: 18px;
  box-shadow: 0 4px 18px rgba(47, 86, 54, 0.07);
}
.fc-sum-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
/* 大数字：主站式渐变文字 */
.fc-sum-num strong {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(90deg, #67a374, #2f5636);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.fc-sum-num i {
  font-style: normal;
  margin-left: 8px;
  font-size: 14px;
  color: #6d8a74;
  font-variant-numeric: tabular-nums;
}
.fc-sum-pct { font-size: 15px; font-weight: 800; color: #639f70; }
.fc-sum-bar {
  height: 10px;
  margin: 12px 0 14px;
  border-radius: 999px;
  background: #dcecdf;
  overflow: hidden;
}
.fc-sum-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7cc297, #c7e491);
  transition: width 0.35s ease;
}
.fc-sum-rows {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.fc-sum-rows > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px;
  background: #e9f4e8;
  border-radius: 12px;
}
.fc-sum-rows span { font-size: 11px; color: #6d8a74; }
.fc-sum-rows b { font-size: 15px; color: #2f4a35; font-variant-numeric: tabular-nums; }
.fc-sum-rows b.up { color: #35744a; }
.fc-sum-rows b.down { color: #c7436c; }
.fc-sum-rows b.warn { color: #8a6a14; }

/* 录入表单 */
.fun-calc-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.fc-field { display: flex; flex-direction: column; gap: 5px; }
.fc-field > span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: #52785b;
}
/* 收获金额右侧实时显示千分位精确值，避免看错位数 */
.fc-field-hint {
  font-style: normal;
  font-weight: 800;
  color: #9ab7a0;
  font-variant-numeric: tabular-nums;
}
.fc-field input,
.fc-field select {
  height: 40px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 14px;
  color: #2f4a35;
  background: #ffffff;
  border: 1px solid rgba(99, 159, 112, 0.3);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.fc-field input:focus,
.fc-field select:focus {
  border-color: rgba(63, 128, 84, 0.65);
  box-shadow: 0 0 0 5px rgba(63, 128, 84, 0.1);
}
.fc-check {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #435747;
  cursor: pointer;
}
.fc-check[hidden] { display: none; }
.fc-check input { width: 17px; height: 17px; accent-color: #639f70; cursor: pointer; }

/* 本局折算实时预览（改任一输入框都会重算） */
.fun-calc-preview {
  margin: 0 0 14px;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.6;
  color: #52785b;
  background: #e9f4e8;
  border: 1px dashed rgba(99, 159, 112, 0.4);
  border-radius: 12px;
}
.fun-calc-preview[hidden] { display: none; }

/* 进度构成明细 */
.fc-sum-break {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.fc-sum-break span {
  padding: 4px 9px;
  font-size: 11px;
  color: #6d8a74;
  background: #e9f4e8;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.fc-sum-break span b { color: #2f5636; font-weight: 800; }

.fun-calc-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
/* 主按钮：绿渐变 + 白字 + 绿阴影 + hover 上浮 */
.fun-calc-add {
  flex: none;
  min-height: 44px;
  padding: 0 22px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, #5aa56f, #35744a);
  border: none;
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(53, 116, 74, 0.35);
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.fun-calc-add:hover {
  filter: brightness(1.06);
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(53, 116, 74, 0.42);
}
.fun-calc-hint {
  flex-basis: 100%; /* 说明文字另起一行，给并排的按钮让出位置 */
  font-size: 11.5px;
  line-height: 1.6;
  color: #6d8a74;
}
.fun-calc-hint + .fun-calc-hint { margin-top: -5px; }

/* 快捷按钮：默认成组显示（稀有收集品）；带 .fc-inline 的与“添加本局”并排 */
.fun-calc-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
.fc-quick-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 15px 8px 11px;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(99, 159, 112, 0.22);
  border-radius: 14px;
  box-shadow: 0 1px 4px rgba(47, 86, 54, 0.05);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.fc-quick-icon {
  flex: none;
  width: 36px;
  height: 36px;
  object-fit: contain;
}
.fc-quick-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.fc-quick-btn strong { font-size: 13.5px; font-weight: 800; color: #2f4a35; }
.fc-quick-text span { font-size: 11px; color: #6d8a74; }
.fc-quick-btn:hover {
  transform: translateY(-3px);
  border-color: rgba(99, 159, 112, 0.5);
  box-shadow: 0 10px 24px rgba(47, 86, 54, 0.14);
}
/* 炸单：补偿计入保底，用粉色提示这是“坏消息”（替代死红） */
.fc-quick-btn.danger { border-color: rgba(239, 111, 142, 0.35); }
.fc-quick-btn.danger strong { color: #c7436c; }
.fc-quick-btn.danger .fc-quick-text span { color: #d68ba2; }
.fc-quick-btn.danger:hover {
  border-color: rgba(239, 111, 142, 0.6);
  background: #fdeef3;
  box-shadow: 0 6px 16px rgba(239, 111, 142, 0.18);
}
/* 稀有收集品：金色点缀 */
.fc-quick-btn.rare { border-color: rgba(217, 162, 39, 0.35); }
.fc-quick-btn.rare strong { color: #8a6a14; }
.fc-quick-btn.rare .fc-quick-text span { color: #b3963f; }
.fc-quick-btn.rare:hover {
  border-color: rgba(217, 162, 39, 0.6);
  background: #fdf8ec;
  box-shadow: 0 6px 16px rgba(217, 162, 39, 0.18);
}
/* 内联变体：与“添加本局”同排、同高，图标缩小、文字单行 */
.fc-quick-btn.fc-inline {
  min-height: 44px;
  padding: 0 15px 0 12px;
  gap: 8px;
}
.fc-inline .fc-quick-icon { width: 24px; height: 24px; }
.fc-inline .fc-quick-text {
  flex-direction: row;
  align-items: baseline;
  gap: 6px;
}
.fc-inline .fc-quick-text span { font-size: 11.5px; }

/* 纯图标变体：正方形，只放图标；含义由 title / aria-label 承载 */
.fc-quick-btn.fc-icon-only {
  width: 44px;
  min-height: 44px;
  padding: 0;
  justify-content: center;
}
.fc-icon-only .fc-quick-icon { width: 30px; height: 30px; }

/* 对局记录 */
.fun-calc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.fun-calc-empty {
  padding: 14px;
  font-size: 13px;
  color: #6d8a74;
  text-align: center;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(99, 159, 112, 0.18);
  border-radius: 12px;
}
.fc-row {
  padding: 11px 13px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(99, 159, 112, 0.2);
  border-radius: 12px;
  transition: background 0.2s, border-color 0.2s;
}
.fc-row:hover { background: rgba(99, 159, 112, 0.09); border-color: rgba(99, 159, 112, 0.35); }
.fc-row-head { display: flex; align-items: center; gap: 10px; }
.fc-row-title {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 700;
  color: #2f4a35;
}
.fc-row-delta { display: flex; flex-wrap: wrap; gap: 6px; }
.fc-row-delta em {
  font-style: normal;
  padding: 3px 8px;
  font-size: 11.5px;
  font-weight: 800;
  border-radius: 999px;
}
.fc-row-delta em.up { color: #35744a; background: #d9f3df; }
.fc-row-delta em.down { color: #c7436c; background: #fdeef3; }
.fc-row-delta em.flat { color: #6d8a74; background: #e9f4e8; }
.fc-row-del {
  flex: none;
  width: 26px;
  height: 26px;
  font-family: inherit;
  font-size: 16px;
  line-height: 1;
  color: #6d8a74;
  background: #e9f4e8;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.fc-row-del:hover { background: #fdeef3; color: #c7436c; }
.fc-row-notes {
  margin-top: 6px;
  font-size: 11.5px;
  line-height: 1.55;
  color: #6d8a74;
}

/* 规则与口径 */
.fun-calc-fold {
  grid-column: 1 / -1; /* 横跨两栏 */
  margin-bottom: 18px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(99, 159, 112, 0.2);
  border-radius: 14px;
  overflow: hidden;
}
.fun-calc-fold > summary {
  padding: 12px 15px;
  font-size: 13px;
  font-weight: 800;
  color: #52785b;
  cursor: pointer;
  list-style: none;
}
.fun-calc-fold > summary::-webkit-details-marker { display: none; }
.fun-calc-fold > summary::after {
  content: '▾';
  float: right;
  color: #9ab7a0;
}
.fun-calc-fold[open] > summary::after { content: '▴'; }
.fun-calc-foldbody { padding: 0 15px 15px; }
.fun-calc-sub {
  margin: 4px 0 7px;
  font-size: 11.5px;
  font-weight: 800;
  color: #67a374;
  letter-spacing: 0.5px;
}
.fun-calc-rules { margin: 0; padding-left: 18px; }
.fun-calc-rules li {
  margin-bottom: 5px;
  font-size: 12px;
  line-height: 1.65;
  color: #435747;
}
.fun-calc-readings li { color: #6d8a74; }

.fun-calc-foot { display: flex; justify-content: flex-end; }
/* 清空记录：粉色系危险操作（替代死红） */
.fun-calc-reset {
  min-height: 38px;
  padding: 0 16px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: #c7436c;
  background: #fdeef3;
  border: 1px solid rgba(239, 111, 142, 0.35);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.fun-calc-reset:hover { background: #fbdfe8; border-color: rgba(239, 111, 142, 0.55); color: #b2375d; }

/* 棋盘（Bingo 等「点格子」单子）：跨列铺满表单，格子可点、点亮打勾 */
.fc-board-field {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fc-board-field[hidden] { display: none; }
.fc-board-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.5px;
  font-weight: 700;
  color: #52785b;
}
.fc-board-count {
  font-style: normal;
  font-weight: 800;
  color: #9ab7a0;
  font-variant-numeric: tabular-nums;
}
.fc-board {
  display: grid;
  grid-template-columns: repeat(var(--fc-board-cols, 10), minmax(0, 1fr));
  gap: 4px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(99, 159, 112, 0.26);
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(47, 86, 54, 0.06);
}
.fc-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  aspect-ratio: 1 / 1;
  padding: 2px;
  font-family: inherit;
  background: #f4faf2;
  border: 1px solid rgba(99, 159, 112, 0.18);
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.fc-cell:hover {
  background: rgba(99, 159, 112, 0.12);
  border-color: rgba(99, 159, 112, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(47, 86, 54, 0.14);
}
/* 红色品质格（grade 6）：粉底 + 粉框（色相贴近主站点缀盘，语义保留） */
.fc-cell.red { background: #fdeef3; border-color: rgba(239, 111, 142, 0.45); box-shadow: inset 0 0 0 1px rgba(239, 111, 142, 0.18); }
.fc-cell.red:hover { background: #fbdfe8; border-color: rgba(239, 111, 142, 0.65); }
/* 整宽棋盘（Bingo）格子大：红框再明显一点 */
.fc-board-row .fc-cell.red { border-width: 2px; border-color: rgba(239, 111, 142, 0.5); }
.fc-cell-no {
  font-style: normal;
  font-size: 9px;
  line-height: 1;
  color: #a9c2ae;
  font-variant-numeric: tabular-nums;
}
.fc-cell-name {
  max-width: 100%;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  color: #52785b;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fc-cell.red .fc-cell-name { color: #b2375d; }
.fc-cell-icon {
  width: 62%;
  max-height: 62%;
  object-fit: contain;
}
/* 已点亮：主站绿渐变 + 右上角打勾 */
.fc-cell.marked {
  background: linear-gradient(135deg, #5aa56f, #35744a);
  border-color: transparent;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}
.fc-cell.marked:hover {
  background: linear-gradient(135deg, #529a66, #2e6a41);
  border-color: transparent;
}
.fc-cell.marked .fc-cell-no,
.fc-cell.marked .fc-cell-name { color: #ffffff; }
.fc-cell.marked::after {
  content: '✓';
  position: absolute;
  top: 1px;
  right: 3px;
  font-size: 10px;
  line-height: 1;
  color: #ffffff;
  opacity: 0.92;
}
.fc-board-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.fc-board-legend span {
  padding: 3px 8px;
  font-size: 11px;
  color: #6d8a74;
  background: #e9f4e8;
  border-radius: 999px;
}

/* 窄屏放不下两栏：右栏折到表单下方，记录列表限高自己滚 */
@media (max-width: 1080px) {
  .fun-calc-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
  .fun-calc-side { padding: 12px 12px 10px; }
  .fun-calc-side .fun-calc-list { max-height: 360px; }
}

@media (max-width: 820px) {
  .menu-detail-calc {
    top: 28vw; /* 冻结导航下方，紧跟“返回单名列表” */
    right: 7.8vw;
    min-height: 10vw;
    padding: 0 3.4vw;
    font-size: 2.8vw;
    border-width: 0.3vw;
  }
  .fun-calc { padding: 0; align-items: flex-end; }
  .fun-calc-box {
    width: 100%;
    max-height: 92vh;
    border-radius: 24px 24px 0 0;
  }
  .fun-calc-head { padding: 14px 18px; }
  .fun-calc-head h3 { font-size: 18px; }
  .fun-calc-body { padding: 16px 18px 20px; }
  .fun-calc-packs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fun-calc-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fun-calc-quick { flex-direction: column; }
  .fun-calc-quick .fc-quick-btn { width: 100%; }
  .fc-sum-main { flex-wrap: wrap; }
  .fc-sum-num strong { font-size: 21px; }
  .fc-sum-rows { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fun-calc-actions { flex-wrap: wrap; }
  /* 窄屏棋盘：格子变小，只留短名 */
  .fc-board { gap: 3px; padding: 6px; }
  .fc-cell { border-radius: 6px; }
  .fc-cell-name { font-size: 8px; }
  .fc-cell-no { font-size: 7px; }
  .fc-cell.marked::after { font-size: 8px; right: 2px; }
  .fc-board.letter-board .fc-cell-letter { font-size: 11px; }
}

/* ============================================================
   多态棋盘（五子棋 / 干员通缉令）：格子按 data-state 区分各态
   - 只有写了 cfg.board.states 的棋盘才有 data-state，单态棋盘不受影响
   ============================================================ */

/* 多态格子不用「✓」标记，各态另有样式；清空按钮挂在棋盘标题行 */
.fc-cell[data-state]::after { content: none; }
.fc-board-head .fc-board-clear {
  flex: none;
  padding: 3px 10px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  color: #52785b;
  background: #ffffff;
  border: 1px solid rgba(99, 159, 112, 0.3);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.fc-board-head .fc-board-clear:hover {
  color: #c7436c;
  background: #fdeef3;
  border-color: rgba(239, 111, 142, 0.45);
}
/* 字母格里的字母（干员通缉令等） */
.fc-cell-letter {
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  color: #52785b;
  font-variant-numeric: tabular-nums;
}
.fc-cell.state-1 .fc-cell-letter,
.fc-cell.state-2 .fc-cell-letter { color: #ffffff; }

/* ---- 五子棋：木色棋盘 + 横竖线，棋子落在交叉点上（不是格子中心外的方块里） ---- */
.fc-board.stone-board {
  position: relative;
  gap: 0;                 /* 格子紧挨着铺，线才能连成整条 */
  padding: 10px;
  background: #e9d3a6;
  border-color: #c8a76a;
}
/* 棋盘线层：横竖各 15 条，线正好穿过每个格子的中心 = 交叉点
   （background-size = 一个格子的宽高，线画在每块的正中间） */
.fc-board.stone-board .fc-board-lines {
  position: absolute;
  inset: 10px;            /* 与棋盘的 padding 对齐，只盖住交叉点区域 */
  pointer-events: none;
  background-image:
    linear-gradient(to right,
      rgba(93, 66, 25, 0) calc(50% - 0.5px),
      rgba(93, 66, 25, 0.55) calc(50% - 0.5px),
      rgba(93, 66, 25, 0.55) calc(50% + 0.5px),
      rgba(93, 66, 25, 0) calc(50% + 0.5px)),
    linear-gradient(to bottom,
      rgba(93, 66, 25, 0) calc(50% - 0.5px),
      rgba(93, 66, 25, 0.55) calc(50% - 0.5px),
      rgba(93, 66, 25, 0.55) calc(50% + 0.5px),
      rgba(93, 66, 25, 0) calc(50% + 0.5px));
  background-size: calc(100% / 15) calc(100% / 15);
  background-position: 0 0;
}
/* 格子就是交叉点热区：底与线都透出来，不加底色 / 边框 */
.fc-board.stone-board .fc-cell,
.fc-board.stone-board .fc-cell:hover,
.fc-board.stone-board .fc-cell.marked,
.fc-board.stone-board .fc-cell.state-1,
.fc-board.stone-board .fc-cell.state-2 {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  transform: none;
}
/* 棋子 / 落点提示都画在交叉点上：一个圆 */
.fc-board.stone-board .fc-cell::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 84%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.4);
  transition: opacity 0.12s, transform 0.12s;
}
/* 交叉点本身画一个小圆点（热区标记），鼠标放上去会变成淡色的落子提示 */
.fc-board.stone-board .fc-cell[data-state='0'] {
  background-image: radial-gradient(circle at 50% 50%, rgba(93, 66, 25, 0.42) 0 1.4px, transparent 1.6px);
}
.fc-board.stone-board .fc-cell[data-state='0']:hover {
  background-image: radial-gradient(circle at 50% 50%, transparent 0 100%);
}
/* 空交叉点：hover 显示一颗淡色提示点，方便看清点在哪 */
.fc-board.stone-board .fc-cell[data-state='0']:hover::before {
  opacity: 1;
  transform: translate(-50%, -50%) scale(0.5);
  background: rgba(93, 66, 25, 0.3);
}
.fc-board.stone-board .fc-cell.state-1::before,
.fc-board.stone-board .fc-cell.state-2::before {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.fc-board.stone-board .fc-cell.state-1::before {
  background: radial-gradient(circle at 34% 28%, #ffffff, #f4f4ef 60%, #d6d6cc);
  box-shadow: 0 2px 3px rgba(90, 66, 30, 0.4), inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.fc-board.stone-board .fc-cell.state-2::before {
  background: radial-gradient(circle at 34% 28%, #6f767e, #2f353b 60%, #14171a);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.45);
}

/* ---- 干员通缉令：26 个字母格，消除后划掉 ---- */
.fc-board.letter-board { gap: 5px; padding: 10px; }
.fc-board.letter-board .fc-cell { gap: 0; }
.fc-board.letter-board .fc-cell[data-state='1'] {
  background: #e9f4e8;
  border-color: rgba(99, 159, 112, 0.3);
}
.fc-board.letter-board .fc-cell[data-state='1']:hover {
  background: #d9f3df;
  border-color: rgba(99, 159, 112, 0.45);
}
.fc-board.letter-board .fc-cell[data-state='1'] .fc-cell-letter {
  color: #9db8a4;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}
.fc-board.letter-board .fc-cell[data-state='1']::after {
  content: '✓';
  position: absolute;
  top: 1px;
  right: 3px;
  font-size: 10px;
  line-height: 1;
  color: #639f70;
}

/* ============================================================
   整宽棋盘（Bingo / 地产大亨）：棋盘横跨弹层两栏，格子才能做大
   ============================================================ */
.fc-board-row {
  grid-column: 1 / -1;   /* 与「规则与口径」一样横跨两栏 */
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}
.fc-board-row .fc-board-field { margin: 0; }

/* 整宽棋盘里的格子：够大，图标才看得清（Bingo 每格约 100px、图标约 62px） */
.fc-board-field .fc-cell-icon { width: 68%; max-height: 68%; }
.fc-board-row .fc-cell { border-radius: 10px; }
.fc-board-row .fc-cell.marked::after { font-size: 13px; top: 2px; right: 5px; }

/* ---- 格名不省略：自动换行、字号缩小，格子相应加高（大富翁游乐园） ---- */
.fc-board.wrap-names .fc-cell {
  aspect-ratio: auto;
  min-height: 84px;
  padding: 7px 5px;
  gap: 3px;
  justify-content: flex-start;
}
.fc-board.wrap-names .fc-cell-no { font-size: 9px; }
.fc-board.wrap-names .fc-cell-name {
  max-width: 100%;
  font-size: 10.5px;
  line-height: 1.25;
  white-space: normal;       /* 换行显示，不出现「…」 */
  overflow-wrap: anywhere;
  word-break: break-word;
  text-overflow: clip;
}
.fc-board.wrap-names .fc-cell-name.long { font-size: 9.5px; }
.fc-board.wrap-names .fc-cell.marked .fc-cell-name { color: #ffffff; }

/* 格子第二行小字（地产大亨的价格 / 机会说明）：金色点缀 */
.fc-cell-sub {
  font-style: normal;
  font-size: 9.5px;
  line-height: 1.2;
  font-weight: 700;
  color: #8a6a14;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.fc-cell.marked .fc-cell-sub { color: rgba(255, 255, 255, 0.92); }

/* ---- 只读棋盘（约会大作战 / 地产大亨）：位置按记录推算，不接受点击 ---- */
.fc-board.readonly-board .fc-cell { cursor: default; }
.fc-board.readonly-board .fc-cell:hover {
  transform: none;
  box-shadow: none;
  background: #f4faf2;
  border-color: rgba(99, 159, 112, 0.18);
}
.fc-board.readonly-board .fc-cell.red:hover { background: #fdeef3; border-color: rgba(239, 111, 142, 0.45); }
.fc-board.readonly-board .fc-cell.marked:hover {
  background: linear-gradient(135deg, #5aa56f, #35744a);
  border-color: transparent;
}
/* 当前所在格：金色高亮圈（与「已走过」的绿色区分开） */
.fc-cell.current {
  box-shadow: 0 0 0 3px #d9a227, 0 0 0 6px rgba(217, 162, 39, 0.25);
  z-index: 2;
}
.fc-cell.current .fc-cell-no { color: #8a6a14; }
.fc-cell.marked.current { box-shadow: 0 0 0 3px #d9a227, 0 0 0 6px rgba(217, 162, 39, 0.22); }

/* ---- 地产大亨：原图的大富翁环线（8 × 8 方框一圈 = 28 格，中间空地放实时信息） ---- */
.fc-board.monopoly-board {
  gap: 6px;
  padding: 10px;
  background: linear-gradient(160deg, #fbf7ea, #f1e8d2);
  border-color: #e2d6b4;
}
.fc-board.monopoly-board .fc-cell {
  aspect-ratio: auto;
  min-height: 74px;
  padding: 6px 5px;
  background: #ffffff;
  border-color: #e6dcc4;
  border-radius: 10px;
}
.fc-board.monopoly-board .fc-cell-name { font-size: 10.5px; color: #5a5340; }
/* 按原图的配色分区：房产米白 / 起点粉 / 机会粉 / 事件橘 / 医院浅蓝 / 监狱灰 */
.fc-board.monopoly-board .fc-cell.k-plot { background: #fffdf6; border-color: #ece2cc; }
.fc-board.monopoly-board .fc-cell.k-start { background: #fdf1f2; border-color: #f0d3d7; }
.fc-board.monopoly-board .fc-cell.k-chance { background: #fdf1f4; border-color: #f0d6de; }
.fc-board.monopoly-board .fc-cell.k-event { background: #fdf3ee; border-color: #f0dccb; }
.fc-board.monopoly-board .fc-cell.k-hospital { background: #f2f7fc; border-color: #d8e5f2; }
.fc-board.monopoly-board .fc-cell.k-prison { background: #f4f4f1; border-color: #e2e2da; }
.fc-board.monopoly-board .fc-cell.marked {
  background: linear-gradient(135deg, #5aa56f, #35744a);
  border-color: transparent;
}
.fc-board.monopoly-board .fc-cell.marked .fc-cell-name { color: #ffffff; }
.fc-board.monopoly-board .fc-cell.marked .fc-cell-sub { color: rgba(255, 255, 255, 0.92); }
/* 环线中间的空地：当前位置 / 圈数 / 地皮 / 金额 / 小鹿币 */
.fc-board-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px 16px;
  text-align: center;
  background: rgba(255, 255, 255, 0.72);
  border: 1.5px dashed #e2d6b4;
  border-radius: 16px;
}
.fc-center-eyebrow { font-size: 11px; font-weight: 800; color: #8a6a14; letter-spacing: 0.5px; }
.fc-center-pos { font-size: 22px; font-weight: 800; color: #2f5636; font-variant-numeric: tabular-nums; }
.fc-center-name { font-size: 13px; font-weight: 800; color: #5a5340; }
.fc-center-rows {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 4px 16px;
  width: 100%;
  max-width: 520px;
  margin-top: 6px;
}
.fc-center-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: #6d8a74;
}
.fc-center-row b { color: #2f5636; font-variant-numeric: tabular-nums; }

/* ============================================================
   展柜（展柜消消乐）：上方展柜格子 + 下方可搜索的图标面板（拖 / 点摆入）
   ============================================================ */
.fc-rack-field {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fc-rack-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.5px;
  font-weight: 700;
  color: #52785b;
}
.fc-rack-count {
  font-style: normal;
  font-weight: 800;
  color: #9ab7a0;
  font-variant-numeric: tabular-nums;
}
.fc-rack-count:empty { display: none; }
.fc-rack-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.fc-rack-src {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: #52785b;
}
.fc-rack-tools input[type='text'],
.fc-rack-tools select {
  height: 34px;
  padding: 0 9px;
  font-family: inherit;
  font-size: 12.5px;
  color: #2f4a35;
  background: #ffffff;
  border: 1px solid rgba(99, 159, 112, 0.3);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.fc-rack-tools input[type='text'] { flex: 1 1 190px; min-width: 130px; }
.fc-rack-tools input[type='text']:focus,
.fc-rack-tools select:focus {
  border-color: rgba(63, 128, 84, 0.65);
  box-shadow: 0 0 0 5px rgba(63, 128, 84, 0.1);
}
.fc-rack-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.fc-rack-chip {
  padding: 3px 9px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  color: #6d8a74;
  background: #ffffff;
  border: 1px solid rgba(99, 159, 112, 0.24);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.fc-rack-chip:hover { border-color: rgba(99, 159, 112, 0.55); color: #35744a; }
.fc-rack-chip.active {
  color: #ffffff;
  background: linear-gradient(135deg, #5aa56f, #35744a);
  border-color: transparent;
  box-shadow: 0 4px 10px rgba(53, 116, 74, 0.3);
}
/* 展柜格子：按档位 6 / 9 / 16 格（摆满后继续摆会多出格子） */
.fc-rack-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 8px;
}
.fc-rack-slot {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1.5px dashed rgba(99, 159, 112, 0.35);
  border-radius: 12px;
  transition: background 0.15s, border-color 0.15s;
}
.fc-rack-slot.filled { border-style: solid; border-color: rgba(99, 159, 112, 0.4); background: #f4faf2; }
.fc-rack-slot.extra { border-color: rgba(217, 162, 39, 0.4); }
.fc-rack-slot.over {
  background: rgba(99, 159, 112, 0.12);
  border-color: #639f70;
  border-style: solid;
  box-shadow: inset 0 0 0 2px rgba(99, 159, 112, 0.3);
}
.fc-rack-no {
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  color: #b9d0ba;
  font-variant-numeric: tabular-nums;
}
.fc-rack-item {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  font-family: inherit;
  background: none;
  border: none;
  border-radius: 11px;
  cursor: pointer;
}
.fc-rack-item:hover { background: rgba(99, 159, 112, 0.12); }
.fc-rack-item-icon { max-width: 84%; max-height: 84%; object-fit: contain; }
.fc-rack-item-text { font-size: 15px; font-weight: 800; color: #52785b; }
.fc-rack-item.fail { background: #fdeef3; box-shadow: inset 0 0 0 1.5px rgba(239, 111, 142, 0.4); }
.fc-rack-item-tag {
  position: absolute;
  right: 1px;
  bottom: 1px;
  padding: 0 3px;
  font-style: normal;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.4;
  color: #ffffff;
  background: #ef6f8e;
  border-radius: 5px;
}
/* 品质描边：6 粉 / 5 金 / 4 紫 / 3 蓝 / 2 绿 / 1 灰（向主站点缀盘靠拢） */
.fc-rack-item.grade-6, .fc-item.grade-6 { box-shadow: inset 0 0 0 2px #f0b7c7; }
.fc-rack-item.grade-5, .fc-item.grade-5 { box-shadow: inset 0 0 0 2px #ecd28f; }
.fc-rack-item.grade-4, .fc-item.grade-4 { box-shadow: inset 0 0 0 2px #cbb6e0; }
.fc-rack-item.grade-3, .fc-item.grade-3 { box-shadow: inset 0 0 0 2px #a9c6e0; }
.fc-rack-item.grade-2, .fc-item.grade-2 { box-shadow: inset 0 0 0 2px #b3d6b0; }
.fc-rack-item.grade-1, .fc-item.grade-1 { box-shadow: inset 0 0 0 2px #d5d5cd; }
.fc-rack-item.fail.grade-6 { box-shadow: inset 0 0 0 2px #f0b7c7; }
.fc-rack-status {
  padding: 5px 10px;
  font-size: 11.5px;
  line-height: 1.6;
  color: #6d8a74;
  background: #e9f4e8;
  border-radius: 10px;
}
.fc-rack-status:empty { display: none; }
/* 图标面板：583 张 64px 图标，可搜索 / 按品质筛，图片懒加载 */
.fc-rack-panel {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(66px, 1fr));
  gap: 6px;
  max-height: 264px;
  padding: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(99, 159, 112, 0.26);
  border-radius: 14px;
}
.fc-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 3px;
  font-family: inherit;
  background: #f4faf2;
  border: 1px solid rgba(99, 159, 112, 0.16);
  border-radius: 10px;
  cursor: grab;
  transition: background 0.15s, border-color 0.15s;
}
.fc-item:hover { background: rgba(99, 159, 112, 0.12); border-color: rgba(99, 159, 112, 0.5); }
.fc-item.dragging { opacity: 0.45; }
.fc-item[hidden] { display: none; }
.fc-item-icon { width: 40px; height: 40px; object-fit: contain; pointer-events: none; }
.fc-item-name {
  max-width: 100%;
  font-size: 9.5px;
  line-height: 1.15;
  color: #435747;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fc-rack-none {
  grid-column: 1 / -1;
  padding: 10px;
  font-size: 12px;
  color: #6d8a74;
  text-align: center;
}
.fc-rack-bulk > summary {
  font-size: 11.5px;
  font-weight: 800;
  color: #67a374;
  cursor: pointer;
}
.fc-rack-bulkbody { display: flex; gap: 8px; margin-top: 7px; }
.fc-rack-bulkbody input {
  flex: 1;
  height: 36px;
  min-width: 0;
  padding: 0 10px;
  font-family: inherit;
  font-size: 13px;
  color: #2f4a35;
  background: #ffffff;
  border: 1px solid rgba(99, 159, 112, 0.3);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.fc-rack-bulkbody input:focus {
  border-color: rgba(63, 128, 84, 0.65);
  box-shadow: 0 0 0 5px rgba(63, 128, 84, 0.1);
}
.fc-rack-bulkadd {
  flex: none;
  height: 36px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, #5aa56f, #35744a);
  border: none;
  border-radius: 999px;
  box-shadow: 0 6px 14px rgba(53, 116, 74, 0.3);
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.2s ease;
}
.fc-rack-bulkadd:hover { filter: brightness(1.06); transform: translateY(-1px); }

@media (max-width: 820px) {
  /* 窄屏：整宽棋盘的格子按比例缩小，不横向溢出 */
  .fc-board-row .fc-cell { border-radius: 7px; }
  .fc-board.wrap-names .fc-cell { min-height: 62px; padding: 4px 3px; }
  .fc-board.wrap-names .fc-cell-name { font-size: 8.5px; line-height: 1.2; }
  .fc-board.wrap-names .fc-cell-name.long { font-size: 8px; }
  .fc-cell-sub { font-size: 8px; }
  .fc-board.monopoly-board { gap: 4px; padding: 6px; }
  .fc-board.monopoly-board .fc-cell { min-height: 54px; padding: 3px 2px; }
  .fc-board.monopoly-board .fc-cell-name { font-size: 8.5px; }
  .fc-center-pos { font-size: 17px; }
  .fc-center-name { font-size: 11px; }
  .fc-center-rows { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
  .fc-center-row { font-size: 10px; }
  /* 展柜：格子与图标面板都缩一点 */
  .fc-rack-slots { grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; }
  .fc-rack-panel { grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); max-height: 210px; }
  .fc-item-icon { width: 34px; height: 34px; }
  .fc-item-name { font-size: 8.5px; }
  .fc-rack-tools input[type='text'] { flex: 1 1 100%; }
}
