/**
 * 鸟德战斗时间轴规划器样式表。
 *
 * 结构顺序：主题变量 → 基础元素 → 三栏布局 → 时间轴 → 图表与统计 →
 * 事件高亮 → 可调整高度与滚动同步 → 响应式规则。
 */

/* ==================== 主题变量 ==================== */
:root {
  --bg: #0c1020;
  --panel: #151a2e;
  --panel2: #1b2239;
  --line: #2c3554;
  --text: #edf1ff;
  --muted: #9da9c9;
  --accent: #8b7cff;
  --danger: #ff6b81;
  --track-h: 24px;
}
* {
  box-sizing: border-box;
}
/* ==================== 页面基础样式 ==================== */
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    14px/1.4 Inter,
    system-ui,
    "Microsoft YaHei",
    sans-serif;
}
/* ==================== 顶部工具栏 ==================== */
.topbar {
  height: 58px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #11162a;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar strong {
  font-size: 18px;
}
.badge {
  margin-left: 10px;
  color: #c6bcff;
  background: #29234e;
  border: 1px solid #4e4389;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
}
.top-actions {
  display: flex;
  gap: 8px;
}
button {
  border: 1px solid #3d476a;
  background: #202844;
  color: var(--text);
  padding: 7px 11px;
  border-radius: 7px;
  cursor: pointer;
}
button:hover {
  filter: brightness(1.15);
}
button.primary {
  background: var(--accent);
  border-color: var(--accent);
}
button.danger {
  background: #4a2030;
  border-color: #8b354d;
}
/* ==================== 三栏主布局 ==================== */
.app-grid {
  display: grid;
  grid-template-columns: 250px minmax(700px, 1fr) 270px;
  min-height: calc(100vh - 58px);
}
.panel {
  background: var(--panel);
  padding: 16px;
  border-right: 1px solid var(--line);
}
.right-panel {
  border-right: 0;
  border-left: 1px solid var(--line);
}
h2 {
  font-size: 14px;
  margin: 6px 0 12px;
  color: #d7ddf7;
}
h3 {
  font-size: 14px;
  margin: 0 0 8px;
}
.panel label {
  display: block;
  color: var(--muted);
  margin-bottom: 10px;
}
.panel input {
  width: 100%;
  margin-top: 5px;
  background: #0f1427;
  border: 1px solid #333d5f;
  color: var(--text);
  border-radius: 6px;
  padding: 8px;
}
.panel input:disabled {
  opacity: 0.62;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #2a3450, #1a2434);
  border: 2px solid #4a6fa5;
  border-radius: 9px;
  padding: 12px;
}
.stats-grid label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: #b8c8d8;
}
.stats-grid input[type="number"] {
  margin-top: 4px;
  padding: 6px 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 5px;
  color: #ffffff;
  font-size: 13px;
}
/* Hide spinner buttons on number inputs */
.stats-grid input[type="number"]::-webkit-outer-spin-button,
.stats-grid input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.stats-grid input[type="number"] {
  -moz-appearance: textfield;
}
/* ==================== 左侧技能与增益面板 ==================== */
.palette {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.palette-item {
  padding: 9px;
  border-radius: 7px;
  background: var(--panel2);
  border: 1px solid var(--line);
  cursor: grab;
  user-select: none;
}
.palette-item small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.hint,
.empty {
  color: var(--muted);
  font-size: 12px;
}
.workspace {
  padding: 14px;
  min-width: 0;
}
/* ==================== 战斗概要指标 ==================== */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px;
}
.metric span {
  color: var(--muted);
  font-size: 12px;
}
.metric strong {
  display: block;
  font-size: 22px;
  margin-top: 4px;
}
.dps-highlight {
  border-color: #a995ff;
  background: linear-gradient(135deg, #2a2450, #171d34);
  box-shadow:
    0 0 0 1px rgba(169, 149, 255, 0.25),
    0 8px 24px rgba(91, 68, 190, 0.22);
}
.dps-highlight strong {
  color: #d9d0ff;
  font-size: 28px;
}
.timeline-card,
.chart-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
/* ==================== 时间轴工具栏与节点属性 ==================== */
.timeline-toolbar {
  height: 44px;
  padding: 0 10px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.timeline-lock-container {
  display: flex;
  justify-content: center;
  align-items: center;
}
.legend {
  color: var(--muted);
  font-size: 12px;
}
.time-node {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 10px 12px;
  background: #11172b;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.time-node strong {
  color: #d9d0ff;
}
.time-node span {
  color: var(--muted);
}
.time-node b {
  color: var(--text);
}
/* ==================== 时间轴轨道、刻度和事件 ==================== */
.timeline-shell {
  display: grid;
  grid-template-columns: 145px 1fr;
  height: 430px;
}
.track-labels {
  padding-top: 28px;
  border-right: 1px solid var(--line);
  background: #12172a;
  overflow: hidden;
}
.track-label {
  height: var(--track-h);
  display: flex;
  align-items: center;
  padding: 0 10px;
  border-bottom: 1px solid #262e48;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.timeline-viewport {
  overflow: auto;
  position: relative;
}
.ruler {
  height: 24px;
  position: sticky;
  top: 0;
  background: #11162a;
  z-index: 6;
  border-bottom: 1px solid var(--line);
}
.tick {
  position: absolute;
  top: 0;
  height: 28px;
  border-left: 1px solid #394360;
  font-size: 10px;
  color: var(--muted);
  padding-left: 4px;
}
.timeline {
  position: relative;
  background-image: linear-gradient(#252d46 1px, transparent 1px);
  background-size: 100% var(--track-h);
}
.event {
  position: absolute;
  height: 20px;
  border-radius: 4px;
  padding: 1px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: grab;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  user-select: none;
  min-width: 44px;
}
.event.selected {
  outline: 2px solid white;
  z-index: 4;
}
.event.spell {
  background: #425cc4;
}
.event.buff {
  background: #27815f;
}
.event.potion {
  background: #9b4e9f;
}
.event.trinket,
.event.engineering {
  background: #9b692b;
}
.cursor-line {
  position: absolute;
  top: 0;
  width: 1px;
  background: #fff;
  z-index: 5;
  pointer-events: none;
}
.cursor-dot {
  position: absolute;
  top: -4px;
  left: -4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
}
/* ==================== 属性与 DPS 图表 ==================== */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
.chart-card {
  padding: 12px;
}
.chart-card canvas {
  width: 100%;
  height: 240px;
  background: #101527;
  border-radius: 6px;
}
/* ==================== 右侧事件详情 ==================== */
.inspector-actions {
  display: flex;
  gap: 8px;
}
@media (max-width: 1100px) {
  .app-grid {
    grid-template-columns: 220px 1fr;
  }
  .right-panel {
    grid-column: 1/-1;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .charts-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .app-grid {
    display: block;
  }
  .summary-cards {
    grid-template-columns: 1fr;
  }
  .left-panel,
  .right-panel {
    border: 0;
  }
  .timeline-shell {
    grid-template-columns: 110px 1fr;
  }
}
/* ==================== 分组轨道、精确对齐与连续缩放 ==================== */
.timeline-shell {
  grid-template-columns: 180px 1fr;
}
.track-column {
  height: 430px;
  background: #12172a;
  border-right: 1px solid var(--line);
  overflow: hidden;
}
.track-ruler-spacer {
  height: var(--ruler-h, 32px);
  border-bottom: 1px solid var(--line);
  background: #11162a;
}
.track-labels {
  padding-top: 0;
  border-right: 0;
  background: #12172a;
  overflow: hidden;
}
.ruler {
  height: 32px;
  cursor: crosshair;
}
.tick {
  height: 32px;
  line-height: 18px;
}
.timeline {
  cursor: crosshair;
}
.event {
  cursor: grab;
}
/* ==================== 时间轴编辑锁与交互状态 ==================== */
.edit-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid #3d476a;
  border-radius: 7px;
  background: #202844;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.edit-toggle input {
  accent-color: var(--accent);
}
/* 勾选时视觉高亮 */
.edit-toggle input:checked + .edit-toggle-copy {
  color: var(--accent);
  font-weight: 600;
}
.edit-toggle input:checked {
  filter: drop-shadow(0 0 6px rgba(139,124,255,0.18));
}
.event.locked {
  cursor: default;
}
.event.trigger-buff {
  cursor: default;
  opacity: 0.85;
}
.event.trigger-buff:hover {
  filter: none;
  box-shadow: none;
}
.event.failed {
  opacity: 0.7;
  filter: grayscale(0.4);
}
.event-failed {
  margin-left: 6px;
  padding: 2px 6px;
  background: rgba(200,40,40,0.12);
  color: #ffc2c2;
  border-radius: 4px;
  font-size: 11px;
}

/* ==================== 可拖动游标、事件详情和技能伤害统计 ==================== */
.cursor-line {
  pointer-events: none;
}
.cursor-handle {
  position: absolute;
  top: -7px;
  left: -7px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #8b7cff;
  box-shadow: 0 0 0 2px rgba(139, 124, 255, 0.25);
  pointer-events: auto;
  cursor: ew-resize;
}
.event-computed {
  display: grid;
  gap: 7px;
  margin: 12px 0;
  padding: 10px;
  background: #101527;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.event-computed div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.event-computed span {
  color: var(--muted);
}
.event-computed b {
  font-weight: 600;
}
.damage-breakdown {
  display: grid;
  grid-template-columns: minmax(430px, 1fr) minmax(430px, 1fr);
  gap: 12px;
  margin-top: 12px;
}
.damage-list-card,
.damage-detail-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  min-height: 340px;
}
.damage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.damage-header h3 {
  margin: 0;
}
.damage-header span {
  color: var(--muted);
  font-size: 12px;
}
.damage-table-head,
.damage-row {
  display: grid;
  grid-template-columns: 42px minmax(150px, 1fr) 120px 78px;
  align-items: center;
  gap: 8px;
}
.damage-table-head {
  padding: 8px 12px;
  color: var(--muted);
  font-size: 12px;
  border-bottom: 1px solid var(--line);
}
.damage-row {
  position: relative;
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 10px 12px;
  text-align: left;
}
.damage-row:hover,
.damage-row.active {
  background: #242d4b;
}
.damage-row span:nth-child(2) {
  position: relative;
  overflow: hidden;
}
.damage-row span:nth-child(2) b {
  position: relative;
  z-index: 2;
}
.damage-row span:nth-child(2) i {
  position: absolute;
  left: 0;
  top: -8px;
  bottom: -8px;
  background: linear-gradient(
    90deg,
    rgba(139, 124, 255, 0.38),
    rgba(139, 124, 255, 0.08)
  );
  border-radius: 4px;
  z-index: 1;
}
.damage-row span:nth-child(3),
.damage-row span:nth-child(4) {
  text-align: right;
}
.damage-empty {
  padding: 24px;
}
.damage-detail-card {
  padding: 14px;
}
.damage-detail-card > h3 {
  font-size: 18px;
  margin-bottom: 12px;
  color: #d9d0ff;
}
.detail-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}
.detail-summary div {
  background: #101527;
  border: 1px solid var(--line);
  padding: 10px;
  border-radius: 7px;
}
.detail-summary span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.detail-summary b {
  display: block;
  margin-top: 4px;
  font-size: 16px;
}
.hit-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.hit-panels section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #11172b;
  overflow: hidden;
}
.hit-panels h4 {
  display: flex;
  justify-content: space-between;
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: #f0cb55;
}
.hit-panels h4 em {
  font-style: normal;
  color: var(--text);
}
.hit-panels dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0;
  padding: 10px 12px;
  gap: 8px;
}
.hit-panels dt {
  color: var(--muted);
}
.hit-panels dd {
  margin: 0;
  text-align: right;
  font-weight: 600;
}
@media (max-width: 1300px) {
  .damage-breakdown {
    grid-template-columns: 1fr;
  }
  .detail-summary {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 760px) {
  .hit-panels {
    grid-template-columns: 1fr;
  }
  .damage-table-head,
  .damage-row {
    grid-template-columns: 32px minmax(120px, 1fr) 90px 60px;
  }
}

.event.current-cast {
  outline: 3px solid #ffd75a;
  box-shadow:
    0 0 0 2px rgba(255, 215, 90, 0.28),
    0 0 18px rgba(255, 215, 90, 0.75);
  filter: brightness(1.28);
  z-index: 5;
}
.event.current-cast.selected {
  outline-color: #fff3a6;
  box-shadow:
    0 0 0 2px rgba(255, 215, 90, 0.38),
    0 0 22px rgba(255, 215, 90, 0.9);
}

.cursor-drag-zone {
  position: absolute;
  top: 0;
  left: -7px;
  width: 15px;
  height: 100%;
  pointer-events: auto;
  cursor: ew-resize;
  z-index: 8;
}
.cursor-drag-zone .cursor-handle {
  top: -7px;
  left: 0;
}
.event.current-cast {
  background-image: linear-gradient(
    rgba(255, 230, 90, 0.24),
    rgba(255, 230, 90, 0.24)
  );
  animation: currentCastPulse 0.8s ease-in-out infinite alternate;
}
@keyframes currentCastPulse {
  from {
    filter: brightness(1.18);
  }
  to {
    filter: brightness(1.5);
  }
}

/* ==================== 当前生效事件与轨道高亮 ==================== */
.event.current-cast {
  background: #f2c94c !important;
  color: #141414 !important;
  border: 2px solid #fff4a8 !important;
  outline: 3px solid rgba(255, 215, 64, 0.95) !important;
  outline-offset: 2px;
  box-shadow:
    0 0 0 3px rgba(255, 196, 0, 0.28),
    0 0 28px rgba(255, 210, 35, 0.95) !important;
  filter: none !important;
  transform: translateY(-1px) scale(1.025);
  z-index: 12 !important;
  animation: castGlow 0.55s ease-in-out infinite alternate !important;
}
.track-label.current-cast-lane {
  color: #16120a !important;
  font-weight: 800;
  background: linear-gradient(90deg, #f2c94c, #ffe996) !important;
  border-left: 5px solid #fff4a8;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.5),
    0 0 18px rgba(255, 210, 35, 0.45);
}
.track-label-draggable {
  cursor: grab;
}
.track-label-draggable:active {
  cursor: grabbing;
}
.track-drag-handle {
  color: var(--muted);
  font-size: 14px;
  flex: 0 0 auto;
  opacity: 0.5;
  user-select: none;
}
.track-label-dragging {
  opacity: 0.4;
}
.track-label-drop-target {
  box-shadow: inset 0 -2px 0 #8b7cff;
  background: rgba(139, 124, 255, 0.12);
}
.track-icon-overlap {
  margin-left: -8px;
}
.cursor-is-dragging,
.cursor-is-dragging * {
  cursor: ew-resize !important;
}
@keyframes castGlow {
  from {
    box-shadow:
      0 0 0 3px rgba(255, 196, 0, 0.25),
      0 0 18px rgba(255, 210, 35, 0.7);
  }
  to {
    box-shadow:
      0 0 0 4px rgba(255, 224, 85, 0.5),
      0 0 34px rgba(255, 230, 80, 1);
  }
}

/* 所有正在生效的技能、消耗品、工程、饰品和 Buff 均可同时高亮。 */

/* ==================== 可垂直调整的时间轴窗口 ==================== */
.timeline-shell {
  height: 430px;
  min-height: 260px;
  max-height: none;
}
.track-column {
  height: 100%;
  min-height: 0;
}
.timeline-viewport {
  height: 100%;
  min-height: 0;
}
.timeline-resize-handle {
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #11172b;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  cursor: ns-resize;
  user-select: none;
  touch-action: none;
}
.timeline-resize-handle:hover,
.timeline-resize-handle.dragging {
  background: #202844;
  color: var(--text);
}
.timeline-resize-handle span {
  display: block;
  width: 42px;
  height: 2px;
  border-radius: 999px;
  background: #4a557a;
}
.timeline-resize-handle b {
  font-weight: 500;
}
body.timeline-height-dragging,
body.timeline-height-dragging * {
  cursor: ns-resize !important;
  user-select: none !important;
}

/* ==================== 左右轨道纵向滚动同步 ==================== */
.track-labels {
  will-change: transform;
  transform: translate3d(0, 0, 0);
}
.track-column {
  position: relative;
}

/* ==================== 战斗结束刻度与事件详情状态 ==================== */
.tick.end-tick {
  color: #fff;
  font-weight: 700;
  border-left-color: #8b7cff;
  z-index: 2;
}
.event-computed .crit-yes {
  color: #ffd85a;
  text-shadow: 0 0 10px rgba(255, 216, 90, 0.45);
}
.event-computed .crit-no {
  color: #aeb8d8;
}

/* 编辑时间轴关闭时，技能面板不可拖拽或新增事件。 */
.palette-item.locked {
  cursor: not-allowed;
  opacity: 0.48;
  filter: grayscale(0.45);
}
.palette-item.trigger-buff-palette {
  cursor: default;
  opacity: 0.7;
}
.palette-item.trigger-buff-palette:hover {
  background: inherit;
  box-shadow: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

/* ==================== 百分比缩放输入与档位按钮 ==================== */
.zoom-step-button {
  width: 32px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0f1528;
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.zoom-step-button:hover {
  border-color: var(--accent);
  background: rgba(128, 139, 255, 0.12);
}
.zoom-step-button:active {
  transform: translateY(1px);
}

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.zoom-percent-input {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0f1528;
}
.zoom-percent-input input {
  width: 88px;
  padding: 6px 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  text-align: right;
}
.zoom-percent-input span {
  padding: 0 9px 0 3px;
  color: var(--muted);
}
.prepull-band {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background: rgba(80, 214, 160, 0.06);
  border-right: 2px solid rgba(80, 214, 160, 0.75);
  pointer-events: none;
  z-index: 0;
}
.prepull-label {
  position: absolute;
  top: 4px;
  left: 6px;
  color: #79e6b5;
  font-size: 11px;
  pointer-events: none;
}

/* ==================== 融合时间轴指标轨道 ==================== */
.metric-track-label {
  position: relative;
  z-index: 6;
  height: 96px;
  align-items: flex-start;
  padding-top: 12px;
  color: #d5dcf7;
  font-weight: 650;
  background: #101527;
}

.crit-track-info-button,
.haste-track-info-button {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  padding: 0;
  border: 1px solid #69759d;
  border-radius: 50%;
  background: #202944;
  color: #dce4ff;
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  cursor: pointer;
}

.crit-track-info-button:hover,
.crit-track-info-button[aria-expanded="true"],
.haste-track-info-button:hover,
.haste-track-info-button[aria-expanded="true"] {
  border-color: #9d91ff;
  background: #393263;
  color: #ffffff;
}

.crit-track-info-popover,
.haste-track-info-popover {
  position: fixed;
  z-index: 1000;
  max-width: min(420px, calc(100vw - 16px));
  padding: 10px 12px;
  border: 1px solid #7065b5;
  border-radius: 8px;
  background: #202640;
  color: #eef1ff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38);
  font-size: 13px;
  line-height: 1.55;
  white-space: normal;
}

.metric-track-first {
  border-top: 2px solid #4a557a;
}

.metric-chart-row {
  position: absolute;
  left: 0;
  overflow: hidden;
  cursor: crosshair;
  border-bottom: 1px solid #262e48;
  background: #101527;
  z-index: 1;
}

.metric-chart-row.metric-chart-first {
  border-top: 2px solid #4a557a;
}

.metric-chart-row canvas {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.metric-chart-row:hover {
  background: #131a30;
}

/* 技能区域保留原有横向轨道网格；指标区域由各自 Canvas 绘制。 */
.timeline {
  background-image: linear-gradient(#252d46 1px, transparent 1px);
  background-size: 100% var(--track-h);
  background-repeat: repeat-y;
}

/* 共用游标必须覆盖技能轨道和底部四条指标曲线。 */
.cursor-line {
  z-index: 20;
}
\n\n/* ==================== 技能图标与轨道筛选 ==================== */\n.skill-icon,\n.palette-icon,\n.track-icon,\n.event-icon,\n.event-filter-icon,\n.damage-skill-icon {\n  display: block;\n  object-fit: cover;\n  border-radius: 5px;\n  flex: 0 0 auto;\n}\n\n.icon-fallback {\n  display: inline-grid;\n  place-items: center;\n  background: #303a61;\n  color: #ffffff;\n  font-weight: 700;\n}\n\n.palette-item {\n  display: flex;\n  align-items: center;\n  gap: 9px;\n  min-width: 0;\n}\n\n.palette-icon-wrap {\n  display: grid;\n  place-items: center;\n  width: 34px;\n  height: 34px;\n  flex: 0 0 34px;\n}\n\n.palette-icon {\n  width: 34px;\n  height: 34px;\n  border: 1px solid rgba(255, 255, 255, 0.25);\n}\n\n.palette-copy {\n  min-width: 0;\n}\n\n.palette-copy b,\n.palette-copy small {\n  display: block;\n}\n\n.event-filter-bar {\n  display: flex;\n  align-items: center;\n  gap: 10px;\n  min-height: 54px;\n  padding: 7px 10px;\n  background: #11172b;\n  border-bottom: 1px solid var(--line);\n}\n\n.event-filter-title {\n  color: var(--muted);\n  font-size: 12px;\n  white-space: nowrap;\n}\n\n.event-track-filters {\n  display: flex;\n  align-items: center;\n  gap: 6px;\n  min-width: 0;\n  overflow-x: auto;\n  padding-bottom: 2px;\n}\n\n.event-filter-button {\n  display: inline-flex;\n  align-items: center;\n  gap: 6px;\n  padding: 4px 7px 4px 4px;\n  border-radius: 8px;\n  background: #171e34;\n  border-color: #313b60;\n  color: var(--muted);\n  opacity: 0.52;\n  white-space: nowrap;\n}\n\n.event-filter-button.active {\n  color: var(--text);\n  opacity: 1;\n  border-color: #7567ce;\n  background: #26234b;\n  box-shadow: 0 0 0 1px rgba(139, 124, 255, 0.16);\n}\n\n.event-filter-button:hover {\n  opacity: 1;\n}\n\n.event-filter-icon {\n  width: 30px;\n  height: 30px;\n}\n\n.event-filter-empty {\n  color: var(--muted);\n  font-size: 12px;\n}\n\n.track-label {\n  display: flex;\n  align-items: center;\n  gap: 9px;\n}\n\n.track-icon {\n  width: 30px;\n  height: 30px;\n  border: 1px solid rgba(255, 255, 255, 0.2);\n}\n\n.event {\n  display: flex;\n  align-items: center;\n  gap: 6px;\n  overflow: hidden;\n}\n\n.event-icon {\n  width: 28px;\n  height: 28px;\n  margin-left: -1px;\n  border: 1px solid rgba(255, 255, 255, 0.2);\n}\n\n.event-name {\n  overflow: hidden;\n  text-overflow: ellipsis;\n  white-space: nowrap;\n}\n\n.damage-skill-cell {\n  display: flex !important;\n  align-items: center;\n  gap: 8px;\n  min-width: 0;\n}\n\n.damage-skill-cell > span {\n  min-width: 0;\n  flex: 1;\n}\n\n.damage-skill-icon {\n  width: 30px;\n  height: 30px;\n  border: 1px solid rgba(255, 255, 255, 0.2);\n}\n
/* ==================== v23：紧凑图标规范与缩放自适应 ==================== */

/* 图标保持清晰且不参与文本压缩。 */
.skill-icon,
.palette-icon,
.track-icon,
.event-icon,
.event-filter-icon,
.damage-skill-icon {
  border-radius: 4px;
  object-fit: cover;
  image-rendering: auto;
}

/* 左侧技能库：24px 图标，保留足够大的拖拽区域。 */
.palette-icon-wrap {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
}

.palette-icon {
  width: 24px;
  height: 24px;
}

.palette-item {
  gap: 7px;
}

/* 顶部轨道显示栏：16px 图标，按钮点击热区不小于 26px。 */
.event-filter-bar {
  min-height: 42px;
  padding: 5px 8px;
  gap: 8px;
}

.event-track-filters {
  gap: 5px;
}

.event-filter-button {
  min-width: 26px;
  min-height: 26px;
  padding: 4px;
  gap: 4px;
  border-radius: 6px;
}

.event-filter-icon {
  width: 16px;
  height: 16px;
}

.event-filter-button span:not(.icon-fallback) {
  font-size: 11px;
}

/* 左侧轨道：14px 图标和同步缩小的文字。 */
.track-label {
  gap: 6px;
  font-size: 12px;
}

.track-icon {
  width: 14px;
  height: 14px;
}

/* 时间轴事件：14px 方形图标；文字随缩放自动切换。 */
.event {
  gap: 3px;
  padding-left: 2px;
  font-size: 12px;
}

.event-icon {
  width: 14px;
  height: 14px;
  margin-left: 0;
}

.event-name-short,
.event-name-full {
  display: none;
}

.event.has-stack-count {
  position: absolute;
  padding-right: 16px;
}

.event-stack-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 13px;
  height: 13px;
  padding: 0 3px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  background: #0d1226;
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  z-index: 2;
}

html[data-timeline-density="compact"] .event {
  justify-content: center;
  padding-left: 0;
}

html[data-timeline-density="compact"] .event-name {
  display: none;
}

html[data-timeline-density="medium"] .event-name-short {
  display: inline;
  font-size: 11px;
}

html[data-timeline-density="full"] .event-name-full {
  display: inline;
}

/* 伤害统计：20px 图标。 */
.damage-skill-icon {
  width: 20px;
  height: 20px;
}

.damage-skill-cell {
  gap: 6px;
}

/* ==================== 轨道显示按钮状态 ==================== */
/*
 * 轨道存在但已隐藏时，按钮仍保留在筛选栏中。
 * 灰度、透明度和虚线边框表示该轨道当前未显示；悬停时恢复辨识度，
 * 让用户明确知道可以再次点击恢复轨道。
 */
.event-filter-button.hidden {
  color: #7f879f;
  background: #111626;
  border-color: #434a60;
  border-style: dashed;
  opacity: 0.45;
  filter: grayscale(100%);
  box-shadow: none;
}

/* 指标轨道开关使用对应曲线颜色作为辨识标记。 */
.metric-filter-button {
  padding-left: 6px;
}

.metric-filter-swatch {
  width: 14px;
  height: 4px;
  flex: 0 0 14px;
  border-radius: 999px;
  background: var(--metric-color);
  box-shadow: 0 0 5px color-mix(in srgb, var(--metric-color) 55%, transparent);
}

.metric-filter-button.hidden .metric-filter-swatch {
  filter: grayscale(1);
  opacity: 0.42;
}

.event-filter-button.hidden .event-filter-icon {
  filter: grayscale(100%);
}

.event-filter-button.hidden:hover,
.event-filter-button.hidden:focus-visible {
  color: var(--text);
  opacity: 0.9;
  filter: grayscale(35%);
  border-color: #6f7898;
  background: #1b2237;
}

.event-filter-button.hidden:hover .event-filter-icon,
.event-filter-button.hidden:focus-visible .event-filter-icon {
  filter: grayscale(35%);
}

/* 选中状态显示小型勾选标记；隐藏状态保留同等宽度，避免按钮跳动。 */
.event-filter-check {
  display: inline-grid;
  place-items: center;
  width: 11px;
  min-width: 11px;
  height: 11px;
  border-radius: 3px;
  font-size: 9px;
  line-height: 1;
  font-weight: 800;
  color: #101528;
  background: #9b8cff;
}

.event-filter-button.hidden .event-filter-check {
  background: transparent;
  border: 1px solid #596079;
}

.event-filter-name {
  font-size: 11px;
}


/* ==================== 左侧技能卡片精简显示 ==================== */
/* 技能卡片仅显示图标与技能名称，不再显示持续时间和冷却时间。 */
.palette-item {
  min-height: 70px;
  padding: 12px 14px;
}

.palette-copy {
  display: flex;
  align-items: center;
  min-width: 0;
}

.palette-copy b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.palette-copy small {
  display: none;
}

/* ==================== v28：紧凑型技能库列表 ==================== */
/*
 * 左侧技能库改为单列紧凑列表：图标和名称位于同一行。
 * 通过缩短行高与左侧栏宽度，为中间时间轴释放更多横向空间。
 */
.app-grid {
  grid-template-columns: 210px minmax(700px, 1fr) 270px;
}

.left-panel {
  padding: 14px 12px;
}

.palette {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.palette-item {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 6px 9px;
  gap: 9px;
  border-radius: 7px;
  background: transparent;
  border: 1px solid transparent;
  cursor: grab;
  transition:
    background-color 120ms ease,
    border-color 120ms ease,
    transform 120ms ease;
}

.palette-item:hover {
  background: #202844;
  border-color: #3d476a;
  transform: translateX(2px);
}

.palette-item:active {
  cursor: grabbing;
}

.palette-item.locked {
  cursor: not-allowed;
  opacity: 0.58;
}

.palette-item.locked:hover {
  transform: none;
  background: transparent;
  border-color: transparent;
}

.palette-icon-wrap {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
}

.palette-icon {
  width: 26px;
  height: 26px;
  border-radius: 5px;
}

.palette-copy {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1;
}

.palette-copy b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  line-height: 1.2;
}

@media (max-width: 1100px) {
  .app-grid {
    grid-template-columns: 195px 1fr;
  }
}

/* ==================== 编辑模式性能优化 ==================== */
/* 高频拖动期间只使用合成层位移，避免阴影、过渡和文本选择触发布局重算。 */
.event {
  will-change: left, width, transform;
}

.event.dragging {
  transition: none !important;
  animation: none !important;
  box-shadow: 0 0 0 2px rgba(255, 214, 92, 0.9) !important;
  z-index: 60;
  cursor: grabbing;
}

body.event-is-dragging,
body.event-is-dragging * {
  user-select: none !important;
}

body.event-is-dragging .event:not(.dragging),
body.event-is-dragging .track-label,
body.event-is-dragging .metric-chart-row {
  transition: none !important;
  animation: none !important;
}

/* ==================== 手动重新计算状态 ==================== */
.simulation-status {
  align-self: center;
  min-width: 118px;
  padding: 5px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
}

.simulation-status.stale {
  color: #ffd68a;
  background: rgba(155, 105, 24, 0.2);
  border-color: rgba(255, 190, 75, 0.48);
}

.simulation-status.calculating {
  color: #cfd8ff;
  background: rgba(76, 101, 176, 0.25);
  border-color: rgba(126, 153, 239, 0.55);
}

.simulation-status.fresh {
  color: #9aefc8;
  background: rgba(25, 126, 86, 0.2);
  border-color: rgba(80, 214, 160, 0.48);
}

.simulation-status.error {
  color: #ffb3bf;
  background: rgba(145, 43, 62, 0.24);
  border-color: rgba(255, 107, 129, 0.55);
}

.stability-summary {
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 1px solid rgba(123, 146, 224, 0.4);
  border-radius: 12px;
  background: rgba(21, 29, 54, 0.72);
}
.stability-heading, .stability-values { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.stability-heading { justify-content: space-between; }
.stability-heading div { display: flex; align-items: baseline; gap: 10px; }
.stability-heading strong { color: #eaf0ff; }
.stability-heading span, .stability-heading label { color: #91a2c7; font-size: 12px; }
.stability-lock-control { display: flex; align-items: center; gap: 6px; }
.stability-help { position: relative; display: inline-flex; }
.stability-help-button {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid rgba(145, 162, 199, 0.65);
  border-radius: 50%;
  color: #cbd7ef;
  background: rgba(25, 34, 61, 0.95);
  font-size: 13px;
  font-weight: 700;
  line-height: 18px;
  cursor: help;
}
.stability-help-button:hover, .stability-help-button:focus-visible {
  color: #fff;
  border-color: #9d86ff;
  outline: none;
}
.stability-help-tooltip {
  position: absolute;
  z-index: 120;
  top: calc(100% + 8px);
  right: 0;
  display: none;
  width: min(420px, 78vw);
  padding: 11px 13px;
  border: 1px solid rgba(142, 120, 231, 0.58);
  border-radius: 10px;
  color: #c9d6ef;
  background: #151b31;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.38);
  font-size: 13px;
  line-height: 1.65;
  white-space: normal;
}
.stability-help-tooltip span { display: block; color: inherit; font-size: inherit; }
.stability-help:hover .stability-help-tooltip,
.stability-help:focus-within .stability-help-tooltip { display: block; }
.stability-values { margin-top: 8px; color: #aebbd8; }
.stability-values b { color: #bca8ff; font-size: 16px; }

button.recalc-needed {
  background: linear-gradient(135deg, #a86c16, #7f4e0d);
  border-color: #e8a236;
  box-shadow: 0 0 0 1px rgba(255, 187, 73, 0.2), 0 0 16px rgba(220, 143, 31, 0.25);
}

button.calculating {
  cursor: wait;
  opacity: 0.78;
}

button.recalc-complete {
  background: #276d58;
  border-color: #50d6a0;
}

button.recalc-error {
  background: #7a293b;
  border-color: #ff6b81;
}

button:disabled {
  cursor: not-allowed;
}

/* 旧结果仍可查看，但用轻微暖色边框提示其与当前排轴不一致。 */
body.simulation-results-stale .dps-highlight,
body.simulation-results-stale .damage-breakdown {
  border-color: rgba(232, 162, 54, 0.5);
}


/* ==================== v32：左侧主要时间轴操作区 ==================== */
.timeline-primary-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 0 0 18px;
  padding: 10px;
  border: 1px solid #303a5d;
  border-radius: 10px;
  background: rgba(18, 24, 45, 0.72);
}

.timeline-primary-actions > button,
.timeline-primary-actions > .edit-toggle {
  width: 100%;
  min-height: 38px;
  justify-content: center;
}

.timeline-primary-actions .simulation-status {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.timeline-primary-actions + h2 {
  margin-top: 0;
}


/* ==================== 低缩放事件防重叠 ==================== */
/*
 * 事件元素的几何宽度由 JavaScript 严格按时间长度计算。
 * 这里确保内部图标和文字不会突破事件边界覆盖相邻技能。
 */
.event {
  box-sizing: border-box;
  min-width: 0;
  contain: layout paint;
}

.event > * {
  max-width: 100%;
}


/* 技能详情面板的默认空状态 */
.damage-detail-empty {
  text-align: left;
}

.damage-detail-empty-title {
  margin: 0 0 12px;
  color: var(--text-primary, #e4e8ff);
  font-weight: 700;
}

.damage-detail-empty-label {
  margin: 0 0 8px;
}

.damage-detail-empty-list {
  margin: 0;
  padding-left: 20px;
  line-height: 1.8;
}


/* ==================== 战斗特效选择弹窗 ==================== */
.loadout-modal{position:fixed;inset:0;z-index:9999;display:grid;place-items:center;background:rgba(4,8,20,.82);backdrop-filter:blur(8px);padding:24px}.loadout-modal[hidden]{display:none}.loadout-dialog{width:min(1380px,96vw);max-height:92vh;overflow:auto;background:#11182d;border:1px solid #465783;border-radius:18px;box-shadow:0 24px 80px rgba(0,0,0,.55);padding:24px}.loadout-dialog-header h2{margin:0 0 6px}.loadout-dialog-header p{margin:0;color:#aeb8d5}.loadout-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:12px}.loadout-grid section{background:#161f36;border:1px solid #2d395b;border-radius:14px;padding:10px}.loadout-grid h3{margin:0 0 6px;font-size:14px}.option-list{display:grid;gap:4px}.option-card{display:flex;gap:8px;align-items:flex-start;padding:5px;border-radius:8px;border:1px solid #303d60;background:#10182b;font-size:13px}.option-card input{margin-top:2px;flex-shrink:0}.option-card small{display:block;color:#9faac6;margin-top:2px;line-height:1.3;font-size:12px}.section-help{font-size:12px;margin:0 0 6px!important;line-height:1.3}.loadout-grid select{width:100%;margin:3px 0 6px;padding:5px;font-size:13px;background:#10182b;border:1px solid #303d60;color:#edf1ff}.selection-description{font-size:12px;color:#aeb8d5;line-height:1.4}.loadout-actions{display:flex;justify-content:flex-end;margin-top:12px}.dynamic-placeholder{border-style:dashed!important}.timeline-primary-actions button:disabled{opacity:.45;cursor:not-allowed}@media(max-width:1100px){.loadout-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:800px){.loadout-grid{grid-template-columns:1fr}}
.selection-count{font-size:12px;color:#8ea3d3;font-weight:500}
.section-highlight{color:#ffd85a;font-weight:700}
.talent-option-card{align-items:center}.talent-option-copy{min-width:0;flex:1}.talent-points-control{display:flex;align-items:center;gap:5px;flex:0 0 auto;color:#9faac6}.talent-points-control input{width:54px;margin:0;padding:5px 4px;text-align:center;background:#0d1427;border:1px solid #465783;border-radius:6px;color:#edf1ff}

/* ==================== v42：角色置顶与分组技能库 ==================== */
.app-grid {
  grid-template-columns: 320px minmax(700px, 1fr) 270px;
}

.left-panel {
  width: 320px;
  padding: 16px 14px;
  overflow-x: hidden;
}

.sidebar-title {
  margin: 0 0 12px;
  font-size: 18px;
}

.timeline-primary-actions {
  margin-bottom: 14px;
}

.skill-library {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.skill-library-heading h2 {
  margin: 0 0 9px;
  font-size: 16px;
}

.palette-search-label {
  margin: 0 0 10px !important;
}

.palette-search-label input {
  margin-top: 0 !important;
  padding-left: 11px;
}

.palette {
  display: block;
  max-height: min(48vh, 600px);
  overflow-y: auto;
  padding-right: 3px;
  scrollbar-width: thin;
}

.palette-group {
  margin-bottom: 6px;
  border: 1px solid #293352;
  border-radius: 9px;
  overflow: hidden;
  background: rgba(16, 22, 42, 0.52);
}

.palette-group-toggle {
  width: 100%;
  min-height: 34px;
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 5px;
  border: 0;
  border-radius: 0;
  padding: 6px 9px;
  text-align: left;
  background: #171e34;
}

.palette-group-toggle small {
  color: var(--muted);
}

.palette-group-chevron {
  color: #a99cff;
  font-size: 11px;
}

.palette-group-items {
  padding: 4px;
}

.palette-item {
  min-height: 38px;
  padding: 5px 7px;
  margin: 1px 0;
}

.palette-icon-wrap {
  width: 26px;
  height: 26px;
  flex-basis: 26px;
}

.palette-icon {
  width: 24px;
  height: 24px;
}

.palette-copy b {
  font-size: 13px;
}

.palette-empty {
  padding: 12px 8px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1100px) {
  .app-grid {
    grid-template-columns: 290px 1fr;
  }
  .left-panel {
    width: 290px;
  }
}


/* ==================== v43：右侧主要操作区 ==================== */
.right-primary-actions {
  margin-bottom: 18px;
}

.right-primary-actions + h2 {
  margin-top: 0;
}

/* ==================== v44：收窄两侧栏，扩大时间轴 ==================== */
/*
 * 左侧只承担角色参数与技能库，右侧只承担操作和事件详情。
 * 两侧适度收窄，把更多横向空间留给中间时间轴。
 */
.app-grid {
  grid-template-columns: 238px minmax(760px, 1fr) 224px;
}

.left-panel {
  width: 238px;
  padding: 14px 12px;
}

.right-panel {
  width: 224px;
  padding: 14px 12px;
}

/* 角色属性改为纵向单列，窄侧栏下不会发生输入框拥挤。 */
.left-panel .two-col {
  grid-template-columns: 1fr;
  gap: 0;
}

.left-panel label {
  margin-bottom: 9px;
}

.left-panel .panel input,
.left-panel input {
  padding: 7px 8px;
}

/* 技能库在较窄侧栏中保持紧凑，并允许名称省略。 */
.skill-library {
  margin-top: 14px;
  padding-top: 12px;
}

.palette {
  max-height: min(52vh, 650px);
}

.palette-group-toggle {
  padding-inline: 7px;
}

.palette-item {
  min-height: 36px;
  padding: 4px 6px;
}

.palette-copy {
  min-width: 0;
}

.palette-copy b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 右侧高频操作改得更紧凑，避免窄栏中占用过多纵向空间。 */
.right-primary-actions {
  padding: 10px;
  gap: 8px;
  margin-bottom: 14px;
}

.right-primary-actions button,
.right-primary-actions .edit-toggle {
  min-height: 38px;
  padding: 8px 10px;
}

.right-primary-actions .simulation-status {
  padding: 7px 9px;
}

.right-panel h2 {
  margin-top: 2px;
}

/* 中等宽度屏幕仍保留三栏，只进一步压缩两侧。 */
@media (max-width: 1280px) and (min-width: 981px) {
  .app-grid {
    grid-template-columns: 218px minmax(620px, 1fr) 210px;
  }

  .left-panel {
    width: 218px;
  }

  .right-panel {
    width: 210px;
  }
}

/* 小屏沿用原有响应式逻辑，避免强制三栏造成溢出。 */
@media (max-width: 980px) {
  .app-grid {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .left-panel {
    width: 220px;
  }

  .right-panel {
    width: auto;
  }
}

/* ==================== v45：更窄左栏与独立滚动技能库 ==================== */
.app-grid {
  grid-template-columns: 220px minmax(780px, 1fr) 224px;
}

.left-panel {
  width: 220px;
  height: calc(100vh - 58px);
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 12px 10px;
}

.recalculate-section {
  margin-bottom: 16px;
  padding: 14px;
  background: linear-gradient(135deg, #1a3a52 0%, #162d42 100%);
  border: 2px solid #d4a574;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.recalc-button-row { display: flex; align-items: center; gap: 8px; }
.recalc-button-help { position: relative; display: block; width: 100%; }
.recalc-button-help .recalc-button { width: 100%; }
.calculation-help-tooltip { width: 100%; right: auto; left: 0; box-sizing: border-box; }
.recalc-button-help:hover .calculation-help-tooltip,
.recalc-button-help:focus-within .calculation-help-tooltip { display: block; }

.recalc-button {
  min-height: 96px !important;
  padding: 12px 24px !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  height: auto !important;
  background: linear-gradient(180deg, #c89860 0%, #a87c4c 100%) !important;
  border: 2px solid #8a6134 !important;
  color: #fff !important;
  cursor: pointer !important;
  border-radius: 8px !important;
  transition: all 0.2s ease !important;
}

.recalc-button:hover:not(:disabled) {
  background: linear-gradient(180deg, #d9a970 0%, #b88c5c 100%) !important;
  box-shadow: 0 6px 16px rgba(212, 165, 116, 0.4) !important;
  transform: translateY(-2px) !important;
}

.recalc-button:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
}

.recalculate-section .simulation-status {
  border-radius: 6px;
  padding: 8px 10px;
  margin: 0;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid #d4a574;
  overflow: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.recalculate-section .simulation-status-title {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 3px;
  color: #d4a574;
  white-space: normal;
  word-wrap: break-word;
}

.recalculate-section .simulation-status-desc {
  font-size: 11px;
  color: #aeb8d5;
  line-height: 1.3;
  margin: 0;
  white-space: normal;
  word-wrap: break-word;
}

.character-panel {
  flex: 0 0 auto;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.character-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-title {
  margin: 0 0 9px;
  font-size: 17px;
  line-height: 1.2;
}

.sidebar-help-button {
  width: 25px;
  height: 25px;
  padding: 0;
  display: grid;
  place-items: center;
  flex: 0 0 25px;
  border-radius: 50%;
  color: var(--muted);
  font-weight: 700;
}

.sidebar-help {
  margin-top: 7px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(12, 16, 32, 0.72);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.left-panel label {
  margin-bottom: 7px;
  font-size: 12px;
}

.left-panel input {
  min-height: 36px;
  margin-top: 3px;
  padding: 6px 7px;
  font-size: 13px;
}

.left-panel .two-col {
  gap: 0;
}

.skill-library {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-top: 10px;
  padding-top: 0;
  border-top: 0;
  overflow: hidden;
}

.skill-library-heading {
  flex: 0 0 auto;
}

.skill-library-heading h2 {
  margin: 0 0 7px;
  font-size: 15px;
}

.palette-search-label {
  flex: 0 0 auto;
  margin-bottom: 7px !important;
}

.palette-search-label input {
  min-height: 34px;
  padding: 5px 7px !important;
  font-size: 12px;
}

.palette {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  padding-right: 2px;
}

.palette-group {
  margin-bottom: 5px;
}

.palette-group-toggle {
  min-height: 36px;
  padding: 5px 7px;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  font-size: 12px;
}

.palette-group-toggle small {
  min-width: 20px;
  padding: 1px 5px;
  border-radius: 999px;
  background: #242d49;
  text-align: center;
  font-size: 10px;
}

.palette-group-items {
  padding: 3px;
}

.palette-item {
  min-height: 34px;
  padding: 3px 5px;
  gap: 6px;
}

.palette-icon-wrap {
  width: 24px;
  height: 24px;
  flex-basis: 24px;
}

.palette-icon {
  width: 22px;
  height: 22px;
}

.palette-copy b {
  font-size: 12px;
}

/* 原先常驻的两段帮助文字已改为问号按钮中的按需说明。 */
.left-panel > .hint {
  display: none;
}

@media (max-width: 1180px) {
  .app-grid {
    grid-template-columns: 205px minmax(680px, 1fr) 210px;
  }
  .left-panel {
    width: 205px;
  }
  .right-panel {
    width: 210px;
  }
}


/* ==================== v46：左右侧栏可拖拽调宽 ==================== */
:root {
  --left-sidebar-width: 220px;
  --right-sidebar-width: 224px;
  --sidebar-resizer-width: 8px;
}

/* 五列结构：左栏、左手柄、工作区、右手柄、右栏。 */
.app-grid {
  grid-template-columns:
    var(--left-sidebar-width)
    var(--sidebar-resizer-width)
    minmax(560px, 1fr)
    var(--sidebar-resizer-width)
    var(--right-sidebar-width) !important;
}

.left-panel {
  width: var(--left-sidebar-width) !important;
  min-width: 0;
}

.right-panel {
  width: var(--right-sidebar-width) !important;
  min-width: 0;
}

.workspace {
  min-width: 0;
}

.sidebar-resize-handle {
  position: relative;
  z-index: 30;
  width: var(--sidebar-resizer-width);
  min-width: var(--sidebar-resizer-width);
  cursor: col-resize;
  touch-action: none;
  background: rgba(16, 22, 43, 0.92);
  border-inline: 1px solid rgba(73, 88, 132, 0.35);
  outline: none;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.sidebar-resize-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 54px;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  background: rgba(151, 139, 255, 0.38);
  box-shadow: 0 0 0 1px rgba(151, 139, 255, 0.08);
}

.sidebar-resize-handle:hover,
.sidebar-resize-handle:focus-visible,
body.sidebar-resizing .sidebar-resize-handle.is-active {
  background: rgba(55, 61, 104, 0.95);
  border-color: rgba(151, 139, 255, 0.8);
}

.sidebar-resize-handle:hover::after,
.sidebar-resize-handle:focus-visible::after,
body.sidebar-resizing .sidebar-resize-handle.is-active::after {
  background: #a99dff;
  box-shadow: 0 0 12px rgba(139, 124, 255, 0.8);
}

body.sidebar-resizing {
  cursor: col-resize !important;
  user-select: none !important;
}

body.sidebar-resizing * {
  cursor: col-resize !important;
}

/* 调宽期间关闭大部分动画，减少重排时的视觉卡顿。 */
body.sidebar-resizing .panel,
body.sidebar-resizing .workspace,
body.sidebar-resizing .timeline-card,
body.sidebar-resizing canvas {
  transition: none !important;
}

/* 窄屏恢复为原响应式结构，不显示拖拽手柄。 */
@media (max-width: 980px) {
  .app-grid {
    grid-template-columns: 220px minmax(0, 1fr) !important;
  }

  .sidebar-resize-handle {
    display: none;
  }

  .left-panel {
    width: 220px !important;
  }

  .right-panel {
    width: auto !important;
  }
}


/* ==================== v47：点击分隔条折叠侧栏 ==================== */
/* 折叠时将对应网格列压缩为 0，分隔条仍保留，便于再次点击展开。 */
body.left-sidebar-collapsed .app-grid {
  grid-template-columns:
    0
    var(--sidebar-resizer-width)
    minmax(560px, 1fr)
    var(--sidebar-resizer-width)
    var(--right-sidebar-width) !important;
}

body.right-sidebar-collapsed .app-grid {
  grid-template-columns:
    var(--left-sidebar-width)
    var(--sidebar-resizer-width)
    minmax(560px, 1fr)
    var(--sidebar-resizer-width)
    0 !important;
}

body.left-sidebar-collapsed.right-sidebar-collapsed .app-grid {
  grid-template-columns:
    0
    var(--sidebar-resizer-width)
    minmax(560px, 1fr)
    var(--sidebar-resizer-width)
    0 !important;
}

body.left-sidebar-collapsed .left-panel,
body.right-sidebar-collapsed .right-panel {
  width: 0 !important;
  min-width: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ==================== v48：技能库随页面无限向下展开 ==================== */
/* 左侧不再建立独立滚动上下文；技能数量增加时由整页自然增长。 */
.left-panel {
  height: auto;
  min-height: calc(100vh - 58px);
  overflow: visible;
}

.skill-library {
  flex: 0 0 auto;
  min-height: auto;
  overflow: visible;
}

.palette {
  flex: 0 0 auto;
  max-height: none;
  overflow: visible;
  padding-right: 0;
  scrollbar-width: auto;
}

/* 分隔条中央显示方向箭头，提示点击后的动作。 */
.sidebar-resize-handle::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 7px;
  height: 7px;
  border-top: 2px solid rgba(219, 214, 255, 0.86);
  border-right: 2px solid rgba(219, 214, 255, 0.86);
  background: rgba(35, 42, 76, 0.96);
  box-shadow: 0 0 0 4px rgba(35, 42, 76, 0.96);
}

.sidebar-resize-handle-left::before {
  transform: translate(-35%, -50%) rotate(-135deg);
}

.sidebar-resize-handle-right::before {
  transform: translate(-65%, -50%) rotate(45deg);
}

.sidebar-resize-handle-left.is-collapsed::before {
  transform: translate(-65%, -50%) rotate(45deg);
}

.sidebar-resize-handle-right.is-collapsed::before {
  transform: translate(-35%, -50%) rotate(-135deg);
}

.sidebar-resize-handle.is-collapsed {
  background: rgba(63, 54, 116, 0.98);
  border-color: rgba(169, 157, 255, 0.82);
}

.sidebar-resize-handle.is-collapsed::after {
  background: rgba(169, 157, 255, 0.82);
  box-shadow: 0 0 12px rgba(139, 124, 255, 0.58);
}


/* ================================================================
   药水双槽位选择：战前 1 药 / 战斗中 2 药
   ================================================================ */
.section-help {
  margin: -4px 0 12px;
  color: #9faac6;
  font-size: 13px;
  line-height: 1.45;
}

.potion-option-list {
  gap: 12px;
}

.potion-option-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid #303d60;
  border-radius: 12px;
  background: #10182b;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.potion-option-card.selected-precombat,
.potion-option-card.selected-combat {
  border-color: #6274b8;
  background: #141f39;
}

.potion-option-card.selected-precombat.selected-combat {
  border-color: #a98cf8;
  box-shadow: 0 0 0 1px rgba(169, 140, 248, .2);
}

.potion-option-copy {
  min-width: 0;
}

.potion-option-copy b,
.potion-option-copy small {
  display: block;
}

.potion-option-copy small {
  margin-top: 4px;
  color: #9faac6;
  line-height: 1.4;
}

.potion-slot-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(94px, 1fr));
  gap: 8px;
}

.potion-slot-button {
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid #425079;
  border-radius: 9px;
  background: #1a2440;
  color: #b8c2df;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.potion-slot-button:hover {
  border-color: #7c8fce;
  color: #eef2ff;
}

.potion-slot-button.selected[data-slot="precombat"] {
  border-color: #46c9a8;
  background: #17483f;
  color: #a7f3df;
  box-shadow: 0 0 0 1px rgba(70, 201, 168, .18);
}

.potion-slot-button.selected[data-slot="combat"] {
  border-color: #f0aa42;
  background: #5a3b13;
  color: #ffe0a3;
  box-shadow: 0 0 0 1px rgba(240, 170, 66, .18);
}

@media (max-width: 620px) {
  .potion-option-card {
    grid-template-columns: 1fr;
  }

  .potion-slot-buttons {
    grid-template-columns: 1fr 1fr;
  }
}

/* ==================== v52：分隔条不越过顶部工具栏 ==================== */
/*
 * 顶部工具栏是页面级固定层；主布局建立独立层叠上下文，
 * 侧栏分隔条只能在主布局内部显示，页面滚动时不会覆盖标题栏。
 */
.topbar {
  z-index: 100;
  isolation: isolate;
}

.app-grid {
  position: relative;
  z-index: 0;
  isolation: isolate;
}

.sidebar-resize-handle {
  z-index: 8;
}


/* ==================== v54：右侧操作区与编辑复选框 ==================== */
/*
 * 仅将“编辑时间轴”恢复为原生可勾选复选框。
 * 右侧操作区的尺寸、按钮、状态条和其余布局保持 v54 不变。
 */
.right-primary-actions {
  gap: 7px;
  padding: 9px;
  border-radius: 12px;
  border: 1px solid rgba(113, 151, 255, 0.65);
  background: linear-gradient(180deg, rgba(34, 43, 76, 0.95), rgba(18, 24, 45, 0.95));
  box-shadow: 0 0 0 1px rgba(32, 52, 98, 0.45) inset, 0 10px 22px rgba(0, 0, 0, 0.22);
}

.right-primary-actions > button,
.right-primary-actions > .edit-toggle {
  min-height: 42px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 700;
}

.right-primary-actions > button {
  padding: 9px 11px;
}

.edit-toggle {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 8px 10px;
  cursor: pointer;
}

.edit-toggle input[type="checkbox"] {
  position: static;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.edit-toggle-copy {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

.edit-toggle:has(input[type="checkbox"]:focus-visible) {
  outline: 2px solid #a99cff;
  outline-offset: 2px;
}

/* 计算状态使用紧凑状态条，不再呈现为大号操作按钮。 */
.right-primary-actions .simulation-status {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.2;
}


/* ==================== v55：两行计算状态 Banner ==================== */
.right-primary-actions .simulation-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 100%;
  min-width: 0;
  min-height: 54px;
  height: auto;
  padding: 8px 10px;
  box-sizing: border-box;
  border-radius: 12px;
  text-align: center;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* ==================== 微信支持卡片 ==================== */
.wechat-support-card {
  margin: 0 0 16px;
  padding: 10px;
  border: 1px solid rgba(111, 231, 174, 0.58);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 0, rgba(61, 214, 141, 0.16), transparent 58%),
    linear-gradient(180deg, rgba(24, 50, 54, 0.96), rgba(15, 27, 42, 0.98));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.26), 0 0 0 1px rgba(72, 205, 141, 0.08) inset;
  text-align: center;
}

.wechat-support-card img {
  display: block;
  width: min(100%, 176px);
  height: auto;
  margin: 0 auto;
  padding: 5px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.34);
}

.wechat-support-card figcaption {
  margin-top: 9px;
  color: #dffff0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
  text-wrap: balance;
}

.site-footer {
  padding: 18px 16px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.site-footer-links {
  line-height: 1.7;
}

.site-footer-disclaimer {
  margin: 6px auto 0;
  max-width: 760px;
  color: color-mix(in srgb, var(--muted) 82%, transparent);
  font-size: 12px;
  line-height: 1.6;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--text);
  text-decoration: underline;
}

.site-footer-separator {
  margin: 0 8px;
  color: var(--line);
}

.legal-page-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 0, rgba(111, 140, 255, 0.13), transparent 34rem),
    var(--bg);
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 12px;
}

.legal-page-nav {
  margin-bottom: 14px;
}

.legal-page-nav a,
.legal-card a {
  color: #aebeff;
}

.legal-card {
  padding: clamp(22px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(20, 26, 47, 0.96);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.24);
}

.legal-header {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.legal-header h1 {
  margin: 4px 0 10px;
  font-size: clamp(28px, 5vw, 42px);
}

.legal-header p,
.legal-card p {
  color: #c4cce5;
  line-height: 1.85;
}

.legal-kicker {
  margin: 0;
  color: #9d91ff !important;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.legal-card section {
  margin-top: 28px;
}

.legal-card h2 {
  margin: 0 0 10px;
  color: #eef1ff;
  font-size: 20px;
}

.legal-card h3 {
  margin: 18px 0 6px;
  color: #dce4ff;
  font-size: 16px;
}

.legal-card p {
  margin: 8px 0;
}

.legal-card ul {
  margin: 10px 0;
  padding-left: 1.4em;
  color: #c4cce5;
  line-height: 1.8;
}

.legal-important {
  padding: 13px 15px;
  border-left: 3px solid #9d91ff;
  border-radius: 0 9px 9px 0;
  background: rgba(139, 124, 255, 0.1);
  color: #e6eaff !important;
}

@media (max-width: 640px) {
  .legal-page {
    width: min(100% - 20px, 900px);
    padding-top: 16px;
  }

  .legal-card {
    padding: 20px 16px;
    border-radius: 14px;
  }
}

@media (max-width: 980px) {
  .wechat-support-card {
    width: min(240px, 100%);
  }
}

.simulation-status-title {
  max-width: 100%;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.25;
}

.simulation-status-desc {
  max-width: 100%;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  opacity: 0.92;
}

.simulation-status.stale .simulation-status-title {
  color: #ffd46a;
}

.simulation-status.stale .simulation-status-desc {
  color: #e6d6a8;
}

.simulation-status.calculating .simulation-status-title {
  color: #9dc3ff;
}

.simulation-status.calculating .simulation-status-desc {
  color: #d1ddff;
}

.simulation-status.fresh .simulation-status-title {
  color: #78f0b3;
}

.simulation-status.fresh .simulation-status-desc {
  color: #d8ffe8;
}

.simulation-status.error .simulation-status-title {
  color: #ff9cab;
}

.simulation-status.error .simulation-status-desc {
  color: #ffd5dc;
}

/* 技能库拖拽反馈：避免图标自身触发浏览器图片拖拽。 */
.palette-item img { pointer-events: none; }
.palette-item.palette-dragging { opacity: .58; }
.timeline.palette-drop-ready { outline: 1px solid rgba(139, 108, 255, .7); }

/* ==================== 技能库 Pointer Events 拖放 ==================== */
.palette-drag-ghost {
  position: fixed !important;
  z-index: 100000 !important;
  left: 0 !important;
  top: 0 !important;
  width: max-content;
  max-width: 240px;
  pointer-events: none !important;
  opacity: 0.92;
  padding: 7px 10px;
  border: 1px solid #8b7cff;
  border-radius: 9px;
  background: #202844;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 0 2px rgba(139, 124, 255, 0.24);
  will-change: transform;
}

body.palette-pointer-dragging,
body.palette-pointer-dragging * {
  cursor: grabbing !important;
  user-select: none !important;
}

.timeline-viewport.palette-drop-target {
  box-shadow: inset 0 0 0 3px rgba(139, 124, 255, 0.82);
  background-color: rgba(139, 124, 255, 0.035);
}

/* v64：技能库使用 Pointer Capture 拖放，禁止浏览器原生拖拽接管。 */
.palette-item {
  touch-action: none;
  -webkit-user-drag: none;
}

.palette-item img {
  -webkit-user-drag: none;
  user-select: none;
}

.palette-item.palette-drag-blocked {
  animation: palette-drag-blocked 420ms ease;
}

@keyframes palette-drag-blocked {
  0%, 100% { box-shadow: none; }
  40% { box-shadow: inset 0 0 0 2px rgba(255, 112, 135, .9); }
}

/* 被动饰品与亮纹刺绣的自动触发延迟。 */
.profession-option-card {
  align-items: center;
}
.profession-option-main {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  min-width: 0;
  flex: 1;
}
.profession-option-copy {
  min-width: 0;
  flex: 1;
}
.proc-delay-control,
.proc-delay-row {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #cbd4ef;
  font-size: 12px;
  white-space: nowrap;
}
.proc-delay-control {
  margin-left: auto;
}
.proc-delay-control input,
.proc-delay-row input {
  width: 72px !important;
  margin: 0 !important;
  padding: 4px 6px !important;
  background: #0c1326;
  border: 1px solid #3b4a72;
  border-radius: 6px;
  color: #edf1ff;
}
.proc-delay-row {
  justify-content: flex-end;
  margin: -2px 0 7px;
}
.proc-delay-row[hidden] {
  display: none;
}

/* 特效选择页：增强各项目分组标题的视觉层级。 */
.loadout-grid section > h3 {
  display: flex;
  align-items: center;
  min-height: 34px;
  margin: -2px -2px 9px;
  padding: 7px 10px;
  border: 1px solid rgba(137, 151, 220, .34);
  border-left: 4px solid #9d8cff;
  border-radius: 9px;
  background: linear-gradient(90deg, rgba(91, 76, 166, .48), rgba(35, 48, 88, .72));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 4px 12px rgba(4, 8, 24, .22);
  color: #f4f2ff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .035em;
}

.loadout-grid section > h3 .selection-count {
  margin-left: auto;
  padding: 2px 7px;
  border: 1px solid rgba(189, 180, 255, .32);
  border-radius: 999px;
  background: rgba(11, 17, 40, .48);
  color: #d8d1ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

/* ==================== 顶部玩家施放顺序轨道 ==================== */
.cast-sequence-track-label {
  position: relative;
  color: #eef1ff;
  font-weight: 700;
  background: linear-gradient(90deg, rgba(77, 89, 139, 0.34), rgba(30, 37, 68, 0.12));
  border-left: 3px solid #8b7cff;
}

.cast-sequence-track-mark {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: #b8afff;
  font-size: 11px;
}

.cast-sequence-icon {
  position: absolute;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  min-width: 20px;
  padding: 2px;
  border: 1px solid rgba(190, 199, 255, 0.72);
  border-radius: 6px;
  background: #202944;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.cast-sequence-icon:hover,
.cast-sequence-icon:focus-visible {
  z-index: 7;
  border-color: #d5d0ff;
  background: #303b63;
  transform: translateY(-1px);
}

.cast-sequence-icon.selected {
  border-color: #ffffff;
  outline: 2px solid #8b7cff;
  outline-offset: 1px;
}

.cast-sequence-skill-icon {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  object-fit: cover;
}

/* 特效选择页在紧凑版基础上再缩小约 10%，保持响应式行为。 */
.loadout-modal {
  padding: 17px;
}

.loadout-dialog {
  width: min(994px, 96vw);
  padding: 17px;
  border-radius: 13px;
  font-size: 11px;
}

.loadout-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.loadout-dialog-header > div {
  min-width: 0;
}

.loadout-close {
  flex: 0 0 auto;
  min-width: 64px;
  min-height: 34px;
  padding: 6px 10px;
  font-size: 12px;
}

.loadout-dialog-header h2 {
  margin-bottom: 4px;
  font-size: 17px;
}

.loadout-dialog-header p {
  font-size: 11px;
}

.loadout-grid {
  gap: 7px;
  margin-top: 9px;
}

.loadout-grid section {
  padding: 7px;
  border-radius: 10px;
}

.loadout-grid section > h3 {
  min-height: 24px;
  margin: -2px -2px 6px;
  padding: 5px 7px;
  border-left-width: 3px;
  border-radius: 6px;
  font-size: 11px;
}

.loadout-grid section > h3 .selection-count {
  padding: 2px 5px;
  font-size: 9px;
}

.option-list {
  gap: 3px;
}

.option-card {
  gap: 5px;
  padding: 4px;
  border-radius: 5px;
  font-size: 10px;
}

.option-card input[type="checkbox"],
.option-card input[type="radio"] {
  width: 12px;
  height: 12px;
}

.option-card small,
.section-help,
.selection-description {
  font-size: 9px;
}

.section-help {
  margin-bottom: 4px !important;
}

.loadout-grid select {
  margin: 2px 0 4px;
  padding: 4px;
  font-size: 10px;
}

.talent-points-control,
.proc-delay-control,
.proc-delay-row {
  gap: 4px;
  font-size: 9px;
}

.talent-points-control input {
  width: 39px;
  padding: 3px;
}

.proc-delay-control input,
.proc-delay-row input {
  width: 52px !important;
  padding: 3px 4px !important;
}

.potion-option-list {
  gap: 9px;
}

.potion-option-card {
  gap: 10px;
  padding: 9px;
  border-radius: 9px;
}

.potion-option-copy small {
  margin-top: 3px;
}

.potion-slot-buttons {
  grid-template-columns: repeat(2, minmax(68px, 1fr));
  gap: 5px;
}

.potion-slot-button {
  min-height: 27px;
  padding: 5px 7px;
  border-radius: 6px;
  font-size: 10px;
}

.loadout-actions {
  margin-top: 9px;
}

.loadout-actions button {
  padding: 6px 11px;
  font-size: 11px;
}

/* 轨道显示筛选区在当前紧凑尺寸上整体放大 10%。 */
.event-filter-bar {
  min-height: 32px;
  padding: 3px 7px;
  gap: 7px;
}

.event-filter-title,
.event-filter-empty {
  font-size: 9px;
  line-height: 1.1;
}

.event-track-filters {
  gap: 4px;
  padding-bottom: 1px;
}

.event-filter-button {
  min-width: 20px;
  min-height: 20px;
  padding: 2px;
  gap: 3px;
  border-radius: 4px;
  line-height: 1;
}

.event-filter-icon {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.event-filter-button span:not(.icon-fallback),
.event-filter-name {
  font-size: 9px;
}

.event-filter-check {
  width: 9px;
  min-width: 9px;
  height: 9px;
  border-radius: 2px;
  font-size: 7px;
}

.metric-filter-button {
  padding-left: 4px;
}

.metric-filter-swatch {
  width: 11px;
  height: 3px;
  flex-basis: 11px;
}

/* 顶部信息区在上一版基础上继续减半上下留白，保留内容尺寸。 */
.stats-grid {
  margin-bottom: 4px;
  padding-top: 4px;
  padding-bottom: 4px;
}

.summary-cards {
  margin-bottom: 4px;
}

.metric {
  padding-top: 4px;
  padding-bottom: 4px;
}

.metric strong {
  margin-top: 2px;
}

.stability-summary {
  margin-bottom: 5px;
  padding-top: 4px;
  padding-bottom: 4px;
}

.stability-values {
  margin-top: 3px;
}

.timeline-toolbar {
  height: 35px;
}
