/* ------------------------------------------------------------------ *
 * media.css — 音视频与设备类工具的共用样式
 * 只放这一类页面共有的块：预览台、电平条、文件拖放、统计表、录制指示。
 * 页面独有的颜色/尺寸写在页面 <style> 里，共享变量不抄。
 * ------------------------------------------------------------------ */

/* ---------- 两栏：预览在左，参数在右 ---------- */
.mv-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 16px;
  align-items: start;
}
.mv-grid.even { grid-template-columns: 1fr 1fr; }
.mv-grid > * { min-width: 0; }
@media (max-width: 820px) {
  .mv-grid, .mv-grid.even { grid-template-columns: 1fr; }
}

/* ---------- 预览台 ---------- */
.mv-stage {
  position: relative;
  background: #0b0f16;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mv-stage.tall { aspect-ratio: 4 / 3; }
.mv-stage.auto { aspect-ratio: auto; min-height: 200px; }
.mv-stage > video,
.mv-stage > canvas,
.mv-stage > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.mv-stage > canvas { background: #0b0f16; }
.mv-stage .mv-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 18px;
  color: #8b95a7;
  font-size: 12.5px;
  line-height: 1.7;
}
.mv-stage.live .mv-empty { display: none; }

/* 录制红点 */
.mv-rec {
  position: absolute;
  left: 10px;
  top: 10px;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 11.5px;
}
.mv-rec.on { display: inline-flex; }
.mv-rec i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #ef4444;
  animation: mv-blink 1s infinite;
}
@keyframes mv-blink { 50% { opacity: .25; } }

/* 右上角角标 */
.mv-tag {
  position: absolute;
  right: 10px;
  top: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .5);
  color: #dbe3ef;
  font-size: 11px;
  font-family: var(--mono);
  letter-spacing: .02em;
}

/* ---------- 按钮条 ---------- */
.mv-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.mv-bar .sp { flex: 1; }

/* ---------- 参数行 ---------- */
.mv-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}
.mv-fields.one { grid-template-columns: 1fr; }
.mv-fields.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 520px) {
  .mv-fields, .mv-fields.three { grid-template-columns: 1fr 1fr; }
  .mv-fields.one { grid-template-columns: 1fr; }
}
.mv-fields .full { grid-column: 1 / -1; }
.mv-fields label {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.mv-fields input[type="number"],
.mv-fields input[type="text"],
.mv-fields select {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}
.mv-fields .unit {
  font-size: 11.5px;
  color: var(--text-faint);
  margin-left: 4px;
}

/* ---------- 统计表 ---------- */
.mv-stat {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 7px 14px;
  font-size: 13px;
  margin: 0;
}
.mv-stat dt { color: var(--text-dim); white-space: nowrap; }
.mv-stat dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  word-break: break-all;
}
.mv-stat dd b { font-family: var(--sans); }

/* ---------- 电平条 ---------- */
.mv-meter {
  height: 12px;
  border-radius: 6px;
  background: var(--panel-sunken);
  border: 1px solid var(--border);
  overflow: hidden;
}
.mv-meter i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #22c55e, #eab308 72%, #ef4444);
  transition: width .08s linear;
}
.mv-meter-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* ---------- 文件拖放 ---------- */
.mv-drop {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--panel-sunken);
  padding: 22px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.mv-drop:hover, .mv-drop.over {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.mv-drop b { display: block; font-size: 13.5px; margin-bottom: 4px; }
.mv-drop span { font-size: 12px; color: var(--text-dim); line-height: 1.6; }
.mv-drop input { display: none; }

/* ---------- 文件列表 ---------- */
.mv-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  font-size: 12.5px;
}
.mv-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.mv-list li:last-child { border-bottom: 0; }
.mv-list .nm {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mv-list .sz { color: var(--text-dim); font-family: var(--mono); font-size: 11.5px; }
.mv-list .idx {
  width: 18px;
  text-align: right;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 11px;
}
.mv-list button {
  border: 0;
  background: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 2px 4px;
}
.mv-list button:hover { color: var(--err); }

/* ---------- 进度 ---------- */
.mv-progress {
  height: 6px;
  border-radius: 3px;
  background: var(--panel-sunken);
  overflow: hidden;
  margin-top: 10px;
}
.mv-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width .1s linear;
}
.mv-progress-t {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 5px;
}

/* ---------- 提示 ---------- */
.mv-note {
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-dim);
  margin-top: 10px;
}
.mv-note b { color: var(--text); }
.mv-out {
  margin-top: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.mv-out .k { font-size: 12px; color: var(--text-dim); }
.mv-out .v {
  font-size: 20px;
  font-weight: 600;
  color: var(--accent-dark);
  font-family: var(--mono);
  line-height: 1.4;
  word-break: break-all;
}
.mv-out .sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

/* ---------- 虚拟键盘 ---------- */
.kb { display: flex; flex-direction: column; gap: 6px; }
.kb-row { display: flex; gap: 6px; }
.kb-key {
  flex: 1 1 0;
  min-width: 0;
  height: 40px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  transition: background .05s, color .05s, border-color .05s;
  overflow: hidden;
  white-space: nowrap;
}
.kb-key.on {
  background: var(--accent);
  border-color: var(--accent-dark);
  color: #fff;
}
.kb-key.hit {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
.kb-key.dead {
  border-style: dashed;
  color: var(--text-faint);
}
@media (max-width: 640px) {
  .kb-key { height: 30px; font-size: 10px; border-radius: 4px; }
  .kb-row { gap: 3px; }
  .kb { gap: 3px; }
}

/* ---------- 全屏测试层 ---------- */
.mv-fs {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.mv-fs .hint {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 12.5px;
  white-space: nowrap;
}
.mv-fs .label {
  position: absolute;
  left: 18px;
  top: 16px;
  color: rgba(255, 255, 255, .8);
  font-size: 12px;
  font-family: var(--mono);
}
