/* 拾贝 · 下载器卡片样式（网站页面内使用）
   布局沿用 FetchV 的文件卡骨架，配色走自有酸橙。 */

.dl-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(20, 24, 32, .06);
  padding: 24px 26px 18px;
  text-align: center;
}

/* ---------- 源 URL 输入行（网站形态必需：可手动粘贴） ---------- */
.url-row {
  display: flex;
  gap: 8px;
  align-items: center;
  max-width: 760px;
  margin: 0 auto 18px;
  text-align: left;
}

.url-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--ink);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}

.url-row input::placeholder { color: #B4BAC4; }

.url-row input:focus {
  outline: none;
  border-color: var(--brand-ink);
  box-shadow: 0 0 0 3px rgba(184, 242, 79, .12);
}

.url-row .paste-btn {
  flex: none;
  border: 1px solid var(--brand-line);
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 13px;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
}

.url-row .paste-btn:hover { background: #FFEBDD; }

/* ---------- 文件图标 + 清晰度 ---------- */
.fileicon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.doc {
  position: relative;
  width: 62px;
  height: 76px;
}

.doc svg { width: 62px; height: 76px; display: block; }

.doc .doc-badge {
  position: absolute;
  right: -9px;
  bottom: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: var(--brand-on);
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(184, 242, 79, .35);
}

.quality { margin-top: 2px; }

.qsel {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 5px 26px 5px 12px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237A808C' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 9px center;
}

.qsel:disabled { color: #AEB4BD; background-color: #F5F6F8; cursor: default; }

/* ---------- 文件名行 ---------- */
.fname-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px auto 10px;
  max-width: 720px;
}

.label {
  flex: none;
  background: #F1F3F6;
  color: #566;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 6px;
}

.fname {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--ink-2);
  background: #fff;
  text-overflow: ellipsis;
}

.fname:focus {
  outline: none;
  border-color: var(--brand-ink);
  box-shadow: 0 0 0 3px rgba(184, 242, 79, .12);
}

/* ---------- 音轨行 ---------- */
.audio-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 auto 16px;
  max-width: 720px;
}

.audio-row select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--ink-2);
  background: #fff;
  cursor: pointer;
  max-width: 240px;
}

.audio-row select:disabled { color: #AEB4BD; background: #F5F6F8; cursor: default; }

/* ---------- 进度条 ---------- */
.prog {
  position: relative;
  height: 40px;
  border-radius: 9px;
  background: #ECEEF2;
  overflow: hidden;
  max-width: 760px;
  margin: 6px auto 12px;
}

#bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #22A34B, #16A34A);
  transition: width .35s ease;
  border-radius: 9px;
}

#pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  pointer-events: none;
}

/* ---------- 统计行 ---------- */
.stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  font-size: 14px;
  color: #4A4F57;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.stats span { min-width: 54px; }
.stats b { color: #1B1F24; font-weight: 700; }

/* 录制中的进度条：总时长未知，百分比没有意义（一直 0.00% 看着像卡住）。
   改成流动条纹，明确表达「正在进行」。 */
.prog.live #bar {
  width: 100%;
  background: repeating-linear-gradient(
    90deg,
    rgba(22, 163, 74, .88) 0 26px,
    rgba(22, 163, 74, .58) 26px 52px
  );
  background-size: 52px 100%;
  animation: recflow 1.1s linear infinite;
}

/* 没录到数据时进度条是空的，白字在灰底上看不见 */
.prog.empty #pct { color: #6B7280; text-shadow: none; }

/* 条纹是深浅交替的，白字落在浅色段上会糊，加一层阴影保证可读 */
.prog.live #pct { text-shadow: 0 1px 2px rgba(0, 0, 0, .3); }

@keyframes recflow {
  from { background-position: 0 0; }
  to { background-position: 52px 0; }
}

@media (prefers-reduced-motion: reduce) {
  .prog.live #bar { animation: none; }
}

#mode { color: var(--brand-ink); font-weight: 700; font-size: 12px; }

