/* ============================================================
   围棋 · KataGo   —— 玻璃拟态（Glassmorphism）样式
   配方参考：https://github.com/Deri-Kurniawan/css-glassmorphism
   核心四件套：半透明底 + 同色系亮边框 + backdrop-filter 模糊 + 柔和阴影
   ============================================================ */

/* ----------------------------- 主题变量 ----------------------------- */
:root {
  --glass-bg: rgba(255, 255, 255, 0.11);
  --glass-bg-strong: rgba(255, 255, 255, 0.17);
  --glass-bg-weak: rgba(255, 255, 255, 0.07);
  --glass-brd: rgba(255, 255, 255, 0.24);
  --glass-brd-strong: rgba(255, 255, 255, 0.42);
  --glass-blur: 14px;
  --glass-shadow: 0 4px 30px rgba(0, 0, 0, 0.12);
  --glass-shadow-lg: 0 10px 44px rgba(0, 0, 0, 0.22);
  --inset-light: inset 0 1px 0 rgba(255, 255, 255, 0.28);

  --text: #f2f5ff;
  --text-dim: rgba(242, 245, 255, 0.66);
  --text-faint: rgba(242, 245, 255, 0.42);
  --accent: #7ee0ff;
  --accent-2: #b28dff;
  --danger: #ff7a90;
  --ok: #74e8a8;

  --radius: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;

  --wall-1: #0b1026;
  --wall-2: #131a3a;
  --wall-3: #1b1233;
  --blob-a: #4f7cff;
  --blob-b: #b06bff;
  --blob-c: #21d4c4;
  --blob-d: #ff77b0;
}

body[data-theme="violet"] {
  --wall-1: #0d0a1f;
  --wall-2: #241349;
  --wall-3: #3a1350;
  --blob-a: #8b5cf6;
  --blob-b: #ec4899;
  --blob-c: #22d3ee;
  --blob-d: #f59e0b;
  --accent: #c4a9ff;
  --accent-2: #ff9ad5;
}

body[data-theme="pine"] {
  --wall-1: #04140f;
  --wall-2: #0b2a22;
  --wall-3: #123027;
  --blob-a: #10b981;
  --blob-b: #22d3ee;
  --blob-c: #a3e635;
  --blob-d: #0ea5e9;
  --accent: #86efac;
  --accent-2: #67e8f9;
}

body[data-theme="sunset"] {
  --wall-1: #1a0b14;
  --wall-2: #3a1224;
  --wall-3: #4a1a12;
  --blob-a: #fb7185;
  --blob-b: #fbbf24;
  --blob-c: #a855f7;
  --blob-d: #f97316;
  --accent: #ffc48a;
  --accent-2: #ff9fb1;
}

/* ----------------------------- 基础 ----------------------------- */
* { box-sizing: border-box; }

html {
  height: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100%;
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 800px at 15% 10%, var(--wall-2), transparent 60%),
    radial-gradient(1000px 700px at 85% 20%, var(--wall-3), transparent 65%),
    linear-gradient(160deg, var(--wall-1), #05070f 70%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* 彩色光斑层 */
.blobs {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.34;
  transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.blob.b1 { width: 46vmax; height: 46vmax; left: -12vmax; top: -10vmax; background: var(--blob-a); }
.blob.b2 { width: 38vmax; height: 38vmax; right: -10vmax; top: 6vmax; background: var(--blob-b); }
.blob.b3 { width: 42vmax; height: 42vmax; left: 22vmax; bottom: -18vmax; background: var(--blob-c); }
.blob.b4 { width: 30vmax; height: 30vmax; right: 12vmax; bottom: -12vmax; background: var(--blob-d); }
body[data-blobs="off"] .blobs { display: none; }

/* 让光斑随鼠标轻微漂移（由 JS 设置 --mx/--my） */
body[data-follow="on"] .blob { transform: translate3d(calc(var(--mx, 0) * 1px), calc(var(--my, 0) * 1px), 0); }
body[data-follow="on"] .blob.b2 { transform: translate3d(calc(var(--mx, 0) * -1.4px), calc(var(--my, 0) * 1.1px), 0); }
body[data-follow="on"] .blob.b3 { transform: translate3d(calc(var(--mx, 0) * 0.8px), calc(var(--my, 0) * -1.2px), 0); }
body[data-follow="on"] .blob.b4 { transform: translate3d(calc(var(--mx, 0) * -0.6px), calc(var(--my, 0) * -0.9px), 0); }

/* --------------------------- 玻璃元件 --------------------------- */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-brd);
  border-radius: var(--radius);
  backdrop-filter: blur(var(--glass-blur)) saturate(170%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(170%);
  box-shadow: var(--glass-shadow), var(--inset-light);
}

/* ----------------------------- 顶栏 ----------------------------- */
.topbar {
  position: relative;
  z-index: 3;
  margin: 16px auto 0;
  max-width: 1560px;
  width: calc(100% - 32px);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-radius: var(--radius-pill);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
}
.brand .logo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.15) 55%, transparent 70%),
    linear-gradient(145deg, #1b1f2e, #05070d);
  border: 1px solid var(--glass-brd-strong);
  box-shadow: var(--inset-light), 0 4px 14px rgba(0, 0, 0, 0.4);
  position: relative;
}
.brand .logo::after {
  content: "";
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fff, #cfd6e4 60%, #98a2b6);
  border: 1px solid rgba(255, 255, 255, 0.7);
}
.brand-title { font-size: 16px; }
.brand-sub { font-size: 11.5px; color: var(--text-faint); font-weight: 400; }

