/*
 * AI漫剧开发系统 补充样式（不改参考项目 style.css）
 */

/* ===== 生成中遮罩层：期间页面无法点击 ===== */
.busy-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(44, 62, 80, 0.82);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.busy-overlay.show {
    display: flex;
}

.busy-box {
    text-align: center;
    font-size: 1.15rem;
    max-width: 420px;
    padding: 20px;
}

.busy-box i {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

/* ===== 三视图 / 首帧缩略图 ===== */
.view-thumb {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    display: block;
    background: #fff;
}

.view-empty {
    width: 90px;
    height: 90px;
    border: 1px dashed var(--border-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    background: var(--light-bg);
}

.view-empty i {
    font-size: 1.6rem;
}

/* ===== 生成状态 ===== */
.status-generating {
    color: var(--warning-color);
    font-weight: 600;
}

.status-error {
    color: var(--accent-color);
    font-weight: 600;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}

/* ===== 选择三视图的带图选项（首帧生成页） ===== */
.img-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all var(--transition-speed);
    background: #fff;
}

.img-option:hover {
    border-color: var(--primary-color);
}

.img-option img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.img-option .img-option-info {
    flex: 1;
    overflow: hidden;
}

.img-option input {
    flex-shrink: 0;
}

/* ===== 音色试听 ===== */
.audio-mini {
    height: 32px;
    vertical-align: middle;
    max-width: 260px;
}

/* ===== 中间大按钮（自动识别） ===== */
.center-action {
    text-align: center;
    padding: 50px 0;
}

.center-action .btn-big {
    padding: 15px 40px;
    font-size: 1.1rem;
    border-radius: 8px;
}

.center-action p {
    color: #6c757d;
    margin-bottom: 20px;
}

/* ===== 分镜视频展示 ===== */
.video-show {
    max-width: 320px;
    width: 100%;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    display: block;
}

.frame-show {
    max-width: 320px;
    width: 100%;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    display: block;
}

/* ===== 长文本单元格 ===== */
.td-clip {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== 分镜脚本单元格：两行摘要 + 景别/字数小字 =====
   分镜脚本按 300~500 字生成，一行截断看不出动作与情绪，
   容易让用户误以为「还是只有几十字」。这里给两行 + 参数行。 */
.td-script {
    max-width: 440px;
    cursor: pointer;
}
.td-script .sb-brief {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.55;
    word-break: break-word;
}
.td-script .sb-sub {
    font-size: 11px;
    color: #8a94a6;
    margin-top: 2px;
    white-space: nowrap;
}
.td-script .sb-sub.sb-short {
    color: #c2410c;
    font-weight: 600;
}

/* ===== 分镜详情：十列参数条 + 脚本文本 ===== */
.sb-count {
    font-size: 12px;
    font-weight: normal;
    color: #8a94a6;
    margin-left: 6px;
}
.sb-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0 14px;
}
.sb-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f3f5f9;
    border: 1px solid var(--border-color);
    font-size: 12px;
    color: #3d4757;
    max-width: 100%;
}
.sb-chip b {
    color: #8a94a6;
    font-weight: normal;
}
.sb-full {
    white-space: pre-wrap;
    line-height: 1.9;
    font-size: 14px;
    color: #2b3441;
}
.sb-line {
    margin-top: 12px;
    padding: 8px 12px;
    background: #f8f9fc;
    border-left: 3px solid var(--primary-color);
    font-size: 13px;
    color: #3d4757;
    line-height: 1.7;
}
.sb-line b {
    display: inline-block;
    min-width: 42px;
    color: #8a94a6;
    font-weight: normal;
    margin-right: 6px;
}

/* ===== 提交按钮间距 ===== */
.btn-gap {
    margin-right: 10px;
}

/* ===== 操作列修复：按钮单元格保持表格单元格布局（不被参考样式的 flex 拽出表格） ===== */
td.action-buttons {
    display: table-cell !important;
    white-space: nowrap;
    text-align: right;
    vertical-align: middle;
    overflow: visible;
    text-overflow: clip;
}
td.action-buttons form {
    display: inline-block;
    margin: 0;
}
td.action-buttons button,
td.action-buttons a {
    display: inline-block;
    vertical-align: middle;
    margin-left: 6px;
}

/* ===== 勾选列：固定宽度，不被压缩出省略号 =====
   只作用于带 .check-table 的表格，避免把音色/项目/通讯录的首列也压成 46px */
.check-table th:first-child,
.check-table td:first-child {
    width: 46px;
    min-width: 46px;
    max-width: 46px;
    text-align: center;
    padding-left: 8px;
    padding-right: 8px;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
}
.check-table th:first-child input,
.check-table td:first-child input {
    margin: 0;
}

