* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #0a0e14;
  color: #e5e7eb;
  display: grid;
  grid-template:
    "header   header   header"  56px
    "left     canvas   right"   1fr
    "timeline timeline timeline" 84px
    / 232px 1fr 252px;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* ===== Header ===== */
header {
  grid-area: header;
  background: linear-gradient(180deg, #11141c 0%, #0d1018 100%);
  border-bottom: 1px solid #1f2433;
  display: flex; align-items: center; padding: 0 16px; gap: 12px;
  z-index: 10;
}
.brand {
  font-weight: 800; font-size: 15px; letter-spacing: 2px;
  color: #e5e7eb; margin-right: 8px;
}
.brand-accent { color: #a78bfa; }
.brand-suffix {
  color: #64748b; font-weight: 500; font-size: 12px;
  letter-spacing: 1px; margin-left: 6px;
}

.ctl { display: flex; align-items: center; gap: 6px; }
.tool-group { padding: 3px; background: #161a26; border: 1px solid #1f2433; border-radius: 6px; }

button, select {
  background: transparent; color: #e5e7eb; border: 1px solid transparent;
  padding: 6px 11px; border-radius: 4px; cursor: pointer; font-size: 13px;
  font-family: inherit;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  min-width: 30px;
}
button:hover { background: #232839; }
.tool {
  font-size: 16px; line-height: 1; padding: 6px 10px; min-width: 32px;
  color: #94a3b8;
}
.tool:hover { color: #e5e7eb; background: #232839; }
.tool.active {
  background: #a78bfa; color: #0a0e14;
  box-shadow: 0 0 0 1px #a78bfa, 0 2px 8px rgba(167,139,250,0.35);
}
select {
  background: #161a26; border: 1px solid #1f2433;
  padding: 6px 28px 6px 10px;
  min-width: 140px;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%2394a3b8' d='M0 0l5 6 5-6z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
select:hover { border-color: #a78bfa; }
input[type="color"] {
  -webkit-appearance: none;
  border: 1px solid #2a3448; padding: 0; height: 28px; width: 36px;
  border-radius: 4px; cursor: pointer; background: transparent;
}
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 3px; }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }

/* ===== Palettes ===== */
.palette {
  background: #0d1018; overflow-y: auto; padding: 14px 12px;
}
#agentPalette {
  grid-area: left; border-right: 1px solid #1f2433;
  padding: 0; display: flex; flex-direction: column;
}
.palette-tabs {
  display: flex; padding: 8px 8px 0; gap: 4px;
  border-bottom: 1px solid #1f2433; flex-shrink: 0;
}
.ptab {
  flex: 1; background: transparent; border: none;
  padding: 8px 6px; color: #64748b; cursor: pointer;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.5px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  min-width: 0;
}
.ptab:hover { color: #94a3b8; }
.ptab.active { color: #a78bfa; border-bottom-color: #a78bfa; }
.ptab-count {
  font-size: 9px; color: #64748b; background: #1a1f2e;
  padding: 1px 5px; border-radius: 8px; letter-spacing: 0;
  font-weight: 600;
}
.ptab.active .ptab-count { background: #a78bfa20; color: #a78bfa; }
.ptab-content {
  flex: 1; overflow-y: auto; padding: 14px 12px;
}
.ptab-content.hidden { display: none; }

.weapon-list { display: flex; flex-direction: column; gap: 12px; }
.weapon-section-title {
  font-size: 9px; text-transform: uppercase; letter-spacing: 2px;
  color: #64748b; font-weight: 700; margin-bottom: 4px;
  display: flex; align-items: center;
}
.cat-dot {
  width: 7px; height: 7px; border-radius: 50%;
  margin-right: 6px; flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}
.weapon-section-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
}
.weapon-card {
  position: relative;
  background: #1a1f2e; border-radius: 5px; overflow: hidden;
  cursor: grab; border: 2px solid transparent;
  transition: all 0.15s;
  padding: 6px 8px;
  display: flex; flex-direction: column; gap: 2px;
  min-height: 44px;
}
.weapon-card:hover {
  border-color: #a78bfa;
  background: #232839;
}
.weapon-card:active { cursor: grabbing; }
.weapon-card img {
  width: 100%; height: 20px; object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 0 2px rgba(0,0,0,0.5));
}
.weapon-card .weapon-name {
  font-size: 10px; font-weight: 600; color: #e5e7eb;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.weapon-card .weapon-cost {
  font-size: 9px; color: #94a3b8;
  font-weight: 600; letter-spacing: 0.5px;
}
.weapon-card .weapon-cost.free { color: #64748b; }
.weapon-card .weapon-cost::before { content: "$"; opacity: 0.6; margin-right: 1px; }

.marker-list {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.marker-card {
  background: #1a1f2e; border: 2px solid transparent;
  border-radius: 6px; cursor: grab;
  padding: 10px 6px 8px; transition: all 0.15s;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.marker-card:hover { border-color: #a78bfa; background: #232839; transform: translateY(-1px); }
.marker-card:active { cursor: grabbing; }
.marker-card img {
  width: 36px; height: 36px; pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}
.marker-card .marker-label {
  font-size: 10px; color: #e5e7eb; font-weight: 600; letter-spacing: 0.5px;
}
#abilityPalette { grid-area: right; border-left: 1px solid #1f2433; }
.palette-title {
  font-size: 10px; text-transform: uppercase; letter-spacing: 2.5px;
  color: #64748b; margin-bottom: 10px; padding-bottom: 8px;
  border-bottom: 1px solid #1f2433; font-weight: 700;
}
.palette-sub {
  color: #a78bfa; text-transform: none; letter-spacing: 0.5px;
  font-size: 11px; font-weight: 600;
}
.role-filter {
  display: flex; gap: 3px; margin-bottom: 10px;
  flex-wrap: wrap;
}
.role-chip {
  --rc: #94a3b8;
  flex: 1; min-width: 0;
  padding: 5px 2px; border-radius: 4px;
  background: #1a1f2e; border: 1px solid transparent;
  color: #94a3b8; font-size: 10px; font-weight: 700;
  letter-spacing: 0; cursor: pointer; transition: all 0.15s;
  display: inline-flex;
  flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px;
  white-space: nowrap;
}
.role-chip svg { flex-shrink: 0; width: 11px; height: 11px; }
.role-chip[data-role="all"] svg { display: none; }
.role-chip[data-role="all"] { padding: 8px 2px; }
.role-chip:hover { color: var(--rc); border-color: var(--rc); }
.role-chip.active {
  background: var(--rc); color: #0a0e14;
  border-color: var(--rc);
  box-shadow: 0 0 8px color-mix(in srgb, var(--rc) 50%, transparent);
}

.agent-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px;
}
.agent-card.role-hidden { display: none; }
.agent-group-title.role-hidden { display: none; }
.agent-group-title {
  grid-column: span 3;
  font-size: 9px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
  margin-top: 8px;
  padding: 4px 2px 4px;
  border-bottom: 1px solid #1f2433;
  display: flex; align-items: center; gap: 6px;
}
.agent-group-title:first-child { margin-top: 0; }
.agent-group-title[data-role="Duelist"]    { color: #ef4444; border-color: rgba(239, 68, 68, 0.3); }
.agent-group-title[data-role="Initiator"]  { color: #fbbf24; border-color: rgba(251, 191, 36, 0.3); }
.agent-group-title[data-role="Sentinel"]   { color: #10b981; border-color: rgba(16, 185, 129, 0.3); }
.agent-group-title[data-role="Controller"] { color: #a78bfa; border-color: rgba(167, 139, 250, 0.3); }
.ag-count {
  font-size: 9px; color: #64748b; font-weight: 600;
  background: #1a1f2e; padding: 1px 6px; border-radius: 8px;
  letter-spacing: 0;
}
.agent-card .role-stripe {
  position: absolute; left: 0; right: 0; bottom: 18px;
  height: 2px; background: #94a3b8;
}
.agent-card {
  position: relative; aspect-ratio: 1;
  background: #1a1f2e; border-radius: 5px; overflow: hidden;
  cursor: grab; border: 2px solid transparent;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.agent-card:hover {
  border-color: #a78bfa; transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(167,139,250,0.25);
}
.agent-card:active { cursor: grabbing; }
.agent-card img {
  width: 100%; height: 100%; object-fit: cover;
  pointer-events: none;
}
.agent-card .name {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.92), transparent);
  color: white; font-size: 9px; padding: 10px 2px 3px;
  text-align: center; font-weight: 600;
  letter-spacing: 0.5px; text-transform: uppercase;
}

.ability-list { display: flex; flex-direction: column; gap: 6px; }
.ability-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; background: #1a1f2e; border-radius: 6px;
  cursor: grab; border: 1px solid transparent;
  transition: all 0.15s;
}
.ability-card:hover { border-color: #a78bfa; background: #232839; }
.ability-card:active { cursor: grabbing; }
.ability-card img {
  width: 36px; height: 36px; flex-shrink: 0; pointer-events: none;
  filter: drop-shadow(0 0 4px rgba(167,139,250,0.3));
}
.ability-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ability-name {
  font-size: 12px; font-weight: 600; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.ability-slot {
  font-size: 10px; color: #94a3b8;
  text-transform: uppercase; letter-spacing: 1px;
}
.hint {
  color: #64748b; font-size: 11px; padding: 16px 8px;
  text-align: center; line-height: 1.6;
}

.lineup-title {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.lineup-actions { display: inline-flex; gap: 4px; }
.mini-btn {
  background: #1a1f2e; border: 1px solid #2a3448; color: #94a3b8;
  width: 22px; height: 22px; padding: 0;
  font-size: 13px; line-height: 1;
  border-radius: 4px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px;
}
.mini-btn:hover { color: #a78bfa; border-color: #a78bfa; }

.lineup-list { display: flex; flex-direction: column; gap: 4px; }
.lineup-card {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; background: #1a1f2e; border-radius: 5px;
  cursor: pointer; border: 1px solid transparent;
  transition: all 0.15s;
  position: relative;
}
.lineup-card:hover { border-color: #a78bfa; background: #232839; }
.lineup-avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid #a78bfa;
  object-fit: cover;
  flex-shrink: 0;
}
.lineup-avatar-empty {
  background: #2a3448;
}
.lineup-body {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 1px;
}
.lineup-card .lineup-name {
  font-size: 12px; color: #e5e7eb; font-weight: 600;
  min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lineup-card .lineup-sub {
  font-size: 9px; color: #94a3b8; letter-spacing: 0.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lineup-filter {
  margin-bottom: 8px;
}
.lineup-filter .role-chip {
  font-size: 9px;
  padding: 4px 1px;
}
.lineup-filter .role-chip svg { width: 9px; height: 9px; }
.lineup-card .lineup-meta {
  font-size: 9px; color: #64748b;
  letter-spacing: 0.5px; flex-shrink: 0;
}
.lineup-card .lineup-del {
  background: transparent; border: none; color: #64748b;
  font-size: 14px; line-height: 1; cursor: pointer;
  padding: 0 4px; opacity: 0; transition: opacity 0.15s;
  min-width: 0;
}
.lineup-card:hover .lineup-del { opacity: 1; }
.lineup-card .lineup-del:hover { color: #ef4444; }

.lineup-card .lineup-info {
  background: transparent; border: none; color: #64748b;
  font-size: 14px; line-height: 1; cursor: pointer;
  padding: 0 4px; opacity: 0; transition: opacity 0.15s;
  min-width: 0;
}
.lineup-card:hover .lineup-info { opacity: 1; }
.lineup-card .lineup-info:hover { color: #a78bfa; }
.lineup-card .lineup-star {
  background: transparent; border: none;
  font-size: 14px; line-height: 1; cursor: pointer;
  padding: 0 4px; opacity: 0; transition: opacity 0.15s;
  color: #64748b; min-width: 0;
}
.lineup-card:hover .lineup-star { opacity: 1; }
.lineup-card .lineup-star.on {
  color: #fbbf24; opacity: 1;
}
.lineup-card .lineup-star:hover { color: #fbbf24; }
.lu-has-video {
  font-size: 11px; margin-left: 4px; opacity: 0.7;
}

.selection-info {
  font-size: 11px; color: #94a3b8;
  background: #1a1f2e; border: 1px solid #2a3448;
  border-radius: 6px; padding: 10px 12px;
  line-height: 1.55;
  max-height: 240px; overflow-y: auto;
  display: flex; gap: 10px; align-items: flex-start;
}
.selection-info.hidden { display: none; }
.selection-info .si-icon {
  width: 40px; height: 40px;
  border: 2px solid #a78bfa;
  border-radius: 4px;
  object-fit: contain;
  flex-shrink: 0;
  background: #0d1018;
}
.selection-info .si-icon-circle { border-radius: 50%; object-fit: cover; }
.selection-info .si-icon-weapon { height: 24px; align-self: center; padding: 2px; }
.selection-info .si-icon-marker {
  border-radius: 50%; box-shadow: 0 0 8px currentColor; border: none;
  width: 24px; height: 24px; margin-top: 4px;
}
.selection-info .si-body { flex: 1; min-width: 0; }
.selection-info .si-name {
  color: #e5e7eb; font-weight: 700; font-size: 13px;
  display: block; margin-bottom: 2px;
}
.selection-info .si-meta {
  color: #64748b; font-size: 10px;
  letter-spacing: 1px; text-transform: uppercase;
  margin-bottom: 8px;
}
.selection-info .si-desc {
  color: #94a3b8; font-size: 11px;
}

.tips { list-style: none; padding: 4px 0; }
.tips.hidden { display: none; }
.tips li {
  color: #94a3b8; font-size: 11px; padding: 4px 0 4px 14px;
  position: relative; line-height: 1.5;
}
.tips li::before {
  content: "▸"; position: absolute; left: 0; color: #a78bfa;
}

/* ===== Canvas ===== */
#canvasWrap {
  grid-area: canvas; background: #0a0e14;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; overflow: hidden; position: relative;
}
.canvas-container {
  box-shadow: 0 0 60px rgba(167,139,250,0.12), 0 0 0 1px #1f2433;
  border-radius: 4px;
}
canvas { display: block; border-radius: 4px; }

/* 准星 overlay:绝对定位浮在主 canvas 上,pointer-events 透明,不挡操作 */
#crosshairOverlay {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 10;
  /* mix-blend-mode: screen 让暗色背景下白色准星更亮 */
  mix-blend-mode: screen;
}
#crosshairOverlay.hidden { display: none; }

.loading {
  position: absolute; color: #94a3b8; font-size: 13px;
  letter-spacing: 1px;
}
.loading.hidden { display: none; }

/* ===== Floating canvas controls ===== */
#floatingControls {
  position: absolute; top: 12px; right: 12px;
  display: flex; gap: 8px; align-items: center;
  z-index: 5;
}
.floating-btn {
  background: rgba(13, 16, 24, 0.85); backdrop-filter: blur(8px);
  border: 1px solid #2a3448; color: #94a3b8;
  padding: 5px 10px; border-radius: 4px;
  font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase;
  cursor: pointer; transition: all 0.15s;
}
.floating-btn:hover { color: #e5e7eb; border-color: #a78bfa; }
.floating-btn.active { background: #a78bfa; color: #0a0e14; border-color: #a78bfa; }

.floating-slider {
  display: flex; align-items: center; gap: 8px;
  background: rgba(13, 16, 24, 0.85); backdrop-filter: blur(8px);
  border: 1px solid #2a3448; padding: 4px 10px; border-radius: 4px;
}
.fs-label {
  font-size: 10px; color: #64748b; letter-spacing: 1.5px; text-transform: uppercase;
  font-weight: 700;
}
.fs-value {
  font-size: 11px; color: #a78bfa; font-weight: 600;
  min-width: 36px; text-align: right;
  font-variant-numeric: tabular-nums;
}
#sizeSlider {
  -webkit-appearance: none; appearance: none;
  width: 90px; height: 4px; background: #2a3448;
  border-radius: 2px; outline: none; cursor: pointer;
}
#sizeSlider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; background: #a78bfa;
  border-radius: 50%; cursor: pointer;
  box-shadow: 0 0 0 2px #0a0e14;
}
#sizeSlider::-moz-range-thumb {
  width: 14px; height: 14px; background: #a78bfa;
  border-radius: 50%; cursor: pointer; border: 2px solid #0a0e14;
}

/* ===== Playback progress bar ===== */
#playbackProgress {
  position: fixed;
  left: 232px; right: 252px;
  bottom: 84px;
  height: 3px;
  background: #1f2433;
  z-index: 6;
  transition: opacity 0.25s;
}
#playbackProgress.hidden { opacity: 0; pointer-events: none; visibility: hidden; }
#playbackProgress:hover { height: 5px; bottom: 83px; }
#playbackProgress.scrubbing { height: 5px; bottom: 83px; }
#playbackProgress.scrubbing .playback-fill { transition: none; }
.playback-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, #a78bfa, #c4b5fd);
  transition: width 0.2s linear;
  box-shadow: 0 0 8px rgba(167,139,250,0.6);
}
.playback-label {
  position: absolute;
  top: -22px; right: 0;
  font-size: 10px; color: #a78bfa;
  background: rgba(13,16,24,0.9);
  padding: 3px 8px; border-radius: 3px;
  letter-spacing: 1.5px; text-transform: uppercase;
  font-weight: 700;
  border: 1px solid #2a3448;
}

/* ===== Timeline ===== */
#timeline {
  grid-area: timeline;
  background: linear-gradient(180deg, #0d1018, #11141c);
  border-top: 1px solid #1f2433;
  display: flex; align-items: center; padding: 0 16px; gap: 12px;
  overflow: hidden;
}
.timeline-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 2.5px;
  color: #64748b; font-weight: 700; flex-shrink: 0;
}
.timeline-status {
  display: flex; flex-direction: column;
  flex-shrink: 0; gap: 2px;
  padding-right: 4px; min-width: 70px;
}
.status-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 2px;
  color: #64748b; font-weight: 700;
}
.status-meta {
  font-size: 10px; color: #94a3b8; font-weight: 500;
  letter-spacing: 0.3px;
  font-variant-numeric: tabular-nums;
}
.save-status::before {
  content: "○"; margin-right: 4px;
  color: #64748b;
}
.save-status.ok { color: #10b981; }
.save-status.ok::before { content: "✓"; color: #10b981; }
.save-status.fail { color: #ef4444; }
.save-status.fail::before { content: "✕"; color: #ef4444; }
.rounds-list {
  display: flex; gap: 8px; overflow-x: auto;
  flex: 1; padding: 4px 0;
}
.round-card {
  flex-shrink: 0;
  position: relative;
  width: 100px; height: 60px;
  background: #1a1f2e; border: 2px solid transparent;
  border-radius: 6px;
  cursor: pointer; padding: 8px 10px;
  display: flex; flex-direction: column; justify-content: space-between;
  transition: all 0.15s;
}
.round-card:hover { border-color: #2a3448; background: #232839; }
.round-card.active {
  border-color: #a78bfa;
  box-shadow: 0 0 0 1px #a78bfa, 0 4px 12px rgba(167,139,250,0.3);
}
.round-card .round-thumb {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  border-radius: 4px; opacity: 0.35;
  pointer-events: none;
}
.round-card.active .round-thumb { opacity: 0.5; }
.round-card .round-num, .round-card .round-name { position: relative; z-index: 1; }
.round-card .round-name {
  text-shadow: 0 1px 2px rgba(0,0,0,0.9), 0 0 4px rgba(0,0,0,0.6);
}
.round-card .round-num {
  font-size: 9px; color: #64748b; letter-spacing: 1.5px; text-transform: uppercase;
  font-weight: 700;
}
.round-card.active .round-num { color: #a78bfa; }
.round-card .round-name {
  font-size: 13px; color: #e5e7eb; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.round-card .round-delete {
  position: absolute; top: 3px; right: 3px;
  width: 16px; height: 16px; padding: 0;
  background: transparent; border: none; color: #64748b;
  font-size: 14px; line-height: 1; cursor: pointer;
  opacity: 0; transition: opacity 0.15s;
  border-radius: 3px; min-width: 0;
}
.round-card:hover .round-delete { opacity: 1; }
.round-card .round-delete:hover { color: #ef4444; background: rgba(239,68,68,0.1); }
.round-add {
  flex-shrink: 0;
  height: 60px; padding: 0 16px;
  background: transparent; border: 1px dashed #2a3448; color: #94a3b8;
  border-radius: 6px; font-size: 12px;
  cursor: pointer; transition: all 0.15s;
}
.round-add:hover { border-color: #a78bfa; color: #a78bfa; border-style: solid; }
.timeline-btn {
  flex-shrink: 0;
  height: 60px; padding: 0 14px;
  background: transparent; border: 1px solid #2a3448; color: #94a3b8;
  border-radius: 6px; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
}
.timeline-btn:hover { border-color: #a78bfa; color: #a78bfa; }
.timeline-select {
  flex-shrink: 0; height: 60px;
  background: transparent; border: 1px solid #2a3448; color: #94a3b8;
  padding: 0 26px 0 12px; border-radius: 6px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%2394a3b8' d='M0 0l5 6 5-6z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: all 0.15s;
}
.timeline-select:hover { border-color: #a78bfa; color: #a78bfa; }
.timeline-select:focus-visible { outline: 1px solid #a78bfa; outline-offset: 1px; }
.timeline-btn.playing { border-color: #10b981; color: #10b981; }
.timeline-btn.recording {
  border-color: #ef4444; color: #ef4444;
  animation: rec-pulse 1.2s infinite;
}
@keyframes rec-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
  50%      { box-shadow: 0 0 0 4px rgba(239,68,68,0); }
}

/* ===== Context Menu ===== */
.context-menu {
  position: fixed; z-index: 100;
  background: #11141c; border: 1px solid #2a3448;
  border-radius: 6px; padding: 4px;
  min-width: 160px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.55), 0 0 0 1px rgba(167,139,250,0.15);
  font-size: 13px;
}
.context-menu.hidden { display: none; }
.context-menu button {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; padding: 7px 12px; text-align: left;
  background: transparent; border: none; border-radius: 4px;
  color: #e5e7eb; cursor: pointer; font-size: 12px;
  min-width: 0;
}
.context-menu button:hover { background: #232839; color: #a78bfa; }
.context-menu button.danger:hover { background: rgba(239,68,68,0.15); color: #ef4444; }
.context-menu button kbd {
  font-size: 10px; color: #64748b; background: #1a1f2e;
  padding: 1px 5px; border-radius: 3px; font-family: inherit;
  letter-spacing: 0.5px;
}
.ctx-color-row {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 8px;
}
.ctx-color-label {
  font-size: 11px; color: #94a3b8; flex: 1;
}
.ctx-color-dot {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid #2a3448 !important;
  cursor: pointer; padding: 0 !important;
  min-width: 0 !important;
  display: flex !important; align-items: center; justify-content: center;
  transition: transform 0.1s;
}
.ctx-color-dot:hover { transform: scale(1.18); border-color: #fff !important; }
.context-sep {
  height: 1px; background: #1f2433; margin: 4px 0;
}

/* ===== Help Modal ===== */
.modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
}
.modal.hidden { display: none; }
.modal-bg {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}
.modal-card {
  position: relative;
  background: #11141c; border: 1px solid #2a3448;
  border-radius: 10px;
  width: min(680px, 90vw);
  max-height: 86vh;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(167,139,250,0.2);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid #1f2433;
}
.modal-header h3 {
  font-size: 14px; letter-spacing: 2px; text-transform: uppercase;
  color: #a78bfa; font-weight: 700; margin: 0;
}
.modal-close {
  background: transparent; border: none; color: #94a3b8;
  font-size: 22px; line-height: 1; cursor: pointer;
  padding: 4px 10px; border-radius: 4px;
  min-width: 0;
}
.modal-close:hover { color: #ef4444; background: rgba(239,68,68,0.1); }
.modal-body {
  overflow-y: auto; padding: 16px 24px 22px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px 32px;
}
.modal-body section h4 {
  font-size: 10px; text-transform: uppercase; letter-spacing: 2.5px;
  color: #64748b; font-weight: 700; margin: 0 0 8px;
  padding-bottom: 6px; border-bottom: 1px solid #1f2433;
}
.kbd-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 0; gap: 12px; font-size: 12px;
}
.kbd-row > span:first-child {
  color: #e5e7eb; font-weight: 500;
  display: inline-flex; align-items: center; gap: 4px;
  white-space: nowrap;
}
.kbd-row > span:last-child {
  color: #94a3b8; font-size: 11px;
  text-align: right;
}
.kbd-row kbd {
  font-size: 10px; color: #a78bfa;
  background: #1a1f2e;
  border: 1px solid #2a3448;
  padding: 2px 7px; border-radius: 4px;
  font-family: -apple-system, "Helvetica Neue", monospace;
  letter-spacing: 0.5px;
}
.role-swatch {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 5px currentColor;
  margin-right: 4px;
}

/* ===== Canvas hover tooltip ===== */
.canvas-tooltip {
  position: fixed;
  background: rgba(13, 16, 24, 0.95);
  border: 1px solid #a78bfa;
  color: #e5e7eb;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.3px;
  pointer-events: none;
  z-index: 220;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
}
.canvas-tooltip.hidden { display: none; }

/* ===== Update banner(新版本提示)===== */
.update-banner {
  position: fixed; top: 12px; left: 50%;
  transform: translateX(-50%);
  z-index: 250;
  display: flex; align-items: center; gap: 12px;
  background: #11141c; border: 1px solid #a78bfa;
  border-radius: 6px;
  padding: 8px 14px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.6), 0 0 0 1px rgba(167,139,250,0.3);
  font-size: 12px; color: #e5e7eb;
  letter-spacing: 0.4px;
}
.update-banner.hidden { display: none; }
.update-banner button {
  background: #a78bfa; color: #0a0e14;
  border: none; padding: 4px 12px; border-radius: 4px;
  cursor: pointer; font-size: 12px; font-weight: 700;
  min-width: 50px;
}
.update-banner button:hover { background: #c4b5fd; }
.update-banner button#updateBannerClose {
  background: transparent; color: #64748b;
  padding: 0 4px; font-size: 16px; min-width: auto;
}
.update-banner button#updateBannerClose:hover { color: #ef4444; background: transparent; }

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 100px; left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: #11141c; border: 1px solid #a78bfa;
  color: #e5e7eb; padding: 10px 18px; border-radius: 6px;
  font-size: 13px; letter-spacing: 0.5px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.55), 0 0 0 1px rgba(167,139,250,0.2);
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 1000;
}
.toast.show {
  opacity: 1; transform: translateX(-50%) translateY(0);
}
.toast.hidden { display: none; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a3448; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3a4458; }

/* ===== Crosshair Modal(strats.gg 风格) ===== */
.modal-card-wide { width: min(960px, 94vw); }
.crosshair-body {
  grid-template-columns: 1.1fr 1fr !important;
  gap: 24px !important;
  padding: 18px 24px 22px !important;
}
.crosshair-left section { margin-bottom: 16px; }
.crosshair-left section h4 {
  display: flex; align-items: center; gap: 8px; justify-content: space-between;
}
.ch-count {
  background: #1a1f2e; color: #a78bfa;
  font-size: 10px; padding: 2px 8px; border-radius: 10px;
  border: 1px solid #2a3448;
}
.ch-input {
  width: 100%; box-sizing: border-box;
  background: #0a0e14; border: 1px solid #2a3448;
  color: #e5e7eb; font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 11px; line-height: 1.4;
  padding: 8px 10px; border-radius: 6px;
  resize: vertical;
}
.ch-input:focus { outline: none; border-color: #a78bfa; box-shadow: 0 0 0 1px rgba(167,139,250,0.4); }
.ch-row {
  display: flex; gap: 8px; margin-top: 8px; align-items: center;
}
.ch-name {
  flex: 1; background: #0a0e14; border: 1px solid #2a3448;
  color: #e5e7eb; padding: 6px 10px; border-radius: 6px;
  font-size: 12px;
}
.ch-name:focus { outline: none; border-color: #a78bfa; }
.ch-row button.primary {
  background: #a78bfa; color: #0a0e14; border: none;
  padding: 6px 14px; border-radius: 6px; font-weight: 700;
  cursor: pointer; font-size: 12px;
}
.ch-row button.primary:hover { background: #c4b5fd; }
.ch-tip {
  color: #64748b; font-size: 10.5px; margin-top: 6px; line-height: 1.5;
}
.ch-presets {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 6px;
}
.ch-preset {
  background: #131826; border: 1px solid #1f2433;
  border-radius: 6px; padding: 6px 4px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: all 0.15s;
}
.ch-preset:hover { border-color: #a78bfa; transform: translateY(-1px); }
.ch-preset canvas {
  width: 56px; height: 56px; background: #0a0e14;
  border-radius: 4px;
}
.ch-preset .ch-preset-name {
  font-size: 10px; color: #e5e7eb; font-weight: 600;
  letter-spacing: 0.5px;
}
.ch-saved-list {
  max-height: 220px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px;
}
.ch-saved-empty {
  color: #475569; font-size: 11px; text-align: center;
  padding: 20px 0; font-style: italic;
}
.ch-saved-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 6px; cursor: pointer;
  background: #131826; border: 1px solid #1f2433;
  transition: all 0.15s;
}
.ch-saved-item:hover { border-color: #a78bfa; background: #1a1f2e; }
.ch-saved-item.active {
  border-color: #a78bfa;
  box-shadow: 0 0 0 1px rgba(167,139,250,0.3);
}
.ch-saved-item canvas {
  width: 36px; height: 36px; background: #0a0e14;
  border-radius: 4px; flex-shrink: 0;
}
.ch-saved-meta {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.ch-saved-name {
  font-size: 12px; color: #e5e7eb; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ch-saved-code {
  font-size: 9px; color: #64748b;
  font-family: ui-monospace, monospace;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ch-saved-del {
  background: transparent; border: none; color: #64748b;
  font-size: 14px; padding: 4px 6px; cursor: pointer; border-radius: 4px;
}
.ch-saved-del:hover { color: #ef4444; background: rgba(239,68,68,0.1); }

.crosshair-right {
  display: flex; flex-direction: column; gap: 14px;
}
.ch-preview-wrap {
  position: relative;
  background: linear-gradient(135deg, #1a2333 0%, #0a0e14 100%);
  border: 1px solid #2a3448;
  border-radius: 10px;
  padding: 16px;
  display: flex; align-items: center; justify-content: center;
  min-height: 312px;
}
#chPreviewCanvas {
  display: block;
  image-rendering: pixelated;
}
.ch-preview-label {
  position: absolute; top: 8px; left: 12px;
  font-size: 9px; letter-spacing: 2px; text-transform: uppercase;
  color: #64748b; font-weight: 700;
}
.ch-actions {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
}
.ch-actions button {
  background: #131826; border: 1px solid #1f2433; color: #e5e7eb;
  padding: 8px; border-radius: 6px; cursor: pointer;
  font-size: 11px; font-weight: 600;
  transition: all 0.15s;
}
.ch-actions button:hover { border-color: #a78bfa; color: #a78bfa; }
.ch-params {
  background: #0a0e14; border: 1px solid #1f2433;
  border-radius: 8px; padding: 12px;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4px 16px;
  font-size: 11px;
  font-family: ui-monospace, "Cascadia Code", monospace;
}
.ch-param-row {
  display: flex; justify-content: space-between;
  padding: 2px 0;
}
.ch-param-key { color: #64748b; }
.ch-param-val { color: #a78bfa; font-weight: 600; }

/* ===== Lineup 卡片元数据(strats.gg 风格)===== */
.lineup-card-meta {
  display: flex; align-items: center; gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.lu-type-badge {
  font-size: 9px; letter-spacing: 0.5px;
  padding: 2px 6px; border-radius: 3px;
  background: rgba(167,139,250,0.15);
  color: #c4b5fd;
  text-transform: uppercase;
  font-weight: 700;
}
.lu-type-smoke { background: rgba(148,163,184,0.15); color: #cbd5e1; }
.lu-type-flash { background: rgba(251,191,36,0.18); color: #fbbf24; }
.lu-type-molly { background: rgba(239,68,68,0.18); color: #fca5a5; }
.lu-type-recon { background: rgba(96,165,250,0.18); color: #93c5fd; }
.lu-type-setup { background: rgba(16,185,129,0.18); color: #6ee7b7; }
.lu-site-badge {
  font-size: 9px; padding: 2px 6px; border-radius: 3px;
  background: #1a1f2e; color: #e5e7eb;
  font-weight: 700;
}
.lineup-search {
  width: 100%; box-sizing: border-box;
  background: #0a0e14; border: 1px solid #2a3448;
  color: #e5e7eb; padding: 5px 10px; border-radius: 6px;
  font-size: 11.5px; margin-bottom: 6px;
}
.lineup-search:focus { outline: none; border-color: #a78bfa; }
.lu-ai-score {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  background: rgba(167,139,250,0.22);
  color: #c4b5fd;
  border: 1px solid rgba(167,139,250,0.45);
  border-radius: 8px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  font-family: ui-monospace, monospace;
  vertical-align: middle;
}
.lu-tag-chip {
  font-size: 9.5px; padding: 1px 6px; border-radius: 8px;
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.3);
  color: #67e8f9; font-weight: 600;
  letter-spacing: 0.3px;
}
.lu-tag-more {
  font-size: 9px; color: #64748b; font-weight: 600;
  padding: 1px 4px;
}
.lu-diff {
  display: inline-flex; gap: 1px; color: #fbbf24;
  font-size: 10px;
}
.lu-diff-empty { color: #2a3448; }
.lineup-filter-extra {
  display: flex; gap: 6px; margin-top: 6px;
  flex-wrap: wrap;
}
.lineup-filter-extra select {
  background: #0a0e14; color: #e5e7eb; border: 1px solid #2a3448;
  border-radius: 4px; padding: 3px 6px; font-size: 11px;
  min-height: 0;
}
.lineup-filter-extra select:focus { border-color: #a78bfa; outline: none; }

/* ===== Crosshair Editor(调参面板)===== */
.ch-editor {
  background: #0a0e14; border: 1px solid #1f2433;
  border-radius: 8px; padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
}
.ch-edit-row {
  display: flex; align-items: center; gap: 10px;
}
.ch-edit-label {
  font-size: 10.5px; color: #94a3b8; min-width: 36px;
  letter-spacing: 0.5px;
}
.ch-color-row {
  display: flex; gap: 4px; flex-wrap: wrap;
}
.ch-color-swatch {
  width: 18px; height: 18px; border-radius: 3px;
  border: 1.5px solid #2a3448; cursor: pointer;
  padding: 0; transition: all 0.12s;
}
.ch-color-swatch:hover { transform: scale(1.15); }
.ch-color-swatch.active {
  border-color: #a78bfa;
  box-shadow: 0 0 0 1px rgba(167,139,250,0.5);
}
.ch-color-custom {
  width: 22px !important; height: 22px;
  background: linear-gradient(135deg, #ff0080 0%, #ffff00 50%, #00ffff 100%);
}
.ch-edit-group {
  background: #131826; border: 1px solid #1f2433;
  border-radius: 6px; padding: 6px 8px;
  display: flex; flex-direction: column; gap: 4px;
}
.ch-edit-group.disabled .ch-slider-row {
  opacity: 0.4; pointer-events: none;
}
.ch-toggle {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; color: #e5e7eb;
  cursor: pointer; user-select: none;
}
.ch-toggle input { accent-color: #a78bfa; cursor: pointer; }
.ch-slider-row {
  display: grid; grid-template-columns: 44px 1fr 28px;
  gap: 8px; align-items: center;
  font-size: 10px; color: #94a3b8;
}
.ch-slider-row input[type=range] {
  width: 100%; accent-color: #a78bfa;
  height: 4px;
}
.ch-sl-val {
  color: #a78bfa; font-family: ui-monospace, monospace;
  font-size: 10px; text-align: right; font-weight: 600;
}
.ch-reset {
  margin-top: 4px;
  background: transparent; border: 1px dashed #2a3448;
  color: #94a3b8; padding: 4px; border-radius: 4px;
  cursor: pointer; font-size: 11px;
}
.ch-reset:hover { border-color: #a78bfa; color: #a78bfa; }

/* ===== Guide Modal(攻略中心,3DM 风格)===== */
.guide-search {
  flex: 0 0 240px;
  background: #0a0e14; border: 1px solid #2a3448;
  color: #e5e7eb; padding: 6px 10px; border-radius: 6px;
  font-size: 12px; margin: 0 12px;
}
.guide-search:focus { outline: none; border-color: #a78bfa; }
.modal-header { gap: 12px; }
.guide-body {
  grid-template-columns: 180px 1fr !important;
  gap: 0 !important;
  padding: 0 !important;
  min-height: 60vh; max-height: 80vh;
}
.guide-nav {
  background: #0a0e14; border-right: 1px solid #1f2433;
  padding: 12px 8px;
  display: flex; flex-direction: column; gap: 4px;
}
.guide-tab {
  background: transparent; border: 1px solid transparent;
  color: #94a3b8; padding: 9px 12px;
  border-radius: 6px; cursor: pointer;
  text-align: left; font-size: 12px; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
  transition: all 0.12s;
}
.guide-tab:hover { color: #e5e7eb; background: #131826; }
.guide-tab.active {
  background: rgba(167,139,250,0.12);
  color: #a78bfa;
  border-color: rgba(167,139,250,0.3);
}
.guide-source {
  margin-top: auto; padding-top: 16px;
  font-size: 9.5px; color: #475569;
  text-align: center; line-height: 1.5;
  border-top: 1px dashed #1f2433;
}
.guide-content {
  overflow-y: auto;
  padding: 18px 22px 22px;
  color: #e5e7eb; font-size: 12.5px; line-height: 1.6;
}
.guide-content h4 {
  font-size: 13px; color: #c4b5fd;
  margin: 0 0 12px; padding-bottom: 8px;
  border-bottom: 1px solid #1f2433;
  letter-spacing: 0.5px;
}
.guide-content h5 {
  font-size: 11px; color: #94a3b8;
  margin: 18px 0 8px;
  text-transform: uppercase; letter-spacing: 1.5px;
  font-weight: 700;
}
.guide-content p {
  margin: 0 0 10px; color: #cbd5e1; font-size: 12px;
}
.guide-content ul, .guide-content ol {
  margin: 0 0 12px; padding-left: 20px;
  color: #cbd5e1; font-size: 12px;
}
.guide-content li { margin-bottom: 4px; }
.guide-content code {
  background: #1a1f2e; padding: 2px 6px; border-radius: 3px;
  font-family: ui-monospace, monospace; font-size: 10.5px;
  color: #fbbf24;
}
.guide-content table {
  width: 100%; border-collapse: collapse;
  margin-bottom: 14px; font-size: 11.5px;
}
.guide-content th, .guide-content td {
  text-align: left; padding: 6px 10px;
  border-bottom: 1px solid #1f2433;
}
.guide-content th {
  color: #a78bfa; font-weight: 700;
  background: #131826;
  text-transform: uppercase; font-size: 10px; letter-spacing: 1px;
}
.guide-content tr:hover td { background: #131826; }
.guide-content .g-tag {
  display: inline-block; padding: 1px 8px;
  border-radius: 10px; font-size: 10px;
  background: rgba(167,139,250,0.15); color: #c4b5fd;
  font-weight: 700;
}
.guide-content .g-tag-duelist    { background: rgba(239,68,68,0.18); color: #fca5a5; }
.guide-content .g-tag-initiator  { background: rgba(251,191,36,0.20); color: #fbbf24; }
.guide-content .g-tag-sentinel   { background: rgba(16,185,129,0.18); color: #6ee7b7; }
.guide-content .g-tag-controller { background: rgba(167,139,250,0.18); color: #c4b5fd; }

.guide-map-select {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px;
}
.guide-map-chip {
  background: #131826; border: 1px solid #1f2433;
  color: #cbd5e1; padding: 5px 12px; border-radius: 14px;
  cursor: pointer; font-size: 11px;
  transition: all 0.12s;
}
.guide-map-chip:hover { border-color: #a78bfa; color: #a78bfa; }
.guide-map-chip.active {
  background: rgba(167,139,250,0.15);
  border-color: #a78bfa; color: #a78bfa; font-weight: 700;
}
.guide-callout-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 6px;
}
.guide-callout-item {
  background: #131826; border: 1px solid #1f2433;
  padding: 6px 10px; border-radius: 6px;
  font-size: 11px;
}
.guide-callout-item .gc-en { color: #a78bfa; font-weight: 700; }
.guide-callout-item .gc-zh { color: #94a3b8; font-size: 10.5px; margin-top: 2px; }

.guide-agent-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 8px; margin-bottom: 16px;
}
.guide-agent-chip {
  background: #131826; border: 2px solid transparent;
  border-radius: 8px; padding: 6px;
  cursor: pointer; transition: all 0.12s;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.guide-agent-chip:hover { transform: translateY(-1px); }
.guide-agent-chip.active { border-color: #a78bfa; }
.guide-agent-chip img {
  width: 48px; height: 48px; border-radius: 50%;
  border: 2px solid #2a3448;
}
.guide-agent-chip .gac-name {
  font-size: 10px; color: #e5e7eb; font-weight: 600;
}
.guide-ability-row {
  display: grid; grid-template-columns: 60px 1fr;
  gap: 12px; padding: 10px 0;
  border-bottom: 1px solid #1f2433;
}
.guide-ability-row:last-child { border-bottom: 0; }
.guide-ability-slot {
  background: #1a1f2e; border-radius: 6px;
  padding: 6px; text-align: center;
  font-size: 10px; color: #94a3b8;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.guide-ability-slot img { width: 32px; height: 32px; }
.guide-ability-slot .gas-key {
  font-family: ui-monospace, monospace; color: #fbbf24; font-weight: 700;
}
.guide-ability-body h6 {
  font-size: 13px; color: #e5e7eb; margin: 0 0 4px;
}
.guide-ability-body .gab-tip {
  background: rgba(251,191,36,0.10);
  border-left: 2px solid #fbbf24;
  padding: 6px 10px; margin-top: 6px;
  font-size: 11.5px; color: #fde68a; border-radius: 0 4px 4px 0;
}

.guide-rank-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.guide-rank-item {
  background: #131826; border-left: 3px solid var(--rk, #a78bfa);
  padding: 8px 12px; border-radius: 0 6px 6px 0;
  font-size: 11px;
}
.guide-rank-item .gri-name { color: #e5e7eb; font-weight: 700; font-size: 13px; }
.guide-rank-item .gri-pct { color: #64748b; font-size: 10px; margin-top: 2px; }

.guide-empty { color: #64748b; text-align: center; padding: 40px 0; font-size: 13px; }

/* ===== 🔊 Speak 按钮(浏览器 TTS 朗读英文)===== */
.term-speak {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; padding: 0;
  margin-right: 6px;
  vertical-align: -4px;
  background: rgba(167,139,250,0.10);
  border: 1px solid rgba(167,139,250,0.25);
  color: #a78bfa;
  border-radius: 50%;
  cursor: pointer;
  font-size: 11px; line-height: 1;
  transition: all 0.15s;
  min-width: 22px;  /* 防止被 reset 覆盖 */
}
.term-speak:hover {
  background: #a78bfa;
  color: #0a0e14;
  transform: scale(1.12);
}
.term-speak:active { transform: scale(0.95); }
.term-speak.playing {
  background: #a78bfa;
  color: #0a0e14;
  animation: speak-pulse 1.2s ease-in-out infinite;
}
@keyframes speak-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(167,139,250, 0.55); }
  50%      { box-shadow: 0 0 0 7px rgba(167,139,250, 0); }
}

/* 表格里的 td 第一个 cell 让按钮 + 文本贴齐 */
.guide-content td .term-speak { margin-right: 8px; }
/* h6 / h5 标题里的按钮稍微再小一点对齐 */
.guide-ability-body h6 .term-speak,
.gri-name .term-speak {
  width: 20px; height: 20px; font-size: 10px;
  vertical-align: -2px; margin-right: 5px;
}

/* ===== Layers panel(图层显隐浮窗)===== */
.layers-panel {
  position: fixed; right: 20px; top: 70px;
  background: #11141c; border: 1px solid #2a3448;
  border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,0.5);
  width: 220px; z-index: 150;
  display: flex; flex-direction: column;
}
.layers-panel.hidden { display: none; }
.layers-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; border-bottom: 1px solid #1f2433;
  font-size: 11px; color: #a78bfa; font-weight: 700;
  letter-spacing: 1px;
}
.layers-header button {
  background: transparent; border: none; color: #64748b;
  cursor: pointer; font-size: 18px; padding: 0 4px; min-width: 0;
}
.layers-header button:hover { color: #ef4444; }
.layers-body {
  padding: 8px 12px 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.layer-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; border-radius: 5px;
  font-size: 12px; color: #e5e7eb; cursor: pointer;
  user-select: none;
}
.layer-row:hover { background: #131826; }
.layer-row input { accent-color: #a78bfa; cursor: pointer; }
.layer-dot {
  width: 10px; height: 10px; border-radius: 50%;
  flex-shrink: 0;
}
.layers-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  margin-top: 8px; padding-top: 8px;
  border-top: 1px dashed #1f2433;
}
.layers-actions button {
  background: #131826; border: 1px solid #1f2433;
  color: #cbd5e1; padding: 5px; border-radius: 5px;
  cursor: pointer; font-size: 11px;
}
.layers-actions button:hover { border-color: #a78bfa; color: #a78bfa; }

/* 自定义地图 option 标识 */
#mapSelect option.custom-map { color: #fbbf24; font-style: italic; }

/* 📂 本地文件夹联动按钮(联动时绿色) */
#folderSyncBtn.folder-linked {
  background: rgba(16,185,129,0.18);
  border-color: #10b981 !important;
  color: #6ee7b7;
}

/* ===== 顶栏下拉菜单(v66 布局哲学重构)===== */
.menu-wrap {
  position: relative; display: inline-flex;
}
.menu-trigger {
  /* 复用现有 header button 样式即可 */
}
.menu-trigger.open {
  background: rgba(167,139,250,0.18);
  border-color: #a78bfa !important;
  color: #a78bfa;
}
.menu-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0;
  background: #11141c; border: 1px solid #2a3448;
  border-radius: 8px;
  padding: 4px;
  min-width: 200px;
  z-index: 150;
  box-shadow: 0 10px 28px rgba(0,0,0,0.55), 0 0 0 1px rgba(167,139,250,0.15);
  display: none;
}
.menu-dropdown.open { display: block; }
.menu-dropdown button {
  display: block !important; width: 100%; text-align: left;
  background: transparent; border: none;
  color: #e5e7eb;
  padding: 8px 12px !important;
  border-radius: 5px; cursor: pointer;
  font-size: 12.5px !important;
  margin: 0;
}
.menu-dropdown button:hover {
  background: rgba(167,139,250,0.12);
  color: #a78bfa;
}
.menu-sep {
  height: 1px; background: #1f2433;
  margin: 4px 6px;
}

/* ===== ⌘K 命令面板(v67) ===== */
.cmdk-modal {
  position: fixed; inset: 0; z-index: 400;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 12vh;
}
.cmdk-modal.hidden { display: none; }
.cmdk-bg {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
}
.cmdk-card {
  position: relative;
  background: #11141c; border: 1px solid #2a3448;
  border-radius: 12px;
  width: min(640px, 92vw);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(167,139,250,0.25);
  overflow: hidden;
  animation: cmdk-pop 0.15s ease-out;
}
@keyframes cmdk-pop {
  from { transform: translateY(-10px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
.cmdk-input {
  width: 100%; box-sizing: border-box;
  background: transparent; border: none; border-bottom: 1px solid #1f2433;
  color: #e5e7eb; padding: 14px 18px;
  font-size: 15px;
  outline: none;
}
.cmdk-input::placeholder { color: #64748b; }
.cmdk-list {
  max-height: 50vh; overflow-y: auto;
  padding: 6px;
}
.cmdk-item {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; border-radius: 6px;
  cursor: pointer; user-select: none;
  font-size: 13px;
}
.cmdk-item .cmdk-icon { font-size: 16px; width: 22px; text-align: center; flex-shrink: 0; }
.cmdk-item .cmdk-title { color: #e5e7eb; font-weight: 600; flex: 1; }
.cmdk-item .cmdk-hint { color: #64748b; font-size: 11px; }
.cmdk-item.active {
  background: rgba(167,139,250,0.15);
}
.cmdk-item.active .cmdk-title { color: #a78bfa; }
.cmdk-item:hover { background: #131826; }
.cmdk-empty {
  text-align: center; padding: 40px 0;
  color: #64748b; font-size: 13px;
}
.cmdk-footer {
  padding: 8px 14px; border-top: 1px solid #1f2433;
  color: #64748b; font-size: 10.5px;
  display: flex; gap: 8px; align-items: center;
}
.cmdk-footer kbd {
  background: #1a1f2e; color: #a78bfa;
  padding: 2px 6px; border-radius: 3px;
  font-size: 10px; font-family: ui-monospace, monospace;
  border: 1px solid #2a3448; margin: 0 2px;
}

/* 📐 网格对齐(v70)*/
#gridBtn.snap-on {
  background: rgba(167,139,250,0.18);
  border-color: #a78bfa !important;
  color: #a78bfa;
}
body.snap-grid .canvas-container {
  background-image:
    linear-gradient(to right, rgba(167,139,250,0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(167,139,250,0.08) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* 🧭 画板坐标显示(v72)*/
.canvas-coord {
  position: fixed; right: 18px; bottom: 18px;
  background: rgba(17,20,28,0.92);
  border: 1px solid #2a3448;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 11px; color: #a78bfa;
  font-family: ui-monospace, monospace;
  letter-spacing: 0.5px;
  z-index: 90;
  pointer-events: none;
  backdrop-filter: blur(6px);
}
.canvas-coord.hidden { display: none; }
.canvas-coord .cc-sep { color: #475569; margin: 0 4px; }
.canvas-coord .cc-label { color: #64748b; margin-right: 4px; }

/* 🎁 Welcome modal cards(v80)*/
.welcome-cards {
  display: flex; flex-direction: column; gap: 8px;
}
.welcome-card {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  background: #0a0e14; border: 1px solid #1f2433;
  border-radius: 8px; cursor: pointer;
  transition: all 0.15s;
}
.welcome-card:hover {
  border-color: #a78bfa;
  background: #131826;
  transform: translateX(2px);
}
.welcome-card .wc-icon {
  font-size: 26px; width: 40px; text-align: center; flex-shrink: 0;
}
.welcome-card .wc-title {
  font-size: 13.5px; color: #e5e7eb; font-weight: 700;
  margin-bottom: 2px;
}
.welcome-card .wc-desc {
  font-size: 11.5px; color: #94a3b8;
}

/* 🖐 全局拖拽接收 overlay(v65)*/
.drop-overlay {
  position: fixed; inset: 0;
  z-index: 300;
  background: rgba(10,14,20,0.85);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;  /* 不挡 dragover/drop 事件 */
  animation: drop-fade 0.2s ease-out;
}
.drop-overlay.hidden { display: none; }
.drop-overlay-inner {
  border: 3px dashed #a78bfa;
  border-radius: 16px;
  padding: 60px 80px;
  text-align: center;
  background: rgba(17,20,28,0.65);
  box-shadow: 0 0 60px rgba(167,139,250,0.4);
}
.drop-overlay-icon { font-size: 64px; }
.drop-overlay-text {
  font-size: 16px; color: #e5e7eb;
  font-weight: 700; margin-top: 18px;
  letter-spacing: 0.5px;
}
@keyframes drop-fade {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

/* ===== Cheatsheet 浮窗 ===== */
.cheatsheet {
  position: fixed; right: 16px; bottom: 16px;
  background: rgba(17,20,28,0.96);
  border: 1px solid #2a3448; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  width: 190px; z-index: 180;
  backdrop-filter: blur(6px);
  font-size: 11px;
}
.cheatsheet.hidden { display: none; }
.cheatsheet-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid #1f2433;
  color: #a78bfa; font-weight: 700; letter-spacing: 0.5px;
}
.cheatsheet-header button {
  background: transparent; border: none; color: #64748b;
  font-size: 14px; padding: 0 4px; cursor: pointer; min-width: 0;
}
.cheatsheet-header button:hover { color: #ef4444; }
.cheatsheet-body {
  padding: 8px 12px; display: grid;
  grid-template-columns: 1fr 1fr; gap: 4px 8px;
}
.cs-row { color: #cbd5e1; display: flex; align-items: center; gap: 4px; }
.cs-row kbd {
  background: #131826; color: #a78bfa;
  padding: 1px 5px; font-size: 9.5px; border-radius: 3px;
  font-family: ui-monospace, monospace;
  border: 1px solid #1f2433;
}

/* ===== 🎥 演示模式(全屏 + 隐藏 UI)===== */
body.demo-mode header,
body.demo-mode aside.palette,
body.demo-mode #agentPalette,
body.demo-mode #rightPalette,
body.demo-mode .rounds-bar,
body.demo-mode #helpModal,
body.demo-mode #updateBanner,
body.demo-mode #cheatsheet {
  display: none !important;
}
body.demo-mode #app {
  grid-template-columns: 0 1fr 0 !important;
  grid-template-rows: 0 1fr !important;
}
body.demo-mode .canvas-wrap {
  padding: 0 !important;
}
.demo-bar {
  position: fixed; left: 50%; bottom: 18px;
  transform: translateX(-50%);
  background: rgba(17,20,28,0.92);
  border: 1px solid #2a3448; border-radius: 36px;
  padding: 8px 14px;
  display: flex; align-items: center; gap: 14px;
  z-index: 250; backdrop-filter: blur(6px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}
.demo-bar.hidden { display: none; }
.demo-bar button {
  background: transparent; border: none; color: #cbd5e1;
  cursor: pointer; padding: 4px 8px; border-radius: 50%;
  width: 32px; height: 32px; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.demo-bar button:hover { background: #1a1f2e; color: #a78bfa; }
.demo-bar-info {
  color: #a78bfa; font-size: 12px; font-weight: 700;
  font-family: ui-monospace, monospace;
  padding: 0 6px; min-width: 50px; text-align: center;
}
.demo-bar-exit {
  color: #ef4444 !important;
  border-left: 1px solid #2a3448 !important;
  border-radius: 0 18px 18px 0 !important;
  margin-left: 4px; padding-left: 12px !important;
}
.demo-bar-exit:hover { background: rgba(239,68,68,0.15) !important; }
.demo-timeline {
  flex: 1; min-width: 120px; max-width: 280px;
  height: 6px; background: #1a1f2e; border-radius: 3px;
  position: relative; cursor: pointer;
  margin: 0 4px;
}
.demo-timeline-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, #a78bfa, #c4b5fd);
  border-radius: 3px;
  transition: width 0.2s ease-out;
  pointer-events: none;
}
.demo-timeline-ticks {
  position: absolute; left: 0; right: 0; top: 0; bottom: 0;
  pointer-events: none;
}
.demo-timeline-tick {
  position: absolute; top: -2px;
  width: 1px; height: 10px;
  background: rgba(255,255,255,0.18);
}
.demo-note {
  position: fixed; left: 50%; top: 24px;
  transform: translateX(-50%);
  background: rgba(17,20,28,0.95); backdrop-filter: blur(6px);
  border: 1px solid rgba(167,139,250,0.4);
  border-radius: 24px;
  padding: 8px 18px;
  font-size: 14px; color: #e5e7eb;
  max-width: 70vw;
  z-index: 245;
  box-shadow: 0 4px 18px rgba(0,0,0,0.5);
  letter-spacing: 0.3px;
}
.demo-note.hidden { display: none; }
.demo-note::before {
  content: '📝 '; color: #a78bfa;
}
body:not(.demo-mode) .demo-note { display: none; }

.demo-timeline-note {
  position: absolute; top: -16px;
  transform: translate(-50%, 0);
  font-size: 9px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.7));
  cursor: help;
  pointer-events: auto;
}
.demo-timeline-thumb {
  position: absolute; top: 50%;
  width: 10px; height: 10px;
  background: #fff; border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 2px #a78bfa, 0 2px 6px rgba(0,0,0,0.4);
  pointer-events: none;
  transition: left 0.2s ease-out;
}

/* ===== Spike 倒计时浮窗 ===== */
.spike-timer {
  position: fixed; right: 16px; top: 70px;
  background: rgba(17,20,28,0.95); backdrop-filter: blur(6px);
  border: 1px solid #2a3448; border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  width: 150px; z-index: 170;
  padding: 12px 14px;
  text-align: center;
}
.spike-timer.hidden { display: none; }
.spike-timer.planted {
  border-color: #ef4444;
  box-shadow: 0 0 24px rgba(239,68,68,0.45), 0 0 0 1px #ef4444;
  animation: spike-pulse 1s ease-in-out infinite;
}
@keyframes spike-pulse {
  0%, 100% { box-shadow: 0 0 24px rgba(239,68,68,0.35), 0 0 0 1px #ef4444; }
  50%      { box-shadow: 0 0 32px rgba(239,68,68,0.7), 0 0 0 1px #ef4444; }
}
.spike-timer-time {
  font-size: 32px; font-family: ui-monospace, monospace;
  color: #a78bfa; font-weight: 700; line-height: 1;
}
.spike-timer.planted .spike-timer-time {
  color: #ef4444;
}
.spike-timer-label {
  font-size: 10px; color: #64748b; letter-spacing: 2px;
  text-transform: uppercase; margin-top: 4px;
}
.spike-timer-row {
  display: flex; justify-content: center; gap: 4px;
  margin-top: 10px; padding-top: 8px;
  border-top: 1px solid #1f2433;
}
.spike-timer-row button {
  background: transparent; border: none; color: #cbd5e1;
  cursor: pointer; padding: 4px 8px; border-radius: 5px;
  min-width: 26px; font-size: 13px;
}
.spike-timer-row button:hover { background: #1a1f2e; color: #a78bfa; }
.spike-timer-row #spikePlant:hover { color: #ef4444; background: rgba(239,68,68,0.12); }
.spike-timer-row #spikeClose:hover { color: #ef4444; background: rgba(239,68,68,0.15); }

/* ===== Skins Library(皮肤库)===== */
.skins-body {
  grid-template-columns: 200px 1fr !important;
  gap: 0 !important;
  padding: 0 !important;
  min-height: 60vh; max-height: 82vh;
}
.skins-sidebar {
  background: #0a0e14; border-right: 1px solid #1f2433;
  padding: 14px 14px;
  overflow-y: auto;
}
.skins-sidebar h4 {
  font-size: 10px; color: #64748b; text-transform: uppercase;
  letter-spacing: 1.5px; margin: 0 0 8px;
  padding-bottom: 6px; border-bottom: 1px solid #1f2433;
}
.skins-sidebar h4:not(:first-child) { margin-top: 18px; }
.skins-weapon-sel {
  width: 100%; box-sizing: border-box;
  background: #131826; color: #e5e7eb;
  border: 1px solid #2a3448; border-radius: 5px;
  padding: 6px 8px; font-size: 12px;
}
.skins-weapon-sel:focus { outline: none; border-color: #a78bfa; }
.skins-tier-chips {
  display: flex; flex-direction: column; gap: 4px;
}
.skins-tier-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 5px;
  cursor: pointer; font-size: 11.5px; color: #cbd5e1;
  background: #131826; border: 1px solid transparent;
  transition: all 0.12s;
}
.skins-tier-chip:hover { background: #1a1f2e; }
.skins-tier-chip.active {
  background: rgba(167,139,250,0.12);
  border-color: var(--tc, #a78bfa);
  color: #fff;
}
.skins-tier-chip .stc-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--tc, #a78bfa);
  flex-shrink: 0;
}
.skins-grid {
  overflow-y: auto; padding: 14px 18px 18px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  align-content: start;
}
.skin-card {
  background: linear-gradient(135deg, #1a2333 0%, #0e1320 100%);
  border: 1px solid var(--tc, #2a3448);
  border-radius: 8px;
  padding: 10px;
  cursor: pointer; transition: all 0.15s;
  display: flex; flex-direction: column; gap: 6px;
  position: relative; overflow: hidden;
}
.skin-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.4), 0 0 0 1px var(--tc, #a78bfa);
}
.skin-card-img {
  width: 100%; height: 70px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}
.skin-card-name {
  font-size: 11.5px; color: #e5e7eb; font-weight: 600;
  text-align: center;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  min-height: 30px; line-height: 1.3;
}
.skin-card-tier {
  position: absolute; top: 6px; right: 6px;
  font-size: 9px; padding: 2px 6px; border-radius: 8px;
  background: var(--tc, #a78bfa); color: #0a0e14;
  font-weight: 700; letter-spacing: 0.5px;
}
.skin-fav {
  position: absolute; top: 4px; left: 4px;
  width: 26px; height: 26px; padding: 0;
  background: rgba(0,0,0,0.55);
  border: 1px solid #1f2433;
  color: #94a3b8;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px; line-height: 1;
  z-index: 2;
  transition: all 0.15s;
}
.skin-fav:hover { color: #ef4444; transform: scale(1.15); border-color: #ef4444; }
.skin-fav.on { color: #ef4444; background: rgba(239,68,68,0.18); border-color: #ef4444; }
.skin-fav.on:hover { color: #fca5a5; }
.skins-empty {
  grid-column: 1 / -1;
  text-align: center; padding: 60px 0;
  color: #64748b; font-size: 13px;
}

/* ===== Skin Detail 浮窗 ===== */
.skin-detail {
  position: fixed; inset: 0; z-index: 220;
  display: flex; align-items: center; justify-content: center;
}
.skin-detail.hidden { display: none; }
.skin-detail-bg {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(8px);
}
.skin-detail-card {
  position: relative;
  background: linear-gradient(135deg, #131826 0%, #0a0e14 100%);
  border: 1px solid var(--tc, #2a3448);
  border-radius: 14px;
  width: min(700px, 92vw); padding: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 1px var(--tc, #a78bfa);
}
.skin-detail-card .modal-close {
  position: absolute; top: 10px; right: 14px;
}
.skin-detail-img-wrap {
  width: 100%; height: 220px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
#skinDetailImg {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,0.5));
}
.skin-detail-info { padding: 0 6px; }
.skin-detail-tier {
  font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--tc, #a78bfa); font-weight: 700;
  margin-bottom: 4px;
}
.skin-detail-info h3 {
  font-size: 18px; color: #e5e7eb; margin: 0 0 14px;
}
.skin-detail-row {
  display: grid; grid-template-columns: 60px 1fr;
  gap: 12px; align-items: center; padding: 6px 0;
  border-top: 1px solid #1f2433;
}
.skin-detail-label {
  font-size: 10.5px; color: #64748b;
  text-transform: uppercase; letter-spacing: 1.5px; font-weight: 700;
}
.skin-detail-chromas {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.skin-detail-chroma {
  width: 38px; height: 38px; border-radius: 6px;
  border: 2px solid #2a3448; cursor: pointer;
  background-size: cover; background-position: center;
  background-color: #1a1f2e;
  transition: all 0.12s;
  padding: 0;
}
.skin-detail-chroma:hover, .skin-detail-chroma.active {
  border-color: var(--tc, #a78bfa);
  transform: scale(1.08);
}

/* ===== Daily Shop ===== */
.shop-body { padding: 16px 22px 22px; display: flex; flex-direction: column; }
.shop-timer {
  text-align: center; color: #fbbf24;
  font-family: ui-monospace, monospace; font-size: 14px;
  padding: 8px; margin-bottom: 14px;
  background: rgba(251,191,36,0.08);
  border: 1px dashed rgba(251,191,36,0.3);
  border-radius: 6px;
}
.shop-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.shop-item {
  background: linear-gradient(135deg, #1a2333 0%, #0a0e14 100%);
  border: 1px solid var(--tc, #2a3448);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer; transition: all 0.15s;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.shop-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px var(--tc), 0 8px 20px rgba(0,0,0,0.4);
}
.shop-item img {
  width: 100%; height: 90px; object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
}
.shop-item-name {
  font-size: 12px; font-weight: 700; color: #e5e7eb; text-align: center;
  min-height: 30px;
}
.shop-item-tier {
  font-size: 10px; color: var(--tc, #a78bfa); font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
}
.shop-item-price {
  font-size: 11px; color: #fbbf24; font-weight: 700;
}
.shop-reroll {
  margin: 14px auto 0;
  background: #a78bfa; color: #0a0e14; border: none;
  padding: 8px 22px; border-radius: 8px; cursor: pointer;
  font-size: 13px; font-weight: 700;
}
.shop-reroll:hover { background: #c4b5fd; }
.shop-tip {
  margin: 14px 0 0; font-size: 11px; color: #64748b; text-align: center;
}

/* ===== Stats 统计面板 ===== */
.stats-body { padding: 18px 22px 22px !important; display: block !important; }
.stats-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px; margin-bottom: 18px;
}
.stats-card {
  background: linear-gradient(135deg, #131826 0%, #0a0e14 100%);
  border: 1px solid #1f2433;
  border-radius: 8px; padding: 14px;
}
.stats-card-label {
  font-size: 10px; color: #64748b; text-transform: uppercase;
  letter-spacing: 1.5px; margin-bottom: 6px;
}
.stats-card-value {
  font-size: 24px; color: #a78bfa; font-weight: 700;
  font-family: ui-monospace, monospace;
}
.stats-card-sub { font-size: 11px; color: #94a3b8; margin-top: 4px; }
.stats-section { margin-top: 18px; }
.stats-section h4 {
  font-size: 11px; color: #94a3b8; text-transform: uppercase;
  letter-spacing: 1.5px; margin: 0 0 10px;
}
.stats-bar {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; padding: 6px 0;
}
.stats-bar-name { width: 90px; color: #e5e7eb; font-weight: 600; }
.stats-bar-track {
  flex: 1; height: 6px; background: #1a1f2e; border-radius: 3px; overflow: hidden;
}
.stats-bar-fill { height: 100%; background: var(--rc, #a78bfa); }
.stats-bar-val { width: 36px; text-align: right; color: #a78bfa; font-family: ui-monospace, monospace; }
.stats-storage {
  background: #0a0e14; border: 1px dashed #1f2433;
  padding: 10px 14px; border-radius: 6px;
  font-size: 11px; color: #94a3b8;
  font-family: ui-monospace, monospace; margin-top: 12px;
}

/* tools tab 横栏 */
.tools-tabs { display: flex; gap: 4px; margin: 0 auto 0 12px; flex: 1; }
.tools-tab {
  background: transparent; border: 1px solid transparent;
  color: #94a3b8; padding: 6px 10px; border-radius: 6px;
  font-size: 11.5px; cursor: pointer; font-weight: 600;
  transition: all 0.12s;
}
.tools-tab:hover { color: #e5e7eb; background: #131826; }
.tools-tab.active { background: rgba(167,139,250,0.12); color: #a78bfa; border-color: rgba(167,139,250,0.3); }

/* ⏱ 训练计时器 */
.timer-wrap { text-align: center; padding: 20px 0; }
.timer-display {
  font-size: 56px; font-family: ui-monospace, monospace;
  font-weight: 700; color: #a78bfa;
  letter-spacing: 2px; line-height: 1.1;
}
.timer-display .timer-ms { font-size: 22px; color: #64748b; vertical-align: top; }
.timer-controls {
  display: flex; gap: 8px; justify-content: center; margin-top: 18px;
}
.timer-controls button {
  background: #131826; border: 1px solid #2a3448; color: #e5e7eb;
  padding: 8px 18px; border-radius: 6px; cursor: pointer;
  font-size: 12px; font-weight: 700;
}
.timer-controls button.primary { background: #a78bfa; color: #0a0e14; border: none; }
.timer-controls button.primary:hover { background: #c4b5fd; }
.timer-controls button:hover { border-color: #a78bfa; color: #a78bfa; }
.timer-laps {
  margin-top: 18px; max-height: 200px; overflow-y: auto;
  background: #0a0e14; border: 1px solid #1f2433; border-radius: 6px;
}
.timer-lap {
  display: flex; justify-content: space-between;
  padding: 6px 14px; font-size: 11px; font-family: ui-monospace, monospace;
  border-bottom: 1px solid #1f2433; color: #94a3b8;
}
.timer-lap:last-child { border-bottom: 0; }
.timer-lap-idx { color: #64748b; }
.timer-lap-time { color: #a78bfa; }

/* 🏆 RR 计算器 + 💰 经济计算器 */
.calc-form {
  background: #0a0e14; border: 1px solid #1f2433;
  border-radius: 8px; padding: 16px; margin-bottom: 14px;
}
.calc-row {
  display: grid; grid-template-columns: 100px 1fr;
  gap: 10px; align-items: center;
  margin-bottom: 10px;
}
.calc-row label { font-size: 11.5px; color: #94a3b8; font-weight: 600; }
.calc-row input, .calc-row select {
  background: #131826; border: 1px solid #2a3448;
  color: #e5e7eb; padding: 6px 10px; border-radius: 5px;
  font-size: 12px; width: 100%; box-sizing: border-box;
}
.calc-row input:focus, .calc-row select:focus {
  outline: none; border-color: #a78bfa;
}
.calc-result {
  margin-top: 14px; padding: 16px;
  background: rgba(167,139,250,0.08);
  border: 1px solid rgba(167,139,250,0.3);
  border-radius: 8px;
  text-align: center;
}
.calc-result-value {
  font-size: 26px; color: #a78bfa; font-weight: 700;
  font-family: ui-monospace, monospace;
}
.calc-result-label {
  font-size: 10px; color: #64748b;
  text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 6px;
}
.calc-result-detail {
  font-size: 11.5px; color: #cbd5e1; margin-top: 8px;
}

/* 经济计算器:回合序列 */
.econ-rounds {
  display: flex; gap: 4px; flex-wrap: wrap; margin: 8px 0 14px;
}
.econ-round-btn {
  width: 30px; height: 30px; border-radius: 5px;
  background: #131826; border: 1px solid #2a3448; color: #94a3b8;
  cursor: pointer; font-size: 12px; font-weight: 700;
  font-family: ui-monospace, monospace;
}
.econ-round-btn.win  { background: rgba(16,185,129,0.18); border-color: #10b981; color: #6ee7b7; }
.econ-round-btn.lose { background: rgba(239,68,68,0.18); border-color: #ef4444; color: #fca5a5; }
.econ-round-btn:hover { border-color: #a78bfa; }
.econ-tip {
  font-size: 10px; color: #64748b; text-align: center;
}

/* 🔫 武器对比 */
.cmp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cmp-side {
  background: #0a0e14; border: 1px solid #1f2433;
  border-radius: 8px; padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.cmp-side select {
  background: #131826; color: #e5e7eb; border: 1px solid #2a3448;
  padding: 6px 10px; border-radius: 5px; font-size: 12px;
}
.cmp-side select:focus { outline: none; border-color: #a78bfa; }
.cmp-img {
  height: 70px; display: flex; align-items: center; justify-content: center;
}
.cmp-img img { max-height: 70px; max-width: 100%; object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5)); }
.cmp-name { text-align: center; font-weight: 700; color: #e5e7eb; font-size: 13px; }
.cmp-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 12px; }
.cmp-table th, .cmp-table td {
  padding: 6px 10px; border-bottom: 1px solid #1f2433;
  text-align: center;
}
.cmp-table th {
  color: #64748b; font-weight: 700; font-size: 10px;
  text-transform: uppercase; letter-spacing: 1.5px;
  background: #131826;
}
.cmp-table td.cmp-label { text-align: left; color: #94a3b8; font-weight: 600; }
.cmp-table td.cmp-win { color: #6ee7b7; font-weight: 700; }
.cmp-table td.cmp-lose { color: #94a3b8; }
.cmp-table tr:hover td { background: #131826; }

/* ===== 📱 移动端 / 窄屏适配(v62)===== */
@media (max-width: 1100px) {
  /* 顶栏总长太长 → 横向滚动 */
  header {
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    white-space: nowrap;
    scrollbar-width: thin;
  }
  header::-webkit-scrollbar { height: 4px; }
  header .ctl, header .tool-group {
    flex-shrink: 0;
  }
  /* 缩小顶栏按钮 padding,密集挤进去 */
  header button {
    padding: 4px 8px !important;
    font-size: 11.5px !important;
  }
}

@media (max-width: 800px) {
  /* 真小屏(手机横屏 / 窄竖屏)*/
  /* aside palette 改为底部抽屉 */
  #app {
    grid-template-columns: 0 1fr 0 !important;
    grid-template-rows: auto 1fr auto !important;
  }
  aside.palette {
    grid-column: 1 / -1;
    max-height: 200px;
    overflow-y: auto;
  }
  #agentPalette { grid-row: 3; }
  #rightPalette { grid-row: 3; }
  /* canvas 占主区 */
  .canvas-wrap { padding: 6px !important; }
  /* 文字字号下调 */
  body { font-size: 13px; }
}

@media (max-width: 520px) {
  /* 手机竖屏:进一步精简 */
  .brand { font-size: 12px !important; }
  header { padding: 4px 6px !important; gap: 4px !important; }
  /* modal 整宽 */
  .modal-card { width: 96vw !important; max-height: 90vh; }
  .modal-card-wide { width: 96vw !important; }
  /* 工具集 tabs 横滚 */
  .tools-tabs { overflow-x: auto; }
  /* lineup 卡片更紧凑 */
  .lineup-card { padding: 6px 8px; }
  /* 演示 demo bar 精简 */
  .demo-bar { padding: 4px 8px; gap: 6px; }
  .demo-timeline { min-width: 60px; max-width: 140px; }
}

/* ====== v81 🖼 分享 / iframe 嵌入 ====== */

/* share modal — 复制链接 + iframe 嵌入代码 + 实时预览 */
.share-body { padding: 18px 22px 22px; max-height: 78vh; overflow-y: auto; }
.share-section { margin-bottom: 22px; }
.share-section:last-child { margin-bottom: 0; }
.share-section-head { display: flex; align-items: baseline; justify-content: space-between; }
.share-section h4 {
  margin: 0 0 4px; font-size: 13px; color: #cbd5e1; font-weight: 700;
}
.share-size {
  font-family: ui-monospace, monospace; font-size: 11px; color: #64748b;
}
.share-tip {
  margin: 0 0 10px; font-size: 11.5px; color: #64748b; line-height: 1.55;
}
.share-row { display: flex; gap: 8px; }
.share-input {
  flex: 1; min-width: 0;
  background: #0a0e14; color: #e5e7eb;
  border: 1px solid #2a3448; border-radius: 6px;
  padding: 9px 11px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11.5px; line-height: 1.5;
  user-select: text; -webkit-user-select: text;
}
.share-input:focus { outline: none; border-color: #a78bfa; }
.share-textarea { width: 100%; resize: vertical; min-height: 64px; }
.share-copy-btn {
  background: #a78bfa; color: #0a0e14;
  border: 0; padding: 0 16px; border-radius: 6px;
  font-weight: 700; font-size: 12px; cursor: pointer;
  min-width: 92px; white-space: nowrap;
  transition: background 0.15s;
}
.share-copy-btn:hover { background: #c4b5fd; }
.share-copy-btn-block {
  width: 100%; margin-top: 8px; padding: 10px;
}
.share-preview-wrap {
  margin-top: 14px;
  border: 1px solid #2a3448; border-radius: 8px;
  overflow: hidden; background: #0a0e14;
}
.share-preview-label {
  background: #131826; padding: 6px 12px;
  font-size: 11px; color: #94a3b8;
  border-bottom: 1px solid #1f2433;
}
.share-preview {
  width: 100%; height: 320px;
  display: block; background: #0a0e14; border: 0;
}

/* ====== v81 嵌入模式(只读 player) ====== */
html[data-embed="1"], html[data-embed="1"] body {
  background: #0a0e14;
}
html[data-embed="1"] body { overflow: hidden; }
/* 把 grid 改成单列 — header / left / right / cmdk / welcome 全藏 */
html[data-embed="1"] body {
  grid-template:
    "canvas"   1fr
    "timeline" 56px
    / 1fr !important;
}
html[data-embed="1"] header,
html[data-embed="1"] #agentPalette,
html[data-embed="1"] #abilityPalette,
html[data-embed="1"] #floatingControls,
html[data-embed="1"] #welcomeModal,
html[data-embed="1"] #shareModal,
html[data-embed="1"] #cmdkModal,
html[data-embed="1"] #helpModal,
html[data-embed="1"] #updateBanner,
html[data-embed="1"] #spikeTimer,
html[data-embed="1"] #cheatsheet,
html[data-embed="1"] #contextMenu,
html[data-embed="1"] #layersPanel,
html[data-embed="1"] #canvasCoord,
html[data-embed="1"] #demoBar,
html[data-embed="1"] #crosshairModal,
html[data-embed="1"] #guideModal,
html[data-embed="1"] #skinsModal,
html[data-embed="1"] #skinDetail,
html[data-embed="1"] #statsModal,
html[data-embed="1"] #shopModal {
  display: none !important;
}
/* 嵌入态 timeline 简化 — 只留回合切换 + 播放(去除录制 / 新增回合 / 速度选择) */
html[data-embed="1"] #timeline {
  height: 56px;
  padding: 8px 12px;
}
html[data-embed="1"] #timeline #recordBtn,
html[data-embed="1"] #timeline #addRoundBtn,
html[data-embed="1"] #timeline #speedSelect,
html[data-embed="1"] #timeline #saveStatus {
  display: none !important;
}

/* 嵌入态底角 brand badge */
.embed-badge {
  position: fixed;
  bottom: 64px; right: 12px;
  background: rgba(10, 14, 20, 0.88);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(167, 139, 250, 0.45);
  border-radius: 18px;
  padding: 6px 12px;
  color: #cbd5e1; text-decoration: none;
  font-size: 11.5px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
  z-index: 9999;
  transition: opacity 0.2s, transform 0.2s, border-color 0.2s;
  opacity: 0.82;
  letter-spacing: 0.5px;
}
.embed-badge:hover {
  opacity: 1; transform: translateY(-1px);
  border-color: #a78bfa;
}
.embed-badge.hidden { display: none; }
.embed-badge-mark { color: #a78bfa; font-size: 13px; }
.embed-badge-text b { color: #a78bfa; font-weight: 800; }

/* 嵌入态:canvas 占整个视口宽度 */
html[data-embed="1"] #canvasWrap { padding: 0; }

/* ====== v82 📱 双指捏合缩放 + 平移 ====== */

/* zoom 比例指示器:zoom !== 100% 时浮在 canvas 左上角,点击复位 */
.zoom-indicator {
  position: absolute;
  top: 12px; left: 12px;
  background: rgba(10, 14, 20, 0.88);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(167, 139, 250, 0.45);
  border-radius: 14px;
  padding: 5px 12px;
  color: #a78bfa;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  z-index: 95;
  transition: background 0.15s, transform 0.15s;
  user-select: none; -webkit-user-select: none;
}
.zoom-indicator::before {
  content: '🔍 ';
  margin-right: 2px;
  font-size: 11px;
}
.zoom-indicator::after {
  content: ' · 复位';
  color: #64748b;
  font-weight: 500;
}
.zoom-indicator:hover {
  background: rgba(167, 139, 250, 0.18);
  transform: translateY(-1px);
}
.zoom-indicator.hidden { display: none; }

/* 嵌入态也允许缩放手势,但 indicator 移到右上 不挡 timeline */
html[data-embed="1"] .zoom-indicator {
  top: 10px; right: 10px; left: auto;
}

/* ====== v90 🤖 AI Tool Calling — tool log 渲染 ====== */

.ai-msg-tools, .ai-msg-grounded {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 4px;
  background: rgba(167,139,250,0.2);
  color: #c4b5fd;
}
.ai-tool-log {
  margin: 4px 0 6px;
  padding: 6px 10px;
  background: rgba(167,139,250,0.06);
  border-left: 3px solid rgba(167,139,250,0.5);
  border-radius: 4px;
  font-size: 10.5px;
  font-family: ui-monospace, monospace;
}
.ai-tool-row {
  display: flex; align-items: baseline; gap: 6px;
  padding: 2px 0;
  line-height: 1.5;
  color: #94a3b8;
  flex-wrap: wrap;
}
.ai-tool-icon { width: 14px; flex-shrink: 0; }
.ai-tool-name {
  background: #0a0e14; padding: 1px 5px; border-radius: 3px;
  color: #c4b5fd; font-size: 10px;
}
.ai-tool-args { color: #64748b; font-size: 10px; }
.ai-tool-msg { color: #cbd5e1; }

/* v97 撤销 AI 整条按钮 */
.ai-undo-btn {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid rgba(239,68,68,0.4);
  border-radius: 10px;
  color: #ef4444;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.ai-undo-btn:hover {
  background: rgba(239,68,68,0.14);
  color: #fca5a5;
}
.ai-msg-undone {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 4px;
  background: rgba(239,68,68,0.16);
  color: #fca5a5;
}
.ai-msg.undone .ai-msg-text {
  opacity: 0.45;
  text-decoration: line-through;
  text-decoration-color: rgba(239,68,68,0.4);
}
.ai-msg.undone .ai-tool-log {
  opacity: 0.45;
}

/* ====== v89 💬 浮动 AI 教练(Intercom 风) ====== */

/* 右下角浮动圆球 */
.ai-fab {
  position: fixed;
  bottom: 100px; right: 18px;
  z-index: 200;
  background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
  color: #0a0e14;
  border: 0;
  border-radius: 28px;
  padding: 10px 16px 10px 14px;
  display: flex; align-items: center; gap: 6px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(167,139,250,0.45), 0 2px 6px rgba(0,0,0,0.4);
  transition: transform 0.15s, box-shadow 0.15s;
  user-select: none; -webkit-user-select: none;
}
.ai-fab:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 8px 28px rgba(167,139,250,0.6), 0 4px 10px rgba(0,0,0,0.5);
}
.ai-fab:active { transform: translateY(0) scale(0.98); }
.ai-fab.hidden { display: none; }
.ai-fab-icon { font-size: 18px; line-height: 1; }
.ai-fab-label { letter-spacing: 0.5px; }
@media (max-width: 520px) {
  .ai-fab-label { display: none; }
  .ai-fab { padding: 10px 12px; border-radius: 50%; }
}

/* 浮动 chat 卡片 */
.ai-floating-panel {
  position: fixed;
  bottom: 100px; right: 18px;
  width: 380px; max-width: calc(100vw - 36px);
  height: 540px; max-height: calc(100vh - 140px);
  z-index: 220;
  background: #11141c;
  border: 1px solid #2a3448;
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6), 0 4px 16px rgba(167,139,250,0.18);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: aip-pop 0.18s ease-out;
}
.ai-floating-panel.hidden { display: none; }
@keyframes aip-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.aip-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(167,139,250,0.16), rgba(167,139,250,0.04));
  border-bottom: 1px solid rgba(167,139,250,0.25);
}
.aip-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 700; color: #e5e7eb;
}
.aip-title-icon { font-size: 15px; }
.aip-title-tag {
  background: rgba(167,139,250,0.22);
  color: #c4b5fd;
  font-size: 10px; font-weight: 700;
  padding: 1px 7px; border-radius: 8px;
  font-family: ui-monospace, monospace;
}
.aip-actions { display: flex; gap: 2px; }
.aip-icon-btn {
  background: transparent; border: 0; color: #94a3b8;
  width: 28px; height: 28px; padding: 0;
  border-radius: 6px;
  font-size: 14px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.aip-icon-btn:hover { background: rgba(167,139,250,0.18); color: #e5e7eb; }

.aip-settings {
  padding: 10px 14px;
  background: #0e1118;
  border-bottom: 1px solid #1f2433;
  display: grid; gap: 6px;
}
.aip-settings.hidden { display: none; }
.aip-settings-row {
  display: flex; gap: 6px;
}
.aip-settings input, .aip-settings select {
  flex: 1; min-width: 0;
  background: #0a0e14; color: #e5e7eb;
  border: 1px solid #2a3448; border-radius: 5px;
  padding: 6px 9px;
  font-family: ui-monospace, monospace; font-size: 11.5px;
}
.aip-settings input:focus, .aip-settings select:focus {
  outline: none; border-color: #a78bfa;
}
.aip-grounding {
  display: flex; align-items: center; gap: 4px;
  background: #0a0e14; border: 1px solid #2a3448;
  border-radius: 5px; padding: 0 9px;
  font-size: 12px; color: #cbd5e1; cursor: pointer;
}
.aip-grounding input { accent-color: #a78bfa; }
.aip-tip {
  font-size: 10.5px; color: #64748b; margin: 2px 0 0; line-height: 1.5;
}
.aip-tip a { color: #a78bfa; text-decoration: none; }

/* v95 高级设置(自定义 endpoint) */
.aip-advanced {
  margin-top: 8px;
  padding: 6px 0 0;
  border-top: 1px dashed rgba(167,139,250,0.18);
}
.aip-advanced summary {
  font-size: 10.5px; color: #94a3b8; cursor: pointer;
  padding: 4px 0;
  user-select: none;
}
.aip-advanced summary:hover { color: #c4b5fd; }
.aip-advanced[open] summary { color: #a78bfa; }
.aip-advanced .aip-settings-row { margin-top: 6px; }
.aip-advanced input[type="text"] {
  background: #0a0e14; color: #e5e7eb;
  border: 1px solid #2a3448; border-radius: 5px;
  padding: 6px 9px; width: 100%;
  font-family: ui-monospace, monospace; font-size: 11px;
}
.aip-advanced input[type="text"]:focus { outline: none; border-color: #a78bfa; }
.aip-advanced textarea {
  background: #0a0e14; color: #e5e7eb;
  border: 1px solid #2a3448; border-radius: 5px;
  padding: 7px 10px; width: 100%;
  font-family: inherit; font-size: 11.5px;
  resize: vertical; min-height: 56px;
}
.aip-advanced textarea:focus { outline: none; border-color: #a78bfa; }

.aip-messages {
  flex: 1; min-height: 0;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 10px;
  background: #0a0e14;
  scroll-behavior: smooth;
}
.aip-messages::-webkit-scrollbar { width: 6px; }
.aip-messages::-webkit-scrollbar-thumb {
  background: rgba(167,139,250,0.3); border-radius: 3px;
}

/* 复用 ai-msg / ai-citations / ai-chip 既有样式 */
.aip-welcome {
  color: #cbd5e1; font-size: 12px;
}
.aip-welcome-title {
  font-size: 13px; color: #e5e7eb; font-weight: 600;
  margin-bottom: 8px;
}
.aip-welcome-chips {
  display: flex; flex-wrap: wrap; gap: 5px;
}
.aip-chip {
  background: rgba(167,139,250,0.08);
  border: 1px solid rgba(167,139,250,0.3);
  border-radius: 12px;
  padding: 4px 9px;
  color: #c4b5fd;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
}
.aip-chip-hero {
  background: linear-gradient(135deg, rgba(167,139,250,0.35), rgba(196,181,253,0.18)) !important;
  border-color: #a78bfa !important;
  color: #e5e7eb !important;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(167,139,250,0.25);
  width: 100%;  /* 占满 hero 一行 */
  margin-bottom: 4px;
}
.aip-chip-hero:hover {
  background: linear-gradient(135deg, rgba(167,139,250,0.5), rgba(196,181,253,0.3)) !important;
  transform: translateY(-1px);
}
.aip-chip:hover {
  background: rgba(167,139,250,0.18);
  border-color: #a78bfa;
  color: #e5e7eb;
}

.aip-input-bar {
  display: grid; grid-template-columns: 1fr auto auto;
  gap: 6px;
  padding: 10px 12px;
  background: #0e1118;
  border-top: 1px solid #1f2433;
}
/* v93 🎙 麦克风按钮 */
.aip-mic {
  background: transparent;
  border: 1px solid #2a3448;
  border-radius: 8px;
  color: #94a3b8;
  font-size: 15px;
  padding: 0 10px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.aip-mic:hover { background: rgba(167,139,250,0.16); color: #c4b5fd; border-color: #a78bfa; }
.aip-mic:disabled { cursor: not-allowed; }
.aip-mic.listening {
  background: rgba(239,68,68,0.18);
  color: #ef4444;
  border-color: #ef4444;
  animation: aip-mic-pulse 1s ease-in-out infinite;
}
@keyframes aip-mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.6); }
  50%      { box-shadow: 0 0 0 6px rgba(239,68,68,0); }
}
.aip-input-bar textarea {
  background: #0a0e14; color: #e5e7eb;
  border: 1px solid #2a3448; border-radius: 6px;
  padding: 7px 10px;
  font-family: inherit; font-size: 12.5px; line-height: 1.5;
  resize: none;
  max-height: 80px;
}
.aip-input-bar textarea:focus {
  outline: none; border-color: #a78bfa;
}
.aip-send {
  background: #a78bfa; color: #0a0e14;
  border: 0; border-radius: 6px;
  padding: 0 14px;
  font-weight: 700; font-size: 14px; cursor: pointer;
  white-space: nowrap;
}
.aip-send:hover { background: #c4b5fd; }
.aip-send:disabled { background: #2a3448; color: #64748b; cursor: not-allowed; }

/* 嵌入模式不显示浮动 AI(iframe 不污染父页面)*/
html[data-embed="1"] .ai-fab,
html[data-embed="1"] .ai-floating-panel {
  display: none !important;
}

/* ====== v85 🌐 Grounding toggle / kb-status / citation chips ====== */

/* settings 区 grounding toggle */
.ai-grounding-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: #cbd5e1; cursor: pointer;
  user-select: none; -webkit-user-select: none;
}
.ai-grounding-row input[type="checkbox"] {
  width: 14px; height: 14px; accent-color: #a78bfa; cursor: pointer;
}
.ai-grounding-row input[disabled] { opacity: 0.4; cursor: not-allowed; }
.ai-grounding-row input[disabled] + span { opacity: 0.5; }
.ai-grounding-tip code {
  background: #0a0e14; padding: 1px 5px; border-radius: 3px;
  font-family: ui-monospace, monospace; font-size: 10.5px; color: #c4b5fd;
}

/* 知识库状态栏 */
.ai-kb-status {
  background: linear-gradient(180deg, rgba(167,139,250,0.08), rgba(167,139,250,0.02));
  border: 1px solid rgba(167,139,250,0.22);
  border-radius: 6px; padding: 7px 12px;
  font-size: 11.5px; color: #cbd5e1;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 4px;
}
.ai-kb-status strong { color: #a78bfa; }
.ai-kb-grounding {
  font-size: 10.5px; padding: 2px 8px; border-radius: 10px;
  font-weight: 700; letter-spacing: 0.4px;
}
.ai-kb-grounding.on {
  background: rgba(16,185,129,0.18); color: #34d399;
  border: 1px solid rgba(16,185,129,0.4);
}
.ai-kb-grounding.off {
  background: rgba(100,116,139,0.18); color: #94a3b8;
  border: 1px solid rgba(100,116,139,0.4);
}
.ai-kb-grounding.na {
  background: rgba(251,191,36,0.16); color: #fbbf24;
  border: 1px solid rgba(251,191,36,0.4);
}

/* 消息附带 grounded 标记 + citation chips */
.ai-msg-grounded {
  display: inline-block;
  font-size: 11px;
  margin-left: 4px;
}
.ai-citations {
  margin-top: 6px;
  padding: 8px 10px;
  background: rgba(167,139,250,0.06);
  border: 1px solid rgba(167,139,250,0.2);
  border-radius: 6px;
  font-size: 10.5px;
  color: #94a3b8;
}
.ai-citations-head {
  margin-bottom: 6px;
  color: #cbd5e1;
}
.ai-citations-head code {
  background: #0a0e14; padding: 1px 5px; border-radius: 3px;
  font-family: ui-monospace, monospace; font-size: 10px; color: #c4b5fd;
}
.ai-citations-list {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.ai-citation {
  display: inline-block;
  padding: 3px 8px;
  background: #0a0e14;
  border: 1px solid #2a3448;
  border-radius: 4px;
  color: #a78bfa; text-decoration: none;
  font-size: 10.5px; font-family: ui-monospace, monospace;
  transition: background 0.15s, border-color 0.15s;
}
.ai-citation:hover {
  background: rgba(167,139,250,0.12);
  border-color: #a78bfa;
  color: #c4b5fd;
}

/* ====== v88 新手术语 — 紧凑版 chip nav 单行横滚 + table 压缩 ====== */

/* 头部:标题 + tip 一行 */
.term-header {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  margin: 4px 0 8px;
}
.term-header h4 {
  margin: 0 !important;
  font-size: 14px !important;
}
.term-header-count {
  display: inline-block;
  background: rgba(167,139,250,0.22);
  color: #c4b5fd;
  font-size: 10.5px; font-weight: 700;
  padding: 1px 7px; border-radius: 8px;
  font-family: ui-monospace, monospace;
  margin-left: 4px;
}
.term-header-tip {
  font-size: 10.5px; color: #64748b;
}

/* chip 导航 — 单行横滚 */
.term-cat-nav {
  display: flex; gap: 6px;
  margin: 0 0 12px;
  padding: 8px 10px;
  background: rgba(167,139,250,0.04);
  border: 1px solid rgba(167,139,250,0.16);
  border-radius: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.term-cat-nav::-webkit-scrollbar {
  height: 4px;
}
.term-cat-nav::-webkit-scrollbar-thumb {
  background: rgba(167,139,250,0.4);
  border-radius: 2px;
}
.term-cat-link {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 4px 9px;
  background: #131826;
  border: 1px solid #2a3448;
  border-radius: 12px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
  scroll-snap-align: start;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.term-cat-link:hover {
  background: rgba(167,139,250,0.16);
  border-color: #a78bfa;
  color: #e5e7eb;
}
.term-cat-count {
  display: inline-block;
  background: rgba(167,139,250,0.22);
  color: #c4b5fd;
  font-size: 9.5px; font-weight: 700;
  padding: 0 5px;
  border-radius: 6px;
  font-family: ui-monospace, monospace;
}

/* section 标题更紧凑 */
.term-cat {
  margin: 14px 0;
  scroll-margin-top: 10px;
}
.term-cat-title {
  font-size: 12.5px;
  color: #a78bfa;
  margin: 12px 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(167,139,250,0.2);
  display: flex; align-items: center; gap: 6px;
  font-weight: 700;
}
.term-cat-sub {
  font-size: 10.5px;
  color: #64748b;
  font-weight: 500;
  font-family: ui-monospace, monospace;
}
.term-cat-chip {
  display: inline-block;
  padding: 1px 7px;
  background: rgba(167,139,250,0.12);
  border: 1px solid rgba(167,139,250,0.3);
  border-radius: 8px;
  color: #c4b5fd;
  font-size: 10.5px;
  white-space: nowrap;
}

/* 表格紧凑 — 隐藏 thead,行 padding 减小 */
.term-table {
  font-size: 12px;
}
.term-table tbody tr td {
  padding: 5px 8px !important;
}
.term-table .term-key {
  width: 30%;
  white-space: nowrap;
}

/* v84: context menu 「问 AI 教练」按钮(紫色高亮) */
.context-menu .ctx-ask-ai {
  color: #a78bfa !important;
  font-weight: 600;
}
.context-menu .ctx-ask-ai:hover {
  background: rgba(167, 139, 250, 0.14) !important;
  color: #c4b5fd !important;
}

/* ====== v83 💬 AI 战术教练(攻略中心第 7 tab) ====== */

.guide-tab-ai {
  position: relative;
  background: linear-gradient(180deg, rgba(167,139,250,0.06), transparent) !important;
}
.guide-tab-ai.active {
  color: #a78bfa !important;
  background: linear-gradient(180deg, rgba(167,139,250,0.16), transparent) !important;
}
.guide-tab-badge {
  position: absolute; top: 6px; right: 6px;
  background: #a78bfa; color: #0a0e14;
  font-size: 9px; font-weight: 800;
  padding: 1px 5px; border-radius: 3px;
  letter-spacing: 0.5px;
}

.ai-coach {
  display: flex; flex-direction: column;
  height: 100%; min-height: 0;
  gap: 8px;
}

/* 设置(API key / model)— v86 折叠态一行紧凑 */
.ai-settings {
  background: #131826; border: 1px solid #1f2433;
  border-radius: 8px; padding: 6px 12px;
  flex-shrink: 0;
}
.ai-settings.collapsed { padding: 6px 12px; }
.ai-settings.collapsed .ai-settings-body { display: none; }
.ai-settings:not(.collapsed) { padding: 8px 12px 12px; }
.ai-settings-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11.5px; color: #cbd5e1; font-weight: 600;
  cursor: pointer;
  gap: 8px;
}
.ai-settings-summary {
  display: inline-flex; align-items: center; gap: 6px;
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
}
.ai-settings-summary code {
  background: #0a0e14; padding: 1px 5px; border-radius: 3px;
  font-family: ui-monospace, monospace; font-size: 10.5px; color: #c4b5fd;
}
.ai-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  font-size: 10.5px; font-weight: 700;
  border: 1px solid transparent;
}
.ai-dot.on  { background: rgba(16,185,129,0.22); color: #34d399; border-color: rgba(16,185,129,0.4); }
.ai-dot.off { background: rgba(100,116,139,0.18); color: #94a3b8; border-color: rgba(100,116,139,0.4); }
.ai-dot.na  { background: rgba(251,191,36,0.18); color: #fbbf24; border-color: rgba(251,191,36,0.4); }
.ai-settings-toggle {
  background: transparent; border: 0; color: #94a3b8;
  cursor: pointer; padding: 0 4px;
  transition: transform 0.2s;
  font-size: 10px; line-height: 1;
}
.ai-settings.collapsed .ai-settings-toggle { transform: rotate(-90deg); }
.ai-settings-body { margin-top: 10px; }
.ai-settings-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr auto;
  gap: 8px;
  align-items: end;
}
.ai-field label {
  font-size: 10.5px; color: #94a3b8; display: block; margin-bottom: 2px;
}
.ai-settings input, .ai-settings select {
  background: #0a0e14; color: #e5e7eb;
  border: 1px solid #2a3448; border-radius: 5px;
  padding: 6px 9px; width: 100%;
  font-family: ui-monospace, monospace; font-size: 11.5px;
}
.ai-settings input:focus, .ai-settings select:focus {
  outline: none; border-color: #a78bfa;
}
.ai-field-grounding { padding-bottom: 6px; }
.ai-tip {
  font-size: 10.5px; color: #64748b; margin: 6px 0 0; line-height: 1.5;
}
.ai-tip a { color: #a78bfa; text-decoration: none; }
.ai-tip a:hover { text-decoration: underline; }

/* 消息流 */
.ai-messages {
  flex: 1; min-height: 180px;
  overflow-y: auto;
  background: #0a0e14; border: 1px solid #1f2433;
  border-radius: 8px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 10px;
  scroll-behavior: smooth;
}
/* v86 紧凑欢迎卡 */
.ai-welcome {
  color: #cbd5e1;
}
.ai-welcome-title {
  font-size: 13px; color: #e5e7eb; font-weight: 600;
  margin-bottom: 10px;
}
.ai-welcome-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.ai-chip {
  background: rgba(167,139,250,0.08);
  border: 1px solid rgba(167,139,250,0.3);
  border-radius: 14px;
  padding: 5px 11px;
  color: #c4b5fd;
  font-size: 11.5px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.ai-chip:hover {
  background: rgba(167,139,250,0.18);
  border-color: #a78bfa;
  color: #e5e7eb;
}
.ai-msg {
  display: flex; flex-direction: column; gap: 4px;
  max-width: 90%;
}
.ai-msg-user { align-self: flex-end; align-items: flex-end; }
.ai-msg-assistant { align-self: flex-start; }
.ai-msg-role {
  font-size: 10.5px; color: #64748b; font-weight: 700;
  letter-spacing: 0.5px;
}
.ai-msg-text {
  background: #131826; border: 1px solid #1f2433;
  border-radius: 10px; padding: 9px 13px;
  font-size: 13px; line-height: 1.7; color: #e5e7eb;
  word-wrap: break-word; white-space: pre-wrap;
}
.ai-msg-user .ai-msg-text {
  background: rgba(167,139,250,0.14);
  border-color: rgba(167,139,250,0.4);
  color: #e5e7eb;
}
.ai-msg-text strong { color: #a78bfa; font-weight: 700; }
.ai-msg-text code {
  background: #0a0e14; padding: 1px 5px; border-radius: 3px;
  font-family: ui-monospace, monospace; font-size: 11.5px;
  color: #c4b5fd;
}
.ai-msg-text.streaming::after {
  content: '▊';
  color: #a78bfa;
  animation: ai-blink 1s steps(2) infinite;
  margin-left: 2px;
}
@keyframes ai-blink { 50% { opacity: 0; } }

/* 输入栏 — v86 紧凑 */
.ai-input-bar {
  display: grid; grid-template-columns: 1fr auto auto;
  gap: 6px;
  flex-shrink: 0;
}
.ai-input-bar textarea {
  background: #0a0e14; color: #e5e7eb;
  border: 1px solid #2a3448; border-radius: 8px;
  padding: 8px 11px;
  font-family: inherit; font-size: 12.5px; line-height: 1.5;
  resize: none;
  transition: border-color 0.15s;
  grid-column: 1;
}
.ai-input-bar textarea:focus {
  outline: none; border-color: #a78bfa;
}
.ai-input-actions {
  display: contents;
}
.ai-send, .ai-clear {
  border: 0; border-radius: 8px;
  font-weight: 700; font-size: 14px; cursor: pointer;
  white-space: nowrap;
  min-width: 40px;
  height: 100%;
  display: inline-flex; align-items: center; justify-content: center;
}
.ai-send {
  background: #a78bfa; color: #0a0e14;
  padding: 0 16px;
}
.ai-send:hover { background: #c4b5fd; }
.ai-send:disabled { background: #2a3448; color: #64748b; cursor: not-allowed; }
.ai-clear {
  background: transparent; color: #94a3b8;
  border: 1px solid #2a3448;
  padding: 0 10px;
  font-size: 16px;
}
.ai-clear:hover { background: #131826; color: #ef4444; border-color: #ef4444; }

/* 检索上下文显示 */
.ai-context {
  font-size: 10.5px; color: #64748b;
  padding: 0 4px;
  font-family: ui-monospace, monospace;
  flex-shrink: 0;
}
.ai-context-kb {
  display: inline-block;
  padding: 1px 6px; border-radius: 3px;
  background: rgba(167,139,250,0.12); color: #a78bfa;
  margin: 0 2px;
}