/* ---------- 操作按钮 ---------- */
.acts {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 10px;
}

.circle {
  width: 50px;
  height: 50px;
  border-radius: 13px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  background: #F1F3F6;
  color: #4A4F57;
  transition: transform .08s, filter .15s, background .15s;
}

.circle:hover { filter: brightness(.96); }
.circle:active { transform: translateY(1px) scale(.97); }
.circle:disabled { opacity: .45; cursor: not-allowed; }
.circle.green { background: #EDF7E0; color: var(--brand-ink); }
.circle.green.primary { background: var(--brand); color: var(--brand-on); }
.circle.red { background: #FDECEE; color: var(--red); }
.circle.brand { background: var(--brand); color: var(--brand-on); }

.hint { font-size: 12px; color: #9AA0A8; }

/* ---------- 日志 + 源 ---------- */
.logbox {
  margin-top: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  text-align: left;
}

.logbox summary {
  cursor: pointer;
  padding: 11px 16px;
  font-size: 13px;
  color: #4A4F57;
  font-weight: 600;
  list-style: none;
}

.logbox summary::-webkit-details-marker { display: none; }
.logbox summary:hover { background: #FAFBFC; }

.log {
  background: #0F1115;
  color: #9FE6A0;
  font-family: Consolas, "SFMono-Regular", ui-monospace, monospace;
  font-size: 12px;
  padding: 12px 16px;
  max-height: 240px;
  overflow-y: auto;
  white-space: pre-wrap;
  min-height: 40px;
}

.srcline {
  margin-top: 12px;
  font-size: 12px;
  color: #8A8F98;
  word-break: break-all;
  text-align: left;
}

/* 隐藏播放器（仍需真实渲染才能让 MSE 持续拉流） */
#v {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* 设置里打开「视频预览」后的静音小窗 */
#v.on {
  left: auto;
  right: 18px;
  bottom: 18px;
  top: auto;
  width: 256px;
  height: 144px;
  opacity: 1;
  background: #000;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(16, 24, 40, .28);
  z-index: 9000;
  pointer-events: none;
}

/* ---------- 静态直链页专用 ---------- */
.dl-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 4px 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.dl-meta .chip {
  border: 1px solid var(--line);
  background: var(--bg-soft);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}

.opt-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
  margin: 0 auto 16px;
  max-width: 760px;
  font-size: 13px;
  color: var(--ink-2);
}

.opt-row label { display: inline-flex; align-items: center; gap: 6px; }
.opt-row input[type="number"] {
  width: 64px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 8px;
  font-size: 13px;
}

/* ---------- 录制页专用 ---------- */
.rec-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 6px 0 16px;
  font-size: 13px;
  color: var(--ink-2);
}

.rec-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #D5D9DF;
}

.rec-dot.on {
  background: var(--red);
  box-shadow: 0 0 0 0 rgba(229, 72, 77, .6);
  animation: pulse 1.4s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .55); }
  70% { box-shadow: 0 0 0 12px rgba(229, 72, 77, 0); }
  100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0); }
}

.warn-box {
  max-width: 760px;
  margin: 0 auto 16px;
  padding: 10px 14px;
  background: #FFF8E8;
  border: 1px solid #FFE3A8;
  border-radius: 9px;
  color: #8A6100;
  font-size: 12.5px;
  text-align: left;
}

/* 录制页：原视频页状态行（补丁/播放/分片写到哪一步） */
.srcstat{margin-top:10px;padding:8px 10px;border-radius:8px;background:#F7F8FA;
  border:1px solid #EDEFF2;font-size:12.5px;color:#5B6572;line-height:1.65;
  display:flex;gap:10px;align-items:flex-start;flex-wrap:wrap;}
.srcstat b{font-weight:600;}
.srcstat .ok{color:#146C33;}
.srcstat .warn{color:#A66400;}
.srcstat .bad{color:#B3261E;}
.srcstat .sp{color:#C9CED6;}
