/* 训练视频 —— 时间线布局 + 上传。依赖 style.css 里的设计变量与基础组件 */

.vmeta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}
.vacts { display: inline-flex; gap: 6px; flex: none; align-items: stretch; }

/* 图标按钮：跟同排的文字按钮一样高（靠 stretch 撑，不写死像素），省掉文字。
   底色用主题色的浅色版，跟导航选中态同一套语言 —— 一眼能认出是「能点的东西」。
   文案放在 title / aria-label —— 桌面悬停看得到，读屏也读得出来 */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  padding: 0;
  background: var(--accent-bg);
  border-color: var(--accent-bg);
  color: var(--accent-strong);
}
.btn-icon svg {
  width: 16px;
  height: 16px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn-icon:active { background: #cdeadd; }   /* accent-bg 再深一档 */

/* ---------- 上传 ---------- */

.upform { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.updrop { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.updrop .note { margin: 0; }
.upfields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.upfields.one { grid-template-columns: 1fr; }

select {
  font: inherit;
  font-size: 14px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  /* 自绘下拉小三角，避免各平台原生控件风格打架 */
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}

.tipbox {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  background: #f7f8f9;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: 10px;
}
.tipbox b { color: var(--accent-strong); font-weight: 600; }
.tipbox.warn { background: #fdf6ec; border-color: #f0dcc0; color: #8a6d3b; }
.tipbox.warn b { color: #8a6d3b; }

.uplist { list-style: none; margin: 8px 0 0; padding: 0; }
.uplist li { padding: 8px 0; border-bottom: 1px solid #f0f1f3; font-size: 12px; }
.uplist li:last-child { border-bottom: none; }
.uplist .urow { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.uplist .uname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uplist .ustate { flex: none; color: var(--muted); font-variant-numeric: tabular-nums; }
.uplist .ustate.done { color: var(--accent-strong); }
.uplist .ustate.err { color: var(--danger); }
.uplist .ubar { height: 3px; border-radius: 2px; background: #eef0f2; margin-top: 6px; overflow: hidden; }
.uplist .ubar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

/* 队列上方那行「识别到的拍摄时间」 */
.shotline {
  font-size: 12px;
  line-height: 1.6;
  color: var(--accent-strong);
  background: var(--accent-bg);
  border-radius: 8px;
  padding: 7px 10px;
  margin-top: 8px;
}

/* 队列行里那一小行：拍摄时间按钮 + 来源 + 体积 */
.uplist .usub {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}
.ushot {
  font: inherit;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  cursor: pointer;
}
.ushot:active { background: #f0f1f3; }
.ushot.busy { border-style: dashed; color: var(--muted); cursor: default; }
.usrc { color: #9aa0a6; }

.uedit { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.uedit input { flex: 1; min-width: 0; font-size: 13px; padding: 4px 6px; }
.uedit button { flex: none; }

/* ---------- 时间线 ---------- */

/* 年 / 月 两层标题条：点一下折起或展开。层级越深缩进越多，
   折叠状态下一屏能放下好几年的量，不用一直往下拖 */
.tl-year { margin-bottom: 4px; }

.tl-row {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 8px 2px;
  background: none;
  border: 0;
  border-radius: 6px;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.tl-row:hover { background: #fafafa; }
.tl-row:active { opacity: .6; }
.tl-caret { flex: none; width: 10px; font-size: 10px; color: var(--muted); }
.tl-name { flex: none; font-weight: 600; }
.tl-sum { margin-left: auto; font-size: 11px; color: var(--muted); white-space: nowrap; }

.tl-yrow { border-bottom: 1px solid var(--line); border-radius: 0; margin-bottom: 4px; }
.tl-yrow .tl-name { font-size: 14px; }

/* 月份比年低一层：缩进 + 左侧细线，从属关系一眼可见 */
.tl-month { margin-left: 5px; padding-left: 11px; border-left: 1px solid var(--line); }
.tl-mrow { padding: 6px 2px; }
.tl-mrow .tl-name { font-size: 13px; color: var(--accent-strong); }

.tl-mbody { padding-top: 2px; }

.tl-day { position: relative; padding-left: 20px; margin-bottom: 16px; }
.tl-day::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 10px;
  bottom: -16px;
  width: 1px;
  background: var(--line);
}
.tl-day:last-child { margin-bottom: 4px; }
.tl-day:last-child::before { content: none; }
.tl-day::after {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  box-sizing: border-box;
}

.tl-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.tl-date { font-size: 14px; font-weight: 600; }
.tl-day .vgrid { margin-bottom: 0; }

/* ---------- 卡片 ---------- */

.vgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
}

.vcard {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.vcard:active { background: #fafbfc; }

.vcard .vcover { position: relative; aspect-ratio: 16 / 9; background: #eef0f2; overflow: hidden; }
.vcard .vcover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vcard .vcover .ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vcard .vcover .ph::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 11px solid #c6cbd1;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  margin-left: 3px;
}

.vcard .vtime,
.vcard .vdur,
.vcard .vdone {
  position: absolute;
  background: rgba(31, 35, 40, .62);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}
.vcard .vtime { top: 6px; left: 6px; }
.vcard .vdone { top: 6px; right: 6px; background: rgba(29, 158, 117, .9); }
.vcard .vdur { right: 6px; bottom: 6px; }

.vcard .vprog { height: 2px; background: #eef0f2; }
.vcard .vprog i { display: block; height: 100%; background: var(--accent); }

.vcard .vbody { padding: 8px 9px 9px; flex: 1; }
.vcard .vtitle {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 35px;
}
.vcard .vsub { font-size: 11px; color: var(--muted); margin-top: 4px; }
.vcard .vsub .cut { color: var(--accent-strong); }

.vcard .vadm { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 9px 9px; }
/* 展开出来的直链：只读输入框 + 复制，卡片内摊开，不用弹窗 */
.vcard .vlink { display: flex; gap: 6px; padding: 0 9px 9px; }
.vcard .vlink input {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  padding: 4px 6px;
  color: var(--muted);
}
/* 编辑时铺满整行，148px 的格子里塞不下几个输入框 */
.vcard.editing { grid-column: 1 / -1; cursor: default; }
.vcard.editing:active { background: var(--card); }
.vedit { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 9px; }
.vedit label.field { margin: 0; }
.vedit .vfull { grid-column: 1 / -1; }
.vedit .row { gap: 6px; }

/* ---------- 播放浮层 ---------- */

.player-mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(16, 18, 20, .93);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.player { width: 100%; max-width: 880px; }
.player video {
  width: 100%;
  max-height: 76vh;
  background: #000;
  border-radius: 10px;
  display: block;
}
.player-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.player-title { color: #fff; font-size: 14px; font-weight: 500; }
.player-close { background: transparent; border-color: rgba(255, 255, 255, .35); color: #fff; }
.player-close:active { background: rgba(255, 255, 255, .12); }
.player-foot { color: rgba(255, 255, 255, .6); font-size: 12px; margin-top: 8px; }

/* ---------- 拍摄 ---------- */

.cam-mask {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(16, 18, 20, .95);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.cam { width: 100%; max-width: 560px; }

.cam-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.cam-title { color: #fff; font-size: 14px; font-weight: 500; }
.cam-x { background: transparent; border-color: rgba(255, 255, 255, .35); color: #fff; }
.cam-x:active { background: rgba(255, 255, 255, .12); }

.cam-view { position: relative; background: #000; border-radius: 10px; overflow: hidden; }
.cam-view video { width: 100%; max-height: 60vh; display: block; }

.cam-hint {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 10px 12px;
  color: #fff;
  font-size: 12px;
  line-height: 1.6;
  background: linear-gradient(transparent, rgba(0, 0, 0, .78));
}
.cam-hint.bad { background: rgba(155, 44, 44, .92); }

.cam-timer {
  position: absolute;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.cam-timer::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e5484d;
  animation: cam-blink 1.1s steps(1, end) infinite;
}
@keyframes cam-blink { 50% { opacity: .2; } }

.cam-row { display: flex; gap: 8px; margin-top: 10px; }
.cam-row select { flex: 1; }

/* 变焦：只有设备真的支持才显示（iPhone 的 WebKit 不暴露这个能力，会自动隐藏） */
.cam-zoomrow { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.cam-zoomlab { flex: none; color: rgba(255, 255, 255, .7); font-size: 12px; }
.cam-zoomrow input[type="range"] { flex: 1; min-width: 0; accent-color: #fff; }
.cam-zoomval {
  flex: none;
  width: 42px;
  text-align: right;
  color: #fff;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.cam select {
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .28);
  color: #fff;
}
.cam select option { color: #111; background: #fff; }
/* 镜头下拉：名称可能长（「后置 超广角」），别把画质那栏挤没 */
.cam-row .cam-lens { flex: none; max-width: 52%; }
/* 只有前置+后置时不用下拉，一个按钮更顺手（下拉得点两次还得挑） */
.cam-flip {
  background: transparent;
  border-color: rgba(255, 255, 255, .35);
  color: #fff;
  flex: none;
}

.cam-bar { margin-top: 10px; }
.cam-btn {
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.cam-btn.rec { background: #e5484d; }
.cam-btn:disabled { opacity: .45; cursor: default; }

.cam-foot { color: rgba(255, 255, 255, .6); font-size: 12px; line-height: 1.7; margin-top: 8px; }
