/* ============================================
   manju.css — 漫剧管理系统迁移适配层样式
   （补充原 style.css 中由 Jinja 控制的部分）
   ============================================ */

/* 权限控制：默认显示，无权限时由 JS 给 body 加类隐藏 */
.no-edit .editor-only,
.no-delete .deleter-only,
.no-upload .uploader-only,
.no-download .download-only,
.no-admin .admin-only,
.no-file-remove .file-remove-only {
    display: none !important;
}

/* 镜头树折叠 */
.tree-root { list-style: none; padding-left: 20px; }
.tree-node { margin: 4px 0; }
.node-label { cursor: pointer; display: flex; align-items: center; padding: 4px 8px; border-radius: 4px; }
.node-label:hover { background: rgba(108, 92, 231, 0.08); }
.toggle-icon { display: inline-block; width: 16px; transition: transform 0.15s; }
.tree-node > .tree-root { display: block !important; }
.tree-node.collapsed > .tree-root { display: none !important; }
.tree-node.collapsed > .node-label .toggle-icon { transform: rotate(-90deg); }
.node-label a.shot-link, .node-label a[onclick] { cursor: pointer; }

/* 批量关联弹窗资产网格 */
#blGrid { max-height: 380px; overflow: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 6px; }
.bl-asset-card { cursor: pointer; text-align: center; background: #2a3145; border-radius: 6px; padding: 4px; position: relative; border: 1px solid transparent; }
.bl-asset-card.linked { background: #1e3a2a; border-color: #22c55e; }
.bl-asset-card .linked-tag { position: absolute; top: 2px; right: 4px; font-size: 10px; color: #22c55e; z-index: 2; }
.bl-asset-card img { width: 100%; height: 80px; object-fit: cover; border-radius: 4px; background: #000; }
.bl-asset-card .name { font-size: 11px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 资产网格（资产页）——与源系统排版一致：卡片最小 220px、间距 20px */
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }

/* 图片悬停放大（资产页） */
.asset-card img { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.asset-card img:hover { transform: scale(1.05); box-shadow: 0 0 20px rgba(108, 92, 231, 0.6); z-index: 10; position: relative; }
.group-header { cursor: pointer; user-select: none; }
.group-header .edit-group { cursor: pointer; opacity: 0.5; transition: opacity 0.2s; font-size: 0.9rem; margin-left: 8px; color: #aaddff; }
.group-header .edit-group:hover { opacity: 1; }

/* 镜头详情页（shot.html）专用 */
.se-wrap { padding: 20px; max-width: 1600px; margin: 0 auto; }
.se-topbar { display: flex; justify-content: space-between; align-items: center; padding: 8px 0 20px 0; }
.se-topbar h3 { color: #fff; margin: 0; font-weight: 500; letter-spacing: 2px; }
.se-back { background: #2a3348; color: #cfd6e4; border: none; border-radius: 8px; padding: 8px 18px; font-size: 0.9rem; text-decoration: none; }
.se-back:hover { background: #3a4560; color: #fff; }
.se-edit-btn { background: #2a3348; color: #cfd6e4; border: none; border-radius: 8px; padding: 8px 22px; }
.se-save-btn { background: #7c5cff; color: #fff; border: none; border-radius: 8px; padding: 8px 22px; }
.se-save-btn:hover { background: #6a4ce6; }
.se-card { background: #1b2233; border-radius: 16px; padding: 22px 26px; margin-bottom: 20px; border: 1px solid rgba(255, 255, 255, 0.03); }
.se-card h5 { color: #e8ecf3; font-weight: 500; margin-bottom: 16px; font-size: 1.05rem; }
.se-meta-row { display: flex; gap: 40px; flex-wrap: wrap; color: #8a93a6; font-size: 0.9rem; }
.se-meta-row b { color: #e8ecf3; font-weight: 500; margin-left: 8px; }
.se-meta-row input, .se-meta-row select { background: transparent; border: none; color: #fff; }
#scriptTextArea { width: 100%; min-height: 340px; background: transparent; border: none; color: #c8cfdd; font-size: 1rem; line-height: 1.9; resize: vertical; outline: none; }
#scriptTextArea:focus { box-shadow: none; }
#scriptTextArea[readonly] { background-color: rgba(15, 20, 28, 0.45) !important; color: #7d8590 !important; cursor: not-allowed; }
.se-actions { display: flex; gap: 12px; margin-top: 16px; }
.se-copy { background: linear-gradient(135deg, #22d3ee, #06b6d4); color: #fff; border: none; border-radius: 24px; padding: 10px 22px; font-size: 0.9rem; }
.se-add { background: #2a3348; color: #cfd6e4; border: none; border-radius: 24px; padding: 10px 22px; }
.se-row4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.se-asset-card { background: #1b2233; border-radius: 14px; padding: 16px; border: 1px solid rgba(255, 255, 255, 0.03); }
.se-asset-card .hd { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.se-asset-card .hd h6 { color: #e8ecf3; margin: 0; font-weight: 500; font-size: 0.95rem; }
.se-asset-card .num { background: #7c5cff; color: #fff; width: 22px; height: 22px; border-radius: 50%; display: inline-block; text-align: center; line-height: 22px; font-size: 0.75rem; }
.se-thumbs { display: flex; gap: 8px; flex-wrap: wrap; min-height: 90px; align-items: center; }
.se-thumbs img { width: 120px; height: 120px; object-fit: cover; border-radius: 8px; cursor: pointer; }
.se-thumbs .empty { color: #5a6376; font-size: 0.8rem; }
.se-upload-video { border: 2px dashed #3a4560; border-radius: 10px; padding: 20px; text-align: center; color: #22d3ee; cursor: pointer; width: 100%; }
.se-upload-video:hover { background: rgba(34, 211, 238, 0.05); }
#uploadProgress { display: none; margin-top: 10px; }
#uploadBar { background: linear-gradient(90deg, #22d3ee, #7c5cff); height: 100%; width: 0%; transition: width 0.2s; }

/* 只读态输入框 */
#shot-info input[readonly], #shot-info select:disabled, #scriptTextArea[readonly] {
    background-color: rgba(15, 20, 28, 0.45) !important;
    color: #7d8590 !important;
    cursor: not-allowed;
}

/* 响应式 */
@media (max-width: 768px) {
    .btn-toolbar, .d-flex.gap-2, .d-flex.gap-3 { flex-wrap: wrap !important; }
    .btn { padding: .35rem .6rem; font-size: .85rem; }
    .table-responsive { display: block; width: 100%; overflow-x: auto; }
    .card-body { padding: .6rem; }
    .modal-dialog { margin: .5rem; }
    .navbar-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
    .navbar-nav .nav-link { padding: .25rem .5rem; }
}
@media (max-width: 992px) { .se-row4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) {
    h5.card-title { font-size: .95rem; }
    .btn-group-sm > .btn, .btn-sm { padding: .25rem .5rem; font-size: .78rem; }
}

/* ============ 员工管理页 ============ */
.perm-group-box { display: flex; flex-direction: column; gap: 10px; max-height: 72vh; overflow-y: auto; padding-right: 4px; }
.perm-group { border: 1px solid rgba(108, 92, 231, .18); border-radius: 8px; padding: 10px 14px; background: rgba(108, 92, 231, .03); }
.perm-group-title { font-size: .88rem; font-weight: 600; color: #6c5ce7; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px dashed rgba(108, 92, 231, .2); }
.perm-group-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 10px; }
.perm-check { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: #c8cfdd; cursor: pointer; padding: 6px 8px; border-radius: 6px; transition: background .15s; }
.perm-check:hover { background: rgba(108, 92, 231, .08); }
.perm-check input { accent-color: #6c5ce7; width: 16px; height: 16px; flex-shrink: 0; }
.perm-badge { display: inline-block; padding: 2px 8px; margin: 2px 3px 2px 0; border-radius: 999px; font-size: .74rem; background: rgba(108, 92, 231, .1); color: #5b4fd0; border: 1px solid rgba(108, 92, 231, .25); white-space: nowrap; }
.perm-badge-ellipsis { color: #94a3b8; font-size: .74rem; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.status-enabled { background: #22c55e; }
.status-disabled { background: #ef4444; }

/* ============ 弹窗（modal）深色化：全站统一（新建分组/新增员工/新建影片等） ============ */
.modal-content {
    background-color: #1a1f2e;
    color: #e8ecf3;
    border: 1px solid #2a3145;
    border-radius: 14px;
}
.modal-header, .modal-footer { border-color: #2a3145; }
.modal-title, .modal-body { color: #e8ecf3; }
.modal-body .form-label { color: #c8cfdd; }
.modal-body .form-text, .modal-body .text-muted, .modal-body small.text-muted { color: #8a93a6 !important; }
.modal-header .btn-close:not(.btn-close-white) {
    filter: invert(1) grayscale(1) brightness(2);
    opacity: .8;
}
.modal-header .btn-close:not(.btn-close-white):hover { opacity: 1; }
.modal-body hr { border-color: #2a3145; opacity: .5; }

/* ============ Bootstrap 原生卡片/表格深色化（员工管理等页面） ============ */
.card {
    background-color: #161b22;
    color: #e6edf3;
    border-color: #30363d;
}
.card .card-body { color: #e6edf3; }
.table {
    --bs-table-bg: transparent;
    --bs-table-color: #e6edf3;
    --bs-table-border-color: #30363d;
    --bs-table-striped-bg: rgba(255,255,255,0.02);
    --bs-table-hover-bg: rgba(108,92,231,0.08);
    color: #e6edf3;
    background-color: transparent;
}
.table > :not(caption) > * > * {
    background-color: transparent;
    color: #e6edf3;
    box-shadow: none;
}
.table thead th { color: #8b949e; font-weight: 600; }
.table td, .table th { border-color: #30363d; }
.table-hover > tbody > tr:hover > * {
    background-color: rgba(108, 92, 231, 0.08);
    color: #fff;
}