.spacer { flex: 1; }

/* 引擎状态胶囊 */
.engine-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  background: var(--glass-bg-weak);
  border: 1px solid var(--glass-brd);
  color: var(--text-dim);
  max-width: 46vw;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-faint);
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
  flex: none;
}
.dot.ready { background: var(--ok); animation: pulse 2.4s infinite; }
.dot.starting { background: #ffd166; animation: pulse 1.2s infinite; }
.dot.error { background: var(--danger); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(116, 232, 168, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(116, 232, 168, 0); }
  100% { box-shadow: 0 0 0 0 rgba(116, 232, 168, 0); }
}

/* ----------------------------- 布局 ----------------------------- */
.layout {
  position: relative;
  z-index: 2;
  max-width: 1560px;
  margin: 16px auto 20px;
  width: calc(100% - 32px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 392px;
  gap: 18px;
  align-items: start;
}
@media (max-width: 1080px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { order: 2; }
  /* 窄屏：不再限高，功能区随内容自然展开，整页滚动 */
  .panes { display: block; }
  .pane { height: auto; overflow: visible; padding-right: 0; }
}

/* 宽屏：让"棋盘 + 侧栏"整体正好落在一屏内，侧栏内容过多时在自身内部滚动 */
@media (min-width: 1081px) {
  /* 宽屏下所有尺寸都按视口高度自适应，整页不需要滚动条 */
  html, body { overflow-y: hidden; height: 100%; }
  .layout { max-width: min(1560px, calc(100vh + 180px)); margin-bottom: 10px; }
  .side {
    position: sticky;
    top: 86px;
    /* 侧栏本身不再整体滚动：由各功能区面板自己滚 */
    height: calc(100vh - 175px);
    overflow: hidden;
  }
}

/* 棋盘面板 */
.board-panel {
  position: relative;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.board-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  /* 深色玻璃盘面：让棋子和网格从花哨的背景光斑里"浮"出来 */
  background:
    radial-gradient(120% 120% at 22% 10%, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0) 55%),
    linear-gradient(158deg, rgba(17, 23, 44, 0.88), rgba(7, 10, 20, 0.93));
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -26px 50px rgba(0, 0, 0, 0.38),
    0 12px 40px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(6px) saturate(140%);
  -webkit-backdrop-filter: blur(6px) saturate(140%);
}
#board { width: 100%; height: 100%; display: block; cursor: pointer; touch-action: manipulation; }

/* 棋盘上的浮动提示 */
.board-floating {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 12px;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  letter-spacing: 0.3px;
  background: rgba(10, 14, 28, 0.5);
  border: 1px solid var(--glass-brd);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 9px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.board-floating.show { opacity: 1; }
.board-floating .spin {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--accent);
  animation: spin 0.85s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.board-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-dim);
}
.turn-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--glass-bg-weak);
  border: 1px solid var(--glass-brd);
}
.stone-icon {
  width: 15px; height: 15px; border-radius: 50%; flex: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.stone-icon.black { background: radial-gradient(circle at 32% 28%, #6e7684, #14161d 62%, #000); }
.stone-icon.white { background: radial-gradient(circle at 32% 28%, #fff, #d5dbe6 62%, #a9b2c2); }

/* ----------------------------- 侧栏 ----------------------------- */
.side { display: flex; flex-direction: column; gap: 12px; }

/* ---------- 顶部横向玻璃切换条（功能区切换） ---------- */
.tabs {
  position: relative;
  flex: none;
  display: flex;
  gap: 3px;
  padding: 5px;
  border-radius: var(--radius-pill);
  /* 标签放不下时可横向滚动 */
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
  -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { height: 5px; }
.tabs::-webkit-scrollbar-track { background: transparent; }
.tabs::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.26); border-radius: 3px; }

.tab {
  position: relative;
  z-index: 1;
  flex: 1 0 auto;
  min-width: 74px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  white-space: nowrap;
  transition: color 0.2s ease;
}
.tab:hover:not(.active) {
  background: rgba(255, 255, 255, 0.08);
  border-color: transparent;
  transform: none;
}
.tab.active { color: var(--text); font-weight: 600; }

/* 跟随选中的玻璃滑块 */
.tab-slider {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 0;
  height: calc(100% - 10px);
  border-radius: var(--radius-pill);
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-brd-strong);
  box-shadow: var(--inset-light), 0 4px 16px rgba(0, 0, 0, 0.24);
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), width 0.34s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}
.tab-slider.ready { opacity: 1; }

/* ---------- 功能区面板 ---------- */
.panes {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}
.pane {
  display: none;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.24) transparent;
}
.pane.active {
  display: flex;
  animation: pane-in 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}
.pane::-webkit-scrollbar { width: 6px; }
.pane::-webkit-scrollbar-track { background: transparent; }
.pane::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.22); border-radius: 3px; }
@keyframes pane-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  padding: 15px 16px 16px;
  border-radius: var(--radius);
}
.card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 12px;
  font-weight: 600;
}
.card-head .hint { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 400; }