/* ===== 首帧参考图库 ===== */
.ref-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.ref-gallery .img-option {
    width: 200px;
    margin-bottom: 0;
    flex-direction: column;
    align-items: flex-start;
}
.ref-gallery .img-option img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    flex-shrink: 0;
}
/* 主参考图卡片（场景图 / 首帧图 二选一）：去掉纵向 flex 撑高造成的空白 */
.ref-gallery .img-option.main-card {
    position: relative;
    padding: 6px;
    gap: 6px;
}
.ref-gallery .img-option.main-card input[type="radio"] {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 18px;
    height: 18px;
    margin: 0;
    z-index: 2;
    accent-color: var(--primary-color);
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}
.ref-gallery .img-option.main-card .img-option-info {
    width: 100%;
    font-size: 0.85rem;
    line-height: 1.5;
}
/* 角色卡片：复选框同样浮在图上，避免占位把卡片撑高 */
.ref-gallery .img-option.ref-card {
    position: relative;
    padding: 6px;
    gap: 6px;
}
.ref-gallery .img-option.ref-card input[type="checkbox"] {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 18px;
    height: 18px;
    margin: 0;
    z-index: 2;
    accent-color: var(--primary-color);
}
.ref-gallery .img-option.ref-card .img-option-info {
    width: 100%;
    font-size: 0.85rem;
    line-height: 1.5;
}
.ref-card.selected {
    border-color: var(--primary-color);
    background: rgba(52, 152, 219, 0.08);
}
.ref-tag {
    display: inline-block;
    margin-left: 6px;
    font-size: 0.75rem;
    color: #6c757d;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1px 8px;
}
.ref-strip {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.ref-chip {
    cursor: pointer;
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 4px 12px;
    font-size: 0.85rem;
}
.ref-chip:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ===== 多用户：角色标签、通讯录操作区 ===== */
.role-badge {
    display: inline-block;
    margin-left: 8px;
    font-size: 0.68rem;
    font-style: normal;
    line-height: 1;
    padding: 3px 7px;
    border-radius: 9px;
    vertical-align: middle;
}
.role-admin { background: rgba(52, 152, 219, 0.18); color: #1b6f9c; }
.role-user { background: rgba(108, 117, 125, 0.16); color: #55606a; }
/* 侧边栏是深色底，徽标改用半透明白 */
.menu-item .role-badge {
    background: rgba(255, 255, 255, 0.16);
    color: #eaf3fa;
    vertical-align: middle;
    font-size: 0.66rem;
    padding: 2px 6px;
}
.menu-item .role-badge.role-admin { color: #cfe9fb; background: rgba(52, 152, 219, 0.35); }

.role-tag {
    display: inline-block;
    font-size: 0.78rem;
    line-height: 1.5;
    padding: 2px 9px;
    border-radius: 10px;
    white-space: nowrap;
    vertical-align: middle;
}
.name-cell { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.name-cell .role-tag { margin: 0; }
.role-tag-admin { background: rgba(52, 152, 219, 0.14); color: #1b6f9c; border: 1px solid rgba(52, 152, 219, 0.35); }
.role-tag-user { background: #f1f3f5; color: #5a646e; border: 1px solid var(--border-color); }
.role-tag-self { background: #fff6e5; color: #a1701d; border: 1px solid #f0d9a8; }

.btn.btn-xs {
    padding: 5px 10px;
    font-size: 0.78rem;
    line-height: 1.2;
    border: none;
    cursor: pointer;
    border-radius: 4px;
}
.btn-danger {
    background-color: var(--accent-color);
    color: #fff;
}
.btn-danger:hover { background-color: #c0392b; }

.input-mini {
    width: 124px;
    height: 30px;
    padding: 2px 8px;
    font-size: 0.82rem;
}

.op-cell { vertical-align: top; }
.op-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.op-row:last-child { margin-bottom: 0; }
.op-row form { margin: 0; }
.muted-tip { color: #adb5bd; }

.danger-check {
    font-size: 0.78rem;
    color: #a33;
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    white-space: nowrap;
}

.tip-box {
    background: #f4f8fc;
    border-left: 4px solid #7fb3e0;
    padding: 10px 14px;
    margin: 4px 0 14px 0;
    font-size: 0.88rem;
    color: #3a4a5a;
    line-height: 1.8;
}

/* ===== 我的账号信息（普通用户通讯录） ===== */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px 18px;
}
.profile-item {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px 14px;
}
.profile-item .k {
    display: block;
    font-size: 0.78rem;
    color: #6c757d;
    margin-bottom: 4px;
}
.profile-item .v {
    font-size: 0.95rem;
    color: #2c3e50;
    word-break: break-all;
}

/* 任务失败原因摘要：显示在「生成失败」下方，完整信息见 title */
.err-brief {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.35;
    color: #b45309;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 4px;
    padding: 2px 6px;
    word-break: break-all;
    cursor: help;
}

/* 分镜视频列表的「视频状态」列：失败时要能放下两行（状态 + 原因摘要） */
.td-video-status {
    width: 240px;
    min-width: 240px;
    max-width: 240px;
}
.td-frame { width: 110px; min-width: 110px; }
.td-op { width: 90px; min-width: 90px; }

/* ================================================================
   分镜视频列表：批量生成提示词
   ================================================================ */
.batch-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 10px 12px;
    margin-bottom: 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
}
.batch-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-weight: 600;
    color: #343a40;
    cursor: pointer;
    white-space: nowrap;
}
.batch-count {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
}
.batch-tip {
    color: #6c757d;
    font-size: 12px;
    line-height: 1.5;
    flex: 1;
    min-width: 220px;
}
.batch-tip code {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    padding: 0 4px;
    color: #d63384;
    font-size: 11px;
}
.btn.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}
.btn:disabled,
.btn.disabled {
    opacity: .5;
    cursor: not-allowed;
}
.td-check { text-align: center; }
.td-prompt { width: 130px; }
.prompt-brief {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.35;
    color: #6c757d;
    cursor: help;
}
.check-table td { vertical-align: middle; }

/* 提示词占位符对照表（gen.php） */
.pic-map {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    align-items: center;
    padding: 8px 10px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 12px;
}
.pic-map-title { font-weight: 600; color: #495057; }
.pic-map-item { color: #495057; white-space: nowrap; }
.pic-map-item code {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    padding: 0 4px;
    color: #d63384;
    font-size: 11px;
}
.prompt-hint { color: #6c757d; font-size: 12px; margin-top: 6px; line-height: 1.6; }
.prompt-hint code {
    background: #f1f3f5;
    border-radius: 3px;
    padding: 0 4px;
    color: #d63384;
}

/* 参考图卡片上的占位符编号（与提示词里的 <pictureN>/<audioN> 一一对应） */
.pic-no {
    display: inline-block;
    margin: 0 4px 4px 0;
    padding: 0 5px;
    background: #fff0f6;
    border: 1px solid #f3c6e2;
    border-radius: 3px;
    color: #d63384;
    font-size: 11px;
    line-height: 16px;
    font-family: Menlo, Consolas, monospace;
}
.pic-no.audio-no {
    background: #eaf1ff;
    border-color: #bcd0f5;
    color: #2563eb;
}
/* ===== 提示词标识四类配色（静态展示区，textarea 为纯文本不适用）=====
   picture 玫红 / audio 蓝 / Subject·(S) 紫 / <d>[Chinese]…</d> 黄橙 */
.tok-pic, .pic-map-item code.tok-pic, .prompt-hint code.tok-pic { color: #d63384 !important; }
.tok-audio, .pic-map-item code.tok-audio, .prompt-hint code.tok-audio { color: #2563eb !important; }
.tok-subject, .pic-map-item code.tok-subject, .prompt-hint code.tok-subject { color: #8b5cf6 !important; }
.tok-dialogue, .pic-map-item code.tok-dialogue, .prompt-hint code.tok-dialogue { color: #d97706 !important; }
.ref-chip .tok-pic, .ref-chip .tok-audio { font-family: Menlo, Consolas, monospace; font-weight: 600; }
.prompt-warn {
    margin: 0 0 8px;
    padding: 6px 10px;
    background: #fff8e6;
    border: 1px solid #ffe1a8;
    border-radius: 6px;
    color: #8a5a00;
    font-size: 12px;
    line-height: 1.6;
}

/* 时长列（分镜列表）：显示这条分镜会用几秒出片，以及秒数来源 */
.td-dur { width: 62px; min-width: 62px; text-align: center; }
.dur-val { font-size: 13px; font-weight: 600; color: #212529; }
.dur-src { font-size: 11px; color: #adb5bd; margin-top: 1px; }

/* ===== 集数导航（分镜视频列表：一集一页） =====
   集多时横向滚动而不是折行：折行会把表格挤下去，翻集时整页跳动很难受 */
/* ===== 集数导航（分镜视频列表：一集一页） =====
   集多时横向滚动而不是折行：折行会把表格挤下去，翻集时整页跳动很难受。
   视觉上刻意做成「一排轻标签」而不是「一排按钮」：
   默认只有浅底、没有边框，当前集实心高亮——一屏十几个集数时不会糊成一片色块。 */
.ep-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
}
.ep-list {
    display: flex;
    gap: 6px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scroll-behavior: smooth;
    /* 藏掉滚动条：一排标签下面拖一根灰条很难看。
       能滚这件事靠"右边被裁掉半个胶囊"来暗示，鼠标滚轮/触控板横滑都能滚。 */
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.ep-list::-webkit-scrollbar { height: 0; display: none; }

.ep-item {
    flex: 0 0 auto;
    scroll-snap-align: center;
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    padding: 7px 13px;
    border: 0;
    border-radius: 999px;
    background: #f2f5f8;
    color: #5a6b7b;
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    transition: background-color .16s ease, color .16s ease, box-shadow .16s ease;
}
.ep-item:hover,
.ep-item:focus {
    background: #e4eef8;
    color: #2a86c8;
    text-decoration: none;
}
.ep-item.active {
    background: var(--primary-color);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(52, 152, 219, .35);
}
/* 集号后面的条数：弱化到几乎只是背景信息，不参与阅读顺序 */
.ep-cnt {
    margin-left: 2px;
    font-size: 11px;
    font-weight: 400;
    opacity: .62;
}
.ep-item.active .ep-cnt { opacity: .85; }

/* 上一集 / 下一集：做成轻量描边胶囊，和集数标签区分开（它是"移动"不是"跳转"） */
.ep-arrow {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 11px;
    border: 1px solid #e3e9ef;
    border-radius: 999px;
    background: #fff;
    color: #5a6b7b;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    transition: border-color .16s ease, color .16s ease, background-color .16s ease;
}
.ep-arrow:hover,
.ep-arrow:focus {
    border-color: var(--primary-color);
    background: #f6fbff;
    color: var(--primary-color);
    text-decoration: none;
}
.ep-arrow.disabled {
    border-color: #eef1f4;
    background: #fafbfc;
    color: #c3ccd6;
    pointer-events: none;
}

/* 横向还能滚时，把边缘那一角渐变淡出：不占地方，也不加滚动条，
   但用户能看出来"右边还有"。类名由页面脚本按实际溢出情况添加。 */
.ep-nav.has-right .ep-list {
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 18px), transparent 100%);
    mask-image: linear-gradient(90deg, #000 calc(100% - 18px), transparent 100%);
}
.ep-nav.has-left .ep-list {
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18px);
    mask-image: linear-gradient(90deg, transparent 0, #000 18px);
}
.ep-nav.has-left.has-right .ep-list {
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
}

/* ===== 集内分页条（单集超过一页时才显示） ===== */
.pager {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    padding: 0 0 12px;
}
/* 左侧说明、右侧页码：info 用 auto 右外边距把页码整体推到右边 */
.pager-info {
    margin-right: auto;
    color: #8494a4;
    font-size: 12px;
    white-space: nowrap;
}
.pager-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 11px;
    border: 0;
    border-radius: 8px;
    background: #f2f5f8;
    color: #5a6b7b;
    font-size: 13px;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    transition: background-color .16s ease, color .16s ease, box-shadow .16s ease;
}
.pager-btn:hover,
.pager-btn:focus {
    background: #e4eef8;
    color: #2a86c8;
    text-decoration: none;
}
.pager-btn.active {
    background: var(--primary-color);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(52, 152, 219, .32);
}
.pager-btn.disabled {
    background: #fafbfc;
    color: #c3ccd6;
    pointer-events: none;
}
.pager-gap {
    color: #b6c2d1;
    font-size: 13px;
    padding: 0 2px;
    user-select: none;
}

/* 窄屏：两边收窄，把宽度让给集数标签 */
@media (max-width: 760px) {
    .ep-nav { gap: 6px; }
    .ep-arrow { padding: 6px 9px; font-size: 11px; }
    .ep-item { padding: 7px 10px; font-size: 12px; }
    .ep-cnt { font-size: 10px; }
}

/* ===== v7：紧凑字体、个人中心与适度科技感 ===== */
body { font-size: 13px; }
.content { position: relative; animation: manjuEnter .28s ease-out both; }
.content-header h2 { font-size: 22px; letter-spacing: .02em; }
.content-header p, .card, .form-control, .form-label, .btn { font-size: 13px; }
.card-title, .card-header h3 { font-size: 15px; }
table { font-size: 12px; }
.card { position: relative; overflow: hidden; border-color: rgba(91, 153, 190, .22); box-shadow: 0 5px 20px rgba(25, 70, 105, .045); }
.card::before { content: ''; position: absolute; top: 0; left: 18px; right: 18px; height: 1px; pointer-events: none; background: linear-gradient(90deg, transparent, rgba(58, 171, 219, .45), transparent); }
.stat-card { transition: transform .2s ease, box-shadow .2s ease; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(36, 137, 185, .12); }
.stat-card > i { filter: drop-shadow(0 0 8px rgba(52, 152, 219, .25)); }
.points-chip, .profile-entry { display: inline-flex; align-items: center; gap: 5px; margin-left: 10px; color: #365a70; text-decoration: none; white-space: nowrap; font-size: 12px; }
.points-chip { padding: 5px 10px; border: 1px solid rgba(45, 156, 197, .25); border-radius: 16px; background: linear-gradient(120deg, rgba(237, 250, 255, .9), rgba(242, 239, 255, .9)); }
.points-chip i { color: #d69c2f; }.points-chip b { color: #167da7; }.profile-entry:hover, .points-chip:hover { color: var(--primary-color); }
.page-progress { position: fixed; z-index: 10001; left: 0; top: 0; width: 0; height: 2px; opacity: 0; pointer-events: none; background: linear-gradient(90deg, #27b8d1, #668cff); box-shadow: 0 0 10px #42c7e6; transition: width .35s ease, opacity .2s ease; }
.page-progress.done { width: 100%; opacity: 0; }.page-progress.loading { width: 72%; opacity: 1; transition: width 2.5s cubic-bezier(.1,.7,.2,1); }
.busy-overlay { background: rgba(12, 29, 45, .86); backdrop-filter: blur(3px); }
.busy-box { min-width: 270px; border: 1px solid rgba(97, 207, 235, .25); border-radius: 12px; background: rgba(20, 48, 67, .55); box-shadow: inset 0 0 30px rgba(57, 180, 215, .06), 0 12px 40px rgba(0,0,0,.2); }
.tech-spinner { display: block; width: 48px; height: 48px; margin: 0 auto 18px; border: 2px solid rgba(98, 210, 235, .18); border-top-color: #65d9ec; border-right-color: #7e9dff; border-radius: 50%; animation: manjuSpin 1s linear infinite; box-shadow: 0 0 16px rgba(70, 199, 226, .18); }
.media-lazy { transition: opacity .35s ease, filter .35s ease; }
.media-lazy:not(.media-loaded) { opacity: .2; filter: saturate(.5); }
.media-lazy.media-loaded { opacity: 1; filter: none; }
.media-lazy.media-error { opacity: .35; background: repeating-linear-gradient(135deg,#edf3f7,#edf3f7 8px,#e4edf2 8px,#e4edf2 16px); }
.points-hero { text-align: right; color: #718596; }.points-hero span { display: block; font-size: 12px; }.points-hero strong { display: block; font-size: 28px; line-height: 1.25; color: #168fb7; letter-spacing: .02em; }
.profile-lines p { display: flex; justify-content: space-between; gap: 15px; padding: 8px 0; border-bottom: 1px dashed #e5edf2; }.profile-lines span { color: #778896; }.profile-lines b { font-weight: 500; }
.rate-pill { font-size: 11px; color: #2781a3; background: #edf9fd; padding: 3px 8px; border-radius: 12px; }
.amount-options { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-bottom: 15px; }.amount-options input { position: absolute; opacity: 0; }.amount-options span { display: block; padding: 10px 4px; text-align: center; border: 1px solid #dfe9ef; border-radius: 7px; cursor: pointer; }.amount-options small { display: block; color: #8193a0; margin-top: 3px; font-size: 10px; }.amount-options input:checked + span { border-color: #3bb4d4; color: #1489ac; background: #f0fbfe; box-shadow: 0 0 0 2px rgba(59,180,212,.08); }
.qr-card { text-align: center; }.qr-card #wechatQr { width: 236px; margin: 14px auto; padding: 8px; background: #fff; }.qr-card img { display: block; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px 18px; margin-bottom: 16px; }.form-grid label { font-size: 12px; color: #566b78; }.form-grid input:not([type=checkbox]),.form-grid select { width: 100%; height: 36px; margin-top: 5px; padding: 5px 9px; border: 1px solid var(--border-color); border-radius: 5px; background: #fff; }.form-grid small,.muted { color: #8494a4; font-size: 11px; }.span-2 { grid-column: span 2; }.check-line { display: flex; align-items: center; gap: 20px; padding-top: 20px; }.block { display: block; }.mono { font-family: Consolas,monospace; font-size: 11px; }.empty-cell { text-align: center; color: #93a2ad; padding: 24px !important; }.points-change.plus { color: #15966c; }.points-change.minus { color: #d4675a; }.status-active { color: #148b68; }.table-responsive { overflow-x: auto; }.actions form { display: inline-block; }
@keyframes manjuSpin { to { transform: rotate(360deg); } }
@keyframes manjuEnter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.main-content,.content,.card,form { min-width:0; }.table-container,.table-responsive { max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch; }
@media (max-width: 760px) { .content { padding:16px 14px; }.card { padding:18px 14px; }.batch-tip { min-width:160px; }.profile-entry span { display:none; }.points-chip { margin-left:4px;padding:4px 7px; }.amount-options { grid-template-columns:repeat(2,1fr); }.form-grid { grid-template-columns:1fr; }.span-2 { grid-column:auto; }.content-header h2 { font-size:20px; } }
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }.content { animation:none; }.media-lazy:not(.media-loaded) { opacity:1;filter:none; } }

/* ===== v8：新建项目「制作设定」单选 + 生成 SKILL ===== */
.studio-set { margin: 6px 0 20px; padding: 16px 16px 14px; border: 1px solid rgba(91, 153, 190, .22); border-radius: 8px; background: linear-gradient(180deg, rgba(246, 251, 254, .9), rgba(255, 255, 255, .96)); position: relative; }
.studio-set::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(58, 171, 219, .5), transparent); }
.studio-set-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; color: #2c4a5c; }
.studio-set-title i { color: #31a9c9; }
.studio-set-title b { font-size: 14px; font-weight: 600; }
.studio-set-title small { color: #8494a4; font-size: 11px; }
.set-group { padding: 9px 0; border-top: 1px dashed #e3edf3; }
.set-group:first-of-type { border-top: none; }
.set-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 7px; }
.set-no { font-family: Consolas, monospace; font-size: 11px; color: #7fb6cc; letter-spacing: .06em; }
.set-head b { font-size: 12.5px; color: #33505f; font-weight: 600; }
.set-head em { font-style: normal; font-size: 11px; color: #93a3ae; }
.choice-row { display: flex; flex-wrap: wrap; gap: 7px; }
.choice { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 0; height: 0; }
.choice span { display: inline-block; padding: 5px 12px; border: 1px solid #dfe9ef; border-radius: 15px; background: #fff; color: #4a6272; font-size: 12px; line-height: 1.5; transition: border-color .15s ease, color .15s ease, background .15s ease, box-shadow .15s ease; }
.choice:hover span { border-color: #a9d6e6; color: #1689ac; }
.choice input:checked + span { border-color: #3bb4d4; background: linear-gradient(120deg, #eefaff, #eef3ff); color: #127f9f; box-shadow: 0 0 0 2px rgba(59, 180, 212, .12); font-weight: 600; }
.choice input:focus-visible + span { outline: 2px solid rgba(59, 180, 212, .45); outline-offset: 2px; }
.gen-box { margin-top: 14px; padding-top: 13px; border-top: 1px dashed #e3edf3; }
.gen-prompt { padding: 10px 12px; border-left: 3px solid #56c3dd; border-radius: 0 6px 6px 0; background: #f4fafd; color: #3d5665; font-size: 12px; line-height: 1.75; word-break: break-all; }
.gen-act { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 11px; }
.gen-btn { padding: 7px 18px; border: none; border-radius: 6px; white-space: nowrap; }
.gen-btn:disabled { opacity: .65; cursor: not-allowed; }
.gen-meta { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; color: #7d8f9d; }
.gen-meta b { color: #168fb7; font-weight: 600; }
.gen-rate { color: #93a3ae; }
.gen-warn { margin: 9px 0 0; color: #c0733c; font-size: 11.5px; }

/* ============ v11：生成前的积分提示条（角色/场景/视频 四页共用） ============ */
.credit-tip {
    display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px;
    margin: 10px 0 0; padding: 8px 12px;
    background: #f3f8fd; border-left: 3px solid #7fb3e0; border-radius: 4px;
    font-size: 12px; color: #3a4a5a; line-height: 1.7;
}
.credit-tip i.fas { color: #d9a441; }
.credit-tip .ct-est b { color: #168fb7; font-size: 13px; }
.credit-tip .ct-bal { color: #6b7c8a; }
.credit-tip .ct-bal b { color: #3a4a5a; }
.credit-tip .ct-err { color: #c0392b; font-weight: 600; }
.credit-tip-warn { background: #fdf3f2; border-left-color: #e08080; }
.credit-tip-off { background: #f7f7f7; border-left-color: #bfbfbf; color: #777; }
.credit-sub { margin: 5px 0 0; font-size: 11.5px; color: #7d8f9d; line-height: 1.6; }
.batch-bar .credit-tip { margin: 0; padding: 6px 10px; font-size: 11.5px; flex: 1 1 auto; }
@media (max-width: 760px) {
    .credit-tip { font-size: 11.5px; padding: 7px 10px; gap: 4px 10px; }
    .batch-bar .credit-tip { flex-basis: 100%; margin-top: 6px; }
}
@media (max-width: 760px) {
    .studio-set { padding: 13px 11px 11px; }
    .choice span { padding: 5px 10px; font-size: 11.5px; }
    .gen-act { align-items: flex-start; }
    .gen-btn { width: 100%; }
}

/* ============ v10：设置页分页与模型表单 ============ */
.set-tabs { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:16px; }
.set-tab { display:inline-flex; align-items:center; gap:6px; padding:8px 15px; border:1px solid var(--border-color); border-radius:22px; background:#fff; color:#456; font-size:13px; text-decoration:none; transition:all .18s ease; }
.set-tab:hover { border-color:var(--primary-color); color:var(--primary-color); }
.set-tab.on { background:var(--primary-color); border-color:var(--primary-color); color:#fff; box-shadow:0 4px 12px rgba(36,137,185,.22); }
.set-tab-n { min-width:18px; height:18px; padding:0 5px; border-radius:9px; background:rgba(0,0,0,.08); font-size:11px; line-height:18px; text-align:center; }
.set-tab.on .set-tab-n { background:rgba(255,255,255,.28); }
.test-ok { color:#148b68; font-size:12px; }
.mode-hint { color:#8494a4; font-size:12px; margin-top:4px; }
.mf-row { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 18px; margin-bottom:14px; }
.mf-row.one { grid-template-columns:1fr; }
.mf-row label { font-size:12px; color:#566b78; }
.mf-row input:not([type=checkbox]), .mf-row select { width:100%; height:36px; margin-top:5px; padding:5px 9px; border:1px solid var(--border-color); border-radius:5px; background:#fff; }
.mf-row small { color:#8494a4; font-size:11px; display:block; margin-top:4px; }
.mf-check { display:flex; align-items:center; gap:22px; padding-top:6px; }
.mf-check label { display:inline-flex; align-items:center; gap:6px; font-size:13px; color:#456; }
.mf-actions { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin-top:6px; }
.test-panel { display:none; margin-top:14px; padding:12px 14px; border:1px solid var(--border-color); border-radius:8px; background:#f8fbfd; }
.test-panel.show { display:block; }
.test-panel .tp-head { font-weight:600; font-size:13px; margin-bottom:8px; color:#2c3e50; line-height:1.75; word-break:break-word; overflow-wrap:anywhere; }
.test-panel .tp-line { font-size:12.5px; color:#4a5b68; line-height:1.9; word-break:break-word; overflow-wrap:anywhere; }
/* 上游返回的英文错误往往是整段话，不折行会挤成一条撑破面板 */
.test-panel .tp-bad.tp-head { white-space:pre-wrap; }
.test-panel .tp-note { margin-top:8px; padding:8px 10px; border-left:3px solid #d9a441; background:#fffaf0; border-radius:4px; font-size:12.5px; color:#6b5a36; line-height:1.85; }
.test-panel .tp-note b { color:#8a6a20; }
.test-panel .tp-ok { color:#148b68; }
.test-panel .tp-bad { color:#d4675a; }
/* 测试「通了但有隐患」（例如接单成功、查询接口异常）：不能用成功绿，也不能用失败红 */
.test-panel .tp-warn { color:#b8770f; }
.test-panel img.tp-img { max-width:220px; border-radius:6px; border:1px solid var(--border-color); margin-top:8px; }
.test-panel video.tp-video { max-width:260px; border-radius:6px; margin-top:8px; }
@media (max-width: 760px) { .mf-row { grid-template-columns:1fr; } .set-tab { padding:6px 11px; font-size:12px; } }
.test-bad { color:#d4675a; font-size:12px; }

/* 设置页模型列表：列多，宽屏铺满，窄屏才给最小宽度让容器内部横滚
   （不给宽屏设 min-width，否则桌面端会白白多出一条横向滚动条） */
.models-table { table-layout: auto; }
.models-table th, .models-table td { white-space: nowrap; }
.models-table td:nth-child(1), .models-table td:nth-child(5), .models-table td:nth-child(9) { white-space: normal; }
.models-table td:nth-child(2) { word-break: break-all; white-space: normal; }
/* 列多，靠内容自动分配：地址 / 字段命名允许在单元格内换行，
   长 URL 与长字段串就不会把表格顶出容器；窄屏时才开启内部横滚。 */
.models-table td:nth-child(2), .models-table td:nth-child(5) { white-space: normal; max-width: 230px; }
.models-table td.mono { overflow-wrap: anywhere; }
/* 只有窄屏才约束行高/对齐，桌面端保持原样 */
@media (max-width: 1240px) {
    .models-table { min-width: 900px; }
    .models-table th, .models-table td { vertical-align: top; }
}

/* ===== 角色外貌 / 场景环境描述：两行摘要 + 字数小字 =====
   识别结果现在是 200~400 字以上，一行截断看不出内容，
   会让用户以为"还是只写了一句穿着"。 */
.td-detail {
    max-width: 520px;
    cursor: default;
    line-height: 1.6;
    font-size: 13px;
    color: #333;
}
.td-detail-len {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #999;
}
.td-detail.td-short .td-detail-len { color: #e6691f; }

@media (max-width: 768px) {
    .td-detail { max-width: 240px; }
}

/* ================= 顶部「新增项目」加号 ================= */
.btn-add-project {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; margin-left: 8px;
    border: 1px solid rgba(45, 156, 197, .45); border-radius: 50%;
    background: #fff; color: var(--primary-color); text-decoration: none;
    font-size: 11px; line-height: 1; transition: all .18s;
}
.btn-add-project:hover { background: var(--primary-color); color: #fff; border-color: var(--primary-color); transform: scale(1.08); }

/* ================= 项目管理列表 ================= */
.proj-table td { vertical-align: middle; }
.proj-name { font-weight: 600; color: #2c3e50; }
.proj-sub { font-size: 11.5px; color: #8a99a6; margin-top: 3px; }
.proj-cur { background: linear-gradient(90deg, rgba(237, 250, 255, .75), rgba(255, 255, 255, 0)); }
.proj-cur-tag { display: inline-block; padding: 1px 6px; border-radius: 8px; background: #2d9cc5; color: #fff; font-size: 10.5px; }

.proj-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.proj-step { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 11px; font-size: 11.5px; white-space: nowrap; }
.proj-step em { font-style: normal; opacity: .75; font-size: 11px; }
.proj-step.step-done { background: rgba(46, 160, 97, .12); color: #1f8a52; }
.proj-step.step-half { background: rgba(214, 156, 47, .16); color: #a8751b; }
.proj-step.step-todo { background: #f1f4f6; color: #93a2ae; }

.proj-live, .proj-err { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; margin-right: 10px; font-size: 11.5px; }
.proj-live { color: #167da7; }
.proj-err { color: #c0392b; }

.proj-bar { width: 66px; height: 6px; border-radius: 3px; background: #eceff1; overflow: hidden; display: inline-block; vertical-align: middle; }
.proj-bar i { display: block; height: 100%; background: linear-gradient(90deg, #4bb6d8, #2d9cc5); }
.proj-pct { margin-left: 6px; font-size: 11.5px; color: #5b6b78; vertical-align: middle; }

.btn-del-project { background: none; border: none; cursor: pointer; color: #c0392b; padding: 6px 8px; font-size: 12px; margin-left: 6px; }
.btn-del-project:hover { text-decoration: underline; }

/* ================= 角色/场景：重新识别、手动新增 ================= */
.recog-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; }
.recog-bar .recog-hint { font-size: 11.5px; color: #7d8f9d; }
.recog-bar form { display: inline; }

/* ================= 分集剧本编辑 ================= */
.script-edit-hint { font-size: 11.5px; color: #7d8f9d; margin-top: 6px; line-height: 1.7; }

@media (max-width: 760px) {
    .proj-steps { gap: 4px; }
    .proj-step { font-size: 10.5px; padding: 2px 6px; }
    .btn-add-project { width: 24px; height: 24px; margin-left: 5px; }

    /* 手机上的表格默认是 table-layout:fixed + nowrap + 800px 最小宽，
       进度标签会全部挤成一列圆点。项目管理表在窄屏改为自动布局、允许换行。 */
    .table-container table.proj-table { table-layout: auto; min-width: 640px; }
    .proj-table th, .proj-table td { white-space: normal; overflow: visible; }
    .proj-table .proj-steps { min-width: 200px; }
    /* 自动布局下名称列会被压缩成竖排，给它定一个下限 */
    .proj-table th:nth-child(2), .proj-table td:nth-child(2) { min-width: 130px; }
    .proj-table .proj-sub { word-break: break-all; }
    .proj-table .action-buttons { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
}

/* ================= 技能中心：五个 SKILL 分页 ================= */
.skill-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    padding: 6px;
    margin-bottom: 14px;
    border-radius: 12px;
    background: #f3f6f9;
    border: 1px solid #e5ecf2;
}
.skill-tab {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    text-align: left;
    padding: 10px 10px 9px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    font: inherit;
    color: #4d6070;
    transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, color .18s ease;
}
.skill-tab:hover { background: #fff; border-color: #dde7ef; }
.skill-tab:focus-visible { outline: 2px solid rgba(52, 152, 219, .45); outline-offset: 1px; }
.skill-tab.active {
    background: #fff;
    border-color: #bcdcf2;
    color: #1d6a9c;
    box-shadow: 0 6px 16px -10px rgba(31, 106, 156, .55), inset 0 -3px 0 0 var(--primary-color);
}
.skill-tab-no {
    flex: 0 0 auto;
    width: 22px; height: 22px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: #e2ebf3;
    color: #6b8296;
    font-size: 11.5px; font-weight: 600;
    transition: background .18s ease, color .18s ease;
}
.skill-tab.active .skill-tab-no { background: var(--primary-color); color: #fff; }
.skill-tab-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; padding-right: 34px; }
.skill-tab-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.skill-tab-name i { margin-right: 3px; opacity: .7; font-size: 12px; }
.skill-tab-hint { font-size: 11px; color: #8496a6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.skill-tab.active .skill-tab-hint { color: #6f8ea6; }
.skill-tab-badge {
    flex: 0 0 auto;
    position: absolute;
    right: 8px;
    bottom: 7px;
    padding: 2px 7px;
    border-radius: 9px;
    background: #eaf4fb;
    color: #2b7fae;
    font-size: 10.5px;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
}
.skill-tab-badge.is-empty { background: #eef1f4; color: #9aa7b3; }

.skill-panel { border: 1px solid #e5ecf2; border-radius: 12px; padding: 14px 16px 12px; background: #fff; }
.skill-page { display: none; }
.skill-page.active { display: block; animation: skill-fade .22s ease; }
@keyframes skill-fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.skill-page-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.skill-page-head h3 { margin: 0; font-size: 15px; color: #2c3e50; }
.skill-page-desc { font-size: 12px; color: #7d8f9d; }
.skill-page-tip {
    margin-left: auto;
    font-size: 11.5px; color: #4f8a68;
    background: #eef7f1; border-radius: 8px; padding: 2px 9px;
}
textarea.form-control.skill-text {
    min-height: 800px;
    height: 800px;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;
    font-size: 0.85rem;
    line-height: 1.7;
    background: #fcfdfe;
}
.skill-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px dashed #e3eaf0; }
.skill-pos { font-size: 12px; color: #7d8f9d; }
.skill-actions-gap { flex: 1; }
.skill-actions .btn { padding: 7px 14px; font-size: 13px; border-radius: 8px; }
.skill-actions .btn[disabled] { opacity: .45; cursor: not-allowed; }
.skill-actions input[type="submit"] { padding: 8px 22px; border-radius: 8px; }

@media (max-width: 1100px) {
    .skill-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .skill-tab-hint { max-width: 140px; }
    .skill-page-tip { margin-left: 0; }
}
@media (max-width: 760px) {
    .skill-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 5px; }
    .skill-tab { padding: 8px; }
    .skill-tab-hint { display: none; }
    .skill-tab-main { padding-right: 26px; }
    .skill-tab-name { white-space: normal; line-height: 1.35; }
    .skill-tab-name i { display: none; }
    .skill-tab-badge { padding: 1px 6px; font-size: 10px; right: 6px; bottom: 6px; }
    .skill-panel { padding: 12px; }
    .skill-page-tip { margin-left: 0; }
    textarea.form-control.skill-text { min-height: 520px; height: 520px; }
    .skill-actions-gap { display: none; }
    .skill-actions input[type="submit"] { flex: 1; }
}

/* ================= 生成中遮罩：计时与卡住时的出口 ================= */
.busy-elapsed { margin: 8px 0 0; font-size: 12px; color: rgba(255, 255, 255, .55); letter-spacing: .02em; }
#busyText { white-space: pre-wrap; line-height: 1.7; }
#busyText.busy-slow { color: #ffd8a8; }
.busy-actions { display: none; margin-top: 14px; }
.busy-btn {
    display: inline-block;
    margin: 4px 5px 0;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(97, 207, 235, .5);
    background: rgba(52, 152, 219, .22);
    color: #d9f2ff;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease;
}
.busy-btn:hover { background: rgba(52, 152, 219, .38); border-color: rgba(97, 207, 235, .85); }
.busy-btn-ghost { background: transparent; color: rgba(255, 255, 255, .7); border-color: rgba(255, 255, 255, .25); }
.busy-btn-ghost:hover { background: rgba(255, 255, 255, .08); color: #fff; }

/* ================================================================
   分镜脚本页：筛选条 + 编辑脚本页左右分栏（60% 剧本 / 40% 分镜）
   ================================================================ */
.sb-filter { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 14px 18px; }
.sb-tabs { display: inline-flex; border: 1px solid rgba(91,153,190,.28); border-radius: 8px; overflow: hidden; }
.sb-tab { display: inline-block; padding: 7px 15px; font-size: 13px; text-decoration: none; color: var(--text-muted, #6c757d); background: transparent; transition: background .18s ease, color .18s ease; }
.sb-tab + .sb-tab { border-left: 1px solid rgba(91,153,190,.24); }
.sb-tab:hover { color: var(--primary-color, #3498db); background: rgba(52,152,219,.08); }
.sb-tab.active { color: #fff; background: var(--primary-color, #3498db); }
.sb-filter-label { font-size: 13px; color: var(--text-muted, #6c757d); margin-left: 6px; }
.sb-filter-select { width: auto; min-width: 180px; max-width: 320px; display: inline-block; padding: 6px 10px; }
.sb-filter-stat { font-size: 12px; color: var(--text-muted, #6c757d); margin-left: auto; }
.sb-filter-stat b { color: var(--primary-color, #3498db); }
.sb-edit-btn { white-space: nowrap; }
.sb-edit-btn.disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.6); }
.sb-no-badge { display: inline-block; min-width: 40px; padding: 2px 7px; border-radius: 5px; font-size: 12px; font-weight: 600; color: #fff; background: linear-gradient(135deg, #4aa3d8, #5bc0de); }

/* 编辑脚本：左右分栏 */
.edit-script-wrap .content-header { margin-bottom: 14px; }
.es-cols { display: flex; gap: 16px; align-items: stretch; }
.es-left { flex: 0 0 60%; max-width: 60%; display: flex; flex-direction: column; }
.es-right { flex: 1 1 40%; min-width: 0; display: flex; flex-direction: column; }
.es-pane-title { padding: 10px 14px; font-size: 14px; font-weight: 600; border-bottom: 1px solid rgba(91,153,190,.22); color: var(--text-color, #2c3e50); }
.es-pane-title .es-meta { font-size: 12px; font-weight: 400; color: var(--text-muted, #6c757d); margin-left: 6px; }
.es-script-body {
    flex: 1 1 auto; height: calc(100vh - 250px); min-height: 420px; overflow-y: auto;
    padding: 16px 18px; font-size: 14px; line-height: 2; white-space: normal;
    background: rgba(255,255,255,.02); border-radius: 0 0 8px 8px;
}
.es-sb-list { flex: 1 1 auto; height: calc(100vh - 250px); min-height: 420px; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.es-sb-item { padding: 12px; border: 1px solid rgba(91,153,190,.22); border-radius: 8px; background: rgba(52,152,219,.03); }
.es-sb-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.es-sb-no { font-size: 13px; font-weight: 600; color: var(--primary-color, #3498db); }
.es-sb-dur { font-size: 12px; color: var(--text-muted, #6c757d); }
.es-sb-ta { width: 100%; resize: vertical; font-size: 13px; line-height: 1.8; }
.es-sb-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.es-sb-status { font-size: 12px; color: var(--text-muted, #6c757d); }
.es-sb-status.ok { color: #2e7d32; }
.es-sb-status.err { color: #c0392b; }
@media (max-width: 900px) {
    .es-cols { flex-direction: column; }
    .es-left, .es-right { flex: 1 1 auto; max-width: 100%; }
    .es-script-body, .es-sb-list { height: auto; max-height: 60vh; }
}
