/* frontend/style.css */
@import url('vendor/fonts/local-fonts.css');
@import url('vendor/bootstrap-icons/font/bootstrap-icons.css');

:root {
    --bg: #050505; --surface: #141414; --surface-hover: #1f1f1f;
    --border: #333; --text: #eee; --dim: #888; --accent: #E60012; /* Corporate Red */
    
    --s-ready: #ffffff; --s-wip: #f5c518; --s-done: #2f9e44;
    --s-wait: #be4bdb; --s-processing: #e599f7; --s-check: #22b8cf; --s-retake: #ff453a;
    --s-ok: #0a84ff; --s-bank: #444444; --s-none: #333333; --s-pass: #22d3ee; --cg-purple: #d500f9;
}
/* Transition convention: 0.15s (fast hover), 0.2s (normal), 0.3s (slow/modal) */

* { box-sizing: border-box; outline: none; }
body {
    margin:0; background:var(--bg); color:var(--text); font-family: 'Inter', sans-serif;
    display:flex; flex-direction: column; height:100vh; overflow:hidden;
    -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;
}

/* ============ Global Top Navigation Bar ============ */
.global-top-nav {
    display: flex; align-items: center; height: 40px; background: #000; border-bottom: 1px solid #222;
    padding: 0 16px; flex-shrink: 0; z-index: 1000; gap: 0;
}
.global-top-nav .brand-mini {
    font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 13px;
    letter-spacing: 1px; margin-right: 16px; white-space: nowrap; color: #888;
}
.global-top-nav .brand-mini .brand-h { color: #ff4444; font-size: 15px; font-weight: 800; }
.global-nav-links { display: flex; height: 100%; gap: 0; }
.global-nav-link {
    display: flex; align-items: center; gap: 6px; padding: 0 18px; height: 100%;
    text-decoration: none; color: #666; font-size: 12px; font-weight: 600;
    border-bottom: 2px solid transparent; transition: all .15s;
}
.global-nav-link:hover { color: #aaa; background: rgba(255,255,255,.03); }
.global-nav-link.active { color: #fff; border-bottom-color: var(--accent); background: rgba(230,0,18,.06); }
.global-nav-link.ai-studio-link:hover { color: #d4af37; }
.global-nav-link.ai-studio-link.active { color: #d4af37; border-bottom-color: #d4af37; background: rgba(212,175,55,.08); }
.global-nav-link i { font-size: 13px; }
.global-top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.app-content-wrap { display: flex; flex: 1; min-height: 0; overflow: hidden; }
input, textarea, [contenteditable] {
  -webkit-user-select: text; -moz-user-select: text; -ms-user-select: text; user-select: text;
}

aside { width: 260px; background: #000; border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; }
.brand { display: none; } /* Brand is now in global top nav */
.brand-h { color: #ff4444; font-size: 18px; font-weight: 800; }
.brand-sub { color: #666; font-weight: 400; margin-left: 4px; }

/* Old sidebar nav-links hidden - now in global top bar */
aside > .nav-links { display: none; }
.nav-links { display: flex; border-bottom: 1px solid var(--border); }
.nav-link {
    flex: 1; padding: 12px 16px; text-decoration: none; color: #666;
    font-size: 12px; font-weight: 600; text-align: center;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    transition: all 0.2s ease; border-bottom: 2px solid transparent;
}
.nav-link:hover { color: #aaa; background: rgba(255,255,255,0.03); }
.nav-link.active { color: #fff; border-bottom-color: var(--accent); background: rgba(230,0,18,0.08); }
.nav-link.ai-studio-link { color: #888; }
.nav-link.ai-studio-link:hover { color: #d4af37; background: rgba(212,175,55,0.08); }
.nav-link.ai-studio-link.active { color: #d4af37; border-bottom-color: #d4af37; background: rgba(212,175,55,0.1); }
.nav-link i { font-size: 14px; }

/* 侧栏顶部"仪表盘"按钮（直接挂在 <aside> 里，brand 下方、项目树上方） */
.sidebar-dashboard-btn {
    display: flex; align-items: center; gap: 8px;
    width: 100%;
    margin: 0;
    padding: 12px 18px;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border, #222);
    color: #888;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.sidebar-dashboard-btn i { font-size: 15px; color: #4ade80; }
.sidebar-dashboard-btn:hover { color: #fff; background: rgba(74, 222, 128, 0.08); }
body.dashboard-mode .sidebar-dashboard-btn {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
    border-left: 3px solid #4ade80;
    padding-left: 15px;
}

/* 仪表盘 mount 点默认隐藏；body.dashboard-mode 时占满 main 并显示 */
.dashboard-mount { display: none; }
body.dashboard-mode .dashboard-mount {
    display: block;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 0;
}
/* 进入 dashboard 模式：右侧 main 内所有非仪表盘内容全部隐藏
   - #nav      顶部按钮/筛选行
   - #grid     卡片网格
   - #table    表格视图
   - #empty / #empty-episode  空态占位
   - #batch-bar  批量操作底栏
   - #player-modal 不动（视频播放器不应该被强制关闭，但仪表盘模式下用户也不太可能开它） */
body.dashboard-mode #nav,
body.dashboard-mode #grid,
body.dashboard-mode #table,
body.dashboard-mode #empty,
body.dashboard-mode #empty-episode,
body.dashboard-mode #episode-completion-row,
body.dashboard-mode #empty-state,
body.dashboard-mode #batch-bar { display: none !important; }

/* 让 .content 在仪表盘模式下不带 padding，让 dashboard 占满 */
body.dashboard-mode .content {
    padding: 0 !important;
    margin: 0 !important;
}
/* main 在仪表盘模式下也撑满，避免顶部留白 */
body.dashboard-mode main#main-content {
    display: flex;
    flex-direction: column;
}

.tree { flex: 1; overflow-y: auto; padding: 10px 0; }
/* 改成 flex-start + 子项 gap=2px，让 [⚙ 项目名] 紧密贴合在左侧；右侧 chevron / 归档按钮组用 margin-left:auto 推到右端 */
.p-row { padding: 12px 20px; cursor: pointer; font-size: 14px; color: #bbb; display: flex; justify-content: flex-start; align-items: center; gap: 2px; transition: background 0.2s ease, color 0.2s ease; }
.p-row:hover { background: var(--surface-hover); color: #fff; }
.p-row > .chev,
.p-row > .archive-actions { margin-left: auto; }
.p-row .chev { transition: transform 0.2s ease; }
.p-row.open .chev { transform: rotate(180deg); }
.p-row.active { color: #fff; background: #111; border-left: 3px solid var(--accent); }
.e-list { max-height: 0; overflow: hidden; background: #080808; transition: max-height 0.3s ease, opacity 0.25s ease, transform 0.25s ease; opacity: 0; transform: translateY(-4px); }
.e-list.show { max-height: 1200px; opacity: 1; transform: translateY(0); }
.e-item { padding: 10px 20px 10px 40px; font-size: 13px; color: #777; cursor: pointer; border-left: 3px solid transparent; }
.e-item:hover { color: #ddd; }
.e-item.active { color: #fff; background: var(--surface-hover); border-left-color: var(--accent); }
/* 归档项目/集数样式 */
.p-row.archived { color: #555; }
.p-row.archived:hover { color: #888; }
.p-row.archived i.bi-archive { font-size: 12px; }

/* 项目设置齿轮按钮（侧栏 .p-row 最左侧，hover 才显形以减少视觉噪音） */
/* margin-right 不再用，依靠 .p-row 的 gap:2px 控制按钮和项目名之间的间距，做到完全贴合 */
.p-row .p-settings-btn {
    width: 20px; height: 20px;
    background: transparent;
    border: 1px solid transparent;
    color: #666;
    border-radius: 4px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s, border-color 0.15s, background 0.15s;
    font-size: 12px;
    padding: 0;
}
.p-row:hover .p-settings-btn,
.p-row.active .p-settings-btn,
.p-row .p-settings-btn:focus-visible {
    opacity: 1;
}
.p-row .p-settings-btn:hover {
    color: var(--accent, #E60012);
    border-color: var(--accent, #E60012);
    background: rgba(230, 0, 18, 0.08);
}
/* 手机端没有 hover，常驻显示 */
body.is-mobile .p-row .p-settings-btn { opacity: 1; color: #888; }
.e-item.archived { color: #444; font-style: italic; }
.e-item.archived:hover { color: #666; }
.e-item.archived i.bi-archive { font-size: 10px; margin-left: 4px; opacity: 0.6; }
.sidebar-ft { padding: 15px; border-top: 1px solid var(--border); display: flex; gap: 10px; }
.btn-new { flex: 1; background: transparent; border: 1px dashed #444; color: #888; padding: 8px; cursor: pointer; border-radius: 4px; }
.btn-new:hover { border-color: #666; color: #fff; }
.btn-display-mode { width: 36px; background: transparent; border: 1px solid #333; color: #888; cursor: pointer; border-radius: 4px; display: flex; align-items: center; justify-content: center; }
.btn-display-mode:hover { color: #fff; border-color: #666; }

main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
nav { border-bottom: 1px solid var(--border); display: flex; flex-direction: column; padding: 12px 20px; background: rgba(20,20,20,0.98); z-index: 10; gap: 10px; flex-shrink: 0; min-height: 0; }

/* 导航行通用 */
.nav-row { display: flex; align-items: center; gap: 16px; width: 100%; }

/* 第一行：项目信息 + 操作按钮 */
.row-1 { justify-content: space-between; }
.proj-info { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.nav-actions { display: flex; gap: 8px; align-items: center; }

/* 截止日期 */
.deadline-wrap { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 400; }
.deadline-label { color: #666; }
.deadline-value { 
    padding: 3px 10px; border-radius: 4px; font-family: 'JetBrains Mono', monospace; 
    transition: all 0.2s ease; font-size: 12px;
}
.deadline-value:hover { background: rgba(255,255,255,0.1); }
.deadline-none { color: #555; }
.deadline-normal { color: #2f9e44; background: rgba(47,158,68,0.15); }
.deadline-warning { color: #f5c518; background: rgba(245,197,24,0.15); }
.deadline-urgent { color: #ff6b6b; background: rgba(255,107,107,0.2); animation: pulse-urgent 1.5s infinite; }
.deadline-overdue { color: #ff453a; background: rgba(255,69,58,0.25); font-weight: 600; }
.deadline-input { 
    position: absolute; opacity: 0; pointer-events: none; 
    /* 让日期选择器在值的位置弹出 */
}
/* 汇报按钮 */
.btn-report {
    display: inline-flex; align-items: center; gap: 5px;
    margin-left: 8px; padding: 5px 10px;
    background: linear-gradient(135deg, #4a9eff 0%, #0066cc 100%);
    border: none; border-radius: 6px;
    color: #fff; font-size: 11px; font-weight: 600;
    cursor: pointer; transition: all 0.2s ease;
}
.btn-report:hover { 
    background: linear-gradient(135deg, #5aafff 0%, #0077dd 100%);
    transform: translateY(-1px); box-shadow: 0 2px 8px rgba(74,158,255,0.3);
}
.btn-report:active { transform: translateY(0); }
.btn-report:disabled { 
    opacity: 0.7; cursor: not-allowed; transform: none; 
}
.btn-report i { font-size: 12px; }
.btn-report-project {
    background: linear-gradient(135deg, #9b59b6 0%, #6c3483 100%);
}
.btn-report-project:hover {
    background: linear-gradient(135deg, #a569bd 0%, #7d3c98 100%);
    box-shadow: 0 2px 8px rgba(155,89,182,0.3);
}

/* 交片按钮 */
.delivered-wrap { display: inline-flex; align-items: center; }
.btn-delivered {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: 4px;
    background: transparent; border: 1px solid #444;
    color: #888; font-size: 11px; font-weight: 500;
    cursor: pointer; transition: all 0.2s ease;
}
.btn-delivered:hover {
    border-color: #2f9e44; color: #2f9e44;
}
.btn-delivered.is-delivered {
    background: rgba(47,158,68,0.2);
    border-color: #2f9e44; color: #2f9e44;
}
.btn-delivered i { font-size: 12px; }
@keyframes pulse-urgent {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* 第二行：统计区域（平分，高亮） */
.row-2 { gap: 12px; padding: 10px 0; }
.row-2.hide { display: none; }
.stat-block { flex: 1; background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 6px; padding: 10px 14px; min-width: 0; }
.stat-title { font-size: 12px; color: #aaa; margin-bottom: 6px; font-weight: 600; }
.stat-bar { display: flex; height: 8px; width: 100%; border-radius: 4px; overflow: hidden; background: #333; }
.p-bar { height: 100%; transition: width 0.5s; }
.a-bar { height: 100%; transition: width 0.5s; flex-shrink: 0; }
.stat-legend { font-size: 11px; color: #888; margin-top: 6px; display: flex; gap: 8px; font-family: 'JetBrains Mono'; flex-wrap: wrap; }
.stat-legend .stat-ready { color: var(--s-ready); }
.stat-legend .stat-wip { color: var(--s-wip); }
.stat-legend .stat-wait { color: var(--s-wait); }
.stat-legend .stat-processing { color: var(--s-processing); }
.stat-legend .stat-check { color: var(--s-check); }
.stat-legend .stat-retake { color: var(--s-retake); }
.stat-legend .stat-ok { color: var(--s-ok); }
.stat-legend .stat-bank { color: #666; }

/* 第三行：筛选 + 搜索 */
.row-3 { gap: 16px; flex-wrap: wrap; }
.filter-item { display: flex; align-items: center; gap: 6px; }
.filter-item span { font-size: 12px; color: #888; white-space: nowrap; }
.filter-item select { min-width: 100px; max-width: 180px; width: auto; padding-right: 20px; }
.search-item { margin-left: auto; }
.search-item input { width: 160px; }

/* 筛选结果计数 */
.filter-result { 
    display: flex; align-items: center; gap: 2px;
    padding: 4px 12px; background: rgba(255,255,255,0.05); 
    border-radius: 6px; font-family: 'JetBrains Mono', monospace;
    margin-left: 10px;
}
.filter-result .count-filtered { 
    font-size: 16px; font-weight: 700; color: var(--accent); 
}
.filter-result .count-sep { 
    font-size: 12px; color: #555; margin: 0 2px; 
}
.filter-result .count-total { 
    font-size: 13px; color: #888; 
}

/* 文字按钮 */
.btn-text { background: transparent; border: 1px solid #444; color: #888; padding: 0 12px; height: 34px; border-radius: 6px; cursor: pointer; font-size: 11px; white-space: nowrap; transition: 0.2s; display: inline-flex; align-items: center; justify-content: center; }
.btn-text:hover { border-color: #666; color: #fff; }
.disabled-permission { opacity: 0.3 !important; filter: grayscale(1); cursor: not-allowed !important; }
.disabled-permission:hover { border-color: #444 !important; color: #888 !important; }
select, input { background: #222; border: 1px solid #333; color: #fff; padding: 0 10px; border-radius: 6px; font-size: 12px; height: 34px; line-height: 1.2; }
input:focus, select:focus { border-color: var(--accent); }
button.icon { width: 34px; height: 34px; background: #222; border: 1px solid #333; color: #888; cursor: pointer; border-radius: 6px; display: flex; align-items: center; justify-content: center; }
button.icon.active { background: #fff; color: #000; }
button.primary { background: var(--accent); border: none; color: #fff; padding: 0 15px; height: 34px; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 12px; display: flex; align-items: center; justify-content: center; }
button.danger { background: var(--s-retake); border: none; color: #fff; padding: 0 15px; height: 34px; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 12px; }
button.danger:hover { background: #ff6a62; }
button.icon.batch-active,
body.batch-mode #btn-batch {
    background: var(--accent);
    color: #fff;
    border-color: #fff;
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(230,0,18,0.28), 0 0 18px rgba(230,0,18,0.72);
}

.content { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 30px; position: relative; }

.episode-completion-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
    margin: 0;
    padding: 7px 10px;
    background: #0f1115;
    border: 1px solid #252a33;
    border-left: 3px solid #60a5fa;
    border-radius: 6px;
}
.epc-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    flex: 0 0 auto;
}
.epc-title {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
}
.epc-bars {
    display: flex;
    flex: 1 1 220px;
    max-width: 420px;
    height: 9px;
    overflow: hidden;
    background: #191d24;
    border: 1px solid #2b3039;
    border-radius: 999px;
}
.epc-seg {
    display: block;
    min-width: 0;
}
.epc-no-aep { background: #ef4444; }
.epc-t { background: #fbbf24; }
.epc-v { background: #22d3ee; }
.epc-other { background: #8b949e; }
.epc-metrics {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 999 1 auto;
}
.epc-metric {
    display: flex;
    align-items: baseline;
    gap: 5px;
    min-width: 96px;
    padding: 4px 8px;
    background: #11151b;
    border: 1px solid #242a33;
    border-radius: 5px;
}
.epc-metric b {
    color: #fff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 15px;
    line-height: 1.2;
}
.epc-metric em {
    color: #a6adbb;
    font-style: normal;
    font-size: 11px;
    white-space: nowrap;
}
.epc-metric small {
    margin-left: auto;
    color: #7b8493;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    white-space: nowrap;
}
.epc-metric-no-aep b { color: #f87171; }
.epc-metric-t b { color: #fbbf24; }
.epc-metric-v b { color: #22d3ee; }

@media (max-width: 760px) {
    .episode-completion-row { gap: 6px; padding: 6px 8px; }
    .epc-bars { flex-basis: 100%; max-width: none; order: 3; }
    .epc-metrics { gap: 6px; }
    .epc-metric { min-width: 92px; padding: 3px 6px; }
}

/* 视图切换动画 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--card-min-w, 300px), 1fr)); gap: var(--card-gap, 25px); transition: gap .2s ease; }
.grid.fade-in { animation: fadeInScale 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }

/* Card Zoom Control — 3 pill buttons */
.card-zoom-ctrl { display: flex; align-items: center; background: #111; border: 1px solid #333; border-radius: 4px; overflow: hidden; flex-shrink: 0; }
.zoom-btn { background: none; border: none; color: #555; cursor: pointer; font-size: 11px; padding: 4px 10px; transition: color .12s, background .12s; font-weight: 600; letter-spacing: 0.5px; border-right: 1px solid #333; }
.zoom-btn:last-child { border-right: none; }
.zoom-btn:hover { color: #ccc; background: #222; }
.zoom-btn.active { color: #fbbf24; background: rgba(251,191,36,0.1); }

/* Card zoom levels —— 仅保留 xs（小）+ m（大）。zoom-s（中）已废，但保留 CSS 兼容旧 localStorage。
   xs 终版：保持缩略图原本的 16/9 比例，单纯整体缩小卡片。
   card-min-w 从 70→140px，小卡片约为上一版的 2 倍。
   文字/UI 仍保持原 xs 可读尺寸；padding 微缩以适配更窄卡片。*/
.grid.zoom-xs { --card-min-w: 140px; --card-gap: 8px; }
.grid.zoom-s  { --card-min-w: 140px; --card-gap: 8px; }    /* 兼容旧配置：'s' 视同 'xs' */
.grid.zoom-m  { --card-min-w: 300px; --card-gap: 25px; }


/* Compact card: XS —— 隐藏笔记/角标，文字 / 按钮基本保持原 xs 大小 */
.grid.zoom-xs .card-content-area,
.grid.zoom-s  .card-content-area { display: none; }
.grid.zoom-xs .card,
.grid.zoom-s  .card { min-height: auto; }
.grid.zoom-xs .cut-no,
.grid.zoom-s  .cut-no { font-size: 12px; }
.grid.zoom-xs .card-body,
.grid.zoom-s  .card-body { padding: 4px 6px; gap: 3px; }
.grid.zoom-xs .badges-row,
.grid.zoom-s  .badges-row { display: none; }
.grid.zoom-xs .c-head-right select,
.grid.zoom-s  .c-head-right select { height: 18px; font-size: 9px; min-width: 0; padding: 0 3px; }
.grid.zoom-xs .scene-tag,
.grid.zoom-s  .scene-tag { display: none; }

/* 缩略图维持原本的 16/9 比例（不再覆盖 aspect-ratio）—— 卡片整体缩小，图自然按宽度等比缩 */

/* Perf: card contain is merged into .card rule above */
.table-wrap { }
@keyframes fadeInScale { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: scale(1); } }
@keyframes fadeInSlide { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

.fade-out-view {
    animation: fadeOutScale 0.2s ease-in forwards !important;
    pointer-events: none;
}
@keyframes fadeOutScale {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.95); }
}

/* 卡片样式 */
.card { background: var(--surface); border: 2px solid var(--border); border-radius: 10px; overflow: hidden; transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease; display: flex; flex-direction: column; position: relative; min-height: 320px; contain: layout style; }
.card:hover { transform: translateY(-4px); box-shadow: 0 15px 40px rgba(0,0,0,0.6); z-index: 2; }
.card.selected {
    border-color: #fff;
    outline: 3px solid var(--accent);
    outline-offset: -3px;
    box-shadow: 0 0 0 2px rgba(230,0,18,0.55), 0 0 18px rgba(230,0,18,0.45);
    transform: scale(0.98);
}
body.batch-mode .card,
body.batch-mode .thumb {
    cursor: pointer;
}
body.batch-mode .thumb .play-overlay {
    opacity: 0;
}

/* L2: 资源热更新 — 绿色脉冲（无黑闪，纯 box-shadow + border-color 过渡） */
.card.card-just-updated {
    animation: card-l2-pulse 1.8s ease-out;
    z-index: 2;
}
tr.t-row.row-just-updated {
    animation: row-l2-pulse 1.8s ease-out;
}
@keyframes card-l2-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
    8%   { box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.65), 0 0 18px 4px rgba(74, 222, 128, 0.4); border-color: #4ade80; }
    100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}
@keyframes row-l2-pulse {
    0%   { background-color: transparent; }
    10%  { background-color: rgba(74, 222, 128, 0.18); }
    100% { background-color: transparent; }
}

/* Skeleton card placeholder */
.card-skeleton { pointer-events: none; }
.card-skeleton .thumb { background: #1a1a1a; }
.card-skeleton .card-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; }
.skeleton-line { height: 10px; background: #222; border-radius: 4px; }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w80 { width: 80%; }
.skeleton-line.w40 { width: 40%; }
.skeleton-pulse {
    background: linear-gradient(90deg, #1a1a1a 25%, #252525 50%, #1a1a1a 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
}
@keyframes skeleton-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.card-hydrated { animation: cardFadeIn 0.15s ease-out; }
@keyframes cardFadeIn { from { opacity: 0.6; } to { opacity: 1; } }

/* 卡片状态边框和背景颜色 */
.card.st-Ready { 
    border-color: var(--s-ready); 
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.15), inset 0 0 80px rgba(255, 255, 255, 0.06);
}
.card.st-Ready:hover { 
    border-color: var(--s-ready); 
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.05) 100%);
    box-shadow: 0 8px 30px rgba(255, 255, 255, 0.25), inset 0 0 100px rgba(255, 255, 255, 0.08);
}

.card.st-WIP { 
    border-color: var(--s-wip); 
    background: linear-gradient(135deg, rgba(245, 197, 24, 0.15) 0%, rgba(245, 197, 24, 0.05) 100%);
    box-shadow: inset 0 0 60px rgba(245, 197, 24, 0.12);
}
.card.st-WIP:hover { 
    border-color: var(--s-wip); 
    background: linear-gradient(135deg, rgba(245, 197, 24, 0.2) 0%, rgba(245, 197, 24, 0.08) 100%);
    box-shadow: 0 8px 30px rgba(245, 197, 24, 0.35), inset 0 0 80px rgba(245, 197, 24, 0.15);
}

.card.st-Done { 
    border-color: var(--s-done); 
    background: linear-gradient(135deg, rgba(47, 158, 68, 0.12) 0%, rgba(47, 158, 68, 0.04) 100%);
    box-shadow: inset 0 0 60px rgba(47, 158, 68, 0.1);
}
.card.st-Done:hover { 
    border-color: var(--s-done); 
    background: linear-gradient(135deg, rgba(47, 158, 68, 0.18) 0%, rgba(47, 158, 68, 0.06) 100%);
    box-shadow: 0 8px 30px rgba(47, 158, 68, 0.3), inset 0 0 80px rgba(47, 158, 68, 0.12);
}

.card.st-Retake { 
    border-color: var(--s-retake); 
    background: linear-gradient(135deg, rgba(255, 69, 58, 0.15) 0%, rgba(255, 69, 58, 0.05) 100%);
    box-shadow: 0 0 15px rgba(255, 69, 58, 0.2), inset 0 0 60px rgba(255, 69, 58, 0.12);
}
.card.st-Retake:hover { 
    border-color: var(--s-retake);
    background: linear-gradient(135deg, rgba(255, 69, 58, 0.2) 0%, rgba(255, 69, 58, 0.08) 100%);
    box-shadow: 0 8px 30px rgba(255, 69, 58, 0.35), inset 0 0 80px rgba(255, 69, 58, 0.15);
}

.card.st-Delivered { 
    border-color: var(--s-ok); 
    background: linear-gradient(135deg, rgba(10, 132, 255, 0.12) 0%, rgba(10, 132, 255, 0.04) 100%);
    box-shadow: inset 0 0 60px rgba(10, 132, 255, 0.1);
}
.card.st-Delivered:hover { 
    border-color: var(--s-ok); 
    background: linear-gradient(135deg, rgba(10, 132, 255, 0.18) 0%, rgba(10, 132, 255, 0.06) 100%);
    box-shadow: 0 8px 30px rgba(10, 132, 255, 0.3), inset 0 0 80px rgba(10, 132, 255, 0.12);
}

/* RENDER — purple */
.card.st-Render {
    border-color: var(--s-wait);
    background: linear-gradient(135deg, rgba(190, 75, 219, 0.15) 0%, rgba(190, 75, 219, 0.05) 100%);
    box-shadow: inset 0 0 60px rgba(190, 75, 219, 0.1);
}
.card.st-Render:hover {
    border-color: var(--s-wait);
    background: linear-gradient(135deg, rgba(190, 75, 219, 0.2) 0%, rgba(190, 75, 219, 0.08) 100%);
    box-shadow: 0 8px 30px rgba(190, 75, 219, 0.3), inset 0 0 80px rgba(190, 75, 219, 0.12);
}

/* PROCESSING — light purple */
.card.st-Processing {
    border-color: var(--s-processing);
    background: linear-gradient(135deg, rgba(229, 153, 247, 0.12) 0%, rgba(229, 153, 247, 0.04) 100%);
    box-shadow: inset 0 0 60px rgba(229, 153, 247, 0.1);
}
.card.st-Processing:hover {
    border-color: var(--s-processing);
    background: linear-gradient(135deg, rgba(229, 153, 247, 0.18) 0%, rgba(229, 153, 247, 0.06) 100%);
    box-shadow: 0 8px 30px rgba(229, 153, 247, 0.3), inset 0 0 80px rgba(229, 153, 247, 0.12);
}

/* CHECK — teal */
.card.st-Check {
    border-color: var(--s-check);
    background: linear-gradient(135deg, rgba(34, 184, 207, 0.12) 0%, rgba(34, 184, 207, 0.04) 100%);
    box-shadow: inset 0 0 60px rgba(34, 184, 207, 0.1);
}
.card.st-Check:hover {
    border-color: var(--s-check);
    background: linear-gradient(135deg, rgba(34, 184, 207, 0.18) 0%, rgba(34, 184, 207, 0.06) 100%);
    box-shadow: 0 8px 30px rgba(34, 184, 207, 0.3), inset 0 0 80px rgba(34, 184, 207, 0.12);
}

/* PASS — cyan */
.card.st-Pass {
    border-color: var(--s-pass);
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.12) 0%, rgba(34, 211, 238, 0.04) 100%);
    box-shadow: inset 0 0 60px rgba(34, 211, 238, 0.1);
}
.card.st-Pass:hover {
    border-color: var(--s-pass);
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.18) 0%, rgba(34, 211, 238, 0.06) 100%);
    box-shadow: 0 8px 30px rgba(34, 211, 238, 0.3), inset 0 0 80px rgba(34, 211, 238, 0.12);
}

/* BANK — greyed out */
.card.st-BANK {
    filter: grayscale(100%) opacity(0.4);
    border: 2px dashed #444;
    background: rgba(68, 68, 68, 0.15);
}

/* NONE — dim */
.card.st-None {
    border: 1px solid #333;
    background: rgba(30, 30, 30, 0.5);
    opacity: 0.6;
}
.card.st-None:hover { opacity: 0.8; border-color: #555; }

.thumb { width: 100%; aspect-ratio: 16 / 9; background: #000; position: relative; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; overflow: hidden;}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
/* hover 时 JS 注入的视频；覆盖在 img 之上。
   J1：默认透明，让底下的缩略图保持可见；视频 canplay 后 JS 加 .ready class 才淡入，
   消除"插入瞬间黑屏闪烁" —— 视频元素本身没解出第一帧时不再显黑底。 */
.thumb video.thumb-hover-video {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    /* 不要 background:#000 —— 那会让加载阶段透出来盖住 img */
    background: transparent;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.12s ease-out;
}
.thumb video.thumb-hover-video.ready {
    opacity: 1;
}
/* hover 视频进度条：底部 2px 极细橘色 */
.thumb .thumb-hover-progress {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 2px;
    background: rgba(0, 0, 0, 0.35);
    z-index: 4;            /* 高于 video / play-overlay，否则会被遮 */
    pointer-events: none;
    overflow: hidden;
}
.thumb .thumb-hover-progress-fill {
    height: 100%;
    width: 0%;
    background: #ff8a00;
    box-shadow: 0 0 4px rgba(255, 138, 0, 0.6);
    /* 不要用 transition：JS 已经按 rAF (~60fps) 主动推进，
       再加 transition 会让每次写值都排进 120ms 缓动队列，反而看起来一顿一顿 */
    will-change: width;
}
.no-img-placeholder { color: #333; font-weight: 700; font-size: 16px; letter-spacing: 2px; }
.play-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.3); display: flex; align-items: center; justify-content: center; opacity: 0; transition: 0.2s; }
.thumb:hover .play-overlay { opacity: 1; }
.play-overlay i { font-size: 40px; color: #fff; filter: drop-shadow(0 2px 10px rgba(0,0,0,0.5)); }
.timestamp { position: absolute; top: 6px; left: 6px; font-size: 10px; background: rgba(0,0,0,0.6); padding: 2px 5px; border-radius: 3px; color: #aaa; font-family: 'JetBrains Mono'; z-index: 2; }

.card-body { padding: 10px 12px; flex: 1; display: flex; flex-direction: column; gap: 8px; position: relative; z-index: 1; background: transparent; }

/* 徽章行 + 下拉菜单 */
.badges-row { display: flex; gap: 4px; padding-bottom: 6px; border-bottom: 1px solid #222; align-items: center; flex-wrap: wrap; }
.badges-left { display: flex; gap: 3px; flex-wrap: wrap; }
.badges-right { display: flex; gap: 3px; margin-left: auto; flex-wrap: wrap; }
.badge { font-size: 10px; padding: 2px 6px; background: #222; color: #555; border-radius: 3px; border: 1px solid #333; font-family: 'JetBrains Mono'; white-space: nowrap; opacity: 0.5; transition: 0.2s; cursor: pointer; }
.badge:hover { opacity: 1; background: #333; }
.badge.on { color: #000; font-weight: 700; border-color: transparent; opacity: 1; }
.badge.tp.on { background: var(--s-done); }
.badge.bg.on { background: var(--s-done); }
.badge.cg.on { background: var(--s-done); }
.badge.ae.on { background: var(--s-done); }
.badge.ai.on { background: var(--s-done); }

/* TP 率表完整度（覆盖 .badge.tp.on 的默认绿）
   - tp-csv  有 .csv/.tsv 电子率表 → 金色 */
.badge.tp.on.tp-csv  { background: #ffd700; color: #000; }
/* - tp-sheet 只有图片率表（文件名含 sheet/率表）→ 维持绿色（同 .on 默认） */
.badge.tp.on.tp-sheet { background: var(--s-done); }
/* - tp-none 文件夹存在但啥率表都没 → 红色警示 */
.badge.tp.on.tp-none { background: #ff4444; color: #fff; }
/* 卡片光圈也跟着 tp_status 变 */
.card.has-tp .badge.tp.on.tp-csv  { box-shadow: 0 0 10px #ffd700; }
.card.has-tp .badge.tp.on.tp-none { box-shadow: 0 0 10px #ff4444; }

.c-head { display: flex; align-items: baseline; gap: 8px; justify-content: space-between; }
.cut-no { font-family: 'JetBrains Mono'; font-size: 20px; font-weight: 700; color: #fff; }
.scene-tag { font-size: 11px; color: #888; cursor: pointer; padding: 1px 5px; border: 1px dashed #333; border-radius: 3px; }
.scene-tag:hover { border-color: var(--accent); color: #fff; }

/* 场景编辑输入框 */
.scene-edit-input {
    width: 50px; height: 20px; font-size: 11px; 
    background: #111; border: 1px solid var(--accent); 
    color: #fff; padding: 1px 5px; border-radius: 3px;
    outline: none;
}
.ae-info { display: flex; gap: 6px; align-items: center; }
.aep-date { font-size: 10px; color: #aaa; font-family: 'JetBrains Mono'; opacity: 1; font-weight: 500; }
.ae-ver { font-size: 10px; color: var(--s-wait); border: 1px solid var(--s-wait); padding: 1px 4px; border-radius: 2px; opacity: 0.7; }

/* 下拉菜单（在徽章行右侧） */
.sel-status, .sel-artist { min-width: 80px; max-width: 140px; background: #1a1a1a; border: 1px solid #333; height: 24px; border-radius: 4px; font-size: 10px; cursor: pointer; padding: 0 6px; font-weight: 600; color: #ddd; }
.sel-status option, .sel-artist option { background: #111; padding: 6px 10px; min-width: 120px; }
.sel-status.readonly, .sel-artist.readonly { background: transparent; border: 1px solid #222; cursor: default; display: flex; align-items: center; padding: 0 6px; font-size: 10px; width: auto; min-width: 0; }

/* 卡片内容区 */
.card-content-area { display: flex; flex-direction: column; flex: 1; }
.info-direct { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }

/* 消息行：标签 + 按钮 + 数量 + 内容 */
.msg-row { display: flex; align-items: center; gap: 6px; position: relative; }
.msg-type-label { font-size: 13px; width: 36px; flex-shrink: 0; font-weight: 500; }
.msg-type-label.retake { color: var(--s-retake); }
.msg-type-label.feedback { color: #6ba4ff; }
.msg-type-label.memo { color: #888; }

/* 内联添加按钮 */
.btn-add-inline { width: 18px; height: 18px; background: transparent; border: 1px solid; color: inherit; font-size: 10px; padding: 0; cursor: pointer; border-radius: 4px; transition: all 0.2s ease; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.btn-add-inline.retake { border-color: rgba(255, 69, 58, 0.3); color: rgba(255, 69, 58, 0.5); }
.btn-add-inline.retake:hover, .btn-add-inline.retake.active { border-color: var(--s-retake); color: var(--s-retake); background: rgba(255, 69, 58, 0.1); }
.btn-add-inline.feedback { border-color: rgba(107, 164, 255, 0.3); color: rgba(107, 164, 255, 0.5); }
.btn-add-inline.feedback:hover, .btn-add-inline.feedback.active { border-color: #6ba4ff; color: #6ba4ff; background: rgba(107, 164, 255, 0.1); }
.btn-add-inline.memo { border-color: rgba(136, 136, 136, 0.3); color: rgba(136, 136, 136, 0.5); }
.btn-add-inline.memo:hover, .btn-add-inline.memo.active { border-color: #888; color: #888; background: rgba(136, 136, 136, 0.1); }

/* 内联输入框（和按钮同一行） */
.inline-input-wrap { display: none; gap: 4px; flex: 1; min-width: 0; opacity: 0; transform: scaleX(0.8); transform-origin: left; transition: all 0.15s ease; }
.inline-input-wrap.show { display: flex; opacity: 1; transform: scaleX(1); }
.inline-input { flex: 1; min-width: 80px; background: #111; border: 1px solid #333; color: #fff; padding: 5px 7px; border-radius: 4px; font-size: 13px; height: 28px; }
.inline-input:focus { border-color: #555; outline: none; }
.inline-input-wrap.retake .inline-input:focus { border-color: var(--s-retake); }
.inline-input-wrap.feedback .inline-input:focus { border-color: #6ba4ff; }
.inline-input-wrap.memo .inline-input:focus { border-color: #888; }
.inline-send { width: 28px; height: 28px; background: #222; border: 1px solid #444; color: #888; border-radius: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.15s; font-size: 12px; flex-shrink: 0; }
.inline-send:hover { background: #333; color: #fff; }
.inline-input-wrap.retake .inline-send:hover { background: var(--s-retake); border-color: var(--s-retake); color: #fff; }
.inline-input-wrap.feedback .inline-send:hover { background: #6ba4ff; border-color: #6ba4ff; color: #fff; }
.inline-input-wrap.memo .inline-send:hover { background: #666; border-color: #666; color: #fff; }

/* 输入框展开时隐藏内容区 */
.msg-row.input-active .msg-content-wrap { display: none; }
.msg-row.input-active .msg-count { display: none; }
.msg-count { font-size: 12px; background: #333; color: #aaa; padding: 2px 6px; border-radius: 8px; cursor: pointer; transition: 0.15s; flex-shrink: 0; }
.msg-count:hover { background: #555; color: #fff; }
.msg-content-wrap { flex: 1; min-width: 0; }
.msg-empty { color: #333; font-size: 13px; }

.msg-content { background: #1a1a1a; border: 1px solid #282828; border-radius: 4px; padding: 5px 7px; font-size: 13px; color: #aaa; position: relative; display: flex; align-items: center; gap: 6px; transition: 0.15s; }
.msg-content:hover { border-color: #444; }
.msg-content.retake { border-color: rgba(255, 69, 58, 0.3); color: #ffaaaa; background: rgba(255, 69, 58, 0.03); }
.msg-content.feedback { border-color: rgba(107, 164, 255, 0.3); color: #aaccff; background: rgba(107, 164, 255, 0.03); }
.msg-content.done { opacity: 0.5; }
.msg-content.done .msg-text { text-decoration: line-through; }
.msg-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-text-clickable { cursor: pointer; }
.msg-text-clickable:hover { text-decoration: underline; text-decoration-style: dotted; }
.msg-time { font-size: 11px; color: #888; font-weight: 500; flex-shrink: 0; }
.msg-actions { display: flex; gap: 3px; flex-shrink: 0; }
.msg-actions button { width: 20px; height: 20px; border: none; border-radius: 3px; cursor: pointer; font-size: 11px; display: flex; align-items: center; justify-content: center; transition: 0.15s; }
.msg-actions .btn-ok { background: #1a2a1a; color: #6a6; }
.msg-actions .btn-ok:hover { background: var(--s-done); color: #000; }
.msg-actions .btn-del { background: #2a1a1a; color: #a55; }
.msg-actions .btn-del:hover { background: var(--s-retake); color: #fff; }

/* 迷你确认弹窗 */
.mini-confirm { position: fixed; background: #1a1a1a; border: 1px solid #444; border-radius: 8px; box-shadow: 0 5px 20px rgba(0,0,0,0.5); z-index: 2000; display: flex; align-items: center; gap: 8px; padding: 8px 12px; transform: translate(-50%, -100%) scale(0.9); opacity: 0; transition: all 0.15s ease; margin-top: -10px; }
.mini-confirm.show { opacity: 1; transform: translate(-50%, -100%) scale(1); }
.mini-confirm span { font-size: 12px; color: #aaa; white-space: nowrap; }
.mini-confirm button { width: 24px; height: 24px; border: none; border-radius: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 12px; transition: 0.15s; }
.mini-confirm .mc-yes { background: var(--s-done); color: #fff; }
.mini-confirm .mc-yes:hover { background: #3ab54a; }
.mini-confirm .mc-no { background: #333; color: #888; }
.mini-confirm .mc-no:hover { background: #444; color: #fff; }

/* 消息弹窗 */
.msg-popup { position: fixed; background: #1a1a1a; border: 1px solid #444; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,0.6); z-index: 1000; min-width: 200px; max-width: 300px; animation: popIn 0.15s ease-out; }
@keyframes popIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
.msg-popup-header { padding: 8px 12px; border-bottom: 1px solid #333; font-size: 11px; color: #888; font-weight: 600; }
.msg-popup-list { max-height: 200px; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.msg-popup-item { padding: 6px 8px; background: #222; border: 1px solid #333; border-radius: 4px; font-size: 11px; color: #ccc; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.msg-popup-item.retake { border-color: var(--s-retake); color: #ffaaaa; }
.msg-popup-item.feedback { border-color: rgba(107, 164, 255, 0.4); color: #aaccff; }
.msg-popup-item.done { opacity: 0.5; }
.msg-popup-item.done .popup-msg-text { text-decoration: line-through; }

/* Message Detail Popup (full with actions) */
.msg-detail-popup { position: fixed; background: #111; border: 1px solid #444; border-radius: 10px; box-shadow: 0 15px 50px rgba(0,0,0,0.8); z-index: 1100; min-width: 280px; max-width: 420px; animation: popIn 0.15s ease-out; }
.mdp-header { padding: 10px 14px; border-bottom: 2px solid #333; font-size: 13px; color: #fff; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.mdp-close { background: none; border: none; color: #666; cursor: pointer; font-size: 12px; padding: 4px; border-radius: 4px; }
.mdp-close:hover { color: #fff; background: #333; }
.mdp-list { max-height: 320px; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.mdp-item { padding: 8px 10px; background: #1a1a1a; border: 1px solid #282828; border-radius: 6px; font-size: 12px; color: #ccc; }
.mdp-item.retake { border-color: rgba(255,69,58,0.3); }
.mdp-item.feedback { border-color: rgba(107,164,255,0.3); }
.mdp-item.ai { border-color: rgba(0,212,170,0.3); }
.mdp-item.done { opacity: 0.5; }
.mdp-item.done .mdp-text { text-decoration: line-through; }
.mdp-text { white-space: pre-wrap; word-break: break-word; line-height: 1.5; margin-bottom: 6px; padding: 3px 6px; border-radius: 4px; transition: background 0.12s; }
.mdp-text.mdp-text-editable { cursor: text; }
.mdp-text.mdp-text-editable:hover { background: rgba(255,138,0,0.10); box-shadow: inset 0 0 0 1px rgba(255,138,0,0.3); }
.mdp-text.editing { display: none; }
.mdp-meta { display: flex; justify-content: space-between; align-items: center; }
.mdp-time { font-size: 10px; color: #666; }
.mdp-actions { display: flex; gap: 4px; }
.mdp-btn { width: 22px; height: 22px; border: none; border-radius: 4px; cursor: pointer; font-size: 11px; display: flex; align-items: center; justify-content: center; transition: 0.15s; }
.mdp-btn.green { background: #1a2a1a; color: #6a6; }
.mdp-btn.green:hover { background: var(--s-done); color: #000; }
.mdp-btn.red { background: #2a1a1a; color: #a55; }
.mdp-btn.red:hover { background: var(--s-retake); color: #fff; }
.popup-msg-text { flex: 1; }
.popup-msg-time { font-size: 9px; color: #555; }
.del-btn { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; background: rgba(0,0,0,0.6); color: #fff; border: none; border-radius: 50%; cursor: pointer; display: none; justify-content: center; align-items: center; z-index: 5; }
.card:hover .del-btn { display: flex; }
.del-btn:hover { background: var(--s-retake); }

/* Table */
.table-wrap { width: 100%; overflow-x: auto; position: relative; }
/* 顶部横向滚动条（让滚动条始终可见） */
.table-wrap::-webkit-scrollbar { height: 8px; }
.table-wrap::-webkit-scrollbar-track { background: #111; border-radius: 4px; }
.table-wrap::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }
.table-wrap::-webkit-scrollbar-thumb:hover { background: #666; }
table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 1200px; }
th { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); color: #888; position: sticky; top: 0; background: var(--bg); z-index: 10; white-space: nowrap; font-size: 11px; font-weight: 500; }
td { padding: 8px; border-bottom: 1px solid #222; vertical-align: middle; height: 110px; }
.t-row:hover td { background: rgba(255,255,255,0.02); }

/* 表格行状态颜色（与卡片统一） */
.t-row.st-Ready { 
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.1) 30%, transparent 60%);
    border-left: 3px solid var(--s-ready);
}
.t-row.st-WIP { 
    background: linear-gradient(90deg, rgba(245, 197, 24, 0.50) 0%, rgba(245, 197, 24, 0.1) 30%, transparent 60%);
    border-left: 3px solid var(--s-wip);
}
.t-row.st-Done { 
    background: linear-gradient(90deg, rgba(9, 211, 172, 0.50) 0%, rgba(9, 211, 172, 0.1) 30%, transparent 60%);
    border-left: 3px solid var(--s-done);
}
.t-row.st-Retake { 
    background: linear-gradient(90deg, rgba(255, 69, 58, 0.60) 0%, rgba(255, 69, 58, 0.15) 30%, transparent 60%);
    border-left: 3px solid var(--s-retake);
}
.t-row.st-Delivered { 
    background: linear-gradient(90deg, rgba(10, 132, 255, 0.50) 0%, rgba(10, 132, 255, 0.1) 30%, transparent 60%);
    border-left: 3px solid var(--s-ok);
}
.t-row.st-Render {
    background: linear-gradient(90deg, rgba(190, 75, 219, 0.50) 0%, rgba(190, 75, 219, 0.1) 30%, transparent 60%);
    border-left: 3px solid var(--s-wait);
}
.t-row.st-Processing {
    background: linear-gradient(90deg, rgba(229, 153, 247, 0.40) 0%, rgba(229, 153, 247, 0.1) 30%, transparent 60%);
    border-left: 3px solid var(--s-processing);
}
.t-row.st-Check {
    background: linear-gradient(90deg, rgba(34, 184, 207, 0.40) 0%, rgba(34, 184, 207, 0.1) 30%, transparent 60%);
    border-left: 3px solid var(--s-check);
}
.t-row.st-Pass {
    background: linear-gradient(90deg, rgba(34, 211, 238, 0.40) 0%, rgba(34, 211, 238, 0.1) 30%, transparent 60%);
    border-left: 3px solid var(--s-pass);
}
.t-row.st-None {
    opacity: 0.5;
    border-left: 3px solid #333;
}
tr.st-BANK { opacity: 0.4; text-decoration: line-through; }
tr.selected td { background: rgba(230,0,18,0.18) !important; }
tr.selected { outline: 3px solid var(--accent); outline-offset: -3px; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.6); }

/* 列表模式框选 - 禁用文字选择 */
#table.batch-mode { user-select: none; -webkit-user-select: none; }
#table.batch-mode .t-row { cursor: pointer; }
#table.batch-mode .t-row:hover { background: rgba(255,255,255,0.03); }

/* 表格列样式 */
.col-cut { font-family: 'JetBrains Mono', monospace; }
.t-cut-no { font-size: 16px; font-weight: 700; color: #fff; margin-bottom: 2px; letter-spacing: 0.5px; }
.t-scene-name { font-size: 11px; color: #fbbf24; font-weight: 600; }
.col-thumb-cell { padding: 6px 8px !important; display: flex; gap: 10px; align-items: center; }
.t-thumb { width: 170px; height: 96px; background: #0a0a0a; border-radius: 4px; overflow: hidden; cursor: pointer; display: flex; align-items: center; justify-content: center; border: 1px solid #222; transition: all 0.2s; flex-shrink: 0; }
.t-thumb:hover { border-color: var(--accent); transform: scale(1.02); }
.t-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* 时间信息（竖排显示） */
.t-time-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.t-time-row { 
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #888;
    padding: 4px 6px;
    background: rgba(255,255,255,0.03);
    border-radius: 3px;
    border: 1px solid #333;
}
.t-time-row i { font-size: 11px; flex-shrink: 0; }
.t-time-row span { font-size: 10px; color: #666; flex-shrink: 0; }
.time-label-render { color: var(--s-done) !important; font-weight: 600; } /* 渲染=绿色 */
.time-label-delivery { color: var(--s-ok) !important; font-weight: 600; } /* 纳品=蓝色 */
.t-time-row strong { font-size: 11px; color: #aaa; font-weight: 500; margin-left: auto; font-family: 'JetBrains Mono', monospace; }
.t-time-row.delivery { color: var(--s-ok); border-color: var(--s-ok); background: rgba(10, 132, 255, 0.08); }
.t-time-row.delivery strong { color: var(--s-ok); }

/* 列表模式 ribbon 标签（优先摄影/摄影模板） */
.t-ribbon-tag { font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 3px; cursor: pointer; white-space: nowrap; }
.t-ribbon-tag.priority { background: #f97316; color: #fff; }
.t-ribbon-tag.template { background: linear-gradient(90deg,#ff6b6b,#ffa500,#ffd700,#4ade80,#60a5fa,#a78bfa,#f472b6); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: title-rainbow 3s linear infinite; border: 1px solid rgba(167,139,250,0.4); }

/* 资源图标 */
.col-assets { padding: 6px 8px !important; }
.asset-row { 
    display: flex; 
    align-items: center; 
    gap: 6px; 
    margin-bottom: 4px;
    padding: 3px 0;
}
.asset-row:last-child { margin-bottom: 0; }
.asset-icon { 
    display: flex; 
    align-items: center; 
    gap: 6px; 
    font-size: 10px; 
    color: #444;
    flex: 1;
}
.asset-icon i { font-size: 13px; flex-shrink: 0; }
.asset-icon.on.tp { color: var(--s-done); }
.asset-icon.on.bg { color: var(--s-done); }
.asset-icon.on.cg { color: var(--s-done); }
.asset-icon.on.ae { color: var(--s-done); }

/* 资源名称 */
.asset-name {
    font-size: 10px;
    color: #aaa;
    font-family: 'JetBrains Mono', monospace;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.asset-no {
    font-size: 10px;
    color: #444;
    font-style: italic;
}
.asset-date {
    font-size: 9px;
    color: #666;
    margin-left: 6px;
    font-family: 'JetBrains Mono', monospace;
    flex-shrink: 0;
}

/* 状态和作业者列 */
.col-status, .col-artist { padding: 4px 6px !important; }
.sel-status, .sel-artist { 
    font-size: 11px; 
    padding: 4px 6px; 
    border: 1px solid #333; 
    border-radius: 3px;
}
/* 列表模式下放大30%的下拉菜单 */
.sel-status-lg, .sel-artist-lg { 
    font-size: 14px; 
    padding: 6px 10px; 
    border: 1px solid #444; 
    border-radius: 4px;
    min-width: 120px;
    max-width: 200px;
    font-weight: 500;
    background: #0a0a0a;
}
.sel-status-lg option, .sel-artist-lg option { padding: 6px 10px; }

/* 消息列 */
.col-retake { background: rgba(255, 69, 58, 0.02); }
.col-feed { background: rgba(10, 132, 255, 0.03); }
.col-memo { background: rgba(255,255,255,0.02); }
.col-del { text-align: center; }

/* 列表模式消息文字折叠（最多2行） */
.t-row .msg-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
    max-height: 3em;
    line-height: 1.4;
    cursor: pointer;
}

/* 列表模式消息列样式（复用卡片模式的 msg-row） */
.col-retake .msg-row,
.col-feed .msg-row,
.col-memo .msg-row {
    padding: 4px 6px;
}


.t-action-btn { cursor: pointer; opacity: 0.5; }
.t-action-btn:hover { opacity: 1; }
.dot-pill { width: 12px; height: 4px; border-radius: 2px; background: #333; display: inline-block; margin-right: 2px; }
.dot-pill.on.tp { background: var(--s-done); }
.dot-pill.on.bg { background: var(--s-done); }
.dot-pill.on.cg { background: var(--s-done); }
.dot-pill.on.ae { background: var(--s-done); }

/* ============ Batch Bar (多选操作栏) ============ */
#batch-bar { 
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); 
    background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%); 
    border: 1px solid #333; border-radius: 10px; 
    padding: 10px 16px; display: none;
    box-shadow: 0 20px 60px rgba(0,0,0,0.9), 0 0 0 1px rgba(255,255,255,0.05) inset; 
    z-index: 100; max-width: 95vw;
    backdrop-filter: blur(15px);
}
#batch-bar.show { display: block; animation: slideUp 0.3s ease; }

.batch-row-main {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

.batch-label { 
    color: #fff; font-weight: 700; font-size: 13px; 
    display: flex; align-items: center; gap: 6px;
    white-space: nowrap;
}
.batch-label span { 
    color: var(--accent); font-size: 18px; 
    font-family: 'JetBrains Mono', monospace;
}

.batch-divider {
    width: 1px; height: 24px; background: #333;
}

/* Custom Checkbox */
.batch-check {
    position: relative; width: 18px; height: 18px; cursor: pointer;
}
.batch-check input {
    position: absolute; opacity: 0; width: 100%; height: 100%; cursor: pointer; z-index: 2;
}
.batch-check .checkmark {
    position: absolute; inset: 0; background: #0a0a0a; border: 1px solid #444;
    border-radius: 4px; transition: all 0.2s;
}
.batch-check .checkmark::after {
    content: ''; position: absolute; display: none;
    left: 5px; top: 2px; width: 5px; height: 9px;
    border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.batch-check input:checked + .checkmark {
    background: var(--accent); border-color: var(--accent);
}
.batch-check input:checked + .checkmark::after { display: block; }
.batch-check:hover .checkmark { border-color: #666; }

.batch-field-label {
    font-size: 11px; color: #888; min-width: 40px;
}
.batch-field-label.del-retake { color: var(--s-retake); }
.batch-field-label.del-feedback { color: #6ba4ff; }
.batch-field-label.del-memo { color: #888; }

.batch-select, .batch-input { 
    background: #0a0a0a; border: 1px solid #333; color: #fff; 
    padding: 0 10px; border-radius: 6px; font-size: 12px; 
    height: 30px; min-width: 120px; max-width: 200px;
    transition: border-color 0.2s;
}
.batch-select { min-width: 130px; }
.batch-select option { padding: 6px 10px; }
.batch-select:focus, .batch-input:focus { border-color: var(--accent); }
.batch-input { width: 80px; min-width: 80px; }

.batch-btn { 
    display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 0 16px; height: 30px; border-radius: 6px; 
    font-size: 12px; font-weight: 600; cursor: pointer;
    border: 1px solid transparent; 
    transition: all 0.2s ease;
    margin-left: auto;
}
.batch-btn i { font-size: 12px; }

.batch-btn.primary { 
    background: var(--accent); color: #fff; min-width: 70px;
}
.batch-btn.primary:hover { 
    background: #ff1a2e; box-shadow: 0 4px 15px rgba(230,0,18,0.4); 
}

.batch-btn.warning { 
    background: transparent; color: #ff9500; border-color: #ff9500; min-width: 70px;
}
.batch-btn.warning:hover { 
    background: rgba(255,149,0,0.15); box-shadow: 0 4px 15px rgba(255,149,0,0.3); 
}

.batch-btn.danger { 
    background: transparent; color: var(--s-retake); border-color: var(--s-retake); 
}
.batch-btn.danger:hover { 
    background: rgba(255,69,58,0.15); box-shadow: 0 4px 15px rgba(255,69,58,0.3); 
}
.batch-btn.danger.full {
    width: 100%; margin-left: 0;
}

/* 批量操作模态框 */
/* ============ Confirm Modal (统一确认对话框) ============ */
.confirm-modal {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(10px);
    z-index: 200;
    display: flex; justify-content: center; align-items: center;
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.confirm-panel {
    background: linear-gradient(180deg, #1a1a1a 0%, #111 100%);
    border: 1px solid #333;
    border-radius: 16px;
    padding: 30px 40px;
    min-width: 360px;
    text-align: center;
    box-shadow: 0 25px 80px rgba(0,0,0,0.8);
    animation: scaleIn 0.2s ease;
}
@keyframes scaleIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.confirm-icon {
    font-size: 48px;
    color: var(--s-retake);
    margin-bottom: 16px;
}
.confirm-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}
.confirm-message {
    font-size: 14px;
    color: #888;
    margin-bottom: 24px;
    line-height: 1.5;
}
.confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.confirm-btn {
    padding: 10px 28px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 100px;
}
.confirm-btn.cancel {
    background: transparent;
    border: 1px solid #444;
    color: #888;
}
.confirm-btn.cancel:hover {
    border-color: #666;
    color: #fff;
}
.confirm-btn.danger {
    background: var(--s-retake);
    border: none;
    color: #fff;
}
.confirm-btn.danger:hover {
    background: #ff6a62;
    box-shadow: 0 4px 20px rgba(255,69,58,0.4);
}

/* ============ Legacy Batch Modal (保留兼容) ============ */
.batch-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    z-index: 150;
    display: flex;
    justify-content: center;
    align-items: center;
}
.batch-panel {
    background: #181818;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 20px;
    min-width: 320px;
}
.batch-panel h3 {
    margin: 0 0 15px 0;
    color: #fff;
    font-size: 16px;
}
.batch-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}
.batch-checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ccc;
    cursor: pointer;
    font-size: 13px;
}
.batch-checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* 进度条 */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #222;
    z-index: 250;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--s-done));
    width: 0%;
    transition: width 0.3s ease;
}
.progress-text {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: #222;
    border: 1px solid #444;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    color: #fff;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

#player-modal { position: fixed; inset: 0; background: #000; z-index: 200; display: none; flex-direction: row; min-height: 0; overflow: hidden; }
.p-main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: #050505; position: relative; overflow: hidden; }
.video-wrap { flex: 1; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; position: relative; }
video { max-width: 100%; max-height: 100%; outline: none; box-shadow: 0 0 50px #000; transition: opacity 0.15s ease; }
/* 视频加载中遮罩 */
.video-loading-overlay {
    position: absolute; inset: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 16px;
    background: rgba(0,0,0,0.85); z-index: 5; color: #888; font-size: 14px;
}
.video-loading-spinner {
    width: 36px; height: 36px; border: 3px solid #333; border-top-color: var(--accent, #f90);
    border-radius: 50%; animation: vl-spin 0.8s linear infinite;
}
@keyframes vl-spin { to { transform: rotate(360deg); } }
/* 分镜面板加载动画 */
.sb-loading-dot {
    display: inline-block; width: 6px; height: 6px; background: #666;
    border-radius: 50%; margin-right: 6px; animation: sb-pulse 1s ease-in-out infinite;
}
@keyframes sb-pulse { 0%,100% { opacity: 0.3; } 50% { opacity: 1; } }
.p-controls { height: 50px; background: #111; display: flex; align-items: center; padding: 0 20px; gap: 15px; border-top: 1px solid #333; }
.p-time { font-family: 'JetBrains Mono'; font-size: 14px; color: #fff; min-width: 100px; text-align: right; font-weight: bold; display: flex; flex-direction: column; gap: 2px; }
.p-time-row { line-height: 1.2; }
.p-time-row.static { color: #666; font-size: 11px; }
.p-bar-wrap { flex: 1; height: 100%; display: flex; align-items: center; position: relative; }
input[type=range] { width: 100%; -webkit-appearance: none; background: transparent; }
input[type=range]::-webkit-slider-runnable-track { width: 100%; height: 8px; background: #333; border-radius: 4px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; height: 18px; width: 18px; border-radius: 50%; background: var(--accent); margin-top: -5px; cursor: pointer; border: 2px solid #fff; }

/* ─── 帧格子进度条（叠在 #v-seek 后面，input 仍可交互） ───
   --frame-w-pct  每帧宽度（百分比）
   --major-w-pct  每秒（24 帧）宽度（百分比，做金色 major line）
   --played-pct   已播放位置（按整帧 snap）
   --minor-alpha  minor 帧线透明度（密度过高时调到 0）
*/
.p-bar-wrap .frame-grid {
    --frame-w-pct: 100%;
    --major-w-pct: 100%;
    --played-pct: 0%;
    --minor-alpha: 0.10;
    position: absolute;
    left: 0; right: 0;
    height: 18px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 4px;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
    background:
        /* 1. 已播放红色填充（用平直 linear-gradient 即可让"格子"被红色覆盖) */
        linear-gradient(to right,
            rgba(230, 0, 18, 0.55) 0,
            rgba(230, 0, 18, 0.55) var(--played-pct),
            transparent var(--played-pct)
        ),
        /* 2. 每秒（24 帧）金色 major line */
        repeating-linear-gradient(to right,
            transparent 0,
            transparent calc(var(--major-w-pct) - 2px),
            rgba(255, 200, 50, 0.65) calc(var(--major-w-pct) - 2px),
            rgba(255, 200, 50, 0.65) var(--major-w-pct)
        ),
        /* 3. 每帧 minor line */
        repeating-linear-gradient(to right,
            transparent 0,
            transparent calc(var(--frame-w-pct) - 1px),
            rgba(255, 255, 255, var(--minor-alpha)) calc(var(--frame-w-pct) - 1px),
            rgba(255, 255, 255, var(--minor-alpha)) var(--frame-w-pct)
        ),
        /* 4. 底色 */
        linear-gradient(#1a1a1a, #1a1a1a);
}
.p-bar-wrap .frame-grid.dense { --minor-alpha: 0; }

/* #v-seek 仅作为 click-to-seek + drag 的交互层。
   playhead 由红色填充 (.frame-grid 的 --played-pct) 担任 → thumb 隐藏。
   B3：去掉 focus outline + selection 不让浏览器画红框。 */
.p-bar-wrap input#v-seek {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 22px;
    margin: 0;
    background: transparent;
    cursor: pointer;
    outline: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.p-bar-wrap input#v-seek:focus,
.p-bar-wrap input#v-seek:focus-visible,
.p-bar-wrap input#v-seek:active {
    outline: none;
    box-shadow: none;
}
.p-bar-wrap input#v-seek::-webkit-slider-runnable-track {
    background: transparent;
    height: 22px;
    border-radius: 0;
}
/* B2：thumb 完全隐藏（红色填充就是 playhead） */
.p-bar-wrap input#v-seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 22px;
    width: 1px;
    background: transparent;
    border: none;
    box-shadow: none;
    cursor: pointer;
}
.p-bar-wrap input#v-seek::-moz-range-track {
    background: transparent;
    height: 22px;
    border: none;
}
.p-bar-wrap input#v-seek::-moz-range-thumb {
    height: 22px;
    width: 1px;
    background: transparent;
    border: none;
    box-shadow: none;
    cursor: pointer;
}
/* B3：整个进度条 wrap 也禁文字选区，防止 drag 时选中周围文案出红框 */
.p-bar-wrap {
    -webkit-user-select: none;
    user-select: none;
}

/* B2：秒数标签层，每个黄色 major line 右侧标"1 2 3 ..." */
.p-bar-wrap .frame-labels {
    position: absolute;
    left: 0; right: 0;
    bottom: calc(50% + 10px);     /* 标签贴在帧格子条上方 */
    height: 12px;
    pointer-events: none;
    z-index: 3;
}
.p-bar-wrap .frame-label {
    position: absolute;
    transform: translateX(2px);    /* 黄线右侧 2px 偏移 */
    top: 0;
    font-size: 9px;
    line-height: 1;
    color: #ffd700;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    pointer-events: none;
    white-space: nowrap;
    text-shadow: 0 0 3px rgba(0,0,0,0.85);
}

/* ─── 音量悬浮 slider（仿 YouTube：icon hover 后竖向 slider 弹出） ─── */
.volume-control {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: 12px;
    height: 100%;
    padding: 0 4px;
}
.volume-control #v-vol-icon {
    color: #888;
    font-size: 18px;
    cursor: pointer;
    transition: color 0.15s;
}
.volume-control:hover #v-vol-icon { color: #fff; }
.volume-popup {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    width: 36px;
    height: 120px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 10px 0 8px;
    display: none;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
    /* 给一段透明 margin 让鼠标从 icon 移到 popup 之间不会触发 hover-out */
    margin-bottom: 0;
}
.volume-popup::after {
    /* 在 popup 和 icon 之间做一个透明桥，hover 不断 */
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0; right: 0;
    height: 10px;
}
.volume-control:hover .volume-popup,
.volume-popup:hover {
    display: flex;
}
.volume-popup-value {
    color: #888;
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 6px;
}
.volume-popup #v-volume {
    /* C1：竖向 slider —— 不再用 `-webkit-appearance: slider-vertical`（它会强制画出 native thumb，
       自定义 ::-webkit-slider-thumb 在该模式下被忽略）。改成 writing-mode + appearance:none 的现代方案，
       这样 ::webkit-slider-thumb 真的能压成 0，圆球彻底消失。
       direction:rtl 让 0 在底部 / 100 在顶部（视觉上跟"轨道往下拖减小音量"一致）。 */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    writing-mode: vertical-lr;
    direction: rtl;
    width: 4px;
    height: 88px;
    margin: 0;
    padding: 0;
    background: #333;
    border-radius: 2px;
    cursor: pointer;
    outline: none;
}
/* Webkit 竖向 slider 的轨道（垂直时 height 用 writing-mode 翻转 → 写 width） */
.volume-popup #v-volume::-webkit-slider-runnable-track {
    width: 4px;
    background: transparent;
    border: none;
}
/* C1：圆点 thumb 彻底消灭 —— 三套浏览器内核全清零 */
.volume-popup #v-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
}
.volume-popup #v-volume::-moz-range-thumb {
    -moz-appearance: none;
    appearance: none;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}
.volume-popup #v-volume::-moz-range-track {
    background: transparent;
    border: none;
}
.volume-popup #v-volume::-ms-thumb {
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
    border: 0 !important;
}
.volume-popup #v-volume::-ms-track {
    background: transparent;
    border-color: transparent;
    color: transparent;
}
.volume-popup #v-volume:focus,
.volume-popup #v-volume:focus-visible {
    outline: none;
}
.p-sidebar { width: 400px; min-width: 280px; max-width: 90vw; background: #111; border-left: 1px solid #333; display: flex; flex-direction: column; padding: 20px; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.ps-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #222; }
.ps-cut { font-size: 32px; font-family: 'JetBrains Mono'; font-weight: 700; color: var(--accent); }
.ps-nav-btn { color: #666; font-size: 16px; cursor: pointer; padding: 4px 6px; border-radius: 4px; }
.ps-nav-btn:hover { color: #fff; background: rgba(255,255,255,0.08); }
.ps-close { color: #666; font-size: 16px; cursor: pointer; padding: 4px 6px; border-radius: 4px; margin-left: 4px; }
.ps-close:hover { color: #fff; background: rgba(255,255,255,0.08); }
.ps-form { display: flex; flex-direction: column; gap: 15px; overflow-y: auto; flex: 1; padding-right: 5px; }

/* 播放器信息区块 */
.ps-info-section {
    background: #161616;
    border: 1px solid #2a2a2a;
    padding: 10px;
    border-radius: 6px;
}
.ps-info-title {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 10px;
    font-weight: 600;
}

/* 播放器资源网格 */
.ps-assets-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ps-asset-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: #1a1a1a;
    border-radius: 4px;
    border: 1px solid #2a2a2a;
}
.ps-asset-item i {
    font-size: 14px;
    color: #444;
    flex-shrink: 0;
}
.ps-asset-item.on i { color: inherit; }
.ps-asset-item.on.tp { color: var(--s-done); }
.ps-asset-item.on.bg { color: var(--s-done); }
.ps-asset-item.on.cg { color: var(--s-done); }
.ps-asset-item.on.ae { color: var(--s-done); }
.ps-asset-item.on.ai { color: #00d4aa; }
/* TP 率表完整度颜色 —— 跟卡片 badge 保持一致 */
.ps-asset-item.on.tp.tp-csv  { color: #ffd700; }
.ps-asset-item.on.tp.tp-none { color: #ff4444; }

/* 资源条可点击 → 跟卡片上 TP/BG/... badge 同样能开素材浏览器 */
.ps-asset-clickable {
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, transform 0.05s;
}
.ps-asset-clickable:hover {
    background: #222;
    border-color: #ff8a00;
}
.ps-asset-clickable:active {
    transform: scale(0.985);
}
.ps-asset-label {
    font-size: 11px;
    color: #666;
    font-weight: 600;
    min-width: 25px;
}
.ps-asset-value {
    font-size: 11px;
    color: #aaa;
    font-family: 'JetBrains Mono', monospace;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ps-asset-item:not(.on) .ps-asset-value {
    color: #555;
    font-style: italic;
}
.ps-asset-date {
    font-size: 9px;
    color: #666;
    font-family: 'JetBrains Mono', monospace;
    margin-left: auto;
}

/* 播放器时间列表 */
.ps-times-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ps-time-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: #1a1a1a;
    border-radius: 4px;
    border: 1px solid #2a2a2a;
    font-size: 11px;
    color: #888;
}
.ps-time-item i {
    font-size: 12px;
    flex-shrink: 0;
}
.ps-time-item span {
    font-size: 10px;
    color: #666;
    min-width: 70px;
}
.ps-time-item strong {
    font-family: 'JetBrains Mono', monospace;
    color: #aaa;
    margin-left: auto;
    font-weight: 500;
}
.ps-time-item.delivery {
    color: var(--s-ok);
    border-color: var(--s-ok);
    background: rgba(9, 211, 172, 0.05);
}
.ps-time-item.delivery strong {
    color: var(--s-ok);
}
.ps-no-info {
    font-size: 11px;
    color: #555;
    text-align: center;
    padding: 10px;
    font-style: italic;
}

.input-block { background: #161616; border: 1px solid #2a2a2a; padding: 10px; border-radius: 6px; }
.ps-block-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ps-block-header h4 { margin: 0; font-size: 11px; color: #888; text-transform: uppercase; }
.ps-block-header .btn-add-inline { width: 20px; height: 20px; font-size: 11px; }
.ps-list { max-height: 150px; overflow-y: auto; margin-bottom: 8px; display: flex; flex-direction: column; gap: 6px; }
.ps-msg { background: #222; padding: 8px 10px; border-radius: 4px; font-size: 12px; color: #ddd; border: 1px solid #333; display: flex; align-items: flex-start; gap: 8px; }
.ps-msg.done { opacity: 0.5; }
.ps-msg.done .ps-msg-text { text-decoration: line-through; }
.ps-msg-text { flex: 1; word-break: break-word; white-space: pre-wrap; }
.ps-msg-time { font-size: 10px; color: #555; flex-shrink: 0; white-space: nowrap; }
.ps-actions { display: flex; gap: 4px; flex-shrink: 0; }
.ps-btn-act { width: 22px; height: 22px; background: #1a1a1a; border: 1px solid #444; color: #888; cursor: pointer; border-radius: 4px; display: flex; align-items: center; justify-content: center; transition: 0.15s; }
.ps-btn-act:hover { color: #fff; border-color: #666; background: #333; }
.ps-btn-act.green { background: #1a3a1a; border-color: #2a4a2a; color: #6a6; }
.ps-btn-act.green:hover { background: var(--s-done); border-color: var(--s-done); color: #000; }
.ps-btn-act.red { background: #3a1a1a; border-color: #4a2a2a; color: #a66; }
.ps-btn-act.red:hover { background: var(--s-retake); border-color: var(--s-retake); color: #fff; }
/* 播放器面板内联输入框 */
.ps-inline-input-wrap { display: flex; gap: 6px; margin-top: 8px; opacity: 0; transform: translateY(-5px); transition: all 0.15s ease; }
.ps-inline-input-wrap.show { opacity: 1; transform: translateY(0); }
.ps-inline-input { flex: 1; background: #080808; border: 1px solid #333; color: #fff; padding: 8px 10px; border-radius: 4px; font-size: 12px; }
.ps-inline-input:focus { border-color: #555; outline: none; }
.ps-inline-input-wrap.retake .ps-inline-input:focus { border-color: var(--s-retake); }
.ps-inline-input-wrap.feedback .ps-inline-input:focus { border-color: #6ba4ff; }
.ps-inline-input-wrap.memo .ps-inline-input:focus { border-color: #888; }
.ps-inline-send { width: 36px; background: #333; color: #aaa; border: 1px solid #444; border-radius: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.15s; }
.ps-inline-send:hover { background: #444; color: #fff; }
.ps-inline-input-wrap.retake .ps-inline-send:hover { background: var(--s-retake); border-color: var(--s-retake); }
.ps-inline-input-wrap.feedback .ps-inline-send:hover { background: #6ba4ff; border-color: #6ba4ff; }
.ps-inline-input-wrap.memo .ps-inline-send:hover { background: #666; border-color: #666; }

/* 自定义删除确认 */
#confirm-mask { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: none; justify-content: center; align-items: center; z-index: 250; }
.modal.confirm { width: 320px; }
.modal.confirm h3 { margin-top: 0; }
.modal.confirm p { color: #ccc; }

/* 加载动画，仅覆盖内容区域 */
#page-loader { position: absolute; inset:0; background: var(--bg); display: none; justify-content: center; align-items: center; flex-direction: column; z-index: 50; gap: 12px; }
.loader-circle { width: 48px; height: 48px; border-radius: 50%; border: 4px solid #444; border-top-color: var(--accent); animation: spin 1s linear infinite; }
.loader-text { color: #888; font-size: 14px; letter-spacing: 2px; }

@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

#modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(5px); z-index: 100; display: none; justify-content: center; align-items: center; }
.modal { width: 320px; background: #181818; border: 1px solid #444; border-radius: 8px; padding: 20px; }
.modal h3 { margin-top: 0; color: #fff; }
.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 11px; color: #888; margin-bottom: 5px; }
.form-row input { width: 100%; background: #000; border: 1px solid #333; color: #fff; padding: 8px; border-radius: 4px; }
.modal-ft { margin-top: 20px; display: flex; justify-content: flex-end; gap: 10px; }

/* Toast 通知 */
#toast-container {
    position: fixed;
    top: 48px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

/* 展示模式 */
#display-mode-modal { position: fixed; inset: 0; z-index: 400; display: none; background: #000; }
.display-mode-stage { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at center, #111 0%, #000 65%); overflow: hidden; }
#display-video, #display-preview { width: 100%; height: 100%; object-fit: contain; background: #000; }
.display-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: #999; font-size: 18px; letter-spacing: 1px; }
.display-empty i { font-size: 52px; color: #444; }
.display-overlay-top, .display-overlay-bottom { position: absolute; left: 0; right: 0; padding: 22px 28px; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.display-overlay-top { top: 0; background: linear-gradient(180deg, rgba(0,0,0,0.78), rgba(0,0,0,0)); }
.display-overlay-bottom { bottom: 0; gap: 20px; background: linear-gradient(0deg, rgba(0,0,0,0.86), rgba(0,0,0,0)); }
.display-badge, .display-chip { background: rgba(15,15,15,0.72); border: 1px solid rgba(255,255,255,0.12); backdrop-filter: blur(12px); color: #fff; border-radius: 999px; padding: 8px 14px; font-size: 12px; }
.display-actions { display: flex; gap: 10px; pointer-events: auto; }
.display-action-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.15); background: rgba(15,15,15,0.72); color: #fff; cursor: pointer; }
.display-action-btn:hover { border-color: rgba(255,255,255,0.35); }
.display-play-mode.active { background: rgba(99,102,241,0.85); border-color: rgba(99,102,241,0.6); }
.display-shot-main { display: flex; flex-direction: column; gap: 8px; color: #fff; min-width: 0; }
.display-shot-title { font-size: 36px; font-weight: 800; letter-spacing: 1px; text-shadow: 0 2px 18px rgba(0,0,0,0.6); }
.display-shot-meta { font-size: 16px; color: rgba(255,255,255,0.85); text-shadow: 0 2px 12px rgba(0,0,0,0.65); }
.display-shot-side { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.toast {
    background: #222;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 12px 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 250px;
    max-width: 360px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    pointer-events: auto;
}
.toast.show {
    opacity: 1;
    transform: translateY(0);
}
.toast i {
    font-size: 20px;
    flex-shrink: 0;
}
.toast span {
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.4;
}
.toast-success {
    border-color: var(--s-done);
    background: rgba(9, 211, 172, 0.15);
}
.toast-success i {
    color: var(--s-done);
}
.toast-error {
    border-color: var(--s-retake);
    background: rgba(255, 69, 58, 0.15);
}
.toast-error i {
    color: var(--s-retake);
}
.toast-warning {
    border-color: #ff9500;
    background: rgba(255, 149, 0, 0.15);
}
.toast-warning i {
    color: #ff9500;
}
.toast-info {
    border-color: var(--accent);
    background: rgba(10, 132, 255, 0.15);
}
.toast-info i {
    color: var(--accent);
}

/* 标签切换 */
.tab-bar { display: flex; gap: 10px; border-bottom: 1px solid #333; }
.tab-btn { 
    background: transparent; 
    border: none; 
    color: #888; 
    padding: 8px 16px; 
    cursor: pointer; 
    border-bottom: 2px solid transparent; 
    transition: all 0.2s;
    font-size: 12px;
}
.tab-btn:hover { color: #fff; }
.tab-btn.active { 
    color: var(--accent); 
    border-bottom-color: var(--accent);
}
.tab-content { margin-top: 15px; }

/* MP4上传区域 */
.upload-drop-zone { 
    border: 2px dashed #444; 
    border-radius: 6px; 
    padding: 40px 20px; 
    text-align: center; 
    background: rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}
.upload-drop-zone.drag-over { 
    border-color: var(--accent); 
    background: rgba(10,132,255,0.1);
}
.upload-drop-zone p { margin: 6px 0; color: #888; font-size: 12px; }
.color-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; border-bottom: 1px solid #222; padding-bottom: 4px; }
/* 设置列表头 */
.settings-list-header { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid #333; margin-bottom: 8px; font-size: 11px; color: #666; }
.settings-list-header span:nth-child(1) { flex: 1; }
.settings-list-header span:nth-child(2) { width: 50px; text-align: center; }
.settings-list-header span:nth-child(3) { width: 40px; text-align: center; }
/* 人员配置行 */
.artist-config-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid #222; }
.artist-name-input { flex: 1; background: #111; border: 1px solid #333; color: #fff; padding: 6px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.artist-name-input:focus { border-color: var(--accent); }
.color-picker { width: 50px; height: 28px; border: none; background: none; cursor: pointer; border-radius: 4px; }
.color-picker::-webkit-color-swatch-wrapper { padding: 2px; }
.color-picker::-webkit-color-swatch { border-radius: 3px; border: 1px solid #555; }
.btn-x { width: 40px; background: none; border: 1px solid #333; color: #666; cursor: pointer; font-size: 16px; height: 28px; border-radius: 4px; transition: 0.2s; }
.btn-x:hover { color: #fff; border-color: var(--s-retake); background: rgba(255,69,58,0.2); }

/* 监控设置样式 */
.monitor-field { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.monitor-field label:first-child { font-size: 12px; color: #aaa; min-width: 80px; }
.monitor-input { 
    flex: 1; max-width: 200px; padding: 6px 10px; 
    background: #1a1a1a; border: 1px solid #333; border-radius: 4px; 
    color: #fff; font-size: 12px; 
}
.monitor-input:focus { border-color: var(--accent); }

/* 开关样式 */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: #333; transition: 0.3s; border-radius: 24px;
}
.toggle-slider:before {
    position: absolute; content: ""; height: 18px; width: 18px;
    left: 3px; bottom: 3px; background-color: #888;
    transition: 0.3s; border-radius: 50%;
}
.toggle-switch input:checked + .toggle-slider { background-color: var(--s-done); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(20px); background-color: #fff; }

/* 提醒天数复选框组 */
.alert-days-group { display: flex; gap: 12px; }
.alert-days-group label { display: flex; align-items: center; gap: 4px; font-size: 12px; color: #aaa; cursor: pointer; }
.alert-days-group input[type="checkbox"] { accent-color: var(--accent); }

/* 设置按钮样式 */
.btn-icon { 
    width: 32px; height: 32px; background: #1a1a1a; border: 1px solid #333; 
    border-radius: 4px; color: #888; cursor: pointer; 
    display: flex; align-items: center; justify-content: center;
}
.btn-icon:hover { color: #fff; border-color: #555; }
button.secondary { 
    background: #222; border: 1px solid #444; color: #ccc; padding: 8px 12px; 
    border-radius: 4px; cursor: pointer; font-size: 12px; transition: 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
button.secondary:hover { background: #333; color: #fff; }

/* 平板优化 */
@media (max-width: 1024px) {
    aside { width: 220px; }
    nav { padding: 10px 12px; gap: 8px; position: sticky; top: 0; }
    .row-1 { flex-wrap: wrap; gap: 10px; }
    .nav-actions { flex-wrap: wrap; }
    .row-2 { flex-direction: column; gap: 8px; }
    .row-3 { flex-wrap: wrap; gap: 10px; }
    .search-item { margin-left: 0; width: 100%; }
    .search-item input { width: 100%; }
    .content { padding: 16px; }
    #player-modal { flex-direction: column; }
    .p-main { flex: 0 0 60vh; }
    .p-sidebar { width: 100%; height: 40vh; border-left: none; border-top: 1px solid #333; }
}

@media (max-width: 820px) {
    aside { width: 200px; }
    .proj-info { font-size: 14px; }
    .p-time { min-width: 140px; font-size: 12px; }
    .grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
}

/* ---------- Tablet (641-1024px)：aside 缩小 + 按钮/下拉紧凑 + 表格横向滚动 ---------- */
@media (min-width: 641px) and (max-width: 1024px) {
    /* 侧栏 */
    aside { width: 190px !important; min-width: 180px !important; }

    /* 顶栏 nav 紧凑 */
    nav { padding: 8px 10px !important; gap: 6px !important; }
    nav .row-1, nav .row-2, nav .row-3 { gap: 6px !important; }

    /* 操作按钮行：允许换行 + 字体缩小 */
    .nav-actions {
        flex-wrap: wrap !important;
        gap: 4px !important;
    }
    .nav-actions .btn-text {
        font-size: 11px !important;
        padding: 4px 7px !important;
    }
    .nav-actions .btn-text i { font-size: 12px; }
    .nav-actions .icon,
    .nav-actions .primary {
        padding: 4px 6px !important;
        min-width: 28px;
    }

    /* 筛选行：支持 wrap、下拉收紧 */
    .row-3 { flex-wrap: wrap !important; }
    .filter-item { gap: 3px !important; }
    .filter-item > span { font-size: 11px !important; }
    .filter-item select {
        max-width: 110px !important;
        font-size: 11px !important;
        padding: 4px 6px !important;
    }
    .ribbon-filter-btn {
        font-size: 11px !important;
        padding: 3px 6px !important;
    }
    .search-item { flex: 1 1 auto; min-width: 140px; }

    /* 全局顶栏右侧紧凑 */
    .global-top-nav .global-top-right {
        gap: 4px !important;
    }
    .global-top-nav .lang-switcher-nav .lang-nav-btn {
        padding: 2px 4px !important;
        font-size: 10px !important;
    }
    #holiday-today { font-size: 10px !important; padding: 0 6px 0 0 !important; }
    #holiday-panel {
        max-width: 92vw !important;
        right: 8px !important;
    }

    /* 全局顶栏 nav 链接略缩 */
    .global-top-nav .global-nav-link {
        font-size: 12px !important;
        padding: 4px 6px !important;
    }
    .global-top-nav .brand-mini { font-size: 13px !important; }

    /* 表格横滚 */
    table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
    table thead, table tbody, table tr { display: table; table-layout: fixed; width: 100%; }

    /* 内容 padding 缩小 */
    .content { padding: 12px !important; }

    /* 人员状态小按钮 */
    .staff-pill { font-size: 11px !important; padding: 2px 8px !important; }
}

/* ---------- Mobile: aside → drawer ---------- */
@media (max-width: 640px) {
    /* body 已在 shared.css 里变 flex-direction: column */

    /* aside 默认收起为顶部条（已在 shared.css 处理），补充表格滚动 */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
        font-size: 11px;
    }
    table thead, table tbody, table tr {
        display: table;
        table-layout: fixed;
        width: max-content;  /* 表格保持原始最小宽度，容器负责滚动 */
        min-width: 100%;
    }
    table th, table td { padding: 6px 8px !important; }

    /* 主内容区字体 */
    .content { padding: 10px; font-size: 13px; }
    .grid    { gap: 10px; }

    /* 顶部 nav 紧凑 */
    nav { padding: 6px 10px !important; gap: 4px !important; }
    nav .btn, nav button { padding: 6px 8px !important; font-size: 12px !important; }

    /* 模态框、对话框全屏化 */
    #player-modal,
    .modal-mask,
    .confirm-overlay {
        padding: 0 !important;
    }
    #player-modal {
        inset: 0 !important;
        border-radius: 0 !important;
    }
    .p-main    { flex: 1 1 50vh; }
    .p-sidebar { height: 50vh; }

    /* Batch bar 占满底部 */
    #batch-bar {
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        transform: none !important;
        border-radius: 0 !important;
        max-width: 100vw !important;
    }

    /* 所有大模态框适配 */
    .dashboard-overlay, .stats-overlay, .schedule-overlay {
        left: 0 !important;
        right: 0 !important;
        top: 40px !important;
        bottom: 0 !important;
        width: 100vw !important;
    }

    /* 通知 / 提示 / 顶栏用户 */
    .global-top-right .lang-switcher-nav { display: none !important; }
}

/* ============ 登录与用户管理 ============ */

/* 侧边栏用户区域 */
.sidebar-user { padding: 12px 15px; border-top: 1px solid var(--border); }
.user-info { display: flex; align-items: center; gap: 10px; }
.user-icon { font-size: 32px; color: #666; }
.user-detail { flex: 1; min-width: 0; }
.user-detail span { display: block; }
#user-name { font-size: 12px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role-tag { font-size: 10px; padding: 1px 6px; border-radius: 3px; margin-top: 2px; display: inline-block; }
.role-editor { background: #4ecdc4; color: #000; }
/* role 颜色由 JS 内联样式控制 */
.btn-logout { width: 28px; height: 28px; background: transparent; border: 1px solid #333; color: #666; cursor: pointer; border-radius: 4px; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.btn-logout:hover { border-color: var(--s-retake); color: var(--s-retake); }

.att-btn.active[data-att="working"] { background: #1a3a1a !important; border-color: #4ade80 !important; color: #4ade80 !important; font-weight: 600 !important; }
.att-btn.active[data-att="leave"]   { background: #3a3a1a !important; border-color: #fbbf24 !important; color: #fbbf24 !important; font-weight: 600 !important; }
.att-btn.active[data-att="off"]     { background: #222 !important; border-color: #555 !important; color: #888 !important; }
.att-btn:hover { border-color: #555 !important; color: #ccc !important; }

.staff-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 500; color: #fff; border: 1px solid #333; background: #111; transition: all .2s; }
.staff-pill .staff-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.staff-pill .staff-status-label { font-size: 9px; opacity: 0.7; margin-left: 2px; }
.staff-pill.s-working { border-color: #2d6a2d; background: rgba(74, 222, 128, 0.08); }
.staff-pill.s-working .staff-dot { background: #4ade80; box-shadow: 0 0 6px #4ade80; animation: pulse-dot 2s infinite; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.staff-pill.s-leave { border-color: #8a6a1a; background: rgba(251, 191, 36, 0.08); }
.staff-pill.s-leave .staff-dot { background: #fbbf24; }
.staff-pill.s-leave::after { content: '休'; font-size: 8px; background: #fbbf24; color: #000; border-radius: 3px; padding: 0 3px; margin-left: 2px; font-weight: 700; }
.staff-pill.s-off { opacity: 0.3; }
.staff-pill.s-off .staff-dot { background: #555; }

/* 用户等级与头像 */
.user-avatar-link { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.user-avatar-icon { font-size: 24px; transition: transform 0.2s; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #2a2a2a, #161616); }
.user-avatar-link:hover .user-avatar-icon { transform: scale(1.15); }
.user-avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.user-name-link { text-decoration: none; display: flex; align-items: center; gap: 6px; }
.user-name-link:hover #user-name { color: var(--accent); }
.user-level-badge { font-size: 10px; background: linear-gradient(135deg, #4a4a4a, #333); color: #fbbf24; padding: 2px 6px; border-radius: 10px; font-weight: 600; }
.btn-icon-sm { width: 28px; height: 28px; background: transparent; border: 1px solid #333; color: #666; cursor: pointer; border-radius: 4px; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.btn-icon-sm:hover { border-color: var(--accent); color: var(--accent); background: rgba(230,0,18,0.1); }

/* 登录遮罩 */
/* ============ Touhou Spinner (少女祈祷中) ============ */
:root {
    --spinner-size: 130px;
    --orb-color-red: #ff1d5e;
    --orb-color-white: #ffffff;
}

.breeding-rhombus-spinner {
    height: var(--spinner-size);
    width: var(--spinner-size);
    position: relative;
    transform: rotate(45deg);
    will-change: transform;
}

.breeding-rhombus-spinner, .breeding-rhombus-spinner * {
    box-sizing: border-box;
}

.breeding-rhombus-spinner .yin-yang-orb {
    height: calc(var(--spinner-size) / 7.5);
    width: calc(var(--spinner-size) / 7.5);
    position: absolute;
    top: calc(var(--spinner-size) / 2.3077);
    left: calc(var(--spinner-size) / 2.3077);
    animation-duration: 2000ms;
    animation-iteration-count: infinite;
    background: transparent;
}

.yin-yang-visual {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(to right, var(--orb-color-red) 50%, var(--orb-color-white) 50%);
    box-shadow: 0 0 4px rgba(0,0,0,0.5);
    animation: orb-spin 1.5s linear infinite reverse;
    position: relative;
    will-change: transform;
}

.yin-yang-visual::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 50%;
    border-radius: 50%;
    background: var(--orb-color-red);
    background-image: radial-gradient(circle, var(--orb-color-white) 15%, var(--orb-color-red) 16%);
}

.yin-yang-visual::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 50%;
    border-radius: 50%;
    background: var(--orb-color-white);
    background-image: radial-gradient(circle, var(--orb-color-red) 15%, var(--orb-color-white) 16%);
}

@keyframes orb-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.breeding-rhombus-spinner .yin-yang-orb:nth-child(2n+0) {
    margin-right: 0;
}

.breeding-rhombus-spinner .yin-yang-orb.child-1 { animation-name: breeding-rhombus-spinner-animation-child-1; animation-delay: calc(100ms * 1); }
.breeding-rhombus-spinner .yin-yang-orb.child-2 { animation-name: breeding-rhombus-spinner-animation-child-2; animation-delay: calc(100ms * 2); }
.breeding-rhombus-spinner .yin-yang-orb.child-3 { animation-name: breeding-rhombus-spinner-animation-child-3; animation-delay: calc(100ms * 3); }
.breeding-rhombus-spinner .yin-yang-orb.child-4 { animation-name: breeding-rhombus-spinner-animation-child-4; animation-delay: calc(100ms * 4); }
.breeding-rhombus-spinner .yin-yang-orb.child-5 { animation-name: breeding-rhombus-spinner-animation-child-5; animation-delay: calc(100ms * 5); }
.breeding-rhombus-spinner .yin-yang-orb.child-6 { animation-name: breeding-rhombus-spinner-animation-child-6; animation-delay: calc(100ms * 6); }
.breeding-rhombus-spinner .yin-yang-orb.child-7 { animation-name: breeding-rhombus-spinner-animation-child-7; animation-delay: calc(100ms * 7); }
.breeding-rhombus-spinner .yin-yang-orb.child-8 { animation-name: breeding-rhombus-spinner-animation-child-8; animation-delay: calc(100ms * 8); }

.breeding-rhombus-spinner .yin-yang-orb.big {
    height: calc(var(--spinner-size) / 3);
    width: calc(var(--spinner-size) / 3);
    top: calc(var(--spinner-size) / 3);
    left: calc(var(--spinner-size) / 3);
    animation: breeding-rhombus-spinner-animation-child-big 2s infinite;
    animation-delay: 0.5s;
    background: none;
}

.breeding-rhombus-spinner .yin-yang-orb.big .yin-yang-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    background: linear-gradient(to right, var(--orb-color-red) 50%, var(--orb-color-white) 50%);
    box-shadow: 0 0 15px rgba(255, 29, 94, 0.4);
    animation: orb-spin 2s linear infinite;
}

.breeding-rhombus-spinner .yin-yang-orb.big .yin-yang-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 50%;
    border-radius: 50%;
    background: var(--orb-color-red);
    background-image: radial-gradient(circle, var(--orb-color-white) 15%, var(--orb-color-red) 16%);
}

.breeding-rhombus-spinner .yin-yang-orb.big .yin-yang-inner::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 50%;
    border-radius: 50%;
    background: var(--orb-color-white);
    background-image: radial-gradient(circle, var(--orb-color-red) 15%, var(--orb-color-white) 16%);
}

@keyframes breeding-rhombus-spinner-animation-child-1 { 50% { transform: translate(-325%, -325%); } }
@keyframes breeding-rhombus-spinner-animation-child-2 { 50% { transform: translate(0, -325%); } }
@keyframes breeding-rhombus-spinner-animation-child-3 { 50% { transform: translate(325%, -325%); } }
@keyframes breeding-rhombus-spinner-animation-child-4 { 50% { transform: translate(325%, 0); } }
@keyframes breeding-rhombus-spinner-animation-child-5 { 50% { transform: translate(325%, 325%); } }
@keyframes breeding-rhombus-spinner-animation-child-6 { 50% { transform: translate(0, 325%); } }
@keyframes breeding-rhombus-spinner-animation-child-7 { 50% { transform: translate(-325%, 325%); } }
@keyframes breeding-rhombus-spinner-animation-child-8 { 50% { transform: translate(-325%, 0); } }
@keyframes breeding-rhombus-spinner-animation-child-big { 50% { transform: scale(0.5); } }
/* Rajdhani + Noto Sans SC already in vendor/fonts/local-fonts.css */

/* 登录页面样式变量（不覆盖主界面变量） */
/* ============ Login Page — Premium Dark Glass ============ */
#login-overlay {
    --login-accent: #E60012;
    --login-glow: rgba(230, 0, 18, 0.15);
}

#login-overlay {
    position: fixed; inset: 0; background: #050505; z-index: 1000;
    display: flex; justify-content: center; align-items: center;
    overflow: hidden;
    font-family: 'Rajdhani', 'Noto Sans SC', sans-serif;
    transition: opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
#login-overlay.hidden { opacity: 0; pointer-events: none; }


/* Intro Layer */
#intro-layer {
    position: absolute; z-index: 200; display: flex; flex-direction: column; align-items: center;
    transition: opacity 0.8s ease;
}
#intro-layer.hidden { opacity: 0; pointer-events: none; }

#enter-btn {
    background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.2);
    padding: 15px 60px; font-size: 14px; letter-spacing: 8px;
    cursor: pointer; transition: all 0.4s ease; text-transform: uppercase;
    font-family: 'Rajdhani', sans-serif;
    position: relative; overflow: hidden; border-radius: 4px;
}
#enter-btn::before {
    content: ''; position: absolute; top: 0; left: 0; width: 0%; height: 100%;
    background: var(--login-accent); transition: width 0.4s ease; z-index: -1;
}
#enter-btn:hover::before { width: 100%; }
#enter-btn:hover { border-color: var(--login-accent); letter-spacing: 12px; }

/* Login Content */
.landing-content {
    position: relative; z-index: 100;
    text-align: center; pointer-events: auto;
    padding: 40px 48px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    /* UI-3：纯 CSS 入场（不需要 GSAP，0 JS 开销）*/
    animation: landingCardIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* UI-3：子元素 stagger 入场 —— 用 nth-child + animation-delay，无 JS */
.landing-content > * {
    animation: landingItemIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.landing-content > *:nth-child(1) { animation-delay: 0.05s; }
.landing-content > *:nth-child(2) { animation-delay: 0.15s; }
.landing-content > *:nth-child(3) { animation-delay: 0.25s; }
.landing-content > *:nth-child(4) { animation-delay: 0.35s; }

@keyframes landingCardIn {
    from { opacity: 0; transform: translateY(14px) scale(0.985); filter: blur(4px); }
    to   { opacity: 1; transform: translateY(0)    scale(1);    filter: blur(0); }
}
@keyframes landingItemIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.title-main {
    font-size: 28px; font-weight: 700; color: #fff; letter-spacing: 10px;
    margin-bottom: 8px; margin-left: 10px;
    text-shadow: 0 0 40px rgba(230, 0, 18, 0.15);
}

.login-subtitle {
    font-size: 11px; color: rgba(255,255,255,0.3); letter-spacing: 4px;
    margin-bottom: 24px; text-transform: uppercase;
}

/* UI-3：respect prefers-reduced-motion —— 关掉所有 motion */
@media (prefers-reduced-motion: reduce) {
    .landing-content,
    .landing-content > *,
    .login-lang-btn {
        animation: none !important;
        transition: none !important;
    }
}

/* ============ WELCOME-2：登录成功欢迎卡动画 ============
   思路：登录卡 .landing-content 加 .dissolving 类 → blur+fade+scale 退场
        欢迎卡 .welcome-card 加 .show 类 → pop 入场（头像放大 + 文本 stagger）
        最后欢迎卡加 .dissolving 类 → 整体淡出
   完全纯 CSS，不挂 GSAP，不影响 index.html 运行时性能 */
.landing-content.dissolving {
    animation: landingDissolve 0.55s cubic-bezier(0.4, 0, 0.6, 1) forwards;
    pointer-events: none;
}
.landing-content.dissolving > * {
    /* 关掉之前的 stagger 入场动画，避免和退场打架 */
    animation: none !important;
}
@keyframes landingDissolve {
    0%   { opacity: 1; transform: translateY(0)   scale(1);    filter: blur(0); }
    100% { opacity: 0; transform: translateY(-12px) scale(0.96); filter: blur(10px); }
}

/* 欢迎卡 —— 与 .landing-content 同一容器（#login-overlay），绝对居中 */
.welcome-card {
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%) scale(0.94);
    opacity: 0;
    pointer-events: none;
    z-index: 101;
    text-align: center;
    padding: 40px 56px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 18px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    min-width: 360px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    transition: opacity 0.4s ease, transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.welcome-card.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
.welcome-card.dissolving {
    animation: welcomeDissolve 0.6s cubic-bezier(0.4, 0, 0.6, 1) forwards;
}
@keyframes welcomeDissolve {
    0%   { opacity: 1; transform: translate(-50%, -50%) scale(1)    rotate(0); filter: blur(0); }
    100% { opacity: 0; transform: translate(-50%, -54%) scale(1.04) rotate(0); filter: blur(8px); }
}

/* 大头像 */
.welcome-avatar {
    width: 96px; height: 96px;
    margin: 0 auto 18px;
    position: relative;
    border-radius: 50%;
    overflow: visible;
    background: linear-gradient(135deg, #2a2a2a, #161616);
    display: flex; align-items: center; justify-content: center;
    font-size: 44px;
    opacity: 0;
    transform: scale(0.5);
}
.welcome-avatar img {
    width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
}
.welcome-avatar-ring {
    position: absolute; inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(230, 0, 18, 0.6);
    opacity: 0;
    pointer-events: none;
}
.welcome-card.show .welcome-avatar {
    animation: welcomeAvatarPop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s forwards;
}
.welcome-card.show .welcome-avatar-ring {
    animation: welcomeRingExpand 1.4s cubic-bezier(0.22, 1, 0.36, 1) 0.5s forwards;
}
@keyframes welcomeAvatarPop {
    0%   { opacity: 0; transform: scale(0.5); }
    60%  { opacity: 1; transform: scale(1.08); }
    100% { opacity: 1; transform: scale(1); }
}
@keyframes welcomeRingExpand {
    0%   { opacity: 0.9; transform: scale(0.9); }
    100% { opacity: 0;   transform: scale(1.6); }
}

/* 姓名 / 角色行 / 称号 / 问候 文本 —— 默认隐藏，show 时 stagger fade-up */
.welcome-name,
.welcome-accent-line,
.welcome-meta-row,
.welcome-title,
.welcome-greeting {
    opacity: 0;
    transform: translateY(12px);
}
.welcome-card.show .welcome-name      { animation: welcomeTextIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.35s forwards; }
.welcome-card.show .welcome-accent-line { animation: welcomeLineGrow 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.5s forwards; }
.welcome-card.show .welcome-meta-row  { animation: welcomeTextIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.65s forwards; }
.welcome-card.show .welcome-title     { animation: welcomeTextIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.78s forwards; }
.welcome-card.show .welcome-greeting  { animation: welcomeTextIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.95s forwards; }
@keyframes welcomeTextIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes welcomeLineGrow {
    from { opacity: 0; transform: translateY(0) scaleX(0); }
    to   { opacity: 1; transform: translateY(0) scaleX(1); }
}

.welcome-name {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #fff;
    margin-bottom: 12px;
}
.welcome-accent-line {
    width: 48px; height: 2px;
    margin: 0 auto 14px;
    background: linear-gradient(90deg, transparent, var(--login-accent, #e60012), transparent);
    transform-origin: center;
}
.welcome-meta-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 13px;
}
.welcome-level {
    background: linear-gradient(135deg, #4a4a4a, #333);
    color: #fbbf24;
    padding: 2px 10px;
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.welcome-role {
    color: rgba(255, 255, 255, 0.75);
    font-weight: 500;
}
.welcome-title {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 22px;
    min-height: 18px;
}
.welcome-title:empty { margin-bottom: 8px; }
.welcome-greeting {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 1.5px;
    font-weight: 300;
}

/* 减少动效偏好下，全部停 */
@media (prefers-reduced-motion: reduce) {
    .landing-content.dissolving,
    .welcome-card,
    .welcome-card.show,
    .welcome-card.dissolving,
    .welcome-card.show .welcome-avatar,
    .welcome-card.show .welcome-avatar-ring,
    .welcome-card.show .welcome-name,
    .welcome-card.show .welcome-accent-line,
    .welcome-card.show .welcome-meta-row,
    .welcome-card.show .welcome-title,
    .welcome-card.show .welcome-greeting {
        animation: none !important;
        transition: none !important;
        opacity: 1 !important;
        transform: translate(-50%, -50%) scale(1) !important;
    }
    .welcome-card .welcome-avatar { opacity: 1 !important; transform: none !important; }
    .welcome-card .welcome-accent-line { opacity: 1 !important; transform: translateY(0) scaleX(1) !important; }
    .welcome-card .welcome-name,
    .welcome-card .welcome-meta-row,
    .welcome-card .welcome-title,
    .welcome-card .welcome-greeting { opacity: 1 !important; transform: translateY(0) !important; }
}

/* UI-3：style.css bump → 通过 link href cache version 拿到新 CSS（见 index.html link 标签 ?v=）*/

/* UI-2：登录页语言切换器 */
.login-lang-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 26px;
}
.login-lang-btn {
    appearance: none;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.55);
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: background 220ms cubic-bezier(0.22, 1, 0.36, 1),
                color 220ms cubic-bezier(0.22, 1, 0.36, 1),
                border-color 220ms cubic-bezier(0.22, 1, 0.36, 1),
                transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.login-lang-btn:hover {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.30);
    color: rgba(255, 255, 255, 0.85);
    transform: translateY(-1px);
}
.login-lang-btn:active { transform: translateY(0); }
.login-lang-btn.active {
    background: linear-gradient(180deg, rgba(230, 0, 18, 0.22), rgba(230, 0, 18, 0.12));
    border-color: rgba(230, 0, 18, 0.55);
    color: #fff;
    box-shadow: 0 6px 16px rgba(230, 0, 18, 0.18);
}

/* Login Input */
.login-form-new { display: flex; flex-direction: column; width: 280px; margin: 0 auto; }

.input-group {
    position: relative;
    margin-bottom: 18px;
}

.input {
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    padding: 14px 16px;
    font-size: 15px;
    color: #f5f5f5;
    transition: border-color 0.2s ease;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    font-family: 'Rajdhani', sans-serif;
}

.input:focus {
    outline: none;
    border-color: var(--login-accent);
    background: rgba(230, 0, 18, 0.04);
    box-shadow: 0 0 20px rgba(230, 0, 18, 0.1), 0 0 4px rgba(230, 0, 18, 0.2);
}
.input:valid {
    outline: none;
    border-color: rgba(255, 255, 255, 0.25);
}
.input:focus:valid {
    border-color: var(--login-accent);
    background: rgba(230, 0, 18, 0.04);
    box-shadow: 0 0 20px rgba(230, 0, 18, 0.1), 0 0 4px rgba(230, 0, 18, 0.2);
}

.user-label {
    position: absolute;
    left: 16px; top: 0;
    color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
    transform: translateY(14px);
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-size: 14px;
}

.input:focus ~ .user-label, .input:valid ~ .user-label {
    transform: translateY(-50%) scale(0.8);
    background: rgba(5, 5, 5, 0.9);
    padding: 0 6px;
    color: var(--login-accent);
    border-radius: 4px;
}

/* Login Button — 渐变 + 加载态 */
#login-btn-new {
    background: linear-gradient(135deg, var(--login-accent) 0%, #cc0010 100%);
    color: #fff; border: none;
    font-family: 'Rajdhani', sans-serif; font-size: 14px; font-weight: 700;
    letter-spacing: 4px; padding: 14px; cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-transform: uppercase; margin-top: 8px;
    width: 100%; border-radius: 12px;
    position: relative; overflow: hidden;
    box-shadow: 0 4px 20px rgba(230, 0, 18, 0.25);
}
#login-btn-new:hover {
    box-shadow: 0 6px 30px rgba(230, 0, 18, 0.4);
    transform: translateY(-1px);
    letter-spacing: 6px;
}
#login-btn-new:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(230, 0, 18, 0.2);
}
#login-btn-new:disabled {
    opacity: 0.6; cursor: not-allowed; transform: none;
    box-shadow: none;
}
/* 按钮加载动画条 */
#login-btn-new.loading::after {
    content: '';
    position: absolute; bottom: 0; left: 0; height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
    animation: btnLoadSlide 1.2s ease-in-out infinite;
    width: 40%;
}
@keyframes btnLoadSlide {
    0% { left: -40%; }
    100% { left: 100%; }
}

/* 记住账户 */
.login-remember-row {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px; color: rgba(255,255,255,0.35);
    margin-bottom: 8px; cursor: pointer; user-select: none;
}
.login-remember-row:hover { color: rgba(255,255,255,0.5); }

.login-error {
    color: var(--login-accent); font-size: 12px; min-height: 20px;
    margin-top: 10px; opacity: 0.9;
}

/* 用户管理模态框 */
.user-create-form { background: #1a1a1a; border: 1px solid #333; border-radius: 6px; padding: 12px; margin-bottom: 16px; }
.user-create-form h4 { margin: 0 0 12px; font-size: 12px; color: #888; }
.create-user-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.create-user-grid .form-row { margin: 0; }
.create-user-grid .form-row label { font-size: 11px; color: #888; margin-bottom: 4px; display: block; }
.create-user-grid .form-row input,
.create-user-grid .form-row select { width: 100%; height: 32px; font-size: 12px; }
.form-error { color: var(--s-retake); font-size: 11px; margin-top: 8px; min-height: 16px; }
#m-edit-user .form-row { margin-bottom: 12px; }
#m-edit-user .form-row label { font-size: 11px; color: #888; margin-bottom: 4px; display: block; }

.users-list-header { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid #333; margin-bottom: 8px; font-size: 11px; color: #666; }
.users-list-header span:nth-child(1) { flex: 1; }
.users-list-header span:nth-child(2) { width: 80px; }
.users-list-header span:nth-child(3) { width: 70px; }
.user-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #222; }
.user-row.is-me { background: rgba(10,132,255,0.1); margin: 0 -10px; padding: 10px; border-radius: 4px; }
.user-row.is-default { }
.user-row-info { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-row-icon { font-size: 28px; color: #555; flex-shrink: 0; }
.user-row-name { font-size: 13px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-row-username { font-size: 11px; color: #666; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.default-badge { font-size: 9px; background: #444; color: #aaa; padding: 1px 4px; border-radius: 2px; margin-left: 4px; }
.user-row-actions { display: flex; gap: 6px; align-items: center; }
.user-row-actions .user-role-tag { min-width: 60px; text-align: center; font-size: 10px; white-space: nowrap; }
.btn-edit-user { width: 28px; height: 28px; background: transparent; border: 1px solid #333; color: #666; cursor: pointer; border-radius: 4px; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.btn-edit-user:hover { border-color: var(--accent); color: var(--accent); }
.btn-delete-user { width: 28px; height: 28px; background: transparent; border: 1px solid #333; color: #666; cursor: pointer; border-radius: 4px; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.btn-delete-user:hover { border-color: var(--s-retake); color: var(--s-retake); background: rgba(255,69,58,0.1); }

/* 纳品面板 */
.delivery-drop-zone { 
    border: 2px dashed #444; 
    border-radius: 8px; 
    padding: 60px 20px; 
    text-align: center; 
    background: rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}
.delivery-drop-zone.drag-over { 
    border-color: var(--accent); 
    background: rgba(10,132,255,0.1);
}
.delivery-drop-zone p { margin: 8px 0; color: #888; }
#delivery-file-list { 
    background: rgba(0,0,0,0.3); 
    border-radius: 6px; 
    padding: 15px; 
}
#delivery-files-content { 
    font-family: 'JetBrains Mono'; 
    font-size: 11px; 
    color: #aaa; 
}
.delivery-file-item { 
    padding: 6px 10px; 
    border-bottom: 1px solid #222; 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
}
.delivery-file-item:last-child { border-bottom: none; }
.delivery-file-valid { color: var(--s-done); }
.delivery-file-invalid { color: var(--s-retake); }
.delivery-thumb-tag {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0,0,0,0.85);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 9px;
    color: var(--s-ok);
    font-family: 'JetBrains Mono';
    z-index: 3;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(9, 211, 172, 0.3);
    max-width: calc(100% - 12px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

#m-edit-user { position: relative; z-index: 10; }

/* MP4 导入删除按钮 */
.mp4-del-btn {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 14px;
}
.mp4-del-btn:hover {
    background: rgba(255, 69, 58, 0.2);
    color: var(--s-retake);
}
.mp4-item:hover { background: rgba(255,255,255,0.03); }

/* TP 素材高亮 - 卡片模式 */
.card.has-tp {
    position: relative;
}
.card.has-tp::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(47, 158, 68, 0.3), transparent 60%);
    z-index: 0;
    pointer-events: none;
    animation: tp-glow 3s ease-in-out infinite;
}
@keyframes tp-glow {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}
.card.has-tp .badge.tp.on { box-shadow: 0 0 10px var(--s-done); }

/* TP 素材高亮 - 表格模式 */
tr.has-tp { background: rgba(47, 158, 68, 0.06) !important; }
tr.has-tp:hover { background: rgba(47, 158, 68, 0.12) !important; }
tr.has-tp .asset-icon.tp.on { text-shadow: 0 0 8px var(--s-done); }

/* 循环播放按钮 */
#v-loop-icon { 
    cursor: pointer; 
    transition: color 0.2s; 
    margin-left: 10px;
}
#v-loop-icon:hover { color: var(--accent); }
#v-loop-icon.active { color: var(--s-done); }

/* 分镜播放区 */
.ps-storyboard-wrap {
    position: relative;
    background: #000;
    border-radius: 6px;
    overflow: hidden;
    aspect-ratio: 16/9;
}
.ps-storyboard-wrap video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.ps-storyboard-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #444;
    font-size: 12px;
}

/* L10：分镜小窗的"放大"角标 —— 默认半透明，hover 高亮 */
.ps-storyboard-wrap .ps-storyboard-zoom-icon {
    position: absolute; top: 6px; right: 6px;
    width: 26px; height: 26px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border-radius: 5px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    opacity: 0.6; pointer-events: none;
    transition: opacity 0.15s, background 0.15s;
    z-index: 2;
}
.ps-storyboard-wrap:hover .ps-storyboard-zoom-icon {
    opacity: 1;
    background: rgba(244, 191, 36, 0.85);
    color: #111;
}
.ps-storyboard-wrap:hover {
    box-shadow: inset 0 0 0 2px rgba(251, 191, 36, 0.6);
}

/* 刷新按钮旋转动画 */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.spin { animation: spin 1s linear infinite; }

/* 自动播放下一镜头按钮 */
#v-autonext-icon { cursor: pointer; transition: color 0.2s; }

/* ============ Attendance Toggle ============ */
.attendance-toggle {
    display: flex;
    gap: 4px;
    padding: 6px 10px;
    border-top: 1px solid #222;
    margin-top: 6px;
}
.attendance-toggle .att-btn,
.attendance-toggle button {
    flex: 1;
    padding: 4px 0;
    border: 1px solid #333;
    border-radius: 4px;
    background: #1a1a1a;
    color: #aaa;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s;
}
.attendance-toggle button:hover {
    border-color: #555;
    color: #ccc;
}

/* ============ Language Switcher ============ */
.lang-switcher {
    display: flex;
    gap: 2px;
    margin-left: auto;
}
.lang-btn {
    background: transparent;
    border: 1px solid #333;
    color: #666;
    padding: 2px 6px;
    font-size: 10px;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s;
    font-family: 'JetBrains Mono', monospace;
}
.lang-btn:hover { color: #aaa; border-color: #555; }
.lang-btn.active { color: var(--accent); border-color: var(--accent); background: rgba(230,0,18,0.1); }

/* ============ AI Tag ============ */
.msg-type-label.ai { color: #00d4aa; }
.btn-add-inline.ai { border-color: rgba(0, 212, 170, 0.3); color: rgba(0, 212, 170, 0.5); }
.btn-add-inline.ai:hover, .btn-add-inline.ai.active { border-color: #00d4aa; color: #00d4aa; background: rgba(0, 212, 170, 0.1); }
.inline-input-wrap.ai .inline-input:focus { border-color: #00d4aa; }
.inline-input-wrap.ai .inline-send:hover { background: #00d4aa; border-color: #00d4aa; color: #fff; }

/* ============ Archive Improvements ============ */
.archive-divider {
    padding: 10px 15px;
    margin-top: 10px;
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-top: 1px solid #333;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255,255,255,0.02);
}
.archive-divider:hover { color: #ccc; background: rgba(255,255,255,0.05); }
.archive-divider .archive-chev { font-size: 12px; transition: transform 0.2s; }
.archive-count {
    margin-left: auto;
    background: #333;
    color: #888;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
}
.archive-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.archive-list.show {
    max-height: 2000px;
}
.archive-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}
.archive-link {
    color: #555;
    font-size: 13px;
    transition: color 0.2s;
    text-decoration: none;
}
.archive-link:hover {
    color: var(--accent);
}
.archive-del-btn {
    background: none; border: none; color: #444; cursor: pointer; font-size: 12px; padding: 2px 4px; transition: color .15s;
}
.archive-del-btn:hover { color: #f87171; }
.msg-content.ai { border-color: rgba(0, 212, 170, 0.3); color: #88eedd; background: rgba(0, 212, 170, 0.03); }
.card.has-ai { position: relative; }
.card.has-ai .msg-type-label.ai {
    color: #00d4aa;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(0, 212, 170, 0.5);
}
/* Player panel AI styles */
.ps-inline-input-wrap.ai .ps-inline-input:focus { border-color: #00d4aa; }
.ps-inline-input-wrap.ai .ps-inline-send:hover { background: #00d4aa; border-color: #00d4aa; }

/* AI column in table */
.col-ai { background: rgba(0, 212, 170, 0.02); }

/* Duration mismatch warning */
.duration-warn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 700;
    color: #ff4444;
    background: rgba(255, 68, 68, 0.15);
    border: 1px solid rgba(255, 68, 68, 0.4);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    margin-right: 6px;
    cursor: help;
    white-space: nowrap;
    animation: duration-pulse 2s ease-in-out infinite;
}
@keyframes duration-pulse { 0%,100%{opacity:1} 50%{opacity:0.6} }
.duration-warn i { font-size: 11px; }

/* ============ Staff Pill Avatar ============ */
.staff-pill-avatar { width: 16px; height: 16px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.staff-pill-role { font-size: 8px; opacity: 0.6; margin-left: 2px; }
.staff-pill-inner { display: flex; flex-direction: column; line-height: 1.2; }
.staff-pill-name { font-size: 11px; }
.staff-render-status { font-size: 9px; white-space: nowrap; letter-spacing: 0.3px; padding: 1px 4px; border-radius: 2px; margin-top: 1px; }
.staff-render-status.active { color: #fff; background: rgba(37,99,235,0.5); font-weight: 600; }
.staff-render-status.idle { color: #888; background: rgba(255,255,255,0.05); }
.staff-render-status.offline { color: #555; font-style: italic; }
.staff-pill.render-active { border-color: #2563eb !important; box-shadow: 0 0 10px rgba(37,99,235,0.5); opacity: 1 !important; }
.staff-render-status.render-highlight { color: #fff; background: rgba(37,99,235,0.7); font-weight: 700; animation: render-pulse 2s infinite; }
@keyframes render-pulse { 0%,100%{opacity:1} 50%{opacity:0.7} }
.staff-group-label {
    font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
    margin-right: 6px; white-space: nowrap; padding: 2px 10px;
    border-radius: 4px; align-self: center;
    color: #888; background: rgba(255,255,255,0.04); border: 1px solid #333;
}
.staff-group-label.photo { color: #60a5fa; background: rgba(96,165,250,0.08); border-color: rgba(96,165,250,0.25); }
.staff-group-label.prod { color: #4ade80; background: rgba(74,222,128,0.08); border-color: rgba(74,222,128,0.25); }
.staff-group-label.agent-grp { color: #00d4aa; background: rgba(0,212,170,0.08); border-color: rgba(0,212,170,0.25); }
.staff-group-label.leave-grp { color: #fbbf24; background: rgba(251,191,36,0.08); border-color: rgba(251,191,36,0.25); }
/* Role badge in profile */
.role-badge { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
/* role-badge 颜色由 JS 内联样式控制，不在 CSS 硬编码 */
.role-badge.agent { background: rgba(0,212,170,0.15); color: #00d4aa; border: 1px solid rgba(0,212,170,0.3); }
.role-badge { border: 1px solid rgba(255,255,255,0.15); }

/* ============ User Profile Modal ============ */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 300; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.user-profile-card {
    background: #161616; border: 1px solid #333; border-radius: 12px;
    padding: 32px; width: 380px; max-width: 90vw; position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.profile-close { position: absolute; top: 12px; right: 12px; background: none; border: none; color: #666; cursor: pointer; font-size: 16px; }
.profile-close:hover { color: #fff; }
.profile-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.profile-avatar {
    width: 72px; height: 72px; border-radius: 50%; overflow: hidden;
    background: linear-gradient(135deg, #2a2a2a, #111); display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; border: 2px solid #333;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-fallback { font-size: 32px; }
.profile-name { font-size: 22px; font-weight: 700; color: #fff; }
.profile-title { font-size: 13px; margin-top: 4px; }
.profile-level { font-size: 11px; background: linear-gradient(135deg, #4a4a4a, #333); color: #fbbf24; padding: 2px 8px; border-radius: 10px; font-weight: 600; margin-left: 6px; }
.profile-role { font-size: 11px; color: #888; margin-top: 2px; }
.profile-stats {
    display: flex; gap: 16px; padding: 16px 0; border-top: 1px solid #222; border-bottom: 1px solid #222;
    margin-bottom: 16px;
}
.profile-stat { text-align: center; flex: 1; }
.profile-stat-val { display: block; font-size: 20px; font-weight: 700; color: #fff; font-family: 'JetBrains Mono'; }
.profile-stat-label { display: block; font-size: 10px; color: #666; margin-top: 4px; text-transform: uppercase; letter-spacing: 1px; }
/* 称号路线图 */
.profile-titles-road { margin-bottom: 16px; }
.titles-road-label { font-size: 11px; color: #666; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
.titles-road-list { display: flex; flex-direction: column; gap: 6px; max-height: 280px; overflow-y: auto; }
.title-road-item {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px;
    border-radius: 8px; border: 1px solid #222; background: #111; transition: all 0.2s;
}
.title-road-item.current { border-color: #fbbf24; background: rgba(251,191,36,0.06); }
.title-road-item.locked { opacity: 0.55; }
.title-road-icon { font-size: 22px; flex-shrink: 0; width: 32px; text-align: center; }
.title-road-info { flex: 1; min-width: 0; }
.title-road-name { display: block; font-size: 13px; font-weight: 600; }
.title-road-range { display: block; font-size: 10px; color: #555; font-family: 'JetBrains Mono'; margin-top: 1px; }
.title-progress-current { display: block; font-size: 10px; color: #fbbf24; margin-top: 2px; }
.title-progress-locked { display: block; font-size: 10px; color: #555; margin-top: 2px; }
.title-road-check { color: #4ade80; font-size: 14px; flex-shrink: 0; }

.profile-achievements { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-ach { font-size: 11px; padding: 4px 10px; background: #1a1a1a; border: 1px solid #333; border-radius: 20px; color: #ccc; }

/* ============ Delivery Button Blue Style ============ */
#btn-delivery { color: #6ba4ff; border-color: #2563eb; background: rgba(37,99,235,0.1); }
#btn-delivery:hover { background: rgba(37,99,235,0.25); color: #93bbff; }

/* ============ Language Switcher (Top Bar) ============ */
.lang-switcher-nav { display: flex; gap: 2px; margin-left: 6px; border-left: 1px solid #333; padding-left: 8px; }
.lang-nav-btn {
    background: transparent; border: 1px solid #333; color: #555; padding: 3px 8px; font-size: 10px;
    cursor: pointer; border-radius: 4px; transition: all 0.2s; font-family: 'JetBrains Mono', monospace; font-weight: 600;
}
.lang-nav-btn:hover { color: #aaa; border-color: #555; }
.lang-nav-btn.active { color: var(--accent); border-color: var(--accent); background: rgba(230,0,18,0.08); }

/* ============ Render Node Pill ============ */
.staff-pill.render-node { border-style: dashed; opacity: 0.7; }
.staff-pill.render-node.s-working { border-color: #2563eb; background: rgba(37,99,235,0.08); opacity: 1; }
.staff-pill.render-node.s-working .bi { color: #6ba4ff; }

/* ============ Notification Badge ============ */
.notif-badge {
    position: absolute; top: -4px; right: -4px; background: #E60012; color: #fff;
    font-size: 9px; font-weight: 700; padding: 1px 4px; border-radius: 8px; min-width: 14px;
    text-align: center; line-height: 12px; pointer-events: none;
}

/* ============ Dropdown Panels (Notification, Timeline, Dashboard) ============ */
.dropdown-panel {
    position: fixed; right: 12px; top: 88px; z-index: 1000;
    background: #111; border: 1px solid #333; border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,.6); min-width: 360px;
    animation: dp-slide-in .2s ease-out;
}
@keyframes dp-slide-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.dp-header {
    display: flex; align-items: center; gap: 8px; padding: 10px 14px;
    border-bottom: 1px solid #222; font-size: 13px;
}
.dp-title { font-weight: 600; color: #ccc; display: flex; align-items: center; gap: 6px; }
.dp-action {
    margin-left: auto; background: none; border: none; color: #60a5fa; cursor: pointer;
    font-size: 11px; padding: 2px 6px;
}
.dp-action:hover { text-decoration: underline; }
.dp-close {
    background: none; border: none; color: #666; font-size: 18px; cursor: pointer;
    padding: 0 4px; line-height: 1;
}
.dp-close:hover { color: #fff; }
.dp-body { padding: 0; }
.dp-empty { text-align: center; padding: 30px; color: #555; font-size: 13px; }

/* Notification items */
.notif-item {
    display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid #1a1a1a;
    cursor: pointer; transition: background .1s;
}
.notif-item:hover { background: #1a1a1a; }
.notif-item.unread { border-left: 3px solid #E60012; }
.notif-icon { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #1a1a1a; flex-shrink: 0; font-size: 14px; }
.notif-content { flex: 1; min-width: 0; }
.notif-title { font-size: 12px; color: #ccc; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-msg { font-size: 11px; color: #666; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-time { font-size: 10px; color: #444; margin-top: 2px; }

/* Timeline panel */
.timeline-panel { min-width: 500px; max-width: 700px; position: fixed; right: 12px; top: 88px; }
.tl-project { margin-bottom: 16px; }
.tl-project-name { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.tl-project-name i { color: #E60012; }
.tl-episode { margin-bottom: 6px; }
.tl-ep-label { font-size: 11px; color: #888; width: 40px; flex-shrink: 0; text-align: right; }
.tl-ep-row { display: flex; align-items: center; gap: 8px; }
.tl-bar-track { flex: 1; height: 18px; background: #1a1a1a; border-radius: 3px; display: flex; overflow: hidden; position: relative; }
.tl-bar-seg {
    height: 100%; display: flex; align-items: center; justify-content: center;
    font-size: 9px; font-weight: 600; color: rgba(255,255,255,.8); white-space: nowrap;
    transition: width .3s ease;
}
.tl-bar-seg.done { opacity: 1; }
.tl-bar-seg.active { animation: tl-pulse 2s infinite; }
.tl-bar-seg.pending { opacity: 0.3; }
@keyframes tl-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.6; } }
.tl-legend { display: flex; gap: 12px; margin-top: 12px; border-top: 1px solid #222; padding-top: 8px; }
.tl-legend-item { display: flex; align-items: center; gap: 4px; font-size: 10px; color: #888; }
.tl-legend-dot { width: 10px; height: 10px; border-radius: 2px; }
.tl-empty-msg { font-size: 12px; color: #666; text-align: center; padding: 20px; }
.tl-empty-msg i { font-size: 32px; display: block; margin-bottom: 8px; color: #333; }

/* Dashboard overlay (wide panel, sticky to scroll) */
.dashboard-overlay {
    position: fixed; top: 80px; left: 272px; right: 0; z-index: 1000;
    background: #0d0d0d; border: 1px solid #333; border-radius: 0 0 12px 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,.8);
    animation: dp-slide-in .2s ease-out;
}
body.player-active .dashboard-overlay { left: 0; top: 40px; }
@media (max-width: 768px) { .dashboard-overlay { left: 0; top: 40px; } }
.dash-overlay-header {
    display: flex; align-items: center; gap: 8px; padding: 10px 20px;
    border-bottom: 1px solid #222; font-size: 13px;
}
.dash-overlay-body {
    max-height: 55vh; overflow-y: auto; padding: 16px 20px;
    display: flex; flex-direction: column; gap: 16px;
}
.dash-top-row { width: 100%; }
.dash-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .dash-two-col { grid-template-columns: 1fr; } }
.dashboard-panel { min-width: 540px; max-width: 700px; }
.dash-section { margin-bottom: 20px; }
.dash-section-title { font-size: 13px; font-weight: 600; color: #aaa; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.dash-section-title i { color: #E60012; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.dash-card {
    background: #0d0d0d; border: 1px solid #222; border-radius: 8px; padding: 12px;
    text-align: center;
}
.dash-card-value { font-size: 24px; font-weight: 700; color: #fff; }
.dash-card-label { font-size: 11px; color: #666; margin-top: 2px; }
.dash-progress-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; padding: 3px 6px; border-radius: 4px; transition: background .12s; }
.dash-progress-row:hover { background: rgba(255,255,255,0.03); }
.dash-ep-current { background: rgba(251,191,36,0.06); }
.dash-ep-label { font-size: 12px; color: #aaa; width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 0; }
.dash-ep-stat { font-size: 11px; color: #666; width: 36px; text-align: right; flex-shrink: 0; }
.dash-proj-name { font-size: 12px; color: #ccc; width: 80px; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-prog-bar { flex: 1; height: 14px; background: #1a1a1a; border-radius: 3px; overflow: hidden; }
.dash-prog-fill { height: 100%; border-radius: 3px; transition: width .5s ease; display: flex; align-items: center; justify-content: flex-end; padding-right: 4px; font-size: 9px; color: rgba(255,255,255,.8); font-weight: 600; }
/* 堆叠进度条：每集各状态占比 */
.dash-stacked-bar { flex: 1; height: 12px; background: #1a1a1a; border-radius: 3px; overflow: hidden; display: flex; }
.dash-artist-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 12px; border-bottom: 1px solid #1a1a1a; }
.dash-artist-name { color: #ccc; width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-artist-bar { flex: 1; }
.dash-artist-stat { color: #666; font-size: 11px; width: 60px; text-align: right; }
.dash-deadline-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid #1a1a1a; }
.dash-deadline-date { font-size: 12px; font-weight: 600; width: 90px; }
.dash-deadline-proj { font-size: 12px; color: #ccc; }
.dash-deadline-days { font-size: 11px; margin-left: auto; font-weight: 600; }
.dash-deadline-days.overdue { color: #f87171; }
.dash-deadline-days.soon { color: #fbbf24; }
.dash-deadline-days.ok { color: #4ade80; }

/* ============ Mobile Responsive ============ */
@media (max-width: 768px) {
    aside { position: fixed; left: -220px; z-index: 999; transition: left .3s ease; height: 100vh; }
    aside.mobile-open { left: 0; box-shadow: 4px 0 20px rgba(0,0,0,.5); }
    .mobile-menu-btn { display: flex !important; }
    main { margin-left: 0 !important; width: 100vw !important; }
    .nav-row.row-1 { flex-wrap: wrap; gap: 8px; }
    .nav-actions { flex-wrap: wrap; gap: 4px; }
    .proj-info { width: 100%; }
    .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important; gap: 6px !important; padding: 8px !important; }
    .card { min-width: 0 !important; }
    .dropdown-panel { right: 4px; left: 4px; min-width: 0; max-width: none; }
    .timeline-panel, .dashboard-panel { min-width: 0; }
    .lang-switcher-nav { display: none; }
    .stats-row { flex-direction: column; }
    .stat-block { width: 100% !important; }
    #staff-online-row { flex-wrap: wrap; }
    .nav-row.row-3 { flex-wrap: wrap; }
    .filter-item { min-width: 70px; }
    .batch-row-main { flex-wrap: wrap; gap: 4px; }
    .modal { width: 95vw !important; max-height: 90vh; overflow-y: auto; }
    .table-wrap { overflow-x: auto; }
    /* Player modal mobile */
    #player-modal .video-wrap { flex-direction: column !important; }
    #player-modal .video-wrap video { width: 100% !important; }
}

/* ============ Ribbon Filter Buttons ============ */
.ribbon-filter-btn {
    background: #111; border: 1px solid #333; color: #888; padding: 4px 10px; border-radius: 4px;
    font-size: 11px; cursor: pointer; transition: all .15s; white-space: nowrap; display: flex; align-items: center; gap: 3px;
}
.ribbon-filter-btn:hover { border-color: #555; color: #ccc; }
.ribbon-filter-btn#f-priority.active { background: rgba(249,115,22,0.15); border-color: #f97316; color: #f97316; box-shadow: 0 0 6px rgba(249,115,22,0.3); }
.ribbon-filter-btn#f-template.active { background: linear-gradient(90deg, rgba(255,107,107,0.1), rgba(74,222,128,0.1), rgba(167,139,250,0.1)); border-color: #a78bfa; color: #a78bfa; box-shadow: 0 0 6px rgba(167,139,250,0.3); }
.ribbon-filter-btn#f-duration.active { background: rgba(255,68,68,0.15); border-color: #ff4444; color: #ff4444; box-shadow: 0 0 6px rgba(255,68,68,0.3); }

/* ============ Card Ribbon Badges ============ */
.ribbon-badge {
    position: absolute; bottom: 4px; font-size: 12px; font-weight: 700; padding: 4px 12px;
    color: #fff; z-index: 3; cursor: pointer; letter-spacing: 0.5px;
    border-radius: 4px; text-shadow: 0 1px 2px rgba(0,0,0,.5);
}
.ribbon-badge.priority {
    left: 4px; background: #f97316; box-shadow: 0 0 8px rgba(249,115,22,0.5);
}
.ribbon-badge.template {
    left: 4px; bottom: 26px;
    background: linear-gradient(90deg, #ff6b6b, #ffa500, #ffd700, #4ade80, #60a5fa, #a78bfa, #f472b6);
    background-size: 200% 100%;
    animation: title-rainbow 3s linear infinite;
    box-shadow: 0 0 8px rgba(167,139,250,0.5);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    text-shadow: none;
    border: 1px solid rgba(167,139,250,0.4);
    padding: 3px 10px;
}
.ribbon-badge.only-bg {
    right: 4px; bottom: 4px; left: auto; background: #f5c518; color: #000; font-size: 11px; padding: 3px 8px;
}
.ribbon-badge.only-cg {
    right: 4px; bottom: 4px; left: auto; background: #d500f9; font-size: 11px; padding: 3px 8px;
}
.ribbon-badge.only-ai {
    right: 4px; bottom: 4px; left: auto; background: #00d4aa; color: #000; font-size: 11px; padding: 3px 8px;
}
.ribbon-badge.only-ae {
    right: 4px; bottom: 4px; left: auto; background: #be4bdb; font-size: 11px; padding: 3px 8px;
}
.ribbon-badge.lipsync {
    left: 4px; bottom: 50px; background: #f472b6; color: #fff; font-size: 11px; padding: 3px 8px;
    box-shadow: 0 0 8px rgba(244,114,182,0.5); animation: duration-pulse 2s ease-in-out infinite;
}
.ribbon-badge.lipsync-done {
    left: 4px; bottom: 50px; background: #555; color: #aaa; font-size: 10px; padding: 2px 6px;
    animation: none;
}
.ribbon-filter-btn#f-lipsync.active { background: rgba(244,114,182,0.15); border-color: #f472b6; color: #f472b6; box-shadow: 0 0 6px rgba(244,114,182,0.3); }
/* Larger toggle badges for ONLY group */
.badge.only-toggle { font-size: 10px; padding: 3px 8px; }

/* ============ Title Animation Effects ============ */
@keyframes title-rainbow { 0%{background-position:0% 50%} 100%{background-position:200% 50%} }
@keyframes title-fire { 0%,100%{text-shadow:0 0 8px rgba(248,113,113,0.5),0 0 16px rgba(251,191,36,0.3)} 50%{text-shadow:0 0 16px rgba(248,113,113,0.8),0 0 32px rgba(251,191,36,0.5)} }
@keyframes title-glow { 0%,100%{opacity:1} 50%{opacity:0.7} }

/* ============ Custom Scrollbar (dark theme) ============ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #0a0a0a; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #555; }
::-webkit-scrollbar-corner { background: #0a0a0a; }
/* Firefox */
* { scrollbar-width: thin; scrollbar-color: #333 #0a0a0a; }

/* ============ Hide top nav in player/preview mode ============ */
body.player-active .global-top-nav { display: none; }
body.player-active .app-content-wrap { height: 100vh; }
body.display-mode .global-top-nav { display: none; }
body.display-mode .app-content-wrap { height: 100vh; }

/* ============ Asset Browser Modal (TP/BG/CG/AE/AI 弹窗) ============ */
/* 桌面端 overflow:hidden 足够；移动端 iOS Safari 会"穿透"滚动到 body，
   必须 position:fixed + width:100% 把 body 整个钉住，关闭时再恢复 scrollY。
   JS 端 open()/close() 协同写 top 偏移与 scrollTo。 */
body.ab-locked {
    overflow: hidden;
    position: fixed;
    inset: 0;
    width: 100%;
    /* top 由 JS 动态写，保留滚动位置 */
}
/* 模态本身不可选文字（解决 shift 拉文字选区 + filmstrip 标签被选中变红的问题），
   同时拦截手机端 modal 边缘的滑动穿透 */
.ab-modal {
    -webkit-user-select: none;
    user-select: none;
    overscroll-behavior: contain;
}
/* CSV 表格内容仍允许选中复制 */
.ab-csv-table,
.ab-csv-table * {
    -webkit-user-select: text;
    user-select: text;
}
/* 模态内的文字选区淡化（确实选中了也不要刺眼红） */
.ab-modal ::selection {
    background: rgba(255, 138, 0, 0.25);
    color: inherit;
}
/* 模态内可聚焦元素的浏览器默认 outline 全去掉（消除"shift 时红框" 的来源）
   键盘 a11y 用 .active 高亮代替 */
.ab-modal :focus,
.ab-modal :focus-visible,
.ab-filmstrip:focus,
.ab-preview:focus,
.ab-strip-item:focus,
.ab-version-item:focus,
.ab-tab:focus {
    outline: none;
}

.ab-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9000;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    animation: ab-fade-in 0.18s ease-out;
}
@keyframes ab-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
.ab-modal {
    width: 100%; max-width: 1400px;
    height: 100%; max-height: 90vh;
    background: #0d0d0d;
    border: 1px solid #222;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    display: flex; flex-direction: column;
    overflow: hidden;
}

/* ── Header ── */
.ab-header {
    display: flex; align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: #0a0a0a;
    border-bottom: 1px solid #1c1c1c;
    flex-shrink: 0;
}
.ab-title {
    display: flex; align-items: baseline; gap: 10px;
    min-width: 140px;
}
.ab-cut-no {
    font-family: 'JetBrains Mono', monospace;
    font-size: 20px; font-weight: 800;
    color: #fff; letter-spacing: 1px;
}
.ab-cut-scene {
    font-size: 12px; color: #888;
}
.ab-tabs {
    display: flex; gap: 4px;
    margin-left: auto; margin-right: auto;
}
.ab-tab {
    --ab-tab-color: #888;
    background: transparent;
    border: 1px solid #2a2a2a;
    color: #888;
    padding: 6px 18px;
    font-size: 13px; font-weight: 700;
    letter-spacing: 1px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'JetBrains Mono', monospace;
}
.ab-tab:hover {
    color: var(--ab-tab-color);
    border-color: var(--ab-tab-color);
    background: rgba(255, 255, 255, 0.03);
}
.ab-tab.active {
    color: #fff;
    background: var(--ab-tab-color);
    border-color: var(--ab-tab-color);
    box-shadow: 0 2px 12px color-mix(in srgb, var(--ab-tab-color) 40%, transparent);
}
.ab-close {
    background: transparent;
    border: none;
    color: #888;
    font-size: 24px; line-height: 1;
    width: 32px; height: 32px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}
.ab-close:hover {
    background: rgba(255, 69, 58, 0.15);
    color: #ff453a;
}

/* ── Body ── */
.ab-body {
    flex: 1;
    display: flex;
    min-height: 0;
}
.ab-preview {
    flex: 1;
    background: #050505;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    position: relative;
    min-width: 0;
}
.ab-preview .ab-img {
    max-width: 100%; max-height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}
.ab-preview .ab-video {
    max-width: 100%; max-height: 100%;
    background: #000;
}

/* Placeholders（空 / 错误 / aep / 其它格式） */
.ab-placeholder {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 12px;
    color: #555;
    text-align: center;
    padding: 32px;
}
.ab-placeholder i {
    font-size: 56px;
    color: #2a2a2a;
}
.ab-placeholder.ab-err { color: #ff8a00; }
.ab-placeholder.ab-err i { color: #ff8a00; }
.ab-placeholder.ab-empty { color: #666; }
.ab-placeholder.ab-aep i { color: #be4bdb; }
.ab-aep-name {
    color: #ddd; font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    word-break: break-all;
}
.ab-aep-hint { color: #555; font-size: 12px; }
.ab-version-chip {
    display: inline-block;
    padding: 2px 10px;
    background: #be4bdb;
    color: #fff;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px; font-weight: 800;
    letter-spacing: 1px;
}
.ab-other-name {
    color: #ccc; font-weight: 600;
    word-break: break-all;
}
.ab-other-hint { color: #555; font-size: 12px; }
.ab-download-link {
    margin-top: 8px;
    color: #ff8a00;
    border: 1px solid #ff8a00;
    padding: 6px 14px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    transition: all 0.15s;
}
.ab-download-link:hover {
    background: #ff8a00;
    color: #000;
}

.ab-spinner {
    width: 32px; height: 32px;
    border: 3px solid #222;
    border-top-color: #ff8a00;
    border-radius: 50%;
    animation: ab-spin 0.8s linear infinite;
}
@keyframes ab-spin {
    to { transform: rotate(360deg); }
}

/* ── Sidebar（版本列表） ── */
.ab-sidebar {
    width: 280px;
    background: #0a0a0a;
    border-left: 1px solid #1c1c1c;
    display: flex; flex-direction: column;
    flex-shrink: 0;
}
.ab-sidebar-head {
    padding: 10px 14px;
    font-size: 11px; font-weight: 700;
    color: #888;
    letter-spacing: 2px;
    text-transform: uppercase;
    border-bottom: 1px solid #1c1c1c;
    flex-shrink: 0;
}

/* B4：TP/CG 多版本时显示的版本下拉 */
.ab-version-picker {
    padding: 8px 12px;
    background: #0d0d0d;
    border-bottom: 1px solid #1c1c1c;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.ab-version-picker-label {
    font-size: 10px;
    color: #666;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    flex-shrink: 0;
}
.ab-version-select {
    flex: 1;
    background: #1a1a1a;
    color: #fff;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    outline: none;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ab-version-select:hover { border-color: #ff8a00; }
.ab-version-select:focus { border-color: #ff8a00; }
.ab-version-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}
.ab-version-empty {
    padding: 20px;
    color: #555;
    text-align: center;
    font-size: 12px;
}
.ab-version-item {
    padding: 8px 10px;
    margin: 2px 0;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.12s;
}
.ab-version-item:hover {
    background: #141414;
    border-color: #2a2a2a;
}
.ab-version-item.active {
    background: rgba(255, 138, 0, 0.12);
    border-color: #ff8a00;
}
.ab-v-row1 {
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 3px;
}
.ab-v-ver {
    flex-shrink: 0;
    background: #be4bdb;
    color: #fff;
    padding: 1px 6px;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px; font-weight: 800;
    letter-spacing: 0.5px;
}
.ab-v-name {
    flex: 1;
    color: #ddd; font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ab-version-item.active .ab-v-name { color: #fff; }
.ab-v-row2 {
    display: flex; align-items: center; gap: 6px;
    font-size: 10px; color: #666;
    font-family: 'JetBrains Mono', monospace;
}
.ab-v-folder { color: #888; }
.ab-v-mtime { margin-left: auto; }
.ab-v-size { color: #555; }

/* ── Footer ── */
.ab-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 16px;
    background: #0a0a0a;
    border-top: 1px solid #1c1c1c;
    flex-shrink: 0;
    font-size: 11px;
    color: #666;
    font-family: 'JetBrains Mono', monospace;
}
.ab-current-file {
    flex: 1;
    display: flex; gap: 16px;
    min-width: 0;
}
.ab-foot-name {
    color: #ccc; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ab-foot-meta { color: #555; white-space: nowrap; }
.ab-foot-cat {
    flex-shrink: 0;
    padding: 1px 6px;
    background: #ff8a00;
    color: #000;
    border-radius: 3px;
    font-weight: 800;
    font-size: 10px;
    letter-spacing: 0.5px;
}
.ab-hint { color: #444; flex-shrink: 0; }

/* ── 率表徽章（侧栏版本项里） ── */
.ab-v-cat {
    flex-shrink: 0;
    padding: 1px 5px;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.5px;
    line-height: 1.3;
}
.ab-v-cat-0 { background: #ff8a00; color: #000; }   /* 电子率表 CSV */
.ab-v-cat-1 { background: #ffd700; color: #000; }   /* 率表图片 */

/* ── 层条目（A / B / C / Sheet …） ── */
.ab-version-layer .ab-v-icon {
    color: #ff8a00;
    font-size: 13px;
    margin-right: 2px;
}
.ab-version-layer .ab-v-name {
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    letter-spacing: 0.5px;
}
.ab-version-layer .ab-v-frames {
    margin-left: auto;
    background: #2a2a2a;
    color: #888;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    flex-shrink: 0;
}
.ab-version-layer.active .ab-v-frames {
    background: #ff8a00;
    color: #000;
}

/* ── 主预览 + 底部 filmstrip 组合布局 ── */
.ab-preview-stack {
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    min-width: 0; min-height: 0;
}
.ab-preview-main {
    flex: 1; min-height: 0;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    position: relative;
    background: #050505;
}
.ab-preview-main .ab-img,
.ab-preview-main .ab-video {
    max-width: 100%; max-height: 100%;
    object-fit: contain;
}

/* B5：TGA / PSD 后端转码慢时的 loading 覆盖层。
   img-loading class 由 JS 在 img.src 切换时加上，img.onload/onerror 后移除 */
.ab-preview-main { position: relative; }
.ab-img-spinner {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    pointer-events: none;
    z-index: 5;
}
.ab-preview-main.img-loading .ab-img-spinner {
    display: flex;
}
.ab-img-spinner-text {
    color: #ff8a00;
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
}

/* ── filmstrip：水平滚动的小缩略图条 ── */
.ab-filmstrip {
    flex-shrink: 0;
    height: 92px;
    background: #0a0a0a;
    border-top: 1px solid #1c1c1c;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    display: flex;
    gap: 4px;
    padding: 6px 8px;
    scroll-behavior: smooth;
    outline: none;
}
.ab-filmstrip::-webkit-scrollbar { height: 6px; }
.ab-filmstrip::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
.ab-filmstrip::-webkit-scrollbar-thumb:hover { background: #555; }

.ab-strip-item {
    flex: 0 0 auto;
    width: 100px;
    height: 80px;
    background: #141414;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: border-color 0.12s, transform 0.12s;
    display: flex; align-items: center; justify-content: center;
}
.ab-strip-item:hover {
    border-color: #444;
}
.ab-strip-item.active {
    border-color: #ff8a00;
    box-shadow: 0 0 8px rgba(255, 138, 0, 0.4);
}
.ab-strip-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    display: block;
}
.ab-strip-fallback {
    color: #555;
    font-size: 24px;
}
.ab-strip-label {
    position: absolute;
    bottom: 2px; right: 4px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 2px;
    line-height: 1.2;
    pointer-events: none;
}
.ab-strip-item.active .ab-strip-label {
    background: #ff8a00;
    color: #000;
}

/* ── 底部 frame 计数 chip ── */
.ab-foot-frame {
    flex-shrink: 0;
    padding: 1px 6px;
    background: #ff8a00;
    color: #000;
    border-radius: 3px;
    font-weight: 800;
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.5px;
}

/* ── CSV 表格预览 ── */
.ab-csv-wrap {
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    background: #0a0a0a;
}
.ab-csv-toolbar {
    flex-shrink: 0;
    display: flex; align-items: center; gap: 12px;
    padding: 8px 14px;
    background: #111;
    border-bottom: 1px solid #1c1c1c;
    font-size: 11px;
    color: #888;
    font-family: 'JetBrains Mono', monospace;
}
.ab-csv-badge {
    background: #ff8a00;
    color: #000;
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 800;
    font-size: 10px;
    letter-spacing: 0.5px;
}
.ab-csv-info { color: #666; }
.ab-csv-meta {
    color: #555;
    font-size: 10px;
    padding: 1px 6px;
    background: #181818;
    border: 1px solid #2a2a2a;
    border-radius: 3px;
}
.ab-csv-trunc {
    color: #ff8a00;
    font-size: 10px;
    padding: 1px 6px;
    background: rgba(255,138,0,0.1);
    border: 1px solid rgba(255,138,0,0.3);
    border-radius: 3px;
}
.ab-csv-dl {
    margin-left: auto;
    color: #ff8a00;
    text-decoration: none;
    border: 1px solid #444;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    transition: all 0.15s;
}
.ab-csv-dl:hover {
    background: #ff8a00;
    color: #000;
    border-color: #ff8a00;
}
.ab-csv-scroll {
    flex: 1;
    overflow: auto;
}
/* ── 紧凑率表样式：参考纸质率表那种密集排版（每行 18~20px 高，单元格不强行换行） ── */
.ab-csv-table {
    border-collapse: collapse;
    font-family: 'JetBrains Mono', 'Inter', sans-serif;
    font-size: 12px;
    line-height: 1.25;
    color: #ddd;
    width: max-content;
    min-width: 100%;
}
.ab-csv-table th,
.ab-csv-table td {
    padding: 2px 8px;
    border: 1px solid #2a2a2a;
    text-align: left;
    white-space: nowrap;            /* 不强制换行 —— 单元格内容窄时一行显示，宽时横向滚动 */
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
    vertical-align: middle;
    height: 20px;                   /* 固定行高让所有行整齐 */
    line-height: 1.25;
}
.ab-csv-table thead th {
    background: #1a1a1a;
    color: #fff;
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 3;
    border-color: #333;
    padding: 4px 8px;
    height: 24px;
}
/* 第一列（一般是 Frame 编号）粘性显示 —— 横向滚动时帧号不丢 */
.ab-csv-table tbody td:first-child,
.ab-csv-table thead th:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #0d0d0d;
    color: #ffd700;                  /* 帧号金色突出 */
    font-weight: 700;
    border-right: 2px solid #333;
}
.ab-csv-table thead th:first-child {
    z-index: 4;
    background: #1a1a1a;
    color: #ffd700;
}
.ab-csv-table tbody tr:nth-child(even) td {
    background: rgba(255,255,255,0.015);
}
.ab-csv-table tbody tr:nth-child(even) td:first-child {
    background: #111;                /* 偶数行的粘性列也要有底色覆盖滚动内容 */
}
.ab-csv-table tbody tr:hover td {
    background: rgba(255,138,0,0.08);
}
.ab-csv-table tbody tr:hover td:first-child {
    background: rgba(255,138,0,0.15);
}
/* 空单元格淡化（率表里空格非常多） */
.ab-csv-table td:empty {
    background: transparent;
}
.ab-csv-table tbody tr:nth-child(even) td:empty {
    background: rgba(255,255,255,0.01);
}
/* 单元格悬停（看长内容） */
.ab-csv-table td:hover {
    max-width: none;
    overflow: visible;
    white-space: pre-wrap;
    z-index: 5;
    position: relative;
    background: #222 !important;
    box-shadow: 0 0 0 1px #ff8a00;
}

/* 手机端：侧栏堆到下方，主区高度收一点 */
body.is-mobile .ab-overlay { padding: 0; }
body.is-mobile .ab-modal {
    max-height: 100vh;
    border-radius: 0;
}
body.is-mobile .ab-header {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 10px;
}
body.is-mobile .ab-title { order: 1; min-width: auto; }
body.is-mobile .ab-close { order: 2; margin-left: auto; }
body.is-mobile .ab-tabs {
    order: 3;
    width: 100%;
    margin: 0;
    justify-content: space-between;
}
body.is-mobile .ab-tab {
    padding: 6px 10px;
    font-size: 11px;
    flex: 1;
}
body.is-mobile .ab-body { flex-direction: column; }
body.is-mobile .ab-preview { flex: 1; min-height: 0; }
body.is-mobile .ab-sidebar {
    width: 100%;
    max-height: 35vh;
    border-left: none;
    border-top: 1px solid #1c1c1c;
}
body.is-mobile .ab-footer { font-size: 10px; padding: 6px 10px; }
body.is-mobile .ab-hint { display: none; }

/* ============================================================================
 * 审核台 v2（REVIEW）—— 全屏审核：扫 render MOV → 逐卡通过/返修 → 一次性提交
 * ============================================================================ */
.review-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.72);
    z-index: 9000;
    display: flex; align-items: center; justify-content: center;
    padding: 2vh 2vw;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    animation: review-fade-in 0.18s ease-out;
}
@keyframes review-fade-in { from { opacity: 0; } to { opacity: 1; } }
.review-panel {
    width: 80vw; height: 80vh;
    max-width: 1500px; max-height: 900px;
    background: #0e0e0e;
    border: 1px solid #242424;
    border-radius: 14px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.65);
    display: flex; flex-direction: column;
    overflow: hidden;
    animation: review-pop-in 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes review-pop-in { from { opacity: 0; transform: scale(0.97) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
/* 审核台加载转圈 —— 不依赖 ai_studio.css 的 .ais-spinner */
.review-spinner {
    width: 30px; height: 30px;
    border: 3px solid #222; border-top-color: #22d3ee;
    border-radius: 50%;
    animation: review-spin 0.8s linear infinite;
    margin: 0 auto 12px;
}
@keyframes review-spin { to { transform: rotate(360deg); } }
.review-head {
    flex-shrink: 0;
    display: flex; align-items: center; gap: 14px;
    padding: 12px 20px;
    background: #131313;
    border-bottom: 1px solid #222;
}
.review-head-title {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 16px; font-weight: 700; color: #fff;
}
.review-head-ep { font-size: 12px; color: #888; font-weight: 400; margin-left: 6px; }
.review-stats { display: inline-flex; align-items: center; gap: 10px; font-size: 12px; }
.review-stats .rv-stat { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: #1a1a1a; }
.review-stats .rv-stat b { font-variant-numeric: tabular-nums; }
.review-stats .rv-stat.pass   { color: #22d3ee; }
.review-stats .rv-stat.retake { color: #ff453a; }
.review-stats .rv-stat.pending { color: #888; }
.review-bulk-btn, .review-close-btn {
    background: transparent; border: 1px solid #333; color: #aaa;
    padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 12px;
    display: inline-flex; align-items: center; gap: 6px;
    transition: all .15s; font-family: inherit;
}
.review-bulk-btn:hover { border-color: #555; color: #ddd; background: rgba(255,255,255,0.04); }
.review-close-btn { width: 34px; height: 34px; justify-content: center; padding: 0; }
.review-close-btn:hover { border-color: #ff453a; color: #ff453a; }

.review-body { flex: 1; overflow-y: auto; padding: 18px 20px; position: relative; }
.review-loading { text-align: center; color: #888; padding: 80px 0; font-size: 13px; }
.review-empty { text-align: center; color: #888; padding: 80px 0; }
.review-empty p { margin: 12px 0 4px; font-size: 15px; }

/* 旧版本归档提示条 */
.review-old-banner {
    display: flex; align-items: center; gap: 12px;
    background: rgba(251,191,36,0.08);
    border: 1px solid rgba(251,191,36,0.3);
    border-radius: 10px;
    padding: 12px 16px; margin-bottom: 16px;
}
.review-old-banner-text { display: flex; flex-direction: column; gap: 2px; }
.review-old-banner-text > span:first-child { font-size: 13px; color: #fde68a; font-weight: 600; }
.review-old-banner-hint { font-size: 11px; color: #9a8a5a; }
.review-old-banner-btn {
    background: #fbbf24; border: 1px solid #fbbf24; color: #2a2206;
    padding: 8px 16px; border-radius: 7px; cursor: pointer;
    font-size: 12px; font-weight: 700; font-family: inherit;
    display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
    transition: background .15s;
}
.review-old-banner-btn:hover { background: #fcd34d; }
.review-old-banner-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 旧版本卡片标记 */
.rv-card.is-old { opacity: 0.78; }
.rv-card.is-old .rv-card-thumb::after {
    content: '旧版本'; position: absolute; top: 8px; left: 8px;
    background: rgba(251,191,36,0.92); color: #2a2206;
    font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 4px;
    z-index: 2;
}
.rv-card-version {
    font-size: 9px; padding: 1px 6px; border-radius: 4px;
    background: rgba(96,165,250,0.16); color: #93c5fd; font-weight: 700;
}
.rv-card.is-old .rv-card-version { background: rgba(251,191,36,0.18); color: #fde68a; }

.review-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
}

.rv-card {
    background: #161616;
    border: 2px solid #262626;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color .15s, box-shadow .15s, transform .1s;
    display: flex; flex-direction: column;
}
.rv-card.dec-pass   { border-color: #22d3ee; box-shadow: 0 0 0 1px rgba(34,211,238,0.4); }
.rv-card.dec-retake { border-color: #ff453a; box-shadow: 0 0 0 1px rgba(255,69,58,0.4); }
.rv-card-thumb {
    width: 100%; aspect-ratio: 16/9; background: #000;
    position: relative; cursor: pointer;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.rv-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rv-card-thumb .rv-no-thumb { color: #444; font-size: 28px; }
.rv-card-thumb .rv-play-hint {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.0); opacity: 0; transition: opacity .15s; color: #fff; font-size: 28px;
    pointer-events: none;
}
.rv-card-thumb:hover .rv-play-hint { opacity: 1; background: rgba(0,0,0,0.35); }
.rv-card-decbadge {
    position: absolute; top: 8px; right: 8px;
    width: 26px; height: 26px; border-radius: 50%;
    display: none; align-items: center; justify-content: center;
    font-size: 14px; color: #fff;
}
.rv-card.dec-pass   .rv-card-decbadge { display: flex; background: #22d3ee; }
.rv-card.dec-retake .rv-card-decbadge { display: flex; background: #ff453a; }

.rv-card-body { padding: 8px 10px; display: flex; flex-direction: column; gap: 7px; }
.rv-card-row1 { display: flex; align-items: center; gap: 8px; }
.rv-card-cut { font-size: 15px; font-weight: 700; color: #fff; }
.rv-card-status {
    font-size: 9px; padding: 1px 7px; border-radius: 4px;
    background: #222; color: #999; text-transform: uppercase;
}
.rv-card-file { font-size: 10px; color: #666; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-card-unmatched { font-size: 10px; color: #ff9f0a; display: inline-flex; align-items: center; gap: 3px; }

.rv-card-actions { display: flex; gap: 6px; }
.rv-act-btn {
    flex: 1; padding: 6px 0; border-radius: 6px; cursor: pointer; font-size: 12px;
    border: 1px solid #333; background: #1a1a1a; color: #aaa;
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    transition: all .12s; font-family: inherit; font-weight: 600;
}
.rv-act-btn.pass:hover   { border-color: #22d3ee; color: #22d3ee; }
.rv-act-btn.retake:hover { border-color: #ff453a; color: #ff453a; }
.rv-card.dec-pass   .rv-act-btn.pass   { background: #22d3ee; color: #06222a; border-color: #22d3ee; }
.rv-card.dec-retake .rv-act-btn.retake { background: #ff453a; color: #2a0606; border-color: #ff453a; }

.rv-card-retake-input { display: none; }
.rv-card.dec-retake .rv-card-retake-input { display: block; }
.rv-card-retake-input textarea {
    width: 100%; box-sizing: border-box; resize: vertical; min-height: 44px;
    background: #0f0f0f; border: 1px solid #3a1a1a; border-radius: 6px;
    color: #ffb3ac; font-size: 11px; padding: 6px 8px; font-family: inherit; line-height: 1.4;
}
.rv-card-retake-input textarea:focus { outline: none; border-color: #ff453a; }
.rv-card-retake-input textarea::placeholder { color: #774; }

.review-foot {
    flex-shrink: 0; display: flex; align-items: center; gap: 12px;
    padding: 12px 20px; background: #131313; border-top: 1px solid #222;
}
.review-foot-summary { font-size: 12px; color: #888; }
.review-cancel-btn {
    background: transparent; border: 1px solid #333; color: #aaa;
    padding: 9px 18px; border-radius: 7px; cursor: pointer; font-size: 13px; font-family: inherit;
}
.review-cancel-btn:hover { border-color: #555; color: #ddd; }
.review-submit-btn {
    background: #22d3ee; border: 1px solid #22d3ee; color: #06222a;
    padding: 9px 22px; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 700;
    display: inline-flex; align-items: center; gap: 7px; font-family: inherit;
    transition: all .15s;
}
.review-submit-btn:hover:not(:disabled) { background: #4be0f5; }
.review-submit-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* 审核模式下播放器要盖在审核台（z-index 9000）之上 */
body.review-mode #player-modal { z-index: 9100; }

/* 播放器内的审核控制条 */
.player-review-bar {
    position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
    display: none; align-items: center; gap: 8px;
    background: rgba(20,20,20,0.94); border: 1px solid #333;
    border-radius: 999px; padding: 8px 12px; z-index: 60;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
}
body.review-mode .player-review-bar { display: flex; }
.player-review-bar .prb-label { font-size: 12px; color: #888; margin-right: 4px; }
.player-review-bar button {
    border: 1px solid #444; background: #222; color: #ccc;
    padding: 7px 16px; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 600;
    display: inline-flex; align-items: center; gap: 6px; font-family: inherit; transition: all .12s;
}
.player-review-bar button.prb-pass.active   { background: #22d3ee; color: #06222a; border-color: #22d3ee; }
.player-review-bar button.prb-retake.active { background: #ff453a; color: #2a0606; border-color: #ff453a; }
.player-review-bar button.prb-pass:hover   { border-color: #22d3ee; color: #22d3ee; }
.player-review-bar button.prb-retake:hover { border-color: #ff453a; color: #ff453a; }
.player-review-bar button.active:hover { color: inherit; }
.player-review-bar .prb-retake-input {
    display: none; width: 220px; background: #0f0f0f; border: 1px solid #3a1a1a;
    border-radius: 999px; color: #ffb3ac; font-size: 12px; padding: 7px 14px; font-family: inherit;
}
.player-review-bar.show-retake-input .prb-retake-input { display: inline-block; }

@media (prefers-reduced-motion: reduce) {
    .rv-card, .rv-card-thumb .rv-play-hint, .rv-act-btn, .review-submit-btn { transition: none !important; }
    .review-overlay, .review-panel { animation: none !important; }
    /* spinner 仍保留转圈 —— 它是"加载中"的功能性指示，不属于装饰性动效 */
}

/* ============ 纳品 v2：Roll 文件夹列表 ============ */
.dlv-roll {
    border: 1px solid #262626; border-radius: 8px;
    background: #141414; overflow: hidden;
    transition: border-color .12s;
}
.dlv-roll.is-checked { border-color: #0a84ff; box-shadow: 0 0 0 1px rgba(10,132,255,0.4); }
.dlv-roll.is-delivered { opacity: 0.72; }
.dlv-roll-head {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; cursor: pointer;
}
.dlv-roll.is-delivered .dlv-roll-head { cursor: default; }
.dlv-check { font-size: 18px; color: #0a84ff; flex-shrink: 0; width: 20px; text-align: center; }
.dlv-check.disabled { color: #444; }
.dlv-roll-info { flex: 1; min-width: 0; }
.dlv-roll-name {
    font-size: 13px; font-weight: 600; color: #eee;
    display: flex; align-items: center; gap: 6px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dlv-roll-meta { font-size: 11px; color: #888; margin-top: 2px; display: flex; align-items: center; gap: 8px; }
.dlv-badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 10px; font-weight: 600; }
.dlv-badge.delivered { background: rgba(74,222,128,0.14); color: #4ade80; }
.dlv-badge.missing { background: rgba(251,191,36,0.14); color: #fbbf24; }
.dlv-roll-toggle {
    background: transparent; border: 1px solid #333; color: #888;
    width: 26px; height: 26px; border-radius: 5px; cursor: pointer; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
}
.dlv-roll-toggle:hover { border-color: #555; color: #ccc; }
.dlv-roll-files { padding: 4px 12px 10px 42px; border-top: 1px solid #1f1f1f; background: #0e0e0e; }
.dlv-file-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 11px; }
.dlv-file-cut { font-weight: 700; color: #fff; min-width: 42px; }
.dlv-file-ver { background: rgba(96,165,250,0.16); color: #93c5fd; padding: 0 6px; border-radius: 4px; font-size: 9px; font-weight: 700; }
.dlv-file-name { color: #777; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
