@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600&family=Noto+Sans+SC:wght@400;500;700&display=swap");
:root {
  --bg-dark: #0d1117; --bg-card: #161b22; --bg-hover: #21262d;
  --border: #30363d; --text: #e6edf3; --text-muted: #8b949e;
  --accent-blue: #58a6ff; --accent-green: #3fb950;
  --accent-orange: #d29922; --accent-red: #f85149;
  --race-t: #74c0fc; --race-p: #b197fc; --race-z: #69db7c;
  --purple: #a855f7;
  --batch-rail-width: 320px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Noto Sans SC", -apple-system, sans-serif;
  background: var(--bg-dark); color: var(--text);
  min-height: 100vh; line-height: 1.6;
}
.container { max-width: 1200px; margin: 0 auto; padding: 2rem; }
.container { padding-top: 4rem; }
.top-nav {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.45rem;
  z-index: 1100;
  background: rgba(13,17,23,0.72);
  border: 1px solid rgba(139,148,158,0.24);
  border-radius: 999px;
  padding: 0.28rem 0.35rem;
  backdrop-filter: blur(8px);
}
.top-nav-link {
  color: #8b949e;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.72rem;
  padding: 0.18rem 0.62rem;
  text-decoration: none;
  transition: all 0.15s ease;
}
.top-nav-link:hover {
  color: #c9d1d9;
  border-color: rgba(88,166,255,0.35);
}
.top-nav-link--active {
  color: #b9d8ff;
  border-color: rgba(88,166,255,0.48);
  background: rgba(88,166,255,0.12);
}
header { text-align: center; margin-bottom: 2.5rem; }
h1 {
  font-size: 1.75rem; font-weight: 700; margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-green));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.subtitle { color: var(--text-muted); font-size: 0.9rem; }
