:root {
  --blue: #1b6dff;
  --text: #1a1d26;
  --gray: #8a8f99;
  --card: #ffffff;
  --page: #f5f6f8;
  --line: #dcdfe6;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

body {
  min-width: 320px;
  background: var(--page);
  color: var(--text);
  display: flex;
  justify-content: center;
  padding: 32px 16px;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

.card {
  width: 100%;
  max-width: 1080px;
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(20, 30, 60, 0.08);
  padding: 32px;
}

header {
  text-align: center;
  margin-bottom: 28px;
}

h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0;
}

.subtitle {
  color: var(--gray);
  font-size: 13px;
  margin-top: 8px;
}

.strategy-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}

.strategy-tab {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #f6f7f9;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.strategy-tab:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: #fff;
}

.strategy-tab.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
  box-shadow: 0 4px 14px rgba(27, 109, 255, 0.25);
}

.tab-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.tab-desc {
  font-size: 12px;
  opacity: 0.85;
  font-weight: 500;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.viewer {
  display: block;
}

.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #111;
  user-select: none;
  --p: 50;
}

.media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media.ours {
  clip-path: inset(0 0 0 50%);
}

.label {
  position: absolute;
  top: 0;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-variant-numeric: tabular-nums;
  z-index: 3;
  max-width: 280px;
  pointer-events: none;
}

.label.base {
  left: 0;
  background: rgba(20, 24, 32, 0.55);
  color: #fff;
}

.label.ours {
  left: calc(var(--p, 50) * 1%);
  background: #1b6dff;
  color: #fff;
  text-align: left;
  max-width: none;
  white-space: nowrap;
  overflow: visible;
  border-radius: 0;
  padding: 4px 6px;
  font-size: 13px;
  line-height: 1.6;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.label .name {
  font-size: 16px;
  font-weight: 700;
}

.label .hl {
  font-weight: 700;
  color: #ffd76a;
}

.label.ours .hl {
  color: #cfe4ff;
}

.divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: #fff;
  transform: translateX(-1px);
  cursor: ew-resize;
  outline: none;
  z-index: 1;
}

.badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
}

.badge .small {
  font-size: 11px;
  opacity: 0.9;
}

.badge .big {
  font-size: 22px;
  font-weight: 800;
  color: #6ea8ff;
}

.controls {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  padding: 10px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
}

.ctrl-btn {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.ctrl-btn svg {
  width: 18px;
  height: 18px;
}

.ctrl-btn .icon-pause,
.controls.playing .icon-play {
  display: none;
}

.controls.playing .icon-pause {
  display: block;
}

.progress {
  appearance: none;
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  outline: none;
  cursor: pointer;
}

.progress::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--blue);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.time {
  flex: none;
  font-size: 12px;
  color: #4a4f57;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rate {
  flex: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  color: #4a4f57;
  cursor: pointer;
}

.metrics {
  margin-top: 16px;
  text-align: center;
  color: var(--gray);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.footer-row {
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 14px;
}

.download-btn {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--gray);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.download-btn:hover {
  color: var(--blue);
  border-color: var(--blue);
}

.download-btn svg {
  width: 20px;
  height: 20px;
}

.download-menu {
  position: absolute;
  right: 0;
  bottom: 52px;
  width: 220px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(20, 30, 60, 0.14);
  padding: 8px;
  z-index: 5;
}

.download-menu a {
  display: block;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.download-menu a:hover {
  background: #eef4ff;
  color: var(--blue);
}

.placeholder-box {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 2px dashed #c5c8ce;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--gray);
  text-align: center;
  gap: 10px;
}

.placeholder-box .icon {
  color: #c5c8ce;
}

.placeholder-box .title {
  font-size: 18px;
  font-weight: 600;
  color: #6b7280;
}

.placeholder-box .desc {
  font-size: 13px;
  max-width: 420px;
  line-height: 1.6;
}

.load-error {
  margin-top: 12px;
  color: #c23b35;
  font-weight: 700;
}

@media (max-width: 768px) {
  body {
    padding: 18px 10px;
  }

  .card {
    padding: 20px;
  }

  h1 {
    font-size: 20px;
  }

  .strategy-tabs,
  .controls {
    flex-direction: column;
  }

  .strategy-tab,
  .progress,
  .time,
  .rate {
    width: 100%;
  }

  .badge {
    width: 64px;
    height: 64px;
  }

  .badge .big {
    font-size: 16px;
  }
}
