/* 操作栏、抽屉、统计、回放 */
.actionbar {
  flex: 0 0 auto;
  position: relative;
  padding: 6px 8px calc(8px + var(--safe-b));
  background: linear-gradient(180deg, rgba(13, 16, 20, 0), rgba(13, 16, 20, 0.95) 30%);
  z-index: 6;
}
.controls-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.ctl {
  height: 36px;
  min-width: 44px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  font-size: 13px;
  white-space: nowrap;
}
.ctl:disabled { opacity: 0.35; }
.seg { display: flex; margin-left: auto; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button {
  height: 36px;
  min-width: 44px;
  padding: 0 8px;
  border: 0;
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: linear-gradient(180deg, #2f855a, #1f6b46); color: #fff; font-weight: 700; }
.seg.wide { margin-left: 0; width: 100%; }
.seg.wide button { flex: 1; height: 44px; }

.action-buttons { display: none; gap: 6px; }
body.play-mode .action-buttons { display: grid; grid-template-columns: 1fr 1.25fr 1.25fr 1fr; }
body.play-mode #btnStep { display: none; }
.act {
  height: 54px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.15;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.08s, filter 0.2s;
}
.act small { font-size: 10.5px; font-weight: 600; opacity: 0.9; }
.act:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); }
.act.fold { background: linear-gradient(180deg, #6b7280, #4b5563); }
.act.call { background: linear-gradient(180deg, #2563eb, #1e40af); }
.act.raise { background: linear-gradient(180deg, #ea7a1a, #b45309); }
.act.allin { background: linear-gradient(180deg, #e11d48, #9f1239); }
.act:disabled { filter: grayscale(1) brightness(0.55); box-shadow: none; opacity: 0.7; }
.actionbar.my-turn .action-buttons { animation: pulse 1.6s ease-in-out infinite; border-radius: 16px; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(252, 211, 77, 0); } 50% { box-shadow: 0 0 0 3px rgba(252, 211, 77, 0.35); } }

.raise-panel {
  background: linear-gradient(180deg, #1f242b, #171b21);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 8px;
  margin-bottom: 6px;
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.5);
}
.raise-presets { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.raise-presets button {
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(245, 196, 81, 0.35);
  background: rgba(245, 196, 81, 0.08);
  color: #ffe8a3;
  font-weight: 700;
}
.raise-presets button:active { background: rgba(245, 196, 81, 0.25); }
.raise-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.raise-row input[type="range"] { flex: 1; height: 44px; accent-color: #ea7a1a; }
.step-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06); font-size: 20px; }
.raise-info input {
  width: 96px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #0f1216;
  color: #fff;
  padding: 0 8px;
  font-size: 16px;
  font-weight: 700;
}
.link-btn { margin-left: auto; height: 40px; padding: 0 10px; border: 0; background: none; color: var(--text2); text-decoration: underline; }

/* 抽屉 */
.scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 20; }
.drawer {
  position: absolute;
  top: 0;
  bottom: 0;
  width: min(92%, 380px);
  background: var(--panel);
  z-index: 21;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.6);
}
.drawer.left { left: 0; transform: translateX(-105%); border-right: 1px solid var(--line); }
.drawer.right { right: 0; transform: translateX(105%); border-left: 1px solid var(--line); }
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 16px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 12px 14px 24px; -webkit-overflow-scrolling: touch; }
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 12px; color: var(--text2); margin-bottom: 6px; }
.field.toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.field.toggle label { margin: 0; font-size: 13px; color: var(--text); }
.field.toggle input { width: 24px; height: 24px; accent-color: #2f855a; }
.hint { font-size: 11.5px; color: var(--muted); margin: 2px 0 14px; line-height: 1.5; }
.seat-agents { display: flex; flex-direction: column; gap: 6px; }
.seat-agent { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.seat-agent > span:nth-child(2) { flex: 0 0 96px; font-size: 13px; }
.seat-agent select {
  flex: 1;
  height: 40px;
  border-radius: 10px;
  background: #0f1216;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0 8px;
}
.hero-tag { flex: 1; color: var(--gold); font-weight: 700; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.primary {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  border: 0;
  background: linear-gradient(180deg, #2f9a5a, #1f6b46);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
  margin-top: 6px;
}

/* 统计 */
.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tabs button { flex: 1; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); }
.tabs button.on { background: rgba(255, 255, 255, 0.12); font-weight: 700; }
.stat-head { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.kpi { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-radius: 12px; padding: 8px; text-align: center; }
.kpi b { display: block; font-size: 17px; }
.kpi span { font-size: 11px; color: var(--muted); }
.kpi.ok b { color: #4ade80; }
.kpi.bad b { color: #f87171; }
.chart-wrap { position: relative; background: #1a1d22; border: 1px solid var(--line); border-radius: 12px; padding: 8px; margin-bottom: 12px; }
.chart-title { font-size: 12px; color: var(--text2); margin-bottom: 4px; }
.chart { position: relative; }
.chart-empty { color: var(--muted); font-size: 12px; padding: 30px 0; text-align: center; }
.line-chart .grid { stroke: #2c2c2a; stroke-width: 1; }
.line-chart .axis { stroke: #4a4a46; stroke-width: 1; }
.line-chart .tick { fill: #8c8b84; font-size: 9.5px; }
.line-chart .series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.line-chart .xhair { stroke: #c3c2b7; stroke-width: 1; stroke-dasharray: 3 3; }
.chart-tip {
  position: absolute;
  top: 4px;
  display: none;
  min-width: 140px;
  background: rgba(10, 12, 15, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 11px;
  pointer-events: none;
  z-index: 3;
}
.chart-tip .tip-h { color: var(--text2); margin-bottom: 3px; }
.chart-tip div { display: flex; align-items: center; gap: 5px; }
.chart-tip i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.chart-tip b { margin-left: auto; padding-left: 8px; color: var(--text); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 11.5px; color: var(--text2); }
.legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.stats-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.stats-table th { color: var(--muted); font-weight: 500; text-align: right; padding: 6px 3px; border-bottom: 1px solid var(--line); }
.stats-table td { text-align: right; padding: 7px 3px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); white-space: nowrap; }
.stats-table th:first-child, .stats-table td:first-child { text-align: left; }
.history { list-style: none; margin: 0; padding: 0; }
.history li { padding: 9px 8px; border-radius: 10px; border: 1px solid var(--line); margin-bottom: 6px; background: rgba(255, 255, 255, 0.03); cursor: pointer; min-height: 44px; }
.history li:active { background: rgba(255, 255, 255, 0.09); }
.history li.empty { cursor: default; text-align: center; }
.history .h1 { font-size: 13px; display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.history .h2 { display: flex; align-items: center; justify-content: space-between; margin-top: 5px; font-size: 11.5px; }
.mini-board { display: flex; gap: 2px; }

/* 回放弹窗 */
.modal { position: absolute; inset: 0; z-index: 30; background: rgba(0, 0, 0, 0.7); display: flex; align-items: stretch; }
.modal-card { flex: 1; margin: 8px; background: var(--panel); border-radius: 16px; border: 1px solid var(--line); display: flex; flex-direction: column; overflow: hidden; }
.replay-step { padding: 6px 12px; font-size: 12.5px; color: var(--text); background: rgba(255, 255, 255, 0.04); min-height: 40px; line-height: 1.4; }
.replay-controls { display: grid; grid-template-columns: 1fr 1.4fr 1.4fr 1fr; gap: 6px; padding: 8px; }
.replay-controls button { height: 46px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.07); font-weight: 700; }
.replay-controls button:disabled { opacity: 0.3; }
.replay-log { flex: 1; overflow-y: auto; margin: 0; padding: 0 10px 12px 34px; font-size: 12.5px; }
.replay-log li { padding: 5px 4px; border-radius: 6px; cursor: pointer; }
.replay-log li.cur { background: rgba(245, 196, 81, 0.16); color: #ffe8a3; }
.replay-log li.future { color: var(--muted); }
.replay-log .st { display: inline-block; min-width: 40px; font-size: 11px; color: var(--text2); }

/* ———— Deeplay 机器人：快捷入口 / 图例状态条 ———— */
.botbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  min-height: 34px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  min-width: 0;
}
.botbar .quick { display: flex; gap: 6px; flex: 1; min-width: 0; }
.quick-btn {
  flex: 1 1 0;
  min-width: 0;
  height: 30px;
  padding: 0 8px;
  border-radius: 9px;
  border: 1px solid rgba(34, 211, 238, 0.55);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.14), rgba(217, 70, 239, 0.14));
  color: #cffafe;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.quick-btn:active { background: rgba(34, 211, 238, 0.25); }
.drawer-body .quick { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.drawer-body .quick-btn { height: 40px; font-size: 13px; flex: none; }
.botbar .legend-bot {
  flex: 1;
  min-width: 0;
  color: #a5f3fc;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.botbar .bot-state {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 55%;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
}
.botbar .bot-state span { overflow: hidden; text-overflow: ellipsis; }
.botbar .bot-state i { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: #fbbf24; }
.botbar.st-ready .bot-state { color: #86efac; }
.botbar.st-ready .bot-state i { background: #22c55e; }
.botbar.st-interrupted .bot-state { color: #fca5a5; }
.botbar.st-interrupted .bot-state i { background: #ef4444; }
.seat-agent select { min-width: 0; max-width: 100%; text-overflow: ellipsis; }
.seat-agent select:disabled, .seg button:disabled { opacity: 0.4; }
.field.toggle input:disabled { opacity: 0.5; }
.hint.gip2 { color: #a5f3fc; }
.hint.gip2:empty { display: none; }