/* 胜率条 */
.winrate-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.winrate-big { font-size: 30px; font-weight: 700; letter-spacing: -0.5px; line-height: 1; }
.winrate-big small { font-size: 15px; font-weight: 500; opacity: 0.7; margin-left: 2px; }
.winrate-label { font-size: 12px; color: var(--text-dim); }

.bar {
  position: relative;
  height: 14px;
  border-radius: var(--radius-pill);
  overflow: hidden;
  border: 1px solid var(--glass-brd);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
}
.bar .black-part {
  position: absolute;
  inset: 0 auto 0 0;
  width: 50%;
  background: linear-gradient(90deg, #2a2f3d, #0b0d13);
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.bar .mid {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(0, 0, 0, 0.28);
}

.score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 11px;
  font-size: 12.5px;
  color: var(--text-dim);
}
.score-row b { color: var(--text); font-weight: 600; font-size: 14px; }
.score-row .lead-black { color: #cfd6e4; }
.score-row .lead-white { color: #fff3b0; }

/* 候选点 */
.cand-list { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }
.cand {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: var(--glass-bg-weak);
  border: 1px solid rgba(255, 255, 255, 0.13);
  font-size: 12.5px;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}
.cand:hover { background: var(--glass-bg-strong); border-color: var(--glass-brd-strong); transform: translateX(2px); }
.cand .tag {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(126, 224, 255, 0.16);
  border: 1px solid rgba(126, 224, 255, 0.42);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
}
.cand .coord { font-family: "Cascadia Mono", Consolas, monospace; letter-spacing: 0.5px; }
.cand .pv {
  grid-column: 2 / 4;
  color: var(--text-faint);
  font-size: 11px;
  font-family: "Cascadia Mono", Consolas, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cand .wr { color: var(--text-dim); font-size: 12px; }
.cand.empty { cursor: default; color: var(--text-faint); justify-content: center; }

/* ----------------------------- 控件 ----------------------------- */
.btn-row { display: flex; gap: 9px; flex-wrap: wrap; }

button, .btn {
  font: inherit;
  font-size: 13px;
  color: var(--text);
  padding: 9px 15px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--glass-brd);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  box-shadow: var(--inset-light), 0 3px 14px rgba(0, 0, 0, 0.16);
  cursor: pointer;
  transition: transform 0.14s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  white-space: nowrap;
}
button:hover:not(:disabled), .btn:hover { background: var(--glass-bg-strong); border-color: var(--glass-brd-strong); transform: translateY(-1px); }
button:active:not(:disabled) { transform: translateY(0) scale(0.985); }
button:disabled { opacity: 0.4; cursor: not-allowed; }
button.primary {
  background: linear-gradient(135deg, rgba(126, 224, 255, 0.24), rgba(178, 141, 255, 0.24));
  border-color: rgba(178, 141, 255, 0.5);
}
button.danger { color: #ffd9df; border-color: rgba(255, 122, 144, 0.42); }
button.small { padding: 6px 12px; font-size: 12px; }

.field { margin-bottom: 12px; }
.field:last-child { margin-bottom: 0; }
.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 7px;
}
.field-label .val { color: var(--accent); font-family: "Cascadia Mono", Consolas, monospace; font-size: 11.5px; }

.seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.13);
}
.seg button {
  flex: 1;
  padding: 7px 4px;
  font-size: 12px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: var(--text-dim);
}
.seg button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); transform: none; border-color: transparent; }
.seg button.active {
  background: var(--glass-bg-strong);
  border-color: var(--glass-brd-strong);
  color: var(--text);
  box-shadow: var(--inset-light);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.switch-row:last-child { border-bottom: none; }

/* 宽屏时开关排成两列，让侧栏更紧凑 */
@media (min-width: 1081px) {
  .switch-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 14px;
  }
  .switch-grid .switch-row { font-size: 12px; white-space: nowrap; }
  .switch-grid .switch { width: 38px; height: 21px; }
  .switch-grid .switch::after { width: 15px; height: 15px; }
  .switch-grid .switch.on::after { transform: translateX(17px); }
}
.switch {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-brd);
  cursor: pointer;
  transition: background 0.2s ease;
  flex: none;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.switch.on { background: rgba(126, 224, 255, 0.34); }
