/* 视频资产全自动化平台 — 深色管理台 */
:root {
  --bg: #0d1117; --bg2: #131a24; --card: #1a2330; --card2: #212d3d;
  --line: #2a3648; --text: #e6edf3; --dim: #8b98a9;
  --blue: #4c8dff; --green: #3fb96f; --yellow: #e0a83a; --purple: #9d6ff0;
  --red: #e5534b; --gray: #5b6675;
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; font-size: 14px; }
.hidden { display: none !important; }
a { color: var(--blue); text-decoration: none; }

/* ---------- 登录 ---------- */
.login-layer { position: fixed; inset: 0; background: radial-gradient(1200px 600px at 70% -10%, #1c2a44 0%, var(--bg) 55%); display: flex; align-items: center; justify-content: center; z-index: 100; }
.login-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 40px 44px; width: 400px; text-align: center; box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.login-logo { font-size: 44px; }
.login-card h1 { font-size: 20px; margin: 10px 0 4px; }
.login-card .sub { color: var(--dim); margin-bottom: 26px; font-size: 12.5px; }
.login-card .field { text-align: left; margin-bottom: 14px; }
.login-card label { display: block; color: var(--dim); font-size: 12px; margin-bottom: 6px; }
.login-card input { width: 100%; padding: 10px 12px; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; color: var(--text); font-size: 14px; }
.login-card input:focus { outline: none; border-color: var(--blue); }
.login-err { color: var(--red); font-size: 12.5px; margin-bottom: 12px; }
.login-hint { color: var(--dim); font-size: 11.5px; margin-top: 18px; }

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: var(--bg2); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; }
.brand { display: flex; gap: 10px; align-items: center; padding: 20px 18px; border-bottom: 1px solid var(--line); }
.brand-icon { font-size: 26px; }
.brand b { font-size: 15px; display: block; }
.brand small { color: var(--dim); font-size: 11px; }
.sidebar nav { flex: 1; padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a { color: var(--dim); padding: 10px 12px; border-radius: 8px; font-size: 13.5px; }
.sidebar nav a:hover { background: var(--card); color: var(--text); }
.sidebar nav a.active { background: linear-gradient(90deg, rgba(76,141,255,.18), transparent); color: var(--blue); }
.sidebar-foot { padding: 14px; border-top: 1px solid var(--line); color: var(--dim); font-size: 12px; display: flex; flex-direction: column; gap: 8px; }
.main { flex: 1; margin-left: 220px; padding: 26px 30px; max-width: 1400px; }

/* ---------- 登录密码框（type=text + CSS 圆点，绕开嵌入式浏览器安全拦截） ---------- */
.pass-row { position: relative; }
.pass-row .pw-eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: 15px; color: var(--dim); padding: 4px; z-index: 1; }
.pass-row .pw-eye:hover { color: var(--text); }

/* ---------- 通用 ---------- */
h2.page-title { font-size: 19px; margin-bottom: 4px; }
p.page-sub { color: var(--dim); font-size: 12.5px; margin-bottom: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.grid { display: grid; gap: 14px; }
.stat-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat .num { font-size: 26px; font-weight: 700; }
.stat .label { color: var(--dim); font-size: 12px; margin-top: 4px; }
.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--card2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; font-size: 13px; cursor: pointer; transition: .15s; }
.btn:hover { border-color: var(--blue); color: var(--blue); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { filter: brightness(1.12); color: #fff; }
.btn.danger:hover { border-color: var(--red); color: var(--red); }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn.block { width: 100%; justify-content: center; padding: 11px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; color: var(--dim); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 12px; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid rgba(42,54,72,.5); vertical-align: middle; }
.tbl tr:hover td { background: rgba(76,141,255,.05); }
.badge { display: inline-block; padding: 2.5px 9px; border-radius: 20px; font-size: 11.5px; }
.badge.pending { background: rgba(76,141,255,.15); color: var(--blue); }
.badge.transcoding { background: rgba(224,168,58,.15); color: var(--yellow); }
.badge.analyzing { background: rgba(157,111,240,.16); color: var(--purple); }
.badge.completed { background: rgba(63,185,111,.15); color: var(--green); }
.badge.failed { background: rgba(229,83,75,.16); color: var(--red); }
.badge.duplicate, .badge.running { background: rgba(91,102,117,.2); color: var(--dim); }
.progress { height: 6px; background: var(--bg2); border-radius: 4px; overflow: hidden; min-width: 90px; }
.progress > i { display: block; height: 100%; background: var(--blue); border-radius: 4px; transition: width .4s; }
.tag { display: inline-block; background: rgba(76,141,255,.12); color: #7fb1ff; border-radius: 5px; padding: 1.5px 7px; font-size: 11.5px; margin: 2px 3px 2px 0; }
.muted { color: var(--dim); font-size: 12px; }
.mono { font-family: Consolas, monospace; font-size: 12px; }
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; color: var(--text); padding: 8px 12px; font-size: 13px; }
.toolbar input { flex: 1; min-width: 200px; }
.toolbar input:focus, .toolbar select:focus { outline: none; border-color: var(--blue); }
.toast-box { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--card2); border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: 8px; padding: 10px 16px; font-size: 13px; box-shadow: 0 8px 30px rgba(0,0,0,.4); animation: slideIn .2s ease; max-width: 380px; }
.toast.err { border-left-color: var(--red); }
.toast.ok { border-left-color: var(--green); }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- 资产卡片 ---------- */
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.asset-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: .15s; }
.asset-card:hover { border-color: var(--blue); transform: translateY(-2px); }
.asset-thumb { aspect-ratio: 16/9; background: linear-gradient(135deg, #16202e, #1e2c40); display: flex; align-items: center; justify-content: center; position: relative; }
.asset-thumb img { width: 100%; height: 100%; object-fit: cover; }
.asset-thumb .dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.72); border-radius: 4px; padding: 1px 6px; font-size: 11px; }
.asset-body { padding: 12px 14px; }
.asset-body .name { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-body .meta { color: var(--dim); font-size: 11.5px; margin-top: 5px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 详情 ---------- */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); gap: 16px; }
@media (max-width: 1100px) { .detail-grid { grid-template-columns: 1fr; } }
.player video { width: 100%; border-radius: 10px; background: #000; max-height: 480px; }
.timeline { position: relative; height: 26px; background: var(--bg2); border-radius: 6px; margin-top: 8px; overflow: hidden; cursor: pointer; }
.timeline .seg-block { position: absolute; top: 0; height: 100%; border-right: 1px solid var(--bg); background: rgba(76,141,255,.25); }
.timeline .seg-block:hover { background: rgba(76,141,255,.55); }
.timeline .cursor { position: absolute; top: 0; width: 2px; height: 100%; background: var(--red); }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 6px 12px; font-size: 12.5px; }
.kv .k { color: var(--dim); }
.kv .v { word-break: break-all; }
.transcript-line { padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; line-height: 1.55; }
.transcript-line:hover { background: rgba(76,141,255,.1); }
.transcript-line .ts { color: var(--blue); font-family: Consolas, monospace; font-size: 11.5px; margin-right: 8px; }
.seg-row { display: flex; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: var(--bg2); }
.seg-row img { width: 132px; height: 76px; object-fit: cover; border-radius: 6px; background: #16202e; flex-shrink: 0; }
.seg-row .info { flex: 1; min-width: 0; }
.seg-row .info .t { font-size: 13px; margin-bottom: 4px; }
.seg-row .info .d { color: var(--dim); font-size: 12px; line-height: 1.5; }

/* ---------- 上传 ---------- */
.dropzone { border: 2px dashed var(--line); border-radius: var(--radius); padding: 46px 20px; text-align: center; color: var(--dim); transition: .2s; cursor: pointer; }
.dropzone:hover, .dropzone.drag { border-color: var(--blue); color: var(--blue); background: rgba(76,141,255,.05); }
.dropzone .icon { font-size: 40px; margin-bottom: 10px; }
.up-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(42,54,72,.5); font-size: 13px; }
.up-item .fname { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 搜索 ---------- */
.search-result { display: flex; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; background: var(--bg2); cursor: pointer; }
.search-result:hover { border-color: var(--blue); }
.search-result img { width: 140px; height: 80px; object-fit: cover; border-radius: 6px; background: #16202e; flex-shrink: 0; }
.score-pill { background: rgba(63,185,111,.15); color: var(--green); border-radius: 10px; padding: 1px 8px; font-size: 11.5px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button { background: none; border: none; color: var(--dim); padding: 9px 16px; font-size: 13.5px; cursor: pointer; border-bottom: 2px solid transparent; }
.tabs button.active { color: var(--blue); border-bottom-color: var(--blue); }
.section-title { font-size: 14.5px; margin: 18px 0 10px; color: var(--text); }

/* 根治浏览器自动填充接管样式导致的"看不见输入"观感 */
.login-card input:-webkit-autofill,
.login-card input:-webkit-autofill:hover,
.login-card input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--bg2) inset;
  transition: background-color 9999s;
}

/* ---------- 技术借鉴增强（Meilisearch 高亮 / YouTube 雪碧图预览 / PhotoPrism 近重复） ---------- */
mark { background: rgba(224,168,58,.35); color: #ffd98a; border-radius: 3px; padding: 0 2px; }
.dup-banner { border-left: 3px solid var(--yellow); font-size: 13px; }
.dup-chip { position: absolute; left: 8px; top: 8px; background: rgba(224,168,58,.85); color: #20160a; border-radius: 4px; padding: 1px 7px; font-size: 11px; font-weight: 600; }
.preview-float { position: absolute; bottom: 34px; display: none; flex-direction: column; align-items: center; z-index: 20; pointer-events: none; }
.preview-float .pf-frame { width: 160px; height: 90px; background: #000 center/1600px 900px no-repeat; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.55); }
.preview-float .pf-t { margin-top: 4px; background: rgba(0,0,0,.75); border-radius: 4px; padding: 1px 7px; font-size: 11.5px; font-family: Consolas, monospace; }
.timeline { position: relative; }
.timeline:hover .cursor { opacity: 1; }