.site-nav {
  margin-top: 0.9rem;
  display: flex;
  justify-content: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.site-nav-link {
  color: var(--accent-blue);
  border: 1px solid rgba(139,148,158,0.35);
  border-radius: 999px;
  font-size: 0.74rem;
  padding: 0.2rem 0.72rem;
  text-decoration: none;
  background: rgba(88,166,255,0.04);
  opacity: 0.78;
}
.site-nav-link:hover {
  border-color: var(--accent-blue);
  background: rgba(88,166,255,0.12);
  opacity: 1;
}
.feedback-qq {
  margin-top: 1.25rem; padding: 1.15rem 1.35rem; display: inline-flex; align-items: center; gap: 1.35rem;
  text-align: left; max-width: 100%; flex-wrap: wrap; justify-content: center;
  border-radius: 14px; border: 1px solid transparent;
  background:
    linear-gradient(165deg, #181c24 0%, #12161c 100%) padding-box,
    linear-gradient(135deg, rgba(88, 166, 255, 0.45), rgba(168, 85, 247, 0.4)) border-box;
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.feedback-qq-qr-wrap {
  flex-shrink: 0; position: relative;
  padding: 3px; border-radius: 14px;
  background: linear-gradient(145deg, var(--accent-blue), var(--purple));
  box-shadow: 0 4px 24px rgba(88, 166, 255, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.35) inset;
  transition: box-shadow 0.25s, transform 0.2s;
}
.feedback-qq-qr-wrap:hover {
  box-shadow: 0 6px 28px rgba(168, 85, 247, 0.28), 0 0 0 1px rgba(0, 0, 0, 0.35) inset;
  transform: translateY(-1px);
}
.feedback-qq-qr {
  display: block; border-radius: 11px; overflow: hidden; line-height: 0;
  background: var(--bg-dark);
}
.feedback-qq-qr img {
  display: block; width: 120px; height: 120px;
  image-rendering: pixelated; image-rendering: crisp-edges;
}
.feedback-qq-text { display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.85rem; color: var(--text-muted); max-width: 280px; }
.feedback-qq-text strong {
  font-size: 0.95rem; font-weight: 700;
  background: linear-gradient(120deg, #7dc4ff, #c4b5fd, #a5f3fc);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.feedback-qq-text code {
  font-family: "JetBrains Mono", monospace; font-size: 0.88rem; color: var(--accent-green);
  background: rgba(63, 185, 80, 0.14); padding: 0.12rem 0.45rem; border-radius: 6px;
  border: 1px solid rgba(63, 185, 80, 0.25);
}
.feedback-qq-link {
  display: inline-flex; align-items: center; align-self: flex-start;
  margin-top: 0.35rem; padding: 0.45rem 0.95rem; border-radius: 8px; font-weight: 600; font-size: 0.82rem;
  color: #e9d5ff; text-decoration: none;
  background: rgba(168, 85, 247, 0.22); border: 1px solid rgba(168, 85, 247, 0.45);
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.feedback-qq-link:hover {
  background: rgba(168, 85, 247, 0.35); border-color: var(--purple); color: #fff;
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.25);
}
.drop-zone {
  border: 2px dashed var(--border); border-radius: 12px;
  padding: 3rem 2rem; text-align: center; cursor: pointer;
  transition: all 0.2s ease; background: var(--bg-card); margin-bottom: 2rem;
}
.drop-zone:hover, .drop-zone.dragover { border-color: var(--accent-blue); background: var(--bg-hover); }
.drop-zone .icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.7; }
.drop-zone p { color: var(--text-muted); font-size: 0.95rem; }
.drop-zone .hint { margin-top: 0.5rem; font-size: 0.8rem; opacity: 0.8; }
input[type="file"] { display: none; }
.result { display: none; }
.result.visible { display: block; }
.game-info {
  background: var(--bg-card); border-radius: 12px; padding: 1rem 1.5rem;
  margin-bottom: 1.5rem; display: flex; gap: 2rem; flex-wrap: wrap;
  border: 1px solid var(--border);
}
.game-info span { color: var(--text-muted); font-size: 0.9rem; }
.game-info strong { color: var(--accent-blue); }
.share-upload-host {
  flex: 1 1 100%;
}
.share-panel {
  margin-top: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(88,166,255,0.04);
  padding: 0.75rem;
}
.share-panel-toggle {
  border: 1px solid var(--accent-blue);
  color: var(--accent-blue);
  background: rgba(88,166,255,0.1);
  border-radius: 8px;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  cursor: pointer;
}
.share-panel-body { margin-top: 0.7rem; }
.share-panel-desc {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 0.55rem;
}
.share-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.55rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.share-meta-grid strong { color: var(--accent-blue); margin-right: 0.25rem; }
.share-consent {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.share-message-label {
  display: block;
  margin-top: 0.25rem;
  margin-bottom: 0.3rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
#shareMessage {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f131a;
  color: var(--text);
  padding: 0.45rem 0.55rem;
  resize: vertical;
}
.share-message-footer {
  display: flex;
  justify-content: flex-end;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}
.share-actions {
  margin-top: 0.45rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.share-submit-btn {
  border: 1px solid var(--accent-green);
  color: #d5fbe0;
  background: rgba(63,185,80,0.15);
  border-radius: 8px;
  padding: 0.35rem 0.9rem;
  font-size: 0.82rem;
  cursor: pointer;
}
.share-submit-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}
.share-submit-status {
  color: var(--text-muted);
  font-size: 0.78rem;
}
.replay-library-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  padding: 1rem 1rem 0.8rem;
  margin-bottom: 1rem;
}
.replay-library-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.5rem;
}
.replay-library-controls input {
  width: 100%;
  border: 1px solid var(--border);
  background: #0f131a;
  color: var(--text);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
}
.replay-library-controls select,
.replay-library-controls button {
  width: 100%;
  border: 1px solid var(--border);
  background: #0f131a;
  color: var(--text);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
}
.replay-library-controls button {
  cursor: pointer;
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  background: rgba(88,166,255,0.08);
}
.replay-library-status {
  margin-top: 0.55rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}
.replay-library-status--warn {
  color: #f2cc60;
}
.replay-library-list {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.7rem;
  max-height: 460px;
  overflow-y: auto;
}
.replay-library-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  background: #141a22;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 0.6rem;
}
.replay-library-item-main {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}
.replay-library-item-title {
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.replay-library-pin {
  border: 1px solid rgba(210,153,34,0.5);
  color: #f2cc60;
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
  font-size: 0.68rem;
}
.replay-library-item-meta {
  color: var(--text-muted);
  font-size: 0.76rem;
}
.replay-library-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.replay-library-tag {
  border: 1px solid rgba(88,166,255,0.35);
  color: #b9d8ff;
  border-radius: 999px;
  padding: 0.06rem 0.45rem;
  font-size: 0.68rem;
  background: rgba(88,166,255,0.08);
}
.replay-library-tag--empty {
  border-color: rgba(139,148,158,0.35);
  color: var(--text-muted);
  background: rgba(139,148,158,0.08);
}
.replay-library-item-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.replay-library-like-count {
  color: #ff8fab;
  font-size: 0.76rem;
  font-weight: 600;
}
.replay-library-item button {
  border: 1px solid var(--accent-blue);
  color: var(--accent-blue);
  background: rgba(88,166,255,0.08);
  border-radius: 8px;
  padding: 0.32rem 0.68rem;
  cursor: pointer;
  white-space: nowrap;
}
.replay-library-like-btn.is-liked-anim {
  animation: replay-like-pop 0.34s ease;
}
@keyframes replay-like-pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.18); }
  70% { transform: scale(0.95); }
  100% { transform: scale(1); }
}
.build-orders { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.time-mode-toggle {
  margin-bottom: 1rem; display: flex; align-items: center;
  gap: 0.75rem; font-size: 0.85rem; color: var(--text-muted); flex-wrap: wrap;
}
.time-mode-toggle label { display: inline-flex; align-items: center; gap: 0.25rem; cursor: pointer; }
.chat-toggle-row { margin: 0.5rem 0 0.25rem; display: flex; justify-content: flex-end; }
.chat-toggle-btn {
  background: transparent; border-radius: 6px; border: 1px solid var(--border);
  color: var(--accent-blue); padding: 0.25rem 0.75rem; font-size: 0.8rem; cursor: pointer;
}
.chat-toggle-btn:hover { background: var(--bg-hover); border-color: var(--accent-blue); }
.chat-panel {
  display: none; background: var(--bg-card); border-radius: 8px;
  border: 1px solid var(--border); padding: 0.75rem 1rem; margin-bottom: 1rem;
  max-height: 240px; overflow-y: auto; font-family: "JetBrains Mono", monospace; font-size: 0.8rem;
}
.chat-item { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.25rem; }
.chat-item:last-child { margin-bottom: 0; }
.chat-time { color: var(--text-muted); }
.chat-player { color: var(--accent-green); }
.chat-target { color: var(--text-muted); }
.chat-text { color: var(--text); }
.build-item.upgrade .unit, .build-item.upgrade .time { color: var(--accent-red); }
.build-item.recall .unit, .build-item.recall .time { color: var(--accent-blue); }
.build-item.unit .unit { color: var(--accent-orange); }
.build-item.worker-death .unit, .build-item.worker-death .time { color: var(--accent-red); }
@media (max-width: 768px) { .build-orders { grid-template-columns: 1fr; } }
.player-panel { background: var(--bg-card); border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.player-header {
  padding: 1rem 1.25rem; font-weight: 600; font-size: 1rem;
  border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 0.5rem;
}
.player-header.team1 { background: linear-gradient(90deg, rgba(116,192,252,0.15), transparent); }
.player-header.team2 { background: linear-gradient(90deg, rgba(249,81,73,0.15), transparent); }
.race-badge { font-family: "JetBrains Mono", monospace; font-weight: 600; font-size: 0.85rem; padding: 0.2rem 0.5rem; border-radius: 4px; }
.race-badge.T { background: rgba(116,192,252,0.3); color: var(--race-t); }
.race-badge.P { background: rgba(177,151,252,0.3); color: var(--race-p); }
.race-badge.Z { background: rgba(105,219,124,0.3); color: var(--race-z); }
.player-header .player-name { max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.export-btn {
  padding: 0.2rem 0.75rem; font-size: 0.8rem; border-radius: 999px;
  border: 1px solid var(--border); background: rgba(88,166,255,0.08);
  color: var(--accent-blue); cursor: pointer; display: inline-flex; align-items: center; gap: 0.25rem;
}
.export-btn::before { content: "\21E9"; font-size: 0.9em; }
.export-btn:hover { border-color: var(--accent-blue); background: rgba(88,166,255,0.2); }
.voice-reader-btn {
  background: rgba(168,85,247,0.1); color: var(--purple);
  border: 1px solid rgba(168,85,247,0.2); border-radius: 6px;
  padding: 4px 10px; font-size: 0.75rem; cursor: pointer;
  margin-right: 8px; display: inline-flex; align-items: center; gap: 4px; transition: all 0.2s;
}
.voice-reader-btn:hover { background: rgba(168,85,247,0.2); border-color: var(--purple); }
.voice-reader-btn span { font-size: 0.9rem; }
.build-list { max-height: 400px; overflow-y: auto; }
.build-list, .chat-panel { scrollbar-width: thin; scrollbar-color: var(--accent-blue) transparent; }
.build-list::-webkit-scrollbar, .chat-panel::-webkit-scrollbar { width: 8px; }
.build-list::-webkit-scrollbar-track, .chat-panel::-webkit-scrollbar-track { background: transparent; }
.build-list::-webkit-scrollbar-thumb, .chat-panel::-webkit-scrollbar-thumb {
  background: rgba(88,166,255,0.4); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box;
}
.build-list::-webkit-scrollbar-thumb:hover, .chat-panel::-webkit-scrollbar-thumb:hover { background: rgba(88,166,255,0.8); }
.build-item {
  display: grid; grid-template-columns: 60px 50px 1fr; gap: 0.75rem;
  padding: 0.5rem 1.25rem; font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem; border-bottom: 1px solid var(--border); align-items: center;
}
.build-item:last-child { border-bottom: none; }
.build-item:hover { background: var(--bg-hover); }
.build-item .time { color: var(--text-muted); font-weight: 500; }
.build-item .supply { color: var(--accent-orange); font-size: 0.8rem; }
.build-item .unit { color: var(--text); }
.loading { text-align: center; padding: 2rem; color: var(--text-muted); display: none; }
.loading.visible { display: block; }
.loading .spinner {
  display: inline-block; width: 32px; height: 32px;
  border: 3px solid var(--border); border-top-color: var(--accent-blue);
  border-radius: 50%; animation: spin 0.8s linear infinite; margin-bottom: 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
.error {
  background: rgba(248,81,73,0.15); border: 1px solid var(--accent-red);
  border-radius: 8px; padding: 1rem; color: var(--accent-red); margin-bottom: 1rem; display: none;
}
.error.visible { display: block; }
.init-status { text-align: center; padding: 1.5rem; color: var(--text-muted); font-size: 0.9rem; }
.init-status .progress { margin-top: 1rem; color: var(--accent-blue); }

/* Voice Reader */
.voice-reader-panel {
  position: fixed; bottom: 20px; right: 20px; width: 340px;
  background: rgba(22,27,34,0.98); border: 1px solid #30363d; border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6); display: none; padding: 18px;
  z-index: 1000; color: #e6edf3; font-family: "Noto Sans SC", sans-serif;
  backdrop-filter: blur(10px);
  --voice-pip-font-scale: 1;
}
.voice-reader-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; border-bottom: 1px solid #30363d; padding-bottom: 8px; }
.voice-reader-header h3 { margin: 0; font-size: 0.95rem; color: var(--purple); line-height: 1.2; padding-right: 20px; }
.voice-reader-close { background: none; border: none; color: #8b949e; font-size: 1.4rem; cursor: pointer; line-height: 1; }
#voice-timer { text-align: center; font-size: 1.8rem; font-weight: bold; margin: 12px 0; color: var(--accent-green); font-family: "JetBrains Mono", monospace; }
.voice-reader-pip-strip {
  display: none; flex-direction: column; gap: 0; width: 100%; height: 100%; min-height: 0; flex: 1 1 auto;
  font-size: calc(var(--voice-pip-font-scale, 1) * clamp(13px, min(4vmin, 3.5vh), 22px));
}
.voice-pip-row {
  display: flex; align-items: stretch; gap: 0; flex: 1 1 auto; min-height: 0;
  padding: clamp(4px, 0.9vmin, 10px) clamp(6px, 1.6vmin, 12px) clamp(3px, 0.7vmin, 8px);
  background: rgba(10,12,16,0.95); border-radius: 8px 8px 0 0;
}
.voice-pip-left { display: flex; align-items: center; justify-content: center; flex: 0 0 clamp(4.2em, 14vmin, 7.5em); }
#voice-timer-pip {
  font-size: 2.35em; font-weight: 700; color: #39ff14; font-family: "JetBrains Mono", monospace;
  line-height: 1; text-shadow: 0 0 12px rgba(57,255,20,0.35); letter-spacing: -0.02em;
}
.voice-pip-divider { width: 2px; flex: 0 0 2px; margin: clamp(2px, 0.5vmin, 6px) clamp(6px, 1.4vmin, 10px); background: linear-gradient(180deg, transparent, #3fb950 20%, #3fb950 80%, transparent); border-radius: 1px; opacity: 0.85; }
.voice-pip-center { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: clamp(2px, 0.4vmin, 5px); }
.voice-pip-current { display: flex; align-items: baseline; flex-wrap: wrap; gap: clamp(4px, 0.8vmin, 8px); line-height: 1.2; }
#voice-pip-step-time { font-family: "JetBrains Mono", monospace; font-size: 1.08em; font-weight: 600; color: #d29922; flex-shrink: 0; }
#voice-pip-step-text { font-size: 1.08em; font-weight: 600; color: #f0f6fc; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#voice-pip-context {
  font-size: 0.9em; color: #6e7681; line-height: 1.3; overflow: hidden;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
}
.voice-pip-actions {
  display: flex; flex-direction: column; justify-content: center; gap: clamp(3px, 0.55vmin, 6px);
  flex: 0 0 auto; padding-left: clamp(4px, 1vmin, 8px);
}
.voice-pip-btn {
  font-size: 0.85em; padding: 0.45em 0.65em; border-radius: 6px; border: 1px solid #30363d;
  background: #21262d; color: #e6edf3; cursor: pointer; font-weight: 600; font-family: inherit;
  white-space: nowrap; line-height: 1.2;
}
.voice-pip-btn:hover:not(:disabled) { background: #30363d; border-color: #484f58; }
.voice-pip-btn:disabled { opacity: 0.38; cursor: not-allowed; }
.voice-pip-footer-bars {
  display: flex; flex-direction: column; gap: clamp(2px, 0.45vmin, 5px); flex-shrink: 0;
  padding: 0 clamp(6px, 1.6vmin, 12px) clamp(5px, 1vmin, 9px); background: rgba(10,12,16,0.95); border-radius: 0 0 8px 8px;
}
.voice-reader-panel.pip-compact {
  width: 100% !important; max-width: none !important; height: 100% !important; padding: 0 !important; border-radius: 10px !important;
  flex: 1 1 auto !important; min-height: 0 !important; flex-direction: column !important; align-items: stretch !important;
}
.voice-reader-panel.pip-compact .voice-reader-main { display: none !important; }
.voice-reader-panel.pip-compact .voice-reader-pip-strip { display: flex !important; }
.voice-reader-panel.pip-compact .voice-bars-host { gap: clamp(2px, 0.5vmin, 6px); margin-bottom: 0; flex-shrink: 0; }
.voice-reader-panel.pip-compact .voice-bars-host .voice-timeline { margin: 0; height: clamp(4px, 0.9vmin, 8px); }
.voice-reader-panel.pip-compact .voice-bars-host .voice-step-progress { margin: 0; height: clamp(3px, 0.7vmin, 6px); }
.voice-bars-host { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.voice-reader-main { display: flex; flex-direction: column; align-items: stretch; }
.voice-queue { min-height: 180px; display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; overflow: hidden; }
.voice-step {
  padding: 4px 10px; border-radius: 6px; font-size: 0.82rem; transition: all 0.2s;
  border: 1px solid transparent; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.voice-step.past { color: #484f58; opacity: 0.6; }
.voice-step.active { background: rgba(168,85,247,0.15); border-color: var(--purple); color: #fff; font-weight: bold; font-size: 1rem; box-shadow: 0 0 10px rgba(168,85,247,0.2); }
.voice-step.future { color: #8b949e; }
.voice-step-progress {
  height: 4px; background: #21262d; border-radius: 2px; overflow: hidden;
  width: 100%; box-sizing: border-box; flex-shrink: 0;
}
#voice-step-bar {
  height: 100%; min-height: 4px; display: block; width: 0%; box-sizing: border-box;
  background: linear-gradient(90deg, #eae608 0%, #22c55e 33%, #ef4444 66%, #a855f7 100%);
  background-size: 100% 100%; transition: width 0.1s linear;
}
.voice-timeline { height: 8px; background: #21262d; border-radius: 4px; margin: 20px 0; cursor: pointer; position: relative; overflow: hidden; }
#voice-timeline-bar { height: 100%; background: var(--accent-blue); width: 0%; border-radius: 4px; opacity: 0.5; }
.voice-controls { display: flex; gap: 12px; margin: 15px 0; }
.voice-btn { flex: 1; padding: 10px; border-radius: 8px; border: none; cursor: pointer; font-weight: 600; font-size: 0.85rem; transition: transform 0.1s; }
.voice-btn:active { transform: scale(0.98); }
.voice-btn-play { background: var(--purple); color: white; }
.voice-btn-reset { background: #30363d; color: #e6edf3; }
#pipBtn {
  background: rgba(168, 85, 247, 0.18); border: 1px solid rgba(168, 85, 247, 0.45); color: #e9d5ff;
  cursor: pointer; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em;
  padding: 6px 11px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2) inset;
  white-space: nowrap; font-family: inherit;
}
#pipBtn:hover {
  background: rgba(168, 85, 247, 0.32); border-color: var(--purple); color: #fff;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.25);
}
.voice-settings { border-top: 1px solid #30363d; padding-top: 12px; font-size: 0.75rem; color: #8b949e; }
.voice-setting-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.voice-setting-row select, .voice-setting-row input[type="range"] { background: #0d1117; border: 1px solid #30363d; color: white; padding: 2px 5px; border-radius: 4px; }
.voice-setting-row input[type="range"] { height: 4px; }
.voice-pip-font-val { min-width: 2.75rem; text-align: right; font-size: 0.7rem; color: #8b949e; font-variant-numeric: tabular-nums; }

/* Benchmarks */
.benchmarks-section { margin-top: 2rem; }
.section-title {
  font-size: 1.25rem; font-weight: 700; margin-bottom: 1rem; color: var(--accent-blue);
  padding-bottom: 0.5rem; border-bottom: 1px solid var(--border);
}
.benchmarks-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 768px) { .benchmarks-grid { grid-template-columns: 1fr; } }
.benchmark-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  padding: 1rem 1.25rem; min-height: 240px;
}
.benchmark-card h3 { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.75rem; font-weight: 500; }

/* Batch replay rail：独立悬浮层（不占主内容宽度，类似 PiP 面板） */
.batch-replay-rail {
  display: none;
  position: fixed;
  left: 12px;
  top: 72px;
  bottom: 24px;
  width: var(--batch-rail-width);
  max-width: calc(100vw - 24px);
  z-index: 850;
  flex-direction: column;
  gap: 0;
  pointer-events: auto;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(22, 27, 34, 0.97);
  box-shadow:
    0 12px 48px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(0, 0, 0, 0.35) inset;
  backdrop-filter: blur(12px);
  overflow: hidden;
}
.batch-replay-rail.batch-replay-rail--visible {
  display: flex;
}
.batch-replay-rail-inner {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  overflow: hidden;
  padding-right: 6px;
}
.batch-replay-rail-resize {
  display: none;
}
.batch-replay-rail-head {
  flex-shrink: 0;
  padding: 0.5rem 0.35rem 0.15rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
}
.batch-replay-rail-head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}
.batch-replay-rail-head strong { color: var(--accent-blue); display: block; margin-bottom: 0.25rem; }
.batch-replay-rail-toggle {
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: #0f131a;
  border-radius: 7px;
  padding: 0.15rem 0.45rem;
  font-size: 0.7rem;
  cursor: pointer;
  white-space: nowrap;
}
.batch-replay-rail-toggle:hover {
  color: var(--accent-blue);
  border-color: var(--accent-blue);
}
.batch-replay-rail-hint { font-size: 0.72rem; opacity: 0.9; }
.batch-replay-rail-search {
  width: 100%;
  margin-top: 0.45rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0f131a;
  color: var(--text);
  padding: 0.35rem 0.55rem;
  font-size: 0.76rem;
}
.batch-replay-rail-cards {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-blue) transparent;
}
.batch-replay-rail-cards::-webkit-scrollbar { width: 6px; }
.batch-replay-rail-cards::-webkit-scrollbar-thumb {
  background: rgba(88,166,255,0.35); border-radius: 999px;
}
.batch-replay-card {
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.78rem;
  line-height: 1.45;
  cursor: default;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.batch-replay-card--done {
  cursor: pointer;
}
.batch-replay-card--done:hover {
  border-color: var(--accent-blue);
  background: var(--bg-hover);
}
.batch-replay-card--selected {
  border-color: var(--accent-green);
  box-shadow: 0 0 0 1px rgba(63, 185, 80, 0.35);
  background: rgba(63, 185, 80, 0.06);
}
.batch-replay-card--error {
  border-color: rgba(248, 81, 73, 0.45);
  background: rgba(248, 81, 73, 0.06);
}
.batch-replay-card--loading,
.batch-replay-card--pending {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}
.batch-replay-card-title {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text);
  word-break: break-all;
  width: 100%;
}
.batch-replay-card-status { color: var(--text-muted); font-size: 0.75rem; }
.batch-replay-card-dl {
  margin: 0.35rem 0 0;
  display: grid;
  grid-template-columns: 4.2rem 1fr;
  gap: 0.2rem 0.4rem;
  font-size: 0.74rem;
}
.batch-replay-card-dl dt {
  margin: 0;
  color: var(--text-muted);
  font-weight: 500;
}
.batch-replay-card-dl dd { margin: 0; color: var(--text); word-break: break-word; }
.batch-replay-card-spinner {
  width: 22px; height: 22px;
  border: 2px solid var(--border);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.batch-replay-rail--collapsed {
  bottom: auto;
  max-height: none;
}
.batch-replay-rail--collapsed .batch-replay-rail-inner {
  flex: none;
  gap: 0;
  padding-right: 0;
}
.batch-replay-rail--collapsed .batch-replay-rail-head {
  padding: 0.5rem 0.45rem;
}
.batch-replay-rail--collapsed .batch-replay-rail-head strong {
  margin-bottom: 0;
}
.batch-replay-rail--collapsed .batch-replay-rail-hint,
.batch-replay-rail--collapsed .batch-replay-rail-search,
.batch-replay-rail--collapsed .batch-replay-rail-cards,
.batch-replay-rail--collapsed .batch-replay-rail-resize {
  display: none !important;
}
@media (min-width: 901px) {
  .batch-replay-rail-resize {
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    width: 10px;
    height: 100%;
    cursor: col-resize;
    z-index: 2;
    background: transparent;
    touch-action: none;
    border-radius: 0 10px 10px 0;
  }
  .batch-replay-rail-resize:hover,
  .batch-replay-rail.batch-replay-rail--resizing .batch-replay-rail-resize {
    background: rgba(88, 166, 255, 0.18);
  }
}
@media (max-width: 900px) {
  .batch-replay-rail {
    position: relative;
    left: auto;
    top: auto;
    bottom: auto;
    width: 100%;
    max-width: none;
    max-height: 240px;
    z-index: 1;
    margin-bottom: 1rem;
  }
}