.switch.on::after { transform: translateX(20px); }

/* 棋谱 */
.moves-card { display: flex; flex-direction: column; }
.moves-list {
  overflow-y: auto;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 4px 8px;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}
.moves-list::-webkit-scrollbar { width: 6px; }
.moves-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.24); border-radius: 3px; }
.move-item { color: var(--text-dim); padding: 2px 4px; border-radius: 6px; }
.move-item .n { color: var(--text-faint); margin-right: 3px; }
.move-item.last { background: rgba(126, 224, 255, 0.16); color: var(--text); }

/* 引擎提示条 */
.engine-note {
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-dim);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 122, 144, 0.1);
  border: 1px solid rgba(255, 122, 144, 0.3);
  margin-bottom: 12px;
  word-break: break-all;
}
.engine-note.hidden { display: none; }
.engine-note code {
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
  background: rgba(0, 0, 0, 0.28);
  padding: 1px 5px;
  border-radius: 5px;
}

/* 结果浮层 */
.result-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(6, 9, 18, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  z-index: 4;
}
.result-overlay.show { opacity: 1; pointer-events: auto; }
.result-box {
  padding: 26px 34px;
  text-align: center;
  border-radius: var(--radius);
  transform: translateY(8px) scale(0.97);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.result-overlay.show .result-box { transform: translateY(0) scale(1); }
.result-title { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.result-sub { font-size: 13px; color: var(--text-dim); margin-bottom: 16px; }

/* 页脚提示 */
.footnote {
  position: relative;
  z-index: 2;
  text-align: center;
  font-size: 11px;
  color: var(--text-faint);
  padding: 0 16px 10px;
}
.footnote kbd {
  font-family: "Cascadia Mono", Consolas, monospace;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-brd);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 10.5px;
}

/* ----------------------------- 引擎连接弹窗 ----------------------------- */
.engine-pill.clickable { cursor: pointer; }
.engine-pill.clickable:hover {
  background: var(--glass-bg-strong);
  border-color: var(--glass-brd-strong);
}

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 7, 16, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-mask.show { opacity: 1; pointer-events: auto; }

.modal {
  width: min(540px, 100%);
  padding: 20px 22px 18px;
  border-radius: var(--radius);
  transform: translateY(10px) scale(0.98);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.modal-mask.show .modal { transform: translateY(0) scale(1); }

.modal-text {
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--text-dim);
  margin: 0 0 14px;
}
.modal-text strong { color: var(--text); }

.text-input {
  width: 100%;
  padding: 10px 13px;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--glass-brd);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.text-input::placeholder { color: var(--text-faint); }
.text-input:focus { border-color: var(--accent); background: rgba(255, 255, 255, 0.11); }

.modal-hint {
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-dim);
  word-break: break-all;
}

/* 提示气泡 */
.toast-host {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 40;
  pointer-events: none;
}
.toast {
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  background: rgba(12, 16, 32, 0.62);
  border: 1px solid var(--glass-brd);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--glass-shadow-lg);
  animation: toast-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.toast.warn { border-color: rgba(255, 122, 144, 0.5); }
.toast.good { border-color: rgba(116, 232, 168, 0.5); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 关闭部分效果（性能/偏好） */
body[data-blur="off"] .glass,
body[data-blur="off"] button,
body[data-blur="off"] .board-floating,
body[data-blur="off"] .result-overlay,
body[data-blur="off"] .toast {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: rgba(18, 24, 44, 0.86);
}
body[data-blur="off"] .toast,
body[data-blur="off"] .board-floating { background: rgba(12, 16, 32, 0.9); }

/* 响应式微调 */
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding: 11px 14px; }
  .engine-pill { max-width: 100%; order: 3; width: 100%; }
  .layout { gap: 14px; margin-top: 12px; }
  .board-panel { padding: 12px; }
  .card { padding: 13px 13px 14px; }
  .winrate-big { font-size: 26px; }
}
