* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ========== 设计令牌（专业工具风） ========== */
:root {
    --brand: #f41f3e;
    --brand-hover: #d91a37;
    --brand-active: #c11430;
    --brand-tint: #fef0f2;
    --brand-tint-2: #fde3e7;
    --text-1: #1f2329;
    --text-2: #4e5258;
    --text-3: #8a8f99;
    --border: #e6e8ec;
    --border-strong: #d4d7de;
    --bg: #f6f7f9;
    --bg-soft: #fafbfc;
    --radius: 8px;
    --radius-sm: 6px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
    --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08);
}

.form-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text-1);
    -webkit-font-smoothing: antialiased;
}

.app {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏：深色藏青，红色仅用于选中态 */
.sidebar {
    width: 244px;
    background: #1d2330;
    color: #a8b0c0;
    padding: 18px 14px;
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255,255,255,0.04);
    z-index: 50;
}

.nav { flex: 1 1 auto; overflow-y: auto; }

.logo {
    margin: 0 4px 14px;
    padding: 2px 8px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.logo-mark {
    width: 44px;
    height: 44px;
    flex: none;
    border-radius: 12px;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 6px 14px rgba(244, 31, 62, 0.45));
}

.logo-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 12px;
}

/* 品牌名：渐变粗体大字 + 英文小标，与下方功能导航形成层级差异 */
.logo-brand {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.logo-name {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: 1px;
    line-height: 1.15;
    background: linear-gradient(100deg, #ffffff 10%, #ffd0da 55%, #ff7a92 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.logo-sub {
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 2.2px;
    color: #6b7385;
    line-height: 1;
}

/* 导航分组标题：与软件名同款渐变文字 + 发光圆点 + 右侧渐隐分割线 */
.nav-group-title {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 20px 16px 9px;
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: 2.4px;
    color: transparent;
    background: linear-gradient(100deg, #ffffff 10%, #ffd0da 55%, #ff7a92 100%);
    -webkit-background-clip: text;
    background-clip: text;
    user-select: none;
}
.nav-group-title::before {
    content: "";
    flex: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 30%, #ff8aa0 0%, #f4203f 55%, #b30f2c 100%);
    box-shadow: 0 0 7px rgba(244, 32, 63, 0.75), 0 0 2px rgba(244, 32, 63, 0.9);
}
.nav-group-title::after {
    content: "";
    flex: 1;
    height: 1px;
    border-radius: 1px;
    background: linear-gradient(90deg, rgba(255, 138, 160, 0.4) 0%, rgba(255, 255, 255, 0.06) 45%, transparent 100%);
}
.nav-group-title:first-child { padding-top: 8px; }

.nav-item {
    position: relative;
    padding: 8px 12px;
    margin: 3px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 11px;
    transition: color 0.15s;
    font-size: 14.5px;
    font-weight: 500;
    color: #a8b0c0;
    border-radius: 10px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #e6e9f0;
}

/* 侧边栏未读角标：私信未读 / 笔记新评论 */
.nav-badge {
    margin-left: auto;
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #f5222d;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    box-shadow: 0 0 0 2px #1d2330;
}
.nav-badge.show { display: inline-flex; }
.nav-badge.badge-pop { animation: navBadgePop .35s ease; }
@keyframes navBadgePop {
    0% { transform: scale(.6); }
    55% { transform: scale(1.18); }
    100% { transform: scale(1); }
}
/* 整个导航项橘黄闪烁：有未读私信/新评论时强提示（覆盖彩色主题） */
.nav-item.nav-alert {
  animation: navAlertFlash 1.1s ease-in-out infinite;
}
.nav-item.nav-alert .nav-icon {
    background: rgba(255, 255, 255, .32) !important;
    color: inherit !important;
    box-shadow: none !important;
}
@keyframes navAlertFlash {
  0%, 100% {
    background: rgba(250, 140, 22, .22);
    color: #ffd591;
    box-shadow: inset 3px 0 0 #fa8c16;
  }
  50% {
    background: rgba(250, 173, 20, .9);
    color: #4d2c00;
    box-shadow: inset 3px 0 0 #ffd666;
  }
}

/* 选中态使用各菜单自己的主题色（--ic/--ic-bg 在各 nav-item 内联定义） */
.nav-item.active {
    background: var(--ic-bg, rgba(244, 48, 78, 0.16));
    color: #fff;
    font-weight: 600;
}

.nav-item.active::before {
    content: "";
    position: absolute;
    left: -14px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 22px;
    border-radius: 0 3px 3px 0;
    background: var(--ic, #f4304e);
}

/* 图标芯片：每项专属彩色淡底托住双色描边图标 */
.nav-icon {
    width: 19px;
    height: 19px;
    flex: none;
    box-sizing: content-box;
    padding: 7px;
    border-radius: 10px;
    background: var(--ic-bg, rgba(182, 189, 204, 0.14));
    color: var(--ic, #b6bdcc);
    transition: transform .15s;
}

.nav-item:hover .nav-icon {
    background: var(--ic-bg-h, rgba(255, 255, 255, 0.14));
    color: var(--ic, #fff);
    transform: translateY(-1px);
}

.nav-item.active .nav-icon {
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--ic, #ff4d6d) 78%, #fff),
        var(--ic, #f41f3e));
    color: #fff;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--ic, #f4304e) 45%, transparent);
}

/* 主内容区 */
.main {
    flex: 1;
    margin-left: 244px;
    padding: 24px 28px;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.page {
    display: none;
}

.page.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.page-title {
    position: relative;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-1);
    padding-left: 11px;
}
.page-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 17px;
    border-radius: 2px;
    background: var(--brand);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* VIP 账号配额 */
.acc-quota-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}
.acc-quota {
    font-size: 13px;
    color: #5b6478;
    background: #eef3ff;
    border: 1px solid #d7e2ff;
    border-radius: 8px;
    padding: 7px 12px;
    white-space: nowrap;
}
.acc-quota b { color: #2f54eb; font-weight: 700; }
.acc-quota.is-full {
    color: #d43030;
    background: rgba(239,68,68,.10);
    border-color: rgba(239,68,68,.35);
}
.acc-quota.is-full b { color: #e02d2d; }
#btn-add-account:disabled {
    opacity: .55;
    cursor: not-allowed;
}

/* ========== 运营总览 ========== */
/* 欢迎横幅 */
.db-hero {
    position: relative;
    border-radius: 12px;
    padding: 22px 26px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(115deg, #232a3d 0%, #2c3148 52%, #3a2638 100%);
    box-shadow: 0 8px 24px rgba(30, 35, 52, 0.28);
}
.db-hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(420px 160px at 88% -30%, rgba(244,31,62,0.35), transparent 70%),
        radial-gradient(300px 140px at 8% 120%, rgba(96,124,255,0.22), transparent 70%);
}
.db-hero-main { position: relative; }
.db-hero-main h2 { font-size: 21px; font-weight: 700; margin-bottom: 6px; letter-spacing: .3px; }
.db-hero-main p { font-size: 13px; color: rgba(255,255,255,0.72); }
.db-hero-actions { position: relative; display: flex; gap: 10px; flex-wrap: wrap; }
.db-hero-btn {
    display: inline-flex; align-items: center; gap: 7px;
    height: 36px; padding: 0 16px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 8px;
    color: #fff; font-size: 13px; font-weight: 500;
    cursor: pointer;
    transition: background-color .15s, border-color .15s, transform .15s;
    backdrop-filter: blur(4px);
}
.db-hero-btn svg { width: 16px; height: 16px; }
.db-hero-btn:hover { background: var(--brand); border-color: var(--brand); transform: translateY(-1px); }

/* 彩色统计卡 */
.db-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}
.db-stat {
    position: relative;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-sm);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.db-stat:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(16,24,40,0.1);
    border-color: #dcdfe5;
}
.db-stat-icon {
    width: 46px; height: 46px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex: none;
}
.db-stat-icon svg { width: 22px; height: 22px; }
.db-i-blue   { background: linear-gradient(135deg, #e8f0ff, #d6e4ff); color: #3b6ef0; }
.db-i-green  { background: linear-gradient(135deg, #e6f9ee, #d1f2de); color: #14a049; }
.db-i-orange { background: linear-gradient(135deg, #fff1e3, #ffe2c4); color: #ef8a17; }
.db-i-purple { background: linear-gradient(135deg, #f1ebff, #e3d7ff); color: #7a4ee0; }
.db-i-cyan   { background: linear-gradient(135deg, #e2f7fb, #cdeef5); color: #0d94a8; }
.db-stat-info { min-width: 0; }
.db-stat-value { font-size: 26px; font-weight: 700; color: var(--text-1); line-height: 1.15; }
.db-stat-label { font-size: 12.5px; color: var(--text-3); margin-top: 3px; }
.db-stat-dot {
    position: absolute; top: 14px; right: 14px;
    width: 8px; height: 8px; border-radius: 50%;
    background: #c9ccd3;
}
.db-stat-dot.is-online { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.15); }

/* 下区两栏 */
.db-grid {
    display: grid;
    grid-template-columns: 1.85fr 1fr;
    gap: 16px;
    align-items: start;
    flex: 0 0 auto;
}
.db-grid > .card, .db-side > .card { margin-bottom: 0; }
.db-chart-card { display: flex; flex-direction: column; }
.db-side { display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.db-guide-card { flex: 0 0 auto; }
.db-interact-card { flex: 0 0 auto; display: flex; flex-direction: column; }
.db-chart-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.db-legend { display: flex; gap: 16px; }
.db-legend-item { font-size: 12px; color: var(--text-3); display: inline-flex; align-items: center; gap: 6px; }
.db-legend-dot { width: 8px; height: 8px; border-radius: 3px; display: inline-block; }
.db-chart { width: 100%; flex: 0 0 544px; min-height: 0; display: flex; }
.db-chart svg { width: 100%; height: 100%; display: block; }
.db-bar-msg { fill: var(--brand); transition: opacity .15s; }
.db-bar-rep { fill: #b6bdc9; transition: opacity .15s; }
.db-bar-str { fill: #0d94a8; transition: opacity .15s; }
.db-bar-g:hover .db-bar-msg, .db-bar-g:hover .db-bar-rep, .db-bar-g:hover .db-bar-str { opacity: .75; }
.db-bar-value { font-size: 10.5px; font-weight: 600; }
.db-bv-msg { fill: var(--brand); }
.db-bv-rep { fill: #8a94a6; }
.db-bv-str { fill: #0d94a8; }
.db-bv-zero { fill: #c2c7d0; font-size: 9.5px; font-weight: 500; }
.db-bar-label { font-size: 11.5px; fill: var(--text-3); }
.db-grid-line { stroke: #eef0f3; stroke-width: 1; }
.db-chart-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--text-3); font-size: 13px; }

/* 快速上手 */
.db-steps { flex: 0 0 auto; }
.db-step { display: flex; gap: 12px; padding: 7px 0; align-items: flex-start; }
.db-step + .db-step { border-top: 1px dashed var(--border); }
.db-step-no {
    width: 24px; height: 24px; border-radius: 50%; flex: none;
    background: var(--brand-tint); color: var(--brand);
    font-size: 12px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    margin-top: 1px;
}
.db-step b { font-size: 13.5px; color: var(--text-1); font-weight: 600; }
.db-step p { font-size: 12.5px; color: var(--text-3); line-height: 1.6; margin-top: 2px; }
.db-guide-tip {
    margin-top: 12px;
    background: var(--brand-tint);
    color: #c0203a;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 12.5px;
    line-height: 1.6;
}

/* 今日互动：2×2 小面板 */
.db-ia-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.db-ia-item {
    display: flex; flex-direction: column; justify-content: center; gap: 6px;
    background: #f6f7f9; border: 1px solid #eef0f3; border-radius: 10px;
    padding: 12px 14px; min-width: 0;
}
.db-ia-icon {
    width: 34px; height: 34px; border-radius: 9px; flex: none;
    display: flex; align-items: center; justify-content: center;
}
.db-ia-icon svg { width: 17px; height: 17px; }
.db-i-pink  { background: linear-gradient(135deg, #ffe7ee, #ffd3e0); color: #e0336b; }
.db-i-amber { background: linear-gradient(135deg, #fdf2dd, #fae3b8); color: #c07f18; }
.db-i-red   { background: linear-gradient(135deg, #ffe8ea, #ffd3d9); color: #e02442; }
.db-i-indigo{ background: linear-gradient(135deg, #e9ebff, #d4d9fc); color: #4d57c4; }
.db-ia-info { min-width: 0; }
.db-ia-value { font-size: 21px; font-weight: 700; color: var(--text-1); line-height: 1.1; }
.db-ia-label { font-size: 12.5px; color: var(--text-2); margin-top: 3px; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.db-ia-sub { font-size: 11.5px; color: var(--text-3); }
.db-ia-sub b { color: var(--text-2); font-weight: 600; }

@media (max-width: 1280px) {
    .db-stats { grid-template-columns: repeat(3, 1fr); }
    .db-grid { grid-template-columns: 1fr; flex: 0 0 auto; }
    .db-side { flex: 0 0 auto; }
    .db-chart { flex-basis: 300px; }
}
@media (max-width: 760px) {
    .db-stats { grid-template-columns: repeat(2, 1fr); }
    .db-hero { flex-direction: column; align-items: flex-start; }
}

/* 卡片 */
.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
}

.card h2 {
    position: relative;
    font-size: 15.5px;
    font-weight: 600;
    margin-bottom: 14px;
    padding-left: 10px;
    color: var(--text-1);
}
.card h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 14px;
    border-radius: 2px;
    background: var(--brand);
}

.help-text p {
    margin-bottom: 10px;
    line-height: 1.8;
    color: var(--text-2);
}

/* 按钮：统一高度与描边规范 */
.btn {
    height: 32px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    line-height: 1;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
}

.btn-primary {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 2px 6px rgba(244, 31, 62, 0.22);
}

.btn-primary:hover {
    background: var(--brand-hover);
}

.btn-primary:active {
    background: var(--brand-active);
}

.btn-secondary {
    background: #fff;
    border-color: var(--border-strong);
    color: var(--text-2);
}

.btn-secondary:hover {
    background: var(--bg);
    border-color: #b8bcc4;
    color: var(--text-1);
}

.btn-danger {
    background: #fff;
    border-color: #f0a3a8;
    color: #d32f3c;
    height: 26px;
    padding: 0 10px;
    font-size: 12px;
}

.btn-danger:hover {
    background: #fef0f2;
    border-color: var(--brand);
}

.btn-sm {
    height: 26px;
    padding: 0 10px;
    font-size: 12px;
}

.btn-ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text-3);
}
.btn-ghost:hover { background: var(--bg); color: var(--text-1); border-color: var(--border-strong); }

.btn-success {
    background: #fff;
    border-color: #9fd6a9;
    color: #168a3e;
    height: 26px;
    padding: 0 10px;
    font-size: 12px;
}

.btn-success:hover {
    background: #f0faf3;
    border-color: #16a34a;
}

.btn-warning {
    background: #fff;
    border-color: #eccb8d;
    color: #b07610;
    height: 26px;
    padding: 0 10px;
    font-size: 12px;
}

.btn-warning:hover {
    background: #fdf8ee;
    border-color: #d4930f;
}

/* 表格 */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    background: var(--bg-soft);
    font-weight: 600;
    color: var(--text-3);
    font-size: 12px;
}

.table td {
    font-size: 13px;
    color: var(--text-2);
}

.table tbody tr:hover {
    background: var(--bg-soft);
}

/* 回复日志：时间列等宽数字 */
#logs-tbody td:first-child {
    color: var(--text-3);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
#logs-tbody td:nth-child(2) { color: var(--text-3); font-size: 12px; }

/* 状态标签：方角小标签，前置彩色圆点 */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.6;
    font-weight: 500;
}
.status-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    margin-right: 5px;
    flex-shrink: 0;
}

.status-online {
    background: #eafaf0;
    color: #168a3e;
}

.status-offline {
    background: #fef0f2;
    color: #d32f3c;
}

.status-error {
    background: #fdf5e7;
    color: #b07610;
}

.status-logging {
    background: #eaf2fe;
    color: #2359d6;
}

/* 回复日志来源标签：规则=蓝灰，AI客服=紫（与工具栏群聊图标同色系） */
.src-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.6;
    font-weight: 500;
    white-space: nowrap;
}
.src-rule {
    background: #eef1f5;
    color: #5b6573;
}
.src-ai {
    background: #efe8fd;
    color: #7a56d8;
}

.status-active {
    background: #eafaf0;
    color: #168a3e;
}

.status-inactive {
    background: var(--bg);
    color: var(--text-3);
}

.status-success {
    background: #eafaf0;
    color: #168a3e;
}

.status-failed {
    background: #fef0f2;
    color: #d32f3c;
}

.msg-incoming {
    color: #1890ff;
}

.msg-outgoing {
    color: #52c41a;
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(17, 24, 39, 0.45);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 10px;
    width: 500px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 12px 32px rgba(16, 24, 40, 0.18);
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-1);
}

.modal-close {
    font-size: 20px;
    cursor: pointer;
    color: var(--text-3);
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-1);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* 表单 */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-2);
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 7px 11px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    color: var(--text-1);
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(244, 31, 62, 0.1);
}

.form-group textarea {
    resize: vertical;
}

/* Toast：深色轻提示 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    background: #2b2f36;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.2);
    z-index: 99999;
    /* 未显示时彻底隐藏：空 toast 仅 36px 宽，只靠 translateX(120%)
       会在右上角露出一截黑边（曾被误认为“AI图标”）。
       位移 + opacity 双保险，动画结束后也完全不可见、不挡点击 */
    opacity: 0;
    pointer-events: none;
    transform: translateX(calc(100% + 32px));
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.toast.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.toast.success {
    background: #1f7a3d;
}

.toast.error {
    background: #c62f3d;
}

.toast.info {
    background: #2b2f36;
}

/* 自定义确认弹窗：替代浏览器原生 confirm */
.confirm-modal {
    background: rgba(17, 24, 39, 0.42);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.18s ease;
}
.confirm-modal.show { opacity: 1; }

.confirm-dialog {
    width: 400px;
    max-width: calc(100vw - 40px);
    background: #fff;
    border-radius: 16px;
    padding: 26px 26px 22px;
    box-shadow: 0 20px 56px rgba(16, 24, 40, 0.26);
    text-align: center;
    transform: translateY(14px) scale(0.96);
    opacity: 0;
    transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.18s ease;
}
.confirm-modal.show .confirm-dialog {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.confirm-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.confirm-icon svg { width: 26px; height: 26px; }
.confirm-icon.is-danger {
    background: linear-gradient(135deg, #fff1f0, #ffe0e2);
    color: #f5222d;
    box-shadow: 0 0 0 6px rgba(245, 34, 45, 0.07);
}
.confirm-icon.is-primary {
    background: linear-gradient(135deg, #eef2ff, #ffe7ec);
    color: var(--brand);
    box-shadow: 0 0 0 6px rgba(244, 31, 62, 0.06);
}

.confirm-title {
    font-size: 16.5px;
    font-weight: 700;
    color: var(--text-1);
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}
.confirm-msg {
    font-size: 13.5px;
    line-height: 1.75;
    color: var(--text-2);
    margin-bottom: 22px;
    word-break: break-word;
}
.confirm-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}
.confirm-actions .btn {
    min-width: 104px;
    height: 38px;
    padding: 0 22px;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: 9px;
}
.confirm-actions .cf-ok.btn-danger {
    background: linear-gradient(135deg, #f5455c, #df1b39);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 16px rgba(223, 27, 57, 0.32);
}
.confirm-actions .cf-ok.btn-danger:hover {
    background: linear-gradient(135deg, #e8324b, #c81531);
    border-color: transparent;
}
.confirm-actions .cf-ok.btn-primary {
    box-shadow: 0 6px 16px rgba(244, 31, 62, 0.26);
}

/* 开关 */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #c9ccd3;
    transition: .2s;
    border-radius: 22px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    transition: .2s;
    border-radius: 50%;
}

.switch input:checked + .switch-slider {
    background-color: var(--brand);
}

.switch input:checked + .switch-slider:before {
    transform: translateX(18px);
}

/* 操作按钮组 */
.action-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.match-tag {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 12px;
    background: var(--bg);
    color: var(--text-2);
    border: 1px solid var(--border);
    white-space: nowrap;
}

/* 规则列表：优先级圆形序号 */
.rule-prio {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 50%;
    background: #eef1f6;
    color: var(--text-2);
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
#rules-tbody td:first-child { text-align: center; }
#rules-tbody td:nth-child(2) strong { color: var(--text-1); font-weight: 600; }

/* 规则列表：关键词标签 */
.kw-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; max-width: 260px; }
.kw-tag {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 4px;
    font-size: 12px;
    background: var(--brand-tint);
    color: var(--brand);
    border: 1px solid var(--brand-tint-2);
    white-space: nowrap;
}
.kw-more {
    display: inline-flex;
    align-items: center;
    padding: 0 6px;
    font-size: 11px;
    color: var(--text-3);
}

/* ========== 私信聚合聊天 ========== */
#page-messages {
    display: none;
    flex-direction: column;
    height: calc(100vh - 40px);
    padding-bottom: 0;
}
#page-messages.active {
    display: flex;
}

/* 账号竖排栏（会话列表左侧） */
.chat-account-rail {
    width: 84px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 6px;
    background: #f6f7f9;
    border-right: 1px solid var(--border);
    overflow-y: auto;
}

.account-tab {
    padding: 8px 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    cursor: pointer;
    background: transparent;
    color: #666;
    border: 1px solid transparent;
    transition: all .15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.account-tab:hover { background: var(--brand-tint); }
.account-tab.active {
    background: var(--brand-tint);
    color: var(--brand);
    border-color: var(--brand-tint-2);
    box-shadow: 0 1px 4px rgba(244,31,62,.14);
}
.rail-avatar-wrap {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}
.rail-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    background: #f0f0f0;
}
.rail-avatar-fallback {
    background: var(--brand);
    color: #fff;
    font-weight: 600;
}
.rail-avatar-all {
    background: #1d2330;
    color: #fff;
    font-weight: 600;
}
.rail-name {
    max-width: 72px;
    text-align: center;
    line-height: 1.25;
    word-break: break-all;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.account-tab .tab-dot {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 10px; height: 10px;
    border-radius: 50%;
    border: 2px solid #f6f7f9;
    box-sizing: content-box;
}
.account-tab:hover .tab-dot,
.account-tab.active .tab-dot { border-color: var(--brand-tint); }
.account-tab .tab-dot.online { background: #52c41a; }
.account-tab .tab-dot.offline { background: #c0c0c0; }
/* 账号未读数字角标：头像右上角，盖住部分绿点也无妨，数字优先醒目 */
.rail-badge {
    position: absolute;
    top: -6px;
    right: -10px;
    background: var(--brand);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    border: 1.5px solid #fff;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.chat-layout {
    display: flex;
    flex: 1;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 2px 12px rgba(16,24,40,0.06);
    min-height: 0;
}

/* 私信页锁定视口高度：消息再多也只在 .chat-messages 内部滚动，
   不允许整页滚动把账号栏/会话栏顶走。
   注意：.page.active 默认 flex:1 1 0%，在高度不确定的 .main 中
   flex-basis 会回退为内容高度并使 height 失效，故此处须改回 flex:none */
#page-messages.active {
    height: calc(100vh - 48px);
    flex: none;
}
.chat-account-rail,
.chat-sidebar,
.chat-window {
    min-height: 0;
}

/* 会话列表 */
.chat-sidebar {
    width: 300px;
    min-width: 300px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}
.chat-sidebar-header {
    padding: 14px 16px;
    font-weight: 600;
    font-size: 15px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-1);
    flex-shrink: 0;
}
.chat-sidebar-header > span:first-child {
    position: relative;
    padding-left: 10px;
}
.chat-sidebar-header > span:first-child::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 14px;
    border-radius: 2px;
    background: var(--brand);
}
.chat-sidebar-tip {
    font-size: 12px;
    color: var(--text-3);
    font-weight: normal;
}
.chat-sidebar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.chat-read-all-btn {
    border: none;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--brand);
    background: rgba(255, 36, 66, .08);
    transition: background .15s, color .15s, opacity .15s;
}
.chat-read-all-btn:hover {
    background: rgba(255, 36, 66, .16);
}
.chat-read-all-btn:disabled {
    cursor: default;
    color: var(--text-3);
    background: transparent;
    opacity: .65;
}
.conversation-list {
    flex: 1;
    overflow-y: auto;
}
.conv-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f7f8fa;
    box-shadow: inset 3px 0 0 transparent;
    transition: background .15s, box-shadow .15s;
}
.conv-item:hover { background: #f5f6f8; }
.conv-item.active {
    background: var(--brand-tint);
    box-shadow: inset 3px 0 0 var(--brand);
}
.conv-item.active .conv-name { color: var(--brand); }
.conv-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    flex: none;display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}
.conv-avatar-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}
.conv-body {
    flex: 1;
    min-width: 0;
}
.conv-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.conv-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 4px;
}
.conv-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.conv-time {
    font-size: 11px;
    color: var(--text-3);
    flex-shrink: 0;
}
.conv-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 3px;
}
.conv-summary {
    font-size: 12px;
    color: var(--text-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}
.conv-badge {
    background: var(--brand);
    color: #fff;
    font-size: 11px;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    border-radius: 9px;
    text-align: center;
    padding: 0 5px;
    flex-shrink: 0;
}
.conv-stranger-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 0 5px;
    height: 17px;
    line-height: 17px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: normal;
    vertical-align: 1px;
    color: #d48806;
    background: #fff7e6;
    border: 1px solid #ffd591;
    flex-shrink: 0;
}

/* 会话列表：私信/群聊 分区切换 */
.chat-conv-tabs {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.conv-tab {
    flex: 1;
    height: 28px;
    border: 1px solid var(--border);
    background: var(--bg-soft);
    color: var(--text-3);
    border-radius: 999px;
    font-size: 13px;
    cursor: pointer;
    transition: all .15s;
}
.conv-tab:hover:not(.active) { background: #eef0f3; color: var(--text-2); }
.conv-tab.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(244,31,62,.22);
}

/* 群会话标记 */
.conv-group-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 0 5px;
    height: 17px;
    line-height: 17px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: normal;
    vertical-align: 1px;
    color: var(--brand);
    background: #fff0f2;
    border: 1px solid #ffc2cb;
    flex-shrink: 0;
}
.conv-owner-tag {
    display: inline-block;
    margin-left: 4px;
    padding: 0 5px;
    height: 17px;
    line-height: 17px;
    border-radius: 4px;
    font-size: 10px;
    vertical-align: 1px;
    color: #ad6800;
    background: #fffbe6;
    border: 1px solid #ffe58f;
    flex-shrink: 0;
}
.conv-group-badge {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    font-size: 10px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px #eee;
    z-index: 1;
}

/* 群聊消息：气泡上方的发送者昵称 */
.msg-sender-name {
    font-size: 11px;
    color: #999;
    padding: 0 4px 3px;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.conv-account-tag {
    font-size: 10px;
    background: #f0f0f0;
    color: #888;
    padding: 0 5px;
    border-radius: 4px;
    flex-shrink: 0;
}
.chat-empty-small {
    padding: 30px 16px;
    text-align: center;
    color: #bbb;
    font-size: 13px;
}

/* 聊天窗口 */
.chat-window {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.chat-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #bbb;
    gap: 8px;
}
.chat-placeholder-icon {
    width: 78px;
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    border-radius: 50%;
    background: var(--brand-tint);
    margin-bottom: 8px;
}
.chat-placeholder { color: var(--text-2); font-size: 14px; }
.chat-placeholder-sub { font-size: 12px; color: var(--text-3); }

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.chat-header {
    padding: 13px 20px;
    border-bottom: 1px solid var(--border);
    background: #fff;
    flex-shrink: 0;
}
.chat-header-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-1);
}
.chat-header-account {
    display: inline-block;
    font-size: 11px;
    color: var(--brand);
    background: var(--brand-tint);
    border-radius: 4px;
    padding: 2px 8px;
    margin-top: 6px;
}
.chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px;
    background: #f5f6f8;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.msg-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}
.msg-row.me { flex-direction: row-reverse; }
.msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ddd;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}
.msg-avatar-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}
.msg-row.me .msg-avatar { background: var(--brand); }
.msg-bubble-wrap {
    max-width: 65%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.msg-row.me .msg-bubble-wrap { align-items: flex-end; }
.msg-sender {
    font-size: 11px;
    color: #aaa;
    padding: 0 4px;
}
.msg-bubble {
    padding: 10px 14px;
    border-radius: 14px 14px 14px 4px;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    background: #fff;
    color: var(--text-1);
    box-shadow: 0 1px 2px rgba(16,24,40,0.06);
    transition: box-shadow .15s;
}
.msg-row:not(.me) .msg-bubble:hover { box-shadow: 0 2px 8px rgba(16,24,40,0.1); }
.msg-row.me .msg-bubble {
    background: var(--brand);
    color: #fff;
    border-radius: 14px 14px 4px 14px;
    box-shadow: 0 2px 6px rgba(244,31,62,0.22);
}
.msg-time {
    font-size: 10px;
    color: var(--text-3);
    padding: 0 4px;
    white-space: nowrap;
}

/* 引用回复（微信同款：气泡顶部灰色引用条） */
.msg-bubble-refwrap { white-space: normal; padding: 8px 10px; }
.msg-ref {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(16,24,40,0.05);
    border-radius: 8px;
    padding: 6px 9px;
    margin-bottom: 6px;
    cursor: default;
}
.msg-row.me .msg-ref { background: rgba(255,255,255,0.22); }
.msg-ref-cover {
    width: 34px; height: 34px;
    border-radius: 5px;
    object-fit: cover;
    flex: none;
}
.msg-ref-body {
    min-width: 0;
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-3, #8a8f99);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.msg-row.me .msg-ref-body { color: rgba(255,255,255,0.85); }
.msg-ref-name { font-weight: 600; }
.msg-ref-main { white-space: pre-wrap; word-break: break-word; }

/* 撤回提示（居中灰色系统条） */
.msg-recall-tip {
    text-align: center;
    color: #bbb;
    font-size: 12px;
    padding: 6px 0;
}

/* 系统通知（新成员入群等）：居中灰色胶囊提示 */
.msg-sys-tip {
    text-align: center;
    color: #c8cad4;
    font-size: 12px;
    padding: 6px 0;
}
.msg-sys-tip::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #8b8fa3;
    vertical-align: middle;
    margin: 0 8px 2px 0;
}
.msg-sys-tip::after {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #8b8fa3;
    vertical-align: middle;
    margin: 0 0 2px 8px;
}

/* 气泡旁的撤回操作：默认隐藏，hover 自己的消息时出现 */
.msg-bubble-with-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}
.msg-row.me .msg-bubble-with-actions { flex-direction: row-reverse; }
.msg-recall-btn {
    display: none;
    border: none;
    background: transparent;
    color: #999;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 4px;
    white-space: nowrap;
}
.msg-row.me:hover .msg-recall-btn { display: inline-block; }
.msg-recall-btn:hover { color: var(--brand); }
.msg-recall-btn:disabled { color: #ccc; cursor: default; }
/* 引用回复按钮：hover 消息行时显示（我方/对方消息均可引用） */
.msg-quote-btn {
    display: none;
    border: none;
    background: transparent;
    color: #999;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 4px;
    white-space: nowrap;
}
.msg-row:hover .msg-quote-btn { display: inline-block; }
.msg-quote-btn:hover { color: var(--brand); }
/* 输入框上方引用状态条 */
.chat-ref-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-2, #f4f5f7);
    border-left: 3px solid var(--brand, #ff2e4d);
    border-radius: 8px;
    padding: 7px 10px;
    margin: 0 0 8px 0;
}
.chat-ref-bar[hidden] { display: none; }
.chat-ref-label {
    flex: none;
    font-size: 11px;
    font-weight: 700;
    color: var(--brand, #ff2e4d);
}
.chat-ref-cancel {
    flex: none;
    margin-left: auto;
    border: none;
    background: transparent;
    color: #999;
    font-size: 13px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
}
.chat-ref-cancel:hover { color: #333; background: rgba(0,0,0,0.06); }
.chat-loading {
    text-align: center;
    color: #aaa;
    font-size: 12px;
    padding: 8px;
}

/* 输入区 */
.chat-input-bar {
    border-top: 1px solid var(--border);
    padding: 10px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #fff;
    position: relative;
    flex-shrink: 0;
}
.chat-toolbar {
    display: flex;
    gap: 6px;
    align-items: center;
}
/* 输入栏工具图标：浅色圆角彩块 + 同色实心图标（IM 风格，克制不花哨） */
.chat-tool-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 9px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    transition: background .15s, transform .15s;
}
.chat-tool-ic {
    width: 21px;
    height: 21px;
    display: block;
}
.chat-tool-btn:hover { transform: translateY(-1px); }
.chat-tool-btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.tool-emoji { background: #fdf0d9; color: #f0a020; }
.tool-emoji:hover, .tool-emoji.active { background: #fae3bc; }
.tool-image { background: #dcf6ed; color: #12a376; }
.tool-image:hover, .tool-image.active { background: #c6efdf; }
.tool-video { background: #fdeaea; color: #e5484d; }
.tool-video:hover, .tool-video.active { background: #fbd6d6; }
.tool-card  { background: #e4effe; color: #3b82f6; }
.tool-card:hover, .tool-card.active  { background: #d2e4fd; }
.tool-group { background: #efe8fd; color: #8261e6; }
.tool-group:hover, .tool-group.active { background: #e2d6fb; }
.tool-goods { background: #fde8ec; color: #e0457a; }
.tool-goods:hover, .tool-goods.active { background: #fbd6df; }
.tool-mini  { background: #fdf1d6; color: #e8920c; }
.tool-mini:hover, .tool-mini.active { background: #fae6b8; }
.tool-coupon { background: #ffe4e9; color: #ff2442; }
.tool-coupon:hover, .tool-coupon.active { background: #ffd3dc; }
.chat-input-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}
.emoji-panel[hidden] { display: none; }
.emoji-panel {
    position: absolute;
    left: 16px;
    bottom: calc(100% - 6px);
    width: 336px;
    max-height: 264px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0,0,0,.12);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 30;
}
.emoji-tabs {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 6px;
}
.emoji-tab {
    border: 1px solid #e8e8e8 !important;
    background: #fafafa !important;
    color: #666;
    font-size: 12px !important;
    line-height: 1 !important;
    padding: 5px 12px !important;
    border-radius: 999px !important;
    cursor: pointer;
}
.emoji-tab.active {
    background: #fff1ed !important;
    border-color: #ff5a3c !important;
    color: #ff5a3c;
}
.emoji-grid {
    display: grid;
    gap: 2px;
}
.emoji-grid-unicode { grid-template-columns: repeat(8, 1fr); }
.emoji-grid-custom { grid-template-columns: repeat(5, 1fr); gap: 6px; }
.emoji-grid[hidden] { display: none; }

/* 小红书内置表情（短码 [微笑R] 等） */
.emoji-xhs-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
}
.emoji-xhs-wrap[hidden] { display: none; }
.xhs-emoji-subtabs {
    display: flex;
    gap: 6px;
}
.xhs-subtab {
    border: 1px solid #e8e8e8 !important;
    background: #fafafa !important;
    color: #666 !important;
    font-size: 11px !important;
    line-height: 1 !important;
    padding: 4px 10px !important;
    border-radius: 999px !important;
    cursor: pointer;
}
.xhs-subtab.active {
    background: #fff1ed !important;
    border-color: #ff5a3c !important;
    color: #ff5a3c !important;
}
.emoji-grid-xhs {
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    overflow-y: auto;
    max-height: 188px;
}
.xhs-emoji-tile {
    padding: 3px !important;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.xhs-emoji-tile img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    pointer-events: none;
}
.xhs-emoji-tile.xhs-emoji-bad { display: none; }

/* 消息气泡内的小红书内置表情 */
.msg-bubble .xhs-emoji {
    width: 1.28em;
    height: 1.28em;
    object-fit: contain;
    vertical-align: -0.22em;
    margin: 0 1px;
}
/* 会话列表摘要里的表情略小，跟随摘要字号 */
.conv-summary .xhs-emoji {
    width: 1.05em;
    height: 1.05em;
    vertical-align: -0.15em;
    margin: 0;
    flex: 0 0 auto;
}
.emoji-panel button {
    border: none;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    padding: 6px 0;
    border-radius: 6px;
    cursor: pointer;
}
.emoji-panel button:hover { background: #f5f5f5; }
.emoji-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #999;
    font-size: 12px;
    padding: 18px 0 6px;
}
.emoji-tile {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    padding: 0 !important;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #f0f0f0;
}
.emoji-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.emoji-tile:hover { border-color: #ff5a3c; }
.emoji-tile-del {
    position: absolute;
    top: 1px;
    right: 1px;
    width: 16px;
    height: 16px;
    line-height: 15px !important;
    padding: 0 !important;
    font-size: 12px !important;
    color: #fff;
    background: rgba(0,0,0,.55) !important;
    border-radius: 50%;
    display: none;
    text-align: center;
}
.emoji-tile:hover .emoji-tile-del { display: block; }
.emoji-tile-badge {
    position: absolute;
    left: 1px;
    bottom: 1px;
    width: 15px;
    height: 15px;
    line-height: 15px;
    text-align: center;
    font-size: 9px;
    color: #fff;
    background: #ff2442;
    border-radius: 50% 50% 50% 0;
    pointer-events: none;
}
.emoji-tile-platform img { box-shadow: 0 0 0 1px rgba(255,36,66,.35); border-radius: 6px; }
.emoji-add-tile {
    aspect-ratio: 1;
    border: 1px dashed #d9d9d9 !important;
    border-radius: 8px;
    color: #bbb;
    font-size: 22px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa !important;
}
.emoji-add-tile:hover { color: #ff5a3c; border-color: #ff5a3c !important; }

/* 自定义表情气泡：无底色贴纸样式，点击可看大图 */
.msg-bubble-emoji {
    background: transparent !important;
    padding: 2px !important;
    box-shadow: none !important;
    border-radius: 8px;
}
.msg-emoji-img {
    display: block;
    max-width: 120px;
    max-height: 160px;
    width: auto;
    height: auto;
    border-radius: 8px;
    cursor: zoom-in;
}
.msg-bubble-emoji.img-broken {
    background: #f5f5f5 !important;
    padding: 10px 14px !important;
    color: #999;
}
.msg-bubble-emoji.img-broken::before { content: "[表情]"; }

/* 视频消息气泡 */
.msg-bubble-video {
    position: relative;
    background: #000 !important;
    padding: 0 !important;
    overflow: hidden;
    border-radius: 12px;
    max-width: 260px;
}
.msg-bubble-video video {
    display: block;
    width: 100%;
    max-width: 260px;
    max-height: 360px;
    height: auto;
    background: #000;
    border-radius: 12px;
    cursor: pointer;
}
.msg-video-duration {
    position: absolute;
    right: 8px;
    bottom: 8px;
    padding: 1px 7px;
    border-radius: 9px;
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: 11px;
    line-height: 16px;
    pointer-events: none;
}
.msg-bubble-video.video-broken {
    background: #f5f5f5 !important;
    width: 150px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.msg-video-fallback { color: #999; font-size: 13px; }

/* 笔记卡片发送面板 */
.card-panel[hidden] { display: none; }
.card-panel {
    position: absolute;
    left: 16px;
    bottom: calc(100% - 6px);
    width: 350px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0,0,0,.12);
    padding: 14px;
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.card-panel-title { font-weight: 600; font-size: 14px; color: #333; }
.card-panel-input {
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
}
.card-panel-input:focus { border-color: var(--brand); }
.card-panel-cover { display: flex; align-items: center; gap: 10px; }
#card-cover-preview,
#goods-card-preview,
#mini-card-preview {
    width: 46px; height: 46px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #eee;
    flex-shrink: 0;
}
.card-panel-hint { font-size: 12px; color: #999; }
.card-panel-msg { font-size: 12px; min-height: 14px; line-height: 1.4; }
.card-panel-msg.error { color: var(--brand); }
.card-panel-msg.ok { color: #34c759; }
.card-panel-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* 群邀请选群面板 */
.group-picker-list {
    max-height: 240px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0 -4px;
    padding: 0 4px;
}
.group-picker-empty { font-size: 12px; color: #999; text-align: center; padding: 18px 0; }
.group-picker-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 8px;
    border-radius: 8px;
    transition: background .12s;
}
.group-picker-item:hover { background: #f7f7f7; }
.group-picker-avatar {
    width: 38px; height: 38px;
    border-radius: 8px;
    object-fit: cover;
    background: #f2f2f2;
    flex-shrink: 0;
}
.group-picker-avatar-ph {
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}
.group-picker-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.group-picker-name {
    font-size: 13px; color: #333;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.group-picker-num { font-size: 11px; color: #999; }
.group-picker-send { flex-shrink: 0; }
.group-picker-item.selected { background: #fff0f2; }

/* 群成员面板 + @芯片 */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.chat-members-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 30px;
    padding: 0 12px;
    border: 1px solid var(--brand);
    border-radius: 15px;
    background: #fff;
    color: var(--brand);
    font-size: 12px;
    cursor: pointer;
    transition: background .12s, color .12s;
}
.chat-members-btn:hover { background: var(--brand); color: #fff; }
.tool-at { background: #e7f1ff; color: #2f7cf6; }
.tool-at:hover, .tool-at.active { background: #d4e6ff; }

.members-panel { width: 320px; }
.members-count { font-size: 12px; color: #999; font-weight: 400; }
.members-picker-list {
    max-height: 280px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0 -4px;
    padding: 0 4px;
}
.member-picker-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
}
.member-picker-item:hover { background: #f7f7f7; }
.member-picker-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 9px;
}
.member-picker-info .group-picker-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 15px;
}
.member-picker-name {
    font-size: 13px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.member-self-tag {
    margin-left: 5px;
    font-size: 10px;
    color: var(--brand);
    background: var(--brand-tint);
    border-radius: 4px;
    padding: 1px 5px;
}
.member-picker-ops { flex-shrink: 0; display: flex; gap: 6px; }
.member-op-btn {
    height: 26px;
    min-width: 40px;
    padding: 0 10px;
    border-radius: 13px;
    border: 1px solid #e3e3e8;
    background: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: all .12s;
}
.member-op-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.member-op-btn.op-at { color: #2f7cf6; border-color: #cfe2ff; background: #f2f7ff; }
.member-op-btn.op-at:hover:not(:disabled),
.member-op-btn.op-at.picked { background: #2f7cf6; border-color: #2f7cf6; color: #fff; }
.member-op-btn:disabled { opacity: .45; cursor: default; }

.chat-at-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 14px 0;
}
.at-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 24px;
    padding: 0 6px 0 9px;
    border-radius: 12px;
    background: #eaf3ff;
    color: #2f7cf6;
    font-size: 12px;
    line-height: 1;
}
.at-chip b { font-weight: 600; }
.at-chip-x {
    border: none;
    background: transparent;
    color: #7fb0f2;
    font-size: 11px;
    cursor: pointer;
    padding: 2px;
    line-height: 1;
}
.at-chip-x:hover { color: #2f7cf6; }

/* 规则弹窗：媒体配置 */
.rule-media-preview {
    margin-top: 6px;
    font-size: 12px;
    color: #2ea043;
    display: flex;
    align-items: center;
    gap: 8px;
}
.rule-media-preview img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #eee;
    background: #f7f7f7;
}
.rule-group-selected { margin-top: 6px; }
.rule-group-sel-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #d2374f;
    background: #fff0f2;
    border-radius: 999px;
    padding: 3px 10px;
}
.rule-group-sel-tag a { color: #999; text-decoration: underline; }
.rule-emoji-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
    margin-top: 6px;
    padding: 4px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    background: #fafafa;
}
.rule-emoji-tile {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    cursor: pointer;
}
.rule-emoji-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.rule-emoji-tile:hover { border-color: #ffb3a7; }
.rule-emoji-tile.selected { border-color: #ff2442; box-shadow: 0 0 0 1px #ff2442 inset; }
.rule-emoji-sel-img {
    width: 20px;
    height: 20px;
    object-fit: cover;
    border-radius: 4px;
    vertical-align: middle;
}
.rule-type-badge {
    display: inline-block;
    font-size: 11px;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 999px;
    white-space: nowrap;
}
.rule-type-text { background: #f0f0f0; color: #666; }
.rule-type-image { background: #e8f3ff; color: #1677ff; }
.rule-type-emoji { background: #e6fffb; color: #08979c; }
.rule-type-note { background: #fff5e6; color: #d48806; }
.rule-type-group { background: #fff0f2; color: #d2374f; }
.rule-type-goods { background: #f0ebff; color: #722ed1; }

.chat-input {
    flex: 1;
    resize: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    max-height: 120px;
    transition: border-color .15s, box-shadow .15s;
}
.chat-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(244,31,62,.1);
}
.chat-send-btn {
    height: 40px;
    min-width: 76px;
    flex-shrink: 0;
}

/* 账号管理：头像 + 昵称 */
.text-muted {
    color: var(--text-3);
}
.acc-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}
.acc-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #f0f0f0;
    box-shadow: 0 0 0 1px var(--border);
}
.acc-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}
.acc-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.3;
}
.acc-info strong {
    font-size: 13.5px;
    color: var(--text-1);
    font-weight: 600;
}
.acc-nick {
    font-size: 12px;
    color: var(--text-3);
}

/* 账号表：ID 列弱化、时间列等宽数字 */
#accounts-tbody td:first-child {
    color: var(--text-3);
    font-size: 12px;
}
#accounts-tbody td:nth-child(5) {
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}


/* ===== 富媒体消息：图片/笔记/卡片 ===== */
.msg-bubble-image {
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.msg-img {
    display: block;
    max-width: 220px;
    max-height: 300px;
    border-radius: 12px;
    cursor: zoom-in;
    object-fit: cover;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.msg-bubble-image.img-broken {
    min-width: 90px;
    min-height: 90px;
    border-radius: 12px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 13px;
}
.msg-bubble-image.img-broken::before { content: "[图片]"; }

/* 笔记/文件/链接卡片：双方都用浅色卡片样式（封面+文字，红底上无法阅读） */
a.msg-card { text-decoration: none; }
.msg-card {
    display: flex;
    gap: 10px;
    align-items: center;
    width: 248px;
    padding: 10px;
    background: #fff;
    color: #333;
    border-radius: 12px;
    cursor: pointer;
    transition: box-shadow .15s;
}
.msg-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.14); }
.msg-card-cover {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f5f5f5;
}
.msg-card-cover-ph {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}
.msg-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.msg-card-tag {
    font-size: 10px;
    color: var(--brand);
    background: #fff0f2;
    border-radius: 4px;
    padding: 1px 6px;
    align-self: flex-start;
    line-height: 1.5;
}
.msg-card-title {
    font-size: 13px;
    line-height: 1.4;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.msg-card-author {
    font-size: 11px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.msg-card-desc {
    font-size: 11px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* 群名片气泡 */
.msg-group-card { cursor: default; }
.msg-group-card:hover { box-shadow: none; }
.msg-group-cover { border-radius: 50%; }
.msg-group-join {
    margin-top: 4px;
    align-self: flex-start;
    background: var(--brand);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    padding: 6px 14px;
    border-radius: 14px;
}

/* 优惠券卡气泡（tradeCoupon，无封面，紧凑红券样式） */
a.msg-coupon { text-decoration: none; }
.msg-coupon {
    display: block;
    width: 192px;
    padding: 0;
    background: #fff;
    color: #333;
    white-space: normal;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow .15s;
}
/* 自己发送时覆盖红色气泡底，保证券卡始终白底深字 */
.msg-row.me a.msg-coupon,
.msg-row.me .msg-coupon {
    background: #fff;
    color: #333;
    box-shadow: 0 1px 2px rgba(16,24,40,0.08);
}
.msg-coupon:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.14); }
.msg-coupon-body {
    padding: 8px 10px 9px 11px;
    border-left: 3px solid #ff2442;
}
.msg-coupon-head {
    display: flex;
    align-items: center;
    gap: 6px;
}
.msg-coupon-badge {
    flex-shrink: 0;
    font-size: 10px;
    line-height: 1;
    color: #fff;
    background: #ff2442;
    border-radius: 4px;
    padding: 3px 5px;
}
.msg-coupon-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.msg-coupon-scope {
    margin-top: 3px;
    font-size: 11px;
    line-height: 1.3;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.msg-coupon-btn {
    margin-top: 7px;
    display: inline-block;
    background: #ff2442;
    color: #fff;
    font-size: 12px;
    line-height: 1;
    padding: 5px 14px;
    border-radius: 13px;
}

/* 大图查看遮罩 */
.img-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.82);
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}
.img-lightbox.open { display: flex; }
.img-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 6px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.5);
}

/* ========== 笔记管理 ========== */
.nt-ic { width: 15px; height: 15px; flex-shrink: 0; display: inline-block; vertical-align: -2px; }
#page-notes .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
#page-notes .btn .nt-ic { width: 14px; height: 14px; }
#modal-note-detail .modal-header-actions .btn,
#modal-note-editor .ne-footer .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
#modal-note-detail .modal-header-actions .btn .nt-ic,
#modal-note-editor .ne-footer .btn .nt-ic { width: 14px; height: 14px; }
.fans-delta { display: inline-flex; align-items: center; gap: 2px; }
.fans-delta .nt-ic { width: 11px; height: 11px; }
.nt-spinner {
    width: 13px; height: 13px; flex-shrink: 0;
    border: 2px solid rgba(0,0,0,.15); border-top-color: currentColor;
    border-radius: 50%; display: inline-block; animation: nt-spin .7s linear infinite;
}
@keyframes nt-spin { to { transform: rotate(360deg); } }

.notes-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.notes-header-actions select {
    min-width: 180px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.notes-header-actions select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(244,31,62,.1);
}

/* 粉丝信息条 */
.notes-fans-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 20px;
    margin: 16px 0 20px;
    box-shadow: var(--shadow-sm);
}
.fans-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}
.fans-item b {
    font-size: 20px;
    color: var(--brand);
}
.fans-label { color: var(--text-3); font-size: 13px; }
.fans-delta { font-size: 12px; font-weight: 600; }
.fans-up { color: var(--brand); }
.fans-down { color: #999; }
.fans-flat { color: #bbb; }

/* 笔记卡片网格 */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
}
.notes-empty {
    grid-column: 1 / -1;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-3);
    font-size: 14px;
}
.note-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform .15s, box-shadow .15s, border-color .15s;
    display: flex;
    flex-direction: column;
}
.note-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
}
.note-card-off { opacity: .55; }
.note-card-cover-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #f5f5f5;
}
.note-card-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.note-card-cover.cover-broken { display: none; }
.note-card-cover.cover-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d3d6dc;
    background: #f6f7f9;
}
.note-card-cover.cover-empty .nt-ic { width: 42px; height: 42px; }
.note-card-tags {
    position: absolute;
    left: 8px;
    top: 8px;
    display: flex;
    gap: 4px;
}
.note-tag {
    font-size: 11px;
    line-height: 1;
    padding: 3px 7px;
    border-radius: 4px;
    color: #fff;
    background: rgba(0,0,0,0.45);
}
.tag-video { background: rgba(47,124,246,.9); }
.tag-note { background: rgba(0,0,0,0.45); }
.tag-private { background: rgba(250,140,22,.92); }
.tag-offline { background: rgba(130,130,130,.92); }
.note-unread-badge {
    position: absolute;
    right: 8px;
    bottom: 8px;
    background: var(--brand);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(244,31,62,.35);
}
.note-card-body {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.note-card-title {
    font-size: 14px;
    line-height: 1.4;
    font-weight: 600;
    color: var(--text-1);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 39px;
}
.note-card-date { font-size: 12px; color: var(--text-3); }
.note-card-metrics {
    display: flex;
    justify-content: space-between;
    gap: 4px;
    margin-top: 2px;
}
.note-card-metrics .metric {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-3);
}
.note-card-metrics .metric i { font-style: normal; display: inline-flex; align-items: center; color: #9aa0ab; }
.note-card-metrics .metric i .nt-ic { width: 14px; height: 14px; }
.note-card-metrics .metric b { font-weight: 600; color: var(--text-2); }
.nm-up, .nm-down, .nm-na, .nm-flat {
    font-size: 10px;
    font-weight: 600;
    margin-left: 1px;
}
.nm-up { color: var(--brand); }
.nm-down { color: #999; }
.nm-na, .nm-flat { color: #ccc; font-weight: 400; }

/* 详情弹窗 */
.note-detail-content {
    width: 780px;
    max-width: 94%;
}
.note-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}
.note-metric-item {
    background: #fafafa;
    border-radius: 10px;
    padding: 12px 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.nm-label { font-size: 12px; color: #999; }
.nm-value { font-size: 22px; color: #333; }
.nm-delta { min-height: 14px; font-size: 12px; }

/* 趋势图 */
.note-trend-box { margin-bottom: 18px; }
.note-trend-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.section-title { font-size: 15px; font-weight: 600; color: #333; }
.note-link-btn {
    font-size: 12px;
    color: var(--brand);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.note-link-btn .nt-ic { width: 13px; height: 13px; }
.note-link-btn:hover { text-decoration: underline; }
.note-link-btn.note-link-disabled {
    color: #aaa;
    background: #f5f5f5;
    border: 1px solid #ececec;
    border-radius: 6px;
    padding: 3px 10px;
    cursor: not-allowed;
    pointer-events: none;
}
.note-trend-chart {
    border: 1px solid #f0f0f0;
    border-radius: 10px;
    padding: 10px;
    background: #fdfdfd;
}
.trend-svg { width: 100%; height: auto; display: block; }
.trend-grid { stroke: #eee; stroke-width: 1; }
.trend-x-label { font-size: 11px; fill: #aaa; }
.trend-end-label { font-size: 11px; font-weight: 600; }
.trend-hint {
    text-align: center;
    font-size: 12px;
    color: #aaa;
    padding: 4px 0 2px;
}

/* 单日数据视图（趋势图仅有一个数据点时） */
.trend-single { padding: 14px 8px 8px; }
.trend-single-date {
    font-size: 12px;
    color: #999;
    margin-bottom: 12px;
}
.trend-single-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}
.trend-single-item {
    background: #fafafa;
    border-radius: 10px;
    padding: 14px 6px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}
.trend-single-item b { font-size: 24px; font-weight: 700; line-height: 1.1; }
.trend-single-item span { font-size: 12px; color: #888; }

/* 评论区 */
.note-comments-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.note-comments-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.comments-empty {
    text-align: center;
    color: #999;
    font-size: 13px;
    padding: 30px 0;
}
.comment-item {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
}
.comment-item.comment-unread {
    background: #fff7f8;
    border: 1px solid #ffe1e6;
}
.comment-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #f0f0f0;
}
.comment-avatar-sm { width: 28px; height: 28px; }
.comment-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffd6dd;
    color: var(--brand);
    font-size: 14px;
    font-weight: 600;
}
.comment-body { flex: 1; min-width: 0; }
.comment-name {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    display: flex;
    align-items: center;
    gap: 6px;
}
.self-badge {
    font-size: 10px;
    color: #fff;
    background: var(--brand);
    border-radius: 3px;
    padding: 1px 5px;
    font-weight: 400;
}
.unread-dot {
    font-size: 10px;
    color: var(--brand);
    background: #ffe1e6;
    border-radius: 3px;
    padding: 1px 5px;
}
.comment-text {
    font-size: 14px;
    color: #222;
    line-height: 1.55;
    margin: 3px 0;
    word-break: break-word;
}
.comment-meta-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: #aaa;
}
.comment-like { color: #999; display: inline-flex; align-items: center; gap: 3px; }
.comment-like .nt-ic { width: 12px; height: 12px; }
.replied-mark {
    color: #52a84f;
    background: #f0faf0;
    border-radius: 4px;
    padding: 1px 6px;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.comment-reply-btn {
    border: none;
    background: none;
    color: var(--brand);
    font-size: 12px;
    cursor: pointer;
    padding: 0;
}
.comment-reply-btn:hover { text-decoration: underline; }

/* 楼中楼 */
.sub-comments {
    margin-top: 8px;
    background: #f7f7f8;
    border-radius: 8px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sub-comment {
    display: flex;
    gap: 8px;
    padding: 4px;
    border-radius: 6px;
}
.sub-comment.comment-unread { background: #fff0f2; }
.sub-comment-self .comment-name { color: var(--brand); }
.sub-comment-body { flex: 1; min-width: 0; }

/* 回复输入框 */
.reply-box {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.reply-box textarea {
    width: 100%;
    border: 1px solid #e2c4c9;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    outline: none;
}
.reply-box textarea:focus { border-color: var(--brand); }
.reply-box-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.reply-msg { font-size: 12px; color: #999; }
.reply-error { color: var(--brand); }

/* ========== 笔记发布 / 编辑 / 删除 / 预览 / 草稿箱 ========== */

/* 通用表单输入（笔记模块） */
.form-input {
    width: 100%;
    padding: 7px 11px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    color: var(--text-1);
    background: #fff;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(244, 31, 62, 0.1);
}

.btn:disabled,
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* 详情弹窗头部操作区 */
.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 红色描边小按钮 */
.btn-danger-outline {
    background: #fff;
    color: var(--brand);
    border: 1px solid var(--brand);
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}
.btn-danger-outline:hover {
    background: var(--brand);
    color: #fff;
}

/* 草稿箱角标 */
#notes-draft-btn { position: relative; }
.draft-badge {
    position: absolute;
    top: -7px;
    right: -9px;
    min-width: 17px;
    height: 17px;
    padding: 0 5px;
    background: var(--brand);
    color: #fff;
    border: 1.5px solid #fff;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.draft-badge[hidden] { display: none; }

/* 小弹窗 */
.modal-sm { width: 420px; }

/* ---------- 笔记编辑器 ---------- */
.note-editor-content {
    width: 680px;
    max-width: 94%;
    position: relative;
}
.ne-account-line {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #666;
    margin-bottom: 14px;
}
.ne-mode-tag {
    font-size: 11px;
    color: var(--brand);
    background: #fff0f2;
    border: 1px solid #ffd3da;
    border-radius: 4px;
    padding: 1px 7px;
    line-height: 1.5;
}
.ne-section { margin-bottom: 16px; }
.ne-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    margin-bottom: 8px;
}
.ne-count {
    font-size: 12px;
    color: #999;
    font-weight: 400;
}

/* 图片网格 */
.ne-img-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 110px);
    gap: 10px;
}
.ne-img-item {
    position: relative;
    width: 110px;
    height: 110px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    border: 1px solid #eee;
}
.ne-img-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ne-img-tag {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 10px;
    border-radius: 4px;
    padding: 1px 6px;
    line-height: 1.5;
}
.ne-cover-tag {
    position: absolute;
    left: 0;
    bottom: 0;
    background: var(--brand);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px 2px 6px;
    border-radius: 0 8px 0 0;
}
.ne-img-op {
    position: absolute;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s;
}
.ne-img-op:hover { background: rgba(255,36,66,0.92); }
.ne-img-item:hover .ne-img-op { display: inline-flex; }
.ne-img-left { left: 4px; top: 50%; transform: translateY(-50%); }
.ne-img-right { right: 4px; top: 50%; transform: translateY(-50%); }
.ne-img-del { top: 4px; right: 4px; font-size: 10px; }

.ne-img-add {
    width: 110px;
    height: 110px;
    border: 1.5px dashed #d0d0d0;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: #999;
    font-size: 12px;
    cursor: pointer;
    background: #fafafa;
    transition: all 0.2s;
}
.ne-img-add:hover {
    border-color: var(--brand);
    color: var(--brand);
    background: #fff7f8;
}
.ne-img-add-icon { font-size: 24px; line-height: 1; }

.ne-img-mask {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #fff;
    font-size: 12px;
}
.ne-img-mask .btn { margin-top: 2px; }
.ne-img-error { background: rgba(180,30,30,0.72); }

/* 笔记类型切换（图文 / 视频） */
.ne-type-tabs {
    display: inline-flex;
    border: 1px solid #ececec;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
}
.ne-type-tab {
    border: none;
    background: #fafafa;
    color: #666;
    font-size: 13px;
    padding: 7px 20px;
    cursor: pointer;
    transition: all 0.15s;
}
.ne-type-tab + .ne-type-tab { border-left: 1px solid #ececec; }
.ne-type-tab:hover { color: var(--brand); }
.ne-type-tab.on { background: var(--brand); color: #fff; font-weight: 600; }
.ne-type-tab.on + .ne-type-tab,
.ne-type-tab + .ne-type-tab.on { border-left-color: var(--brand); }

/* 视频选择区 */
.ne-video-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #333;
}
.ne-video-count { font-size: 12px; color: #999; }
.ne-video-slot { display: flex; }
.ne-video-add {
    width: 190px;
    height: 130px;
    border: 1.5px dashed #d0d0d0;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #999;
    font-size: 12px;
    cursor: pointer;
    background: #fafafa;
    transition: all 0.2s;
}
.ne-video-add:hover { border-color: var(--brand); color: var(--brand); background: #fff7f8; }
.ne-video-item {
    position: relative;
    width: 190px;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    border: 1px solid #eee;
}
.ne-video-item video {
    display: block;
    width: 100%;
    height: 230px;
    object-fit: contain;
    background: #000;
}
.ne-video-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 5px 8px;
    font-size: 11px;
    color: #666;
    background: #fafafa;
}
.ne-video-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ne-video-item:hover .ne-video-del { display: inline-flex; }
.ne-video-mask .ne-progress {
    width: 82%;
    height: 4px;
    background: rgba(255,255,255,0.28);
    border-radius: 2px;
    overflow: hidden;
}
.ne-progress-bar { height: 100%; width: 0; background: #fff; transition: width 0.2s; }

/* 自定义封面 */
.ne-cover-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-top: 14px;
}
.ne-cover-label {
    font-size: 13px;
    color: #333;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.ne-cover-hint { font-size: 11px; color: #999; line-height: 1.5; }
.ne-cover-slot { display: flex; }
.ne-cover-add {
    width: 96px;
    height: 96px;
    border: 1.5px dashed #d0d0d0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 11px;
    cursor: pointer;
    background: #fafafa;
    text-align: center;
    padding: 0 6px;
    transition: all 0.2s;
}
.ne-cover-add:hover { border-color: var(--brand); color: var(--brand); background: #fff7f8; }
.ne-cover-item {
    position: relative;
    width: 96px;
    height: 96px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    border: 1px solid #eee;
}
.ne-cover-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ne-cover-item:hover .ne-img-op { display: inline-flex; }

/* 标题 / 正文 / 可见范围 */
.ne-title-input { height: 38px; }
.ne-content-input {
    height: 160px;
    resize: vertical;
    line-height: 1.6;
}
.ne-topic-tip {
    margin-top: 6px;
    font-size: 12px;
    color: #999;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 5px;
}
.ne-topic-tip > .nt-ic { width: 14px; height: 14px; margin-top: 2px; color: #e8a13a; flex-shrink: 0; }
.ne-topic-tip b { color: var(--brand); font-weight: 600; }
.ne-privacy-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
}
.ne-privacy-select {
    width: auto;
    min-width: 150px;
    padding: 7px 10px;
}
.ne-privacy-tip { font-size: 12px; color: #999; display: inline-flex; align-items: center; gap: 4px; }
.ne-privacy-tip .nt-ic { width: 13px; height: 13px; color: #e6a23c; }

/* 提交中遮罩 */
.ne-busy {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.72);
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}
.ne-busy[hidden] { display: none; }
.ne-busy-box {
    background: rgba(40,40,40,0.88);
    color: #fff;
    font-size: 13px;
    border-radius: 8px;
    padding: 14px 22px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.ne-spinner {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    display: inline-block;
    animation: ne-spin 0.8s linear infinite;
    flex: none;
}
@keyframes ne-spin { to { transform: rotate(360deg); } }

.ne-footer { position: relative; }

/* ---------- 删除确认 ---------- */
.del-warning {
    background: #fff6f0;
    border: 1px solid #ffd8c4;
    color: #cf3b12;
    font-size: 13px;
    line-height: 1.6;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 14px;
    display: flex;
    align-items: flex-start;
    gap: 7px;
}
.del-warning > .nt-ic { width: 16px; height: 16px; margin-top: 2px; flex-shrink: 0; }
.del-warning b { color: #d93026; }
.del-target {
    font-size: 13px;
    color: #555;
    margin-bottom: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.del-tip {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

/* ---------- 手机预览 ---------- */
.preview-content {
    width: 440px;
    max-width: 94%;
    overflow: hidden;
}
.preview-body {
    display: flex;
    justify-content: center;
    padding: 18px;
    background: #f0f1f5;
    overflow-x: auto;
}
.phone-frame {
    width: 360px;
    height: 680px;
    max-height: calc(90vh - 110px);
    background: #fff;
    border: 9px solid #1c1c1e;
    border-radius: 38px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
    flex: none;
}
.phone-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 130px;
    height: 18px;
    background: #1c1c1e;
    border-radius: 0 0 14px 14px;
    z-index: 10;
}
.phone-author {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 26px 14px 10px;
    flex: none;
}
.phone-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: #eee;
    border: 1px solid #f0f0f0;
}
.phone-author-info { flex: 1; min-width: 0; }
.phone-nickname {
    font-size: 14px;
    font-weight: 600;
    color: #222;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.phone-sub { font-size: 11px; color: #999; margin-top: 1px; }
.phone-follow {
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 12px;
    padding: 5px 14px;
    cursor: default;
    flex: none;
}
.phone-carousel {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f5f5f5;
    flex: none;
}
.phone-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.phone-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.4);
    color: #fff;
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.phone-arrow:hover { background: rgba(0,0,0,0.6); }
.phone-prev { left: 8px; }
.phone-next { right: 8px; }
.phone-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
}
.phone-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.6);
    cursor: pointer;
}
.phone-dot.on { background: #fff; width: 14px; border-radius: 3px; }
.phone-index {
    position: absolute;
    right: 10px;
    bottom: 8px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 11px;
    border-radius: 10px;
    padding: 1px 8px;
}
.phone-text {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px 16px;
}
.phone-title {
    font-size: 15px;
    font-weight: 700;
    color: #222;
    margin-bottom: 6px;
}
.phone-desc {
    font-size: 13px;
    line-height: 1.7;
    color: #444;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ---------- 草稿箱 ---------- */
.draft-box-content { width: 560px; }
.draft-box-sub { font-size: 12px; color: #999; font-weight: 400; }
.draft-box-list { display: flex; flex-direction: column; gap: 10px; }
.draft-item {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 12px 14px;
    background: #fafafa;
    transition: border-color 0.2s;
}
.draft-item:hover { border-color: #ffc4cd; }
.draft-item-main { flex: 1; min-width: 0; }
.draft-item-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 7px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.draft-edit-tag {
    font-size: 10px;
    font-weight: 400;
    color: #e68a00;
    background: #fff6e5;
    border: 1px solid #ffe2ad;
    border-radius: 4px;
    padding: 0 6px;
    line-height: 1.6;
    flex: none;
}
.draft-item-snippet {
    font-size: 12px;
    color: #777;
    margin: 4px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.draft-no-text { color: #bbb; }
.draft-item-meta { font-size: 11px; color: #aaa; }
.draft-item-ops { display: flex; gap: 8px; flex: none; }

/* ========== 智能批量私信 ========== */
.bl-card { margin-bottom: 18px; }
.bl-card-title { position: relative; font-size: 15px; font-weight: 600; color: var(--text-1);
    margin-bottom: 14px; padding-left: 10px; }
.bl-card-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 14px;
    border-radius: 2px;
    background: var(--brand);
}
.bl-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.bl-card-head .bl-card-title { margin-bottom: 0; }
.bl-job-sub { font-size: 12px; color: var(--text-3); font-weight: normal; margin-left: 8px; }
.bl-label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.bl-hint { font-size: 12px; color: var(--text-3); font-weight: normal; }
.bl-hint code { background: var(--bg); padding: 1px 5px; border-radius: 4px; font-size: 11px; }
.bl-form-row { margin-bottom: 14px; }
.bl-form-grid { display: flex; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.bl-form-cell { flex: 1; min-width: 150px; }
.bl-form-cell .form-input { margin-bottom: 4px; }
.bl-textarea { resize: vertical; line-height: 1.6; }
.bl-uids { font-family: Consolas, Menlo, monospace; font-size: 13px; }
.bl-create-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.bl-import-result { font-size: 13px; line-height: 1.6; }
.bl-import-result.bl-ok { color: #389e0d; }
.bl-import-result.bl-warn { color: #d46b08; }
.bl-err { color: var(--brand); font-size: 13px; }

/* 账号选择 */
.bl-acct-list { display: flex; flex-direction: column; gap: 8px; }
.bl-acct-item { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--border);
    border-radius: 8px; cursor: pointer; font-size: 13px; transition: border-color .15s, background .15s; }
.bl-acct-item:hover { border-color: var(--brand-tint-2); background: var(--brand-tint); }
.bl-acct-item.is-disabled { opacity: .55; cursor: not-allowed; background: var(--bg-soft); }
.bl-acct-order { display: inline-block; min-width: 30px; font-weight: 700; color: var(--brand); font-size: 12px; }
.bl-acct-name { font-weight: 500; }
.bl-acct-id { color: var(--text-3); font-size: 12px; }
.bl-acct-tag { margin-left: auto; font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.bl-tag-on { background: #eafaf0; color: #168a3e; }
.bl-tag-off { background: var(--bg); color: var(--text-3); }

/* 进度/统计 */
.bl-note { background: #fdf5e7; border: 1px solid #f6dfae; color: #b07610; font-size: 13px;
    padding: 8px 12px; border-radius: 8px; margin-bottom: 12px; line-height: 1.6; }
.bl-progress-wrap { margin-bottom: 14px; }
.bl-stats { display: flex; gap: 20px; font-size: 13px; color: var(--text-2); margin-bottom: 8px; flex-wrap: wrap; }
.bl-stats b { font-size: 16px; color: var(--text-1); margin-left: 4px; }
.bl-stats .bl-ok b { color: #168a3e; }
.bl-stats .bl-fail b { color: var(--brand); }
.bl-stats .bl-pending b { color: #ef8a17; }
.bl-progress { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.bl-progress-bar { height: 100%; width: 0; background: var(--brand);
    border-radius: 4px; transition: width .4s; }

/* 账号状态卡片 */
.bl-acct-status { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.bl-acct-chip { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px;
    border: 1px solid var(--border); background: var(--bg-soft); font-size: 13px; flex-wrap: wrap; }
.bl-acct-chip.is-current { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(244,31,62,.12); background: var(--brand-tint); }
.bl-chip-order { width: 20px; height: 20px; border-radius: 50%; background: #c9ccd3; color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-size: 11px; }
.bl-acct-chip.is-current .bl-chip-order { background: var(--brand); }
.bl-chip-name { font-weight: 600; }
.bl-chip-state { font-size: 12px; padding: 2px 9px; border-radius: 999px; }
.bl-chip-cnt { font-size: 12px; color: var(--text-3); }
.bl-chip-reason { font-size: 12px; color: #b07610; }
.bl-state-sending .bl-chip-state { background: #e8effe; color: #2f63dc; }
.bl-state-waiting .bl-chip-state { background: var(--bg); color: var(--text-3); }
.bl-state-limited { background: #fef0f2; }
.bl-state-limited .bl-chip-state { background: #fde3e7; color: #c11430; }
.bl-state-offline { background: var(--bg-soft); }
.bl-state-offline .bl-chip-state { background: #fdf5e7; color: #b07610; }

/* 表格/tab */
.bl-table { font-size: 13px; }
.bl-uid { font-family: Consolas, Menlo, monospace; font-size: 12px; word-break: break-all; }
.bl-reason { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: #c11430; font-size: 12px; }
.bl-empty { text-align: center; color: var(--text-3); padding: 24px 0 !important; font-size: 13px; }
/* 发送明细：限高内部滚动（合并后只保留一张表，避免占满整页），表头吸顶 */
.bl-targets-scroll { max-height: 420px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
/* collapse 边框模型会使 th 的 sticky 失效，滚动表格改用 separate（视觉不变） */
.bl-targets-scroll .bl-table { border-collapse: separate; border-spacing: 0; }
.bl-targets-scroll .bl-table thead th { position: sticky; top: 0; z-index: 1; }
.bl-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.bl-tab { border: 1px solid var(--border); background: #fff; padding: 5px 14px; border-radius: 999px;
    font-size: 13px; cursor: pointer; color: var(--text-2); transition: all .15s; }
.bl-tab:hover:not(.active) { background: var(--bg-soft); color: var(--text-1); }
.bl-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.bl-badge { font-size: 12px; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.bl-badge-sent { background: #eafaf0; color: #168a3e; }
.bl-badge-failed { background: #fde3e7; color: #c11430; }
.bl-badge-pending { background: #fdf5e7; color: #b07610; }

/* ========== 账号专属代理 ========== */
.px-dot { display: inline-block; margin-left: 6px; font-size: 11px; padding: 1px 7px;
    border-radius: 9px; background: var(--bg); color: var(--text-3); vertical-align: middle; }
.px-dot.is-on { background: #e6f4ff; color: #1677ff; }
.px-result { margin-top: 10px; font-size: 13px; line-height: 1.7; padding: 9px 12px;
    border-radius: 8px; background: #fafafa; color: #888; word-break: break-all; }
.px-result.px-ok { background: #f0fff0; color: #237804; border: 1px solid #b7eb8f; }
.px-result.px-fail { background: #fff1f0; color: #cf1322; border: 1px solid #ffa39e; }
.px-result.px-wait { background: #e6f4ff; color: #0958d9; border: 1px solid #91caff; }
#px-url { font-family: Consolas, Menlo, monospace; font-size: 13px; }

/* ========== 添加账号·代理引导 ========== */
.add-proxy-skip {
    margin-top: 8px; padding: 0; border: none; background: none; cursor: pointer;
    font-size: 12.5px; color: var(--text-3); text-decoration: underline;
    text-underline-offset: 2px;
}
.add-proxy-skip:hover { color: var(--brand); }
.add-proxy-offbox {
    margin-top: 4px; padding: 12px 14px;
    background: #fff7e6; border: 1px solid #ffd591; border-radius: 8px;
}
.add-proxy-off-title { font-size: 13px; font-weight: 600; color: #ad4e00; margin-bottom: 2px; }
.add-proxy-offbox .form-hint { color: #8c5a17; }

#modal-proxy-warning { z-index: 1010; }
.modal-warn { width: 420px; }
.modal-warn-body { padding: 26px 26px 18px; text-align: center; }
.modal-warn-icon {
    width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: #fff1f0; color: #f5222d;
}
.modal-warn-icon svg { width: 27px; height: 27px; }
.modal-warn-body h3 { font-size: 16px; font-weight: 600; color: var(--text-1); margin-bottom: 10px; }
.modal-warn-body p { font-size: 13.5px; line-height: 1.75; color: var(--text-2); text-align: left; }
.modal-warn-footer {
    padding: 4px 26px 22px; display: flex; justify-content: flex-end; gap: 10px;
}

/* ========== AI 客服 ========== */
/* nt-check / nt-actions / nt-id / nt-badge：多页面共用的小组件 */
.nt-check { display: flex; align-items: center; gap: 6px; font-size: 13px;
    font-weight: 600; margin-bottom: 10px; cursor: pointer; color: var(--text-1); }
.nt-actions { display: flex; gap: 10px; margin-top: 12px; }
.nt-id { color: var(--text-3); font-size: 12px; }
.nt-badge { font-size: 12px; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.nt-badge-on { background: #e8effe; color: #2f63dc; }
.nt-badge-line { background: var(--bg); color: var(--text-2); }
.nt-badge-off { background: var(--bg); color: var(--text-3); }
.ai-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; margin-bottom: 16px; }
.ai-grid .card { margin-bottom: 0; }
.ai-card-title { position: relative; font-size: 15px; font-weight: 600; color: var(--text-1);
    margin: 0 0 14px; padding-left: 10px; display: flex; align-items: center;
    justify-content: space-between; gap: 10px; }
.ai-card-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 14px;
    border-radius: 2px;
    background: var(--brand);
}
.ai-form-row { display: flex; gap: 12px; }
.ai-cell { margin-bottom: 10px; flex: 1; min-width: 0; }
.ai-cell-grow { flex: 1.4; }
.ai-cell label { display: block; font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.ai-cell .form-input { width: 100%; padding: 6px 8px; font-size: 13px; }
.ai-textarea { resize: vertical; font-family: inherit; line-height: 1.6; }
.ai-hint { color: var(--text-3); font-size: 12px; font-weight: 400; }
.ai-hint-block { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 6px;
    padding: 8px 10px; font-size: 12px;
    color: var(--text-3); line-height: 1.7; margin-bottom: 12px; }
.ai-test-result { font-size: 12px; align-self: center; }
.ai-ok { color: #16a34a; }
.ai-fail { color: #dc2626; }
.ai-account-list { display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow-y: auto; }
.ai-account-row { display: flex; align-items: center; justify-content: space-between;
    padding: 8px 10px; border-radius: 6px; transition: background .15s; }
.ai-account-row:hover { background: var(--bg-soft); }
.ai-switch { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.ai-name { font-weight: 600; }
.ai-add-btn { font-weight: 400; }
.ai-kb-table .ai-kb-kw { color: var(--text-3); font-size: 12px; }
.ai-kb-table .ai-kb-ans { max-width: 380px; }
.ai-kb-table td { vertical-align: top; }
.ai-kb-table th:nth-child(4), .ai-kb-table td:nth-child(4) { text-align: center; }
.ai-row-ops { white-space: nowrap; }
.ai-empty { text-align: center; color: var(--text-3); padding: 24px 0; font-size: 13px; }
.ai-ask-bar { display: flex; gap: 10px; }
.ai-ask-bar .form-input { flex: 1; }
.ai-ask-result { margin-top: 12px; }
.ai-ask-items { font-size: 12px; color: var(--text-3); margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.ai-ask-answer { background: #f6ffed; border: 1px solid #d9f2c0; border-radius: 8px;
    padding: 12px 14px; font-size: 14px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; }
.ai-ask-silent { color: #b07a00; }
.ai-ask-error { color: #f5222d; font-size: 13px; }
@media (max-width: 1100px) {
    .ai-grid { grid-template-columns: 1fr; }
}

/* ========== 创意工坊 ========== */
.ws-ic { width: 15px; height: 15px; flex-shrink: 0; display: inline-block; vertical-align: -2px; }
#page-workshop .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
#page-workshop .btn .ws-ic { width: 14px; height: 14px; }
.ws-tip { background: linear-gradient(120deg, #fff8f0 0%, #fff4ea 100%); border: 1px solid #f5ddc3; color: #8a5a30;
    font-size: 13px; line-height: 1.8; padding: 12px 16px; margin-bottom: 14px; border-radius: 10px;
    display: flex; align-items: center; gap: 11px; }
.ws-tip b { color: #6e441d; }
.ws-tip-ic { width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0; display: flex;
    align-items: center; justify-content: center; color: #fff;
    background: linear-gradient(135deg, #ffb457 0%, #f5831c 100%);
    box-shadow: 0 4px 10px rgba(245,131,28,.3); transition: background .2s, box-shadow .2s; }
.ws-tip-ic.ws-tip-red { background: linear-gradient(135deg, #ff4763 0%, #ef2b4b 100%); box-shadow: 0 4px 10px rgba(239,43,75,.3); }
.ws-tip-ic.ws-tip-blue { background: linear-gradient(135deg, #4d86f7 0%, #2f6fe8 100%); box-shadow: 0 4px 10px rgba(47,111,232,.3); }
.ws-tip-ic.ws-tip-amber { background: linear-gradient(135deg, #ffb457 0%, #f5831c 100%); box-shadow: 0 4px 10px rgba(245,131,28,.3); }
.ws-tip-ic.ws-tip-violet { background: linear-gradient(135deg, #8a6cf5 0%, #6d4fe0 100%); box-shadow: 0 4px 10px rgba(109,79,224,.3); }
.ws-tip-ic .ws-ic { width: 17px; height: 17px; }
.ws-tip-txt { flex: 1; }
.ws-tabs { display: flex; gap: 4px; margin-bottom: 16px; padding: 5px; background: #f3f4f6;
    border: 1px solid #ecedf0; border-radius: 12px; }
.ws-tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 4px; border-radius: 9px; border: 1px solid transparent;
    cursor: pointer; font-size: 13px; color: #8a8f99; user-select: none; font-weight: 500;
    transition: background .18s, color .18s, box-shadow .18s; }
.ws-tab:hover { color: var(--text-1); background: rgba(255,255,255,.65); }
.ws-tab-on { background: #fff; color: var(--text-1); font-weight: 600;
    box-shadow: 0 1px 3px rgba(17,24,39,.08), 0 2px 8px rgba(17,24,39,.05); border-color: #eceef2; }
.ws-tab-on:hover { background: #fff; }
.ws-tab-ic { width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center;
    justify-content: center; transition: background .2s, box-shadow .2s; }
.ws-tab-ic .ws-ic { width: 16px; height: 16px; vertical-align: 0; }
.ws-tic-red { background: #ffecef; color: #f02d4d; }
.ws-tic-blue { background: #e9f0ff; color: #2f6fe8; }
.ws-tic-amber { background: #fdf2e0; color: #d98306; }
.ws-tic-violet { background: #efebff; color: #6d4fe0; }
.ws-tab-on .ws-tic-red { background: linear-gradient(135deg, #ff4763, #ef2b4b); color: #fff; box-shadow: 0 3px 9px rgba(239,43,75,.32); }
.ws-tab-on .ws-tic-blue { background: linear-gradient(135deg, #4d86f7, #2f6fe8); color: #fff; box-shadow: 0 3px 9px rgba(47,111,232,.32); }
.ws-tab-on .ws-tic-amber { background: linear-gradient(135deg, #f5a623, #e8850a); color: #fff; box-shadow: 0 3px 9px rgba(232,133,10,.3); }
.ws-tab-on .ws-tic-violet { background: linear-gradient(135deg, #8a6cf5, #6d4fe0); color: #fff; box-shadow: 0 3px 9px rgba(109,79,224,.32); }
.ws-tic-pink { background: #ffe4ec; color: #ec2f6b; }
.ws-tab-on .ws-tic-pink { background: linear-gradient(135deg, #ff5e8d, #ec2f6b); color: #fff; box-shadow: 0 3px 9px rgba(236,47,107,.32); }
.ws-tip-ic.ws-tip-pink { background: linear-gradient(135deg, #ff6b97 0%, #ec2f6b 100%); box-shadow: 0 4px 10px rgba(236,47,107,.3); }
.ws-label { display: block; font-size: 12px; color: #888; margin: 10px 0 5px; }
.ws-prompt { resize: vertical; line-height: 1.7; font-family: inherit; }
.ws-chips { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin: 10px 0; }
.ws-chip-label { font-size: 12px; color: #aaa; }
.ws-chip { border: 1px solid #e5e7eb; background: #fafafa; border-radius: 14px; padding: 3px 12px;
    font-size: 12px; cursor: pointer; color: #555; }
.ws-chip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-tint); }
.ws-chip.ws-chip-on { border-color: var(--brand); background: var(--brand); color: #fff; }
.ws-ai-row { display: flex; gap: 14px; align-items: flex-end; margin-top: 8px; }
.ws-cell { flex: 1; }
.ws-cell .form-input { width: 100%; }
.ws-ai-row .btn { white-space: nowrap; padding: 0 26px; height: 36px; }
.ws-hint { font-size: 12px; color: #999; margin-top: 10px; min-height: 18px; }
.ws-hint-err { color: #f5222d; }
.ws-ai-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.ws-ai-preview { min-height: 360px; background: repeating-conic-gradient(#f5f5f5 0% 25%, #fafafa 0% 50%) 0/16px 16px;
    border: 1px solid #eee; border-radius: 10px; display: flex; align-items: center; justify-content: center;
    padding: 12px; }
.ws-preview-empty { color: #aaa; font-size: 13px; text-align: center; }
.ws-gen-img { max-width: 100%; max-height: 440px; border-radius: 8px; display: block; margin: 0 auto 10px; }
.ws-gen-ops { display: flex; gap: 10px; justify-content: center; }
.ws-edit-layout { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.ws-canvas-wrap { position: relative; background: #f3f4f6; border-radius: 10px; padding: 16px;
    display: flex; align-items: center; justify-content: center; min-height: 520px; }
#ws-canvas { max-width: 100%; max-height: 72vh; width: auto; height: auto; border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0,0,0,.12); touch-action: none; cursor: grab; }
#ws-canvas:active { cursor: grabbing; }
.ws-canvas-empty { position: absolute; inset: 16px; display: flex; flex-direction: column;
    align-items: center; justify-content: center; color: #999; font-size: 14px;
    background: #fff; border: 2px dashed #ddd; border-radius: 8px; }
.ws-controls { max-height: 78vh; overflow-y: auto; padding-right: 4px; }
/* 文字封面：右侧面板高度与左侧预览框（720px 画布 + 32px 内边距）严格对齐，避免底部留白 */
#ws-panel-text .ws-controls { max-height: 752px; }
.ws-ctrl-group { background: #fafafa; border: 1px solid #f0f0f0; border-radius: 8px;
    padding: 12px; margin-bottom: 12px; }
.ws-ctrl-title { font-size: 13px; font-weight: 600; color: #555; margin-bottom: 8px; }
.ws-ctrl-group .btn { margin: 0 6px 6px 0; }
.ws-seg { display: flex; gap: 0; border: 1px solid #e5e7eb; border-radius: 6px; overflow: hidden; width: fit-content; flex-wrap: wrap; }
.ws-seg button { border: none; background: #fff; padding: 5px 12px; font-size: 12px; cursor: pointer; color: #666;
    display: inline-flex; align-items: center; gap: 5px; }
.ws-seg button .ws-ic { width: 13px; height: 13px; }
.ws-seg button + button { border-left: 1px solid #e5e7eb; }
.ws-seg button.ws-seg-on { background: var(--brand); color: #fff; }
.ws-imode-seg { margin-bottom: 12px; flex-wrap: wrap; row-gap: 6px; }
.ws-imode-seg button { padding: 7px 16px; font-size: 13px; }
.ws-ref { background: #fafafa; border: 1px dashed #e5e7eb; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
.ws-ref-row { display: flex; gap: 12px; align-items: center; margin-top: 6px; }
.ws-ref-thumb { width: 72px; height: 72px; border-radius: 6px; border: 1px solid #e5e7eb; background: #fff center/cover no-repeat; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; color: #bbb; overflow: hidden; }
.ws-ref-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ws-ref-ops { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ws-ref-select { width: auto !important; min-width: 160px; flex: 0 1 auto; padding: 5px 8px; height: auto; font-size: 12px; }
.ws-tpl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 8px; }
.ws-tpl-card { border: 2px solid #e5e7eb; border-radius: 10px; padding: 8px 6px 6px; text-align: center; cursor: pointer; background: #fff; transition: border-color .15s, box-shadow .15s; }
.ws-tpl-card:hover { border-color: var(--border-strong); }
.ws-tpl-card.ws-tpl-on { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(244,31,62,.08); }
.ws-tpl-card canvas { width: 100%; height: auto; border-radius: 6px; display: block; }
.ws-tpl-name { font-size: 12px; color: #555; margin-top: 6px; }
.ws-tpl-card.ws-tpl-on .ws-tpl-name { color: var(--brand); font-weight: 600; }
.ws-tc-label { display: block; font-size: 12px; color: #888; margin: 10px 0 4px; }
/* ===== AI 员工 ===== */
.ws-staff-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.ws-staff-tab { display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; border-radius: 8px; background: #f3f4f6; color: var(--text-2);
    font-size: 13px; cursor: pointer; user-select: none; transition: all .15s; }
.ws-staff-tab .ws-ic { width: 15px; height: 15px; color: #9aa0aa; transition: color .15s; }
.ws-staff-tab.wst-on { background: var(--brand); color: #fff;
    font-weight: 600; box-shadow: 0 3px 9px rgba(244,31,62,.25); }
.ws-staff-tab.wst-on .ws-ic { color: #fff; }
.ws-staff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.ws-ref-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; flex-wrap: wrap; }
.ws-ref-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid #eee; }
.ws-staff-gen { width: 100%; margin-top: 12px; }
/* 爆款创作：配图网格 */
.ws-viral-imgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 10px; }
.ws-viral-slot {
    position: relative; border-radius: 8px; overflow: hidden;
    border: 1px solid #e6e8ec; background: #f7f8fa;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px; padding: 8px; text-align: center;
}
.ws-viral-slot img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; display: block; }
.ws-viral-slot.s-ok { border-color: #ffd0df; background: #fff; }
.ws-viral-slot.s-loading { background: #f2f3f7; color: #9aa0ab; font-size: 12px; }
.ws-viral-slot.s-loading p { margin: 0; }
.ws-viral-slot.s-fail { background: #fff4f4; border-color: #ffd4d4; color: #d33; font-size: 11.5px; }
.ws-viral-err { margin: 0; line-height: 1.4; word-break: break-all; }
.ws-viral-pending { color: #b6bac2; font-size: 12px; }
.ws-viral-redraw {
    position: absolute; right: 5px; top: 5px; z-index: 2;
    width: 26px; height: 26px; border-radius: 7px; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    background: rgba(20,22,28,.62); color: #fff; opacity: 0; transition: opacity .15s;
}
.ws-viral-slot:hover .ws-viral-redraw { opacity: 1; }
.ws-viral-redraw .ws-ic { width: 14px; height: 14px; }
.ws-viral-busy .ws-viral-redraw { pointer-events: none; }
.ws-viral-nseg { flex-wrap: nowrap; }
.ws-viral-nseg button { padding: 6px 10px; }
.ws-staff-actions { display: flex; gap: 8px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
.ws-staff-actions .ws-ref-select { flex: 1 1 150px; }
.ws-staff-settings { margin-top: 18px; border-top: 1px dashed #e5e7eb; padding-top: 12px; }
.ws-staff-settings summary { cursor: pointer; font-size: 13px; color: #888; user-select: none; }
.ws-staff-providers { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.ws-staff-providers .ws-hint { flex: 0 1 auto; }
.ws-staff-cfg { display: grid; grid-template-columns: 1fr 1fr 1.4fr auto; gap: 10px; margin-top: 10px; }
.ws-staff-cfg label { font-size: 12px; color: #888; }
.ws-staff-cfg input { margin-top: 4px; }
.ws-chat-box { height: 440px; overflow-y: auto; background: #f7f8fa; border-radius: 12px; padding: 16px; }
.ws-chat-msg { display: flex; gap: 10px; margin-bottom: 14px; align-items: flex-start; }
.ws-chat-user { flex-direction: row-reverse; }
.ws-chat-avatar { width: 38px; height: 38px; border-radius: 11px; background: #eef0f3; color: #8a8f99;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ws-chat-avatar .ws-ic { width: 20px; height: 20px; }
.ws-av-ai { background: linear-gradient(135deg, #ff5170, #e61d44); color: #fff;
    box-shadow: 0 4px 11px rgba(230,29,68,.3); }
.ws-av-user { background: #e7e9ef; color: #6b7280; }
.ws-chat-bubble { max-width: 78%; padding: 10px 14px; border-radius: 14px; background: #fff;
    font-size: 14px; line-height: 1.6; color: #222; box-shadow: 0 1px 3px rgba(0,0,0,.06);
    white-space: pre-wrap; word-break: break-word; }
.ws-chat-user .ws-chat-bubble { background: var(--brand); color: #fff; }
.ws-chat-typing { color: #999; }
.ws-chat-input { display: flex; gap: 10px; margin-top: 12px; }
.ws-chat-input textarea { flex: 1; resize: none; }
.ws-safe-bar { display: flex; align-items: center; justify-content: space-between;
    margin: 10px 0; gap: 12px; }
.ws-safe-status { font-size: 13px; line-height: 1.6; }
.ws-safe-aibox { margin-top: 12px; }
.ws-safe-level { font-size: 15px; margin-bottom: 8px; }
.ws-safe-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 12px; }
.ws-safe-table th, .ws-safe-table td { border: 1px solid #e5e7eb; padding: 8px 10px; text-align: left;
    vertical-align: top; }
.ws-safe-table th { background: #f9fafb; color: #666; font-weight: 600; }
.ws-safe-word { color: #d33; font-weight: 600; white-space: nowrap; }
.ws-safe-rewrite { background: #f6fff8; border: 1px solid #bbf7d0; border-radius: 10px; padding: 12px; margin-top: 8px; }
.ws-safe-rewrite-text { font-size: 13px; line-height: 1.7; color: #333; white-space: pre-wrap;
    margin-bottom: 8px; max-height: 260px; overflow-y: auto; }
/* ===== 系统设置：模型密钥 ===== */
.sys-tip-card { background: #f3f5fa; border: 1px solid #dfe3ec; color: var(--text-2);
    border-left: 3px solid #1d2330;
    font-size: 13px; line-height: 1.7; margin-bottom: 16px; }
.sys-tip-card b { color: var(--text-1); }
.sys-card { margin-bottom: 16px; transition: box-shadow .18s, transform .18s; }
.sys-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.sys-card-head { display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px; gap: 12px; flex-wrap: wrap; }
.sys-card-title { font-size: 15px; font-weight: 600; color: var(--text-1);
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sys-card-title .ws-hint { font-weight: normal; }
.sys-ic {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}
.sys-ic-blue { background: #e8effe; color: #2f63dc; }
.sys-ic-green { background: #e6f7ee; color: #13a05b; }
.sys-ic-purple { background: #f0ebfe; color: #6a45d6; }
.sys-badge { font-size: 12px; padding: 3px 12px; border-radius: 999px; font-weight: 500;
    white-space: nowrap; }
.sys-badge:empty { display: none; }
.sys-badge-ok { background: #e8f9ee; color: #16a34a; border: 1px solid #bbf7d0; }
.sys-badge-no { background: #feecec; color: #dc2626; border: 1px solid #fecaca; }
.sys-badge-warn { background: #fff6e6; color: #d97706; border: 1px solid #fde7b3; }
/* 各功能页「Key 已统一到系统设置」状态条 */
.sys-unified-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin: 10px 0 4px; padding: 9px 14px; border: 1px solid #e8e8ef; border-radius: 10px;
    background: #faf9fc; }
.sys-unified-bar .ws-img-settings-head { padding: 0; background: transparent; }
.ws-staff-settings.sys-unified-bar { margin-top: 14px; border: 1px solid #e8e8ef;
    border-top: 1px solid #e8e8ef; padding: 9px 14px; }
.sys-unified-status { font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.sys-unified-status.is-ok { color: #16a34a; }
.sys-unified-status.is-no { color: #dc2626; }
.sys-unified-status.is-warn { color: #d97706; }
.sys-providers { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.sys-form { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 12px; }
.sys-form label { font-size: 12px; color: var(--text-3); }
.sys-form input { margin-top: 4px; }
.sys-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding-top: 12px;
    border-top: 1px dashed var(--border); flex-wrap: wrap; }
.sys-keymask { font-size: 12px; }
.sys-msg { margin-top: 8px; font-size: 13px; line-height: 1.6; min-height: 18px; }
.sys-msg-ok { color: #16a34a; }
.sys-msg-err { color: #dc2626; }
@media (max-width: 1100px) { .sys-form { grid-template-columns: 1fr; } }
.ws-slider-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: #777; }
.ws-slider-row span { width: 34px; flex-shrink: 0; }
.ws-slider-row input { flex: 1; }
.ws-slider-row b { width: 42px; text-align: right; font-weight: 400; color: #999; }
.ws-preset-row { display: flex; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.ws-preset { border: 1px solid #e5e7eb; background: #fff; border-radius: 14px; padding: 3px 12px;
    font-size: 12px; cursor: pointer; color: #666; }
.ws-preset-on { background: #333; color: #fff; border-color: #333; }
.ws-title-input { margin-bottom: 8px; }
.ws-pos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; width: fit-content; margin: 4px 0 8px; }
.ws-pos-cell { width: 34px; height: 26px; border: 1px solid #ddd; background: #fff; border-radius: 4px;
    display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.ws-pos-cell i { width: 7px; height: 7px; border-radius: 50%; background: #ccc; display: block; }
.ws-pos-cell.ws-pos-on { border-color: var(--brand); background: var(--brand-tint); }
.ws-pos-cell.ws-pos-on i { background: var(--brand); }
.ws-form-inline { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; color: #777; }
.ws-form-inline .form-input { flex: 1; padding: 4px 8px; font-size: 12px; }
.ws-form-inline input[type=color] { width: 42px; height: 30px; padding: 2px; border: 1px solid #ddd; border-radius: 4px; background: #fff; }
.ws-export-group .btn { width: 100%; margin: 0; }
.ws-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.ws-gallery-empty { grid-column: 1/-1; text-align: center; color: #999; padding: 36px 0; font-size: 13px; }
.ws-item { border: 1px solid #eee; border-radius: 10px; overflow: hidden; background: #fff;
    display: flex; flex-direction: column; }
.ws-item-img { width: 100%; aspect-ratio: 3/4; object-fit: cover; cursor: pointer; display: block; background: #f5f5f5; }
.ws-item-badge { position: absolute; margin: 8px; display: inline-flex; align-items: center; gap: 4px;
    background: rgba(255,255,255,.92); color: #444; border: 1px solid rgba(0,0,0,.07);
    font-size: 11px; font-weight: 500; padding: 3px 9px; border-radius: 11px;
    width: fit-content; position: relative; margin-bottom: -30px; z-index: 2;
    backdrop-filter: blur(4px); }
.ws-item-badge .ws-ic { width: 12px; height: 12px; }
.ws-item-badge.kind-ai { color: #f02d4d; }
.ws-item-badge.kind-edit { color: #d98306; }
.ws-item-badge.kind-upload { color: #2f6fe8; }
.ws-item-badge.kind-textcover { color: #6d4fe0; }
/* 加载/状态小图标 */
.ws-spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor;
    border-right-color: transparent; border-radius: 50%; animation: ws-spin .7s linear infinite; flex-shrink: 0; }
.ws-spinner-lg { width: 18px; height: 18px; border-width: 2.5px; }
@keyframes ws-spin { to { transform: rotate(360deg); } }
.ws-loading { display: flex; align-items: center; justify-content: center; gap: 9px; color: #999; }
.ws-fi { display: inline-flex; vertical-align: -2px; margin-right: 2px; }
.ws-fi .ws-ic { width: 14px; height: 14px; }
.ws-fi-green { color: #16a34a; }
.ws-fi-red { color: #d33; }
.ws-fi-amber { color: #e67e22; }
.ws-staff-settings summary { display: flex; align-items: center; gap: 7px; }
.ws-staff-settings summary .ws-ic { width: 15px; height: 15px; color: #9aa0aa; }
.ws-item-prompt { font-size: 12px; color: #555; padding: 8px 10px 2px; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 22px; }
.ws-item-meta { font-size: 11px; color: #bbb; padding: 0 10px 8px; }
.ws-item-ops { display: flex; gap: 6px; padding: 0 10px 8px; }
.ws-item-ops .btn { flex: 1; padding: 3px 0; }
.ws-item-draft { display: flex; gap: 6px; padding: 0 10px 10px; }
.ws-draft-sel { flex: 1; padding: 4px 6px; font-size: 12px; }
.ws-item-draft .btn { white-space: nowrap; }
@media (max-width: 1100px) {
    .ws-ai-layout, .ws-edit-layout { grid-template-columns: 1fr; }
    .ws-controls, #ws-panel-text .ws-controls { max-height: none; }
}

/* 生图服务设置 */
.ws-img-settings { margin-top: 14px; border: 1px solid #e8e8ef; border-radius: 10px; overflow: hidden; }
.ws-img-settings-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #faf9fc; cursor: pointer; font-size: 13px; font-weight: 600; color: #444; user-select: none; }
.ws-img-settings-head:hover { background: #f4f2f8; }
.ws-img-settings-title { display: inline-flex; align-items: center; gap: 7px; }
.ws-img-settings-title .ws-ic { width: 15px; height: 15px; color: #7c6fc0; }
.ws-img-settings-state { margin-left: auto; font-size: 12px; font-weight: 500; color: #999; }
.ws-img-state-on { color: #16a34a; }
.ws-img-settings-arrow { width: 15px; height: 15px; color: #999; transition: transform .2s; }
.ws-img-settings-arrow.open { transform: rotate(180deg); }
.ws-img-settings-body { padding: 12px 14px; border-top: 1px solid #f0eef4; }
.ws-img-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.ws-img-grid { display: grid; grid-template-columns: 1.2fr 1fr 1.2fr; gap: 10px; }
.ws-img-grid .ws-label { font-size: 12px; }
.ws-img-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; }

/* 标题拖拽 */
#ws-canvas { cursor: move; touch-action: none; }
.ws-pos-tip { font-size: 11px; color: #999; margin: 4px 0 8px; display: flex; align-items: center; gap: 6px; }
.ws-pos-tip b { color: var(--brand); font-weight: 600; }
.ws-pos-reset { margin-left: auto; border: 1px solid #ddd; background: #fff; color: #666; border-radius: 6px; font-size: 11px; padding: 2px 8px; cursor: pointer; }
.ws-pos-reset:hover { border-color: var(--brand); color: var(--brand); }

/* ========== 系统设置：授权信息 / 版本更新 ========== */
.lic-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px 28px;
    padding: 6px 2px 2px;
}
.lic-info-item { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.lic-info-label { font-size: 12px; color: #8a93a5; }
.lic-info-value { font-size: 14px; font-weight: 600; color: #2b3245; }
.lic-mono {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 12px; font-weight: 500; word-break: break-all;
}
.lic-dot {
    display: inline-block; width: 7px; height: 7px; border-radius: 50%;
    background: #c2c8d2; margin-right: 6px; vertical-align: 1px;
}
.lic-dot.is-ok { background: #2fbf71; box-shadow: 0 0 6px rgba(47,191,113,.7); }

/* ========== 激活 / 锁屏遮罩 ========== */
.license-gate {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: radial-gradient(1200px 600px at 50% -10%, #2a3247 0%, #141823 55%, #0d1017 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.license-gate[hidden] { display: none; }
.license-card {
    width: 420px;
    max-width: 100%;
    background: #1d2330;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 18px;
    padding: 34px 34px 24px;
    box-shadow: 0 30px 80px rgba(0,0,0,.55);
    color: #c8cedb;
}
.license-logo {
    width: 62px; height: 62px;
    border-radius: 16px;
    overflow: hidden;
    margin: 0 auto 14px;
    box-shadow: 0 10px 26px rgba(244,31,62,.4);
}
.license-logo img { width: 100%; height: 100%; object-fit: cover; }
.license-title {
    text-align: center;
    font-size: 19px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 8px;
}
.license-desc {
    text-align: center;
    font-size: 12.5px;
    color: #8d96a8;
    margin: 0 0 20px;
    line-height: 1.6;
}
.license-label {
    display: block;
    font-size: 12.5px;
    color: #a8b0c0;
    margin-bottom: 8px;
}
.license-input {
    width: 100%;
    height: 44px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(0,0,0,.25);
    color: #fff;
    font-size: 15px;
    letter-spacing: 1px;
    padding: 0 14px;
    outline: none;
    box-sizing: border-box;
}
.license-input:focus { border-color: var(--brand); }
.license-error {
    margin-top: 10px;
    font-size: 12.5px;
    color: #ff7a92;
    line-height: 1.5;
}
.license-btn {
    width: 100%;
    height: 44px;
    margin-top: 16px;
    font-size: 15px;
}
.license-machine {
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px dashed rgba(255,255,255,.1);
}
.license-machine-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11.5px;
    color: #7d8699;
    margin-bottom: 6px;
}
.license-copy-btn {
    border: 1px solid rgba(255,255,255,.16);
    background: transparent;
    color: #c8cedb;
    border-radius: 6px;
    font-size: 11px;
    padding: 2px 10px;
    cursor: pointer;
}
.license-copy-btn:hover { border-color: var(--brand); color: #fff; }
.license-machine code {
    display: block;
    font-size: 11.5px;
    word-break: break-all;
    color: #9fb6ff;
    background: rgba(0,0,0,.3);
    border-radius: 8px;
    padding: 8px 10px;
    user-select: all;
}
.license-foot {
    margin-top: 16px;
    text-align: center;
    font-size: 11px;
    color: #5d6575;
}
.license-notice {
    margin-top: 18px;
    background: rgba(224, 167, 58, .08);
    border: 1px solid rgba(224, 167, 58, .28);
    border-radius: 10px;
    padding: 11px 13px;
}
.license-notice[hidden] { display: none; }
.license-notice-hd {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #e0a73a;
    font-weight: 600;
    margin-bottom: 5px;
}
.license-notice-ico {
    width: 14px;
    height: 14px;
    flex: none;
}
.license-notice-body {
    font-size: 12.5px;
    line-height: 1.7;
    color: #c8cedb;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 150px;
    overflow-y: auto;
}
/* 强制更新弹窗必须盖在锁屏(z-index:9999)之上 */
#modal-update { z-index: 10001; }

/* ========== 在线更新弹窗 ========== */
.upd-ver {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.upd-ver-new { font-size: 15px; font-weight: 700; color: #222; }
.upd-ver-flag {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: var(--brand);
    border-radius: 5px;
    padding: 2px 8px;
}
.upd-notes {
    font-size: 13px;
    color: #555;
    line-height: 1.7;
    white-space: pre-wrap;
    max-height: 200px;
    overflow-y: auto;
}
.upd-progress-wrap { margin-top: 16px; }
.upd-progress {
    height: 8px;
    border-radius: 4px;
    background: #eee;
    overflow: hidden;
}
.upd-progress-bar {
    height: 100%;
    width: 0;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--brand), #ff7a92);
    transition: width .3s ease;
}
.upd-progress-text { margin-top: 8px; font-size: 12px; color: #888; }
.upd-error {
    margin-top: 12px;
    font-size: 12.5px;
    color: var(--brand);
    line-height: 1.5;
}

/* ==================== 视频工厂（ve） ==================== */
.ve-panel { padding: 16px; }

/* ffmpeg 引导卡片 */
.ve-guide {
    max-width: 640px;
    margin: 24px auto;
    padding: 34px 30px 28px;
    text-align: center;
}
.ve-guide-ic {
    width: 58px; height: 58px;
    margin: 0 auto 14px;
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #ff4763, #ef2b4b);
    color: #fff;
    box-shadow: 0 8px 22px rgba(239,43,75,.28);
}
.ve-guide-ic .ws-ic { width: 28px; height: 28px; }
.ve-guide-title { font-size: 18px; font-weight: 700; color: var(--text-1); margin-bottom: 10px; }
.ve-guide-desc { font-size: 13.5px; color: var(--text-2); line-height: 1.75; }
.ve-guide-desc code, .ve-guide-manual code {
    background: #f3f4f6; border: 1px solid var(--border); border-radius: 4px;
    padding: 1px 6px; font-size: 12px; color: var(--brand);
}
.ve-guide-prog { margin: 18px 0 4px; text-align: left; }
.ve-guide-bar { height: 8px; border-radius: 5px; background: #f0f1f4; overflow: hidden; }
.ve-guide-bar-in {
    height: 100%; width: 0; border-radius: 5px;
    background: linear-gradient(90deg, var(--brand), #ff7a92);
    transition: width .3s ease;
}
.ve-guide-prog-txt { margin-top: 8px; font-size: 12.5px; color: var(--text-2); }
.ve-guide-ops { display: flex; gap: 10px; justify-content: center; margin: 20px 0 14px; flex-wrap: wrap; }
.ve-guide-manual {
    font-size: 12px; color: #9aa0a8; line-height: 1.7;
    border-top: 1px dashed var(--border); padding-top: 14px;
}
.ve-guide-manual b { color: var(--text-2); font-weight: 600; }

/* 编辑器布局 */
.ve-app { display: flex; flex-direction: column; min-height: 640px; }
.ve-topbar {
    display: flex; align-items: center; gap: 8px;
    padding-bottom: 12px; margin-bottom: 12px;
    border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.ve-proj-select { width: 200px; flex-shrink: 0; font-size: 13px; }
.ve-save-state { font-size: 12px; color: #9aa0a8; margin-left: 4px; }
.ve-topbar-spacer { flex: 1; }
.btn-danger-ghost {
    background: transparent; color: var(--brand); border: 1px solid transparent;
}
.btn-danger-ghost:hover { background: var(--brand-tint); border-color: #f6c9d1; }

.ve-body {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr) 240px;
    gap: 12px;
    align-items: stretch;
}

/* 左：素材箱 */
.ve-bin {
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--bg-soft);
    display: flex; flex-direction: column;
    min-height: 560px; max-height: calc(100vh - 210px);
}
.ve-bin-tabs { display: flex; border-bottom: 1px solid var(--border); }
.ve-bin-tab {
    flex: 1; text-align: center; padding: 9px 0; font-size: 13px;
    color: var(--text-2); cursor: pointer; user-select: none;
    border-bottom: 2px solid transparent;
}
.ve-bin-tab:hover { color: var(--text-1); }
.ve-bin-tab-on { color: var(--brand); font-weight: 600; border-bottom-color: var(--brand); }
.ve-bin-actions { display: flex; gap: 6px; padding: 10px; }
.ve-bin-actions .btn { flex: 1; font-size: 12.5px; }
.ve-bin-list {
    flex: 1; overflow-y: auto; padding: 0 10px 10px;
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: start;
    grid-auto-rows: min-content;
}
.ve-bin-empty {
    grid-column: 1/-1; color: #9aa0a8; font-size: 12.5px;
    text-align: center; padding: 34px 8px; line-height: 1.7;
}
.ve-card {
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: #fff; overflow: hidden; font-size: 12px;
    display: flex; flex-direction: column;
}
.ve-card-thumb {
    position: relative; aspect-ratio: 1 / 1; background: #eef0f3;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ve-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ve-card-audio { color: #a8adb5; }
.ve-card-audio .ws-ic { width: 34px; height: 34px; }
.ve-card-badge {
    position: absolute; left: 5px; top: 5px;
    display: inline-flex; align-items: center; gap: 3px;
    background: rgba(17,20,26,.62); color: #fff;
    font-size: 10.5px; line-height: 1; padding: 3px 6px; border-radius: 4px;
}
.ve-card-badge .ws-ic { width: 11px; height: 11px; }
.ve-card-add {
    position: absolute; right: 5px; bottom: 5px;
    width: 26px; height: 26px; border: none; border-radius: 50%;
    background: var(--brand); color: #fff; font-size: 18px; line-height: 1;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(239,43,75,.4);
}
.ve-card-add:hover { background: var(--brand-hover); }
.ve-card-title {
    padding: 6px 7px 0; font-weight: 600; color: var(--text-1);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ve-card-meta {
    padding: 3px 7px; color: #9aa0a8; font-size: 11px;
    display: flex; gap: 6px; flex-wrap: wrap;
}
.ve-card-ref { color: var(--brand); }
.ve-card-ops { display: flex; gap: 4px; padding: 4px 7px 8px; }
.ve-card-ops .btn { flex: 1; padding: 3px 0; font-size: 11.5px; }
.ve-card[draggable="true"] { cursor: grab; }
.ve-card[draggable="true"]:active { cursor: grabbing; }
.ve-card-dragging { opacity: .55; }

/* 素材卡片拖到时间轴轨道 */
.ve-tl-lane.ve-lane-drop {
    background: rgba(239, 43, 75, .09);
    box-shadow: inset 0 0 0 2px rgba(239, 43, 75, .55);
}
.ve-tl-lane.ve-lane-drop::after {
    content: ''; position: absolute; top: -1px; bottom: -1px;
    left: var(--drop-x, 0); width: 2px; z-index: 6; pointer-events: none;
    background: var(--brand); box-shadow: 0 0 6px rgba(239, 43, 75, .7);
}

/* 中：预览 + 时间轴 */
.ve-center { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
/* 预览容器：高度只由视口决定（不随画布内容变化），打破“画布撑高舞台→舞台
   反算画布”的反馈环；舞台填满容器，画布在确定的盒子里 contain 计算 */
.ve-preview-wrap {
    position: relative;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: #1d2128; padding: 14px;
    display: flex; flex-direction: column;
    height: clamp(408px, calc(56vh + 28px), 556px);
    box-sizing: border-box;
}
.ve-stage {
    position: relative; flex: 1 1 auto;
    min-width: 0; min-height: 0; width: 100%;
    display: flex; align-items: center; justify-content: center;
}
/* 画布宽高一律由 veFitCanvas 按舞台实际盒子 contain 计算后内联设定；
   下面的声明仅作 JS 未执行时的兜底（竖屏默认比例） */
.ve-canvas {
    position: relative;
    --rw: 9; --rh: 16;
    height: 100%;
    width: auto;
    aspect-ratio: var(--rw) / var(--rh);
    background: #000; border-radius: 6px; overflow: hidden;
    box-shadow: 0 6px 26px rgba(0,0,0,.45);
}
.ve-canvas { container-type: size; }
.ve-pv-img, .ve-pv-video {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    background: #000;
    transform-origin: center center;
    will-change: opacity, transform;
}
/* 视频/图片统一填满画布（cover 居中裁切），与导出成片一致、无黑边；
   画布比例可在右上角比例条切换，首条视频入轨时会自动适配素材方向 */
.ve-pv-img, .ve-pv-video { object-fit: cover; }
/* 画布比例切换条 */
.ve-ratio-bar {
    position: absolute; right: 10px; top: 8px; z-index: 8;
    display: flex; gap: 2px; padding: 3px;
    background: rgba(0,0,0,.5); border-radius: 7px;
}
.ve-ratio-bar button {
    border: none; background: transparent; color: rgba(255,255,255,.72);
    font-size: 11px; line-height: 1; padding: 5px 8px;
    border-radius: 5px; cursor: pointer; letter-spacing: .2px;
}
.ve-ratio-bar button:hover { color: #fff; background: rgba(255,255,255,.12); }
.ve-ratio-bar button.on {
    color: #fff; background: var(--brand, #ef2b4b); font-weight: 600;
}
#ve-pv-img, #ve-pv-video { z-index: 0; }
#ve-pv-img2, #ve-pv-video2 { z-index: 1; }
.ve-pv-video[hidden], .ve-pv-img[hidden] { display: none; }
/* 叠加元素池：盖在主轨转场黑/白场之上（与后端 overlay→ass 烧录顺序一致），字幕永远最顶 */
.ve-pv-overlays {
    position: absolute; inset: 0; z-index: 3;
    pointer-events: none;
}
.ve-pv-overlays[hidden] { display: none; }
.ve-pv-ov {
    position: absolute;
    pointer-events: auto;
}
.ve-pv-ov-img, .ve-pv-ov-video {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    /* contain：素材完整显示不裁切，空余透明，与导出 pad 透明区一致 */
    background: transparent;
    object-fit: contain;
}
.ve-pv-ov-video[hidden], .ve-pv-ov-img[hidden] { display: none; }
.ve-pv-ov-lim {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(10, 12, 16, .72);
    color: rgba(255, 255, 255, .85);
    font-size: 2.6cqh; line-height: 1.5; text-align: center; padding: 8%;
    pointer-events: none;
}
.ve-pv-ov-lim[hidden] { display: none; }
/* 选中框 + 8 缩放手柄 */
.ve-pv-ov { cursor: grab; }
.ve-pv-ov.on { outline: 2px solid var(--brand, #ef2b4b); outline-offset: -1px; }
.ve-pv-ov.ve-pv-ov-move { cursor: grabbing; }
.ve-pv-ov-h { position: absolute; inset: 0; pointer-events: none; }
.ve-pv-ov-h i {
    display: none;
    position: absolute; width: 11px; height: 11px;
    border-radius: 50%; background: #fff;
    border: 2px solid var(--brand, #ef2b4b);
    box-shadow: 0 1px 3px rgba(0,0,0,.4);
    pointer-events: auto;
}
.ve-pv-ov.on .ve-pv-ov-h i { display: block; }
.ve-pv-ov-h i[data-d="nw"] { left: -6px; top: -6px; cursor: nwse-resize; }
.ve-pv-ov-h i[data-d="n"]  { left: 50%; top: -6px; transform: translateX(-50%); cursor: ns-resize; }
.ve-pv-ov-h i[data-d="ne"] { right: -6px; top: -6px; cursor: nesw-resize; }
.ve-pv-ov-h i[data-d="e"]  { right: -6px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }
.ve-pv-ov-h i[data-d="se"] { right: -6px; bottom: -6px; cursor: nwse-resize; }
.ve-pv-ov-h i[data-d="s"]  { left: 50%; bottom: -6px; transform: translateX(-50%); cursor: ns-resize; }
.ve-pv-ov-h i[data-d="sw"] { left: -6px; bottom: -6px; cursor: nesw-resize; }
.ve-pv-ov-h i[data-d="w"]  { left: -6px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }
.ve-pv-flash {
    position: absolute; inset: 0; z-index: 2;
    pointer-events: none; background: #000; opacity: 0;
}
.ve-pv-flash[hidden] { display: none; }
.ve-pv-sub {
    position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: 4;
    pointer-events: none;
}
.ve-pv-sub[hidden] { display: none; }
.ve-pv-sub-i {
    position: absolute;
    transform: translate(-50%, -50%);
    max-width: 88%;
    display: block; text-align: center; line-height: 1.35;
    color: #fff;
    white-space: pre-line; word-break: break-word;
    letter-spacing: .02em;
    cursor: move;
    pointer-events: auto;
}
.ve-pv-sub-i.ve-pv-sub-on {
    outline: 2px dashed rgba(239, 43, 75, .8);
    outline-offset: 3px;
    border-radius: 3px;
}
.ve-pv-missing {
    position: absolute; inset: 0; z-index: 5;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,.7); font-size: 13px;
    background: #111418;
}
.ve-pv-missing[hidden] { display: none; }
.ve-pv-prep {
    position: absolute; inset: 0; z-index: 5;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
    background: rgba(0,0,0,.5); color: rgba(255,255,255,.92);
    font-size: 13px; letter-spacing: .5px; text-align: center; padding: 0 24px;
    pointer-events: none;
}
.ve-pv-prep[hidden] { display: none; }
.ve-pv-prep-spin {
    width: 32px; height: 32px; border-radius: 50%;
    border: 3px solid rgba(255,255,255,.28); border-top-color: #fff;
    animation: ve-pv-spin .8s linear infinite;
}
@keyframes ve-pv-spin { to { transform: rotate(360deg); } }
.ve-tr-btn { width: 30px; height: 28px; padding: 0; display: flex; align-items: center; justify-content: center; }
.ve-tr-btn .ws-ic { width: 15px; height: 15px; }
.ve-mute-btn { width: 32px; margin-left: 2px; }
.ve-mute-btn.ve-mute-on { color: #e63946; border-color: rgba(230,57,70,.45); background: rgba(230,57,70,.08); }
.ve-clip.ve-clip-now { box-shadow: inset 0 0 0 2px var(--brand, #e63946); }
.ve-stage-hint {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,.55); font-size: 13px; pointer-events: none;
}
.ve-transport {
    display: flex; align-items: center; gap: 10px;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--bg-soft); padding: 7px 12px;
}
.ve-play-btn { width: 32px; height: 28px; padding: 0; display: flex; align-items: center; justify-content: center; }
.ve-time { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; min-width: 48px; }
.ve-time-track {
    position: relative; flex: 1; height: 6px; border-radius: 4px; background: #e6e8ec; cursor: pointer;
}
.ve-playhead {
    position: absolute; top: -3px; left: 0;
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--brand); box-shadow: 0 1px 4px rgba(0,0,0,.25);
    transform: translateX(-50%);
}
.ve-timeline {
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--bg-soft); padding: 8px 0;
    overflow-x: auto; overflow-y: auto;
    min-height: 190px; max-height: 46vh;
}
.ve-tl-inner { min-width: 100%; padding-right: 8px; }
.ve-tl-row { display: flex; align-items: stretch; height: 42px; }
.ve-tl-label {
    position: relative;
    width: 46px; flex-shrink: 0; font-size: 11.5px; color: var(--text-2);
    display: flex; align-items: center; justify-content: center;
    border-right: 1px solid var(--border);
}
.ve-tl-clear {
    position: absolute; inset: 0; width: 100%;
    display: flex; align-items: center; justify-content: center;
    border: none; background: #fff1f0; color: #d32f2f; cursor: pointer;
    opacity: 0; transition: opacity .12s; padding: 0;
}
.ve-tl-clear svg { width: 15px; height: 15px; }
.ve-tl-row:hover .ve-tl-clear { opacity: 1; }
.ve-tl-clear:hover { background: #ffd9d6; }
.ve-tl-lane {
    position: relative; flex: 1;
    border-bottom: 1px dashed #e4e7ec;
}
.ve-tl-row:last-child .ve-tl-lane { border-bottom: none; }
/* 字幕多图层行：一行内多条泳道，跨层可时间重叠 */
.ve-tl-row-sub { height: auto; }
.ve-tl-sublanes { flex: 1; display: flex; flex-direction: column; min-width: 0; }
/* 片段绝对定位不贡献内容高度，泳道禁止压缩，否则多泳道行会塌缩到标签高度、片段溢出重叠 */
.ve-tl-sublane { position: relative; height: 30px; flex: 0 0 auto; }
.ve-tl-sublane:last-child { border-bottom: none; }
.ve-tl-sublane .ve-clip { top: 3px; height: 24px; }
/* 无片段的空泳道：收窄成细投放条，避免多轨时把时间轴撑得过高 */
.ve-tl-sublane.ve-tl-lane-empty { height: 22px; background: repeating-linear-gradient(135deg, transparent, transparent 8px, rgba(0,0,0,.025) 8px, rgba(0,0,0,.025) 16px); }
.ve-tl-sublane-tag {
    position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
    font-size: 10px; color: #b3b8c0; pointer-events: none; z-index: 0;
}
.ve-tl-label-acts {
    position: absolute; inset: 0; display: flex;
    opacity: 0; transition: opacity .12s;
}
.ve-tl-row:hover .ve-tl-label-acts { opacity: 1; }
.ve-tl-lbtn {
    flex: 1; border: none; padding: 0; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    background: #eef4ff; color: #2f6bff;
}
.ve-tl-lbtn svg { width: 14px; height: 14px; }
.ve-tl-lbtn.ve-tl-lclr { background: #fff1f0; color: #d32f2f; }
.ve-tl-ladd:hover { background: #dde8ff; }
.ve-tl-lclr:hover { background: #ffd9d6; }
.ve-tl-empty { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 11px; color: #b3b8c0; }
.ve-clip {
    position: absolute; top: 4px; height: 34px;
    border-radius: 5px; overflow: hidden;
    display: flex; align-items: center; gap: 4px;
    padding: 0 6px; font-size: 11px; color: #fff;
    cursor: pointer; user-select: none;
    box-shadow: 0 1px 3px rgba(0,0,0,.18);
}
.ve-clip img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .45; }
.ve-clip span { position: relative; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ve-clip-video { background: linear-gradient(135deg, #4d86f7, #2f6fe8); }
.ve-clip-overlay { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.ve-tl-ov-hint { color: #7fc7c2 !important; }
.ve-clip-subtitle { background: linear-gradient(135deg, #f5a623, #e8850a); }
.ve-clip-voice { background: linear-gradient(135deg, #34c08e, #1ba572); }
.ve-clip-bgm { background: linear-gradient(135deg, #8a6cf5, #6d4fe0); }
.ve-clip:hover { z-index: 5; }
.ve-clip-on { outline: 2px solid var(--brand); outline-offset: 1px; z-index: 6; }
/* 框选多选：蓝色描边（区别于单选红） */
.ve-clip-multi { outline: 2px solid #2f6bff; outline-offset: 1px; z-index: 6; }
/* 橡皮筋选框 */
.ve-marquee {
    position: absolute; z-index: 8; pointer-events: none;
    border: 1px solid var(--brand);
    background: rgba(244, 31, 62, 0.08);
    border-radius: 2px;
}
.ve-tl-lane[data-track] { cursor: crosshair; }
.ve-tl-lane[data-track] .ve-clip { cursor: grab; }
/* 检查器多选面板 */
.ve-multi-summary { font-size: 12.5px; color: var(--text); line-height: 1.8; }
.ve-multi-tip { margin-top: 6px; font-size: 11px; line-height: 1.7; color: var(--text-3, #9aa1ab); }
.ve-multi-del { width: 100%; margin-top: 4px; }
.ve-multi-cancel { width: 100%; margin-top: 8px; }
/* 超短片段：裁剪热区让位给点击/拖动（需要裁剪时放大时间轴即可恢复） */
.ve-clip-mini .ve-clip-e { pointer-events: none; }
.ve-clip-mini .ve-clip-e::after { display: none; }

/* 右：检查器 */
.ve-inspector {
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--bg-soft); padding: 12px;
    min-height: 560px; max-height: calc(100vh - 210px); overflow-y: auto;
}
.ve-ins-ph { text-align: center; color: #9aa0a8; font-size: 13px; padding: 40px 0; line-height: 1.8; }
.ve-ins-ph small { color: #b7bcc4; }
.ve-ins-head { font-size: 13.5px; font-weight: 700; color: var(--text-1); margin-bottom: 12px; line-height: 1.5; }
.ve-ins-row {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 12.5px; padding: 7px 0; border-bottom: 1px dashed var(--border);
}
.ve-ins-row span { color: var(--text-2); }
.ve-ins-row b { color: var(--text-1); font-weight: 600; font-variant-numeric: tabular-nums; }
.ve-ins-hint { font-size: 11.5px; color: #b3b8c0; line-height: 1.7; padding: 10px 0; }
.ve-ins-del { width: 100%; margin-top: 6px; }

/* ========== 视频工厂·T6 检查器表单 ========== */
.ve-ins-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ve-ins-tag {
    flex: none; font-size: 10.5px; font-weight: 600; color: var(--brand);
    background: rgba(233, 58, 104, .1); border-radius: 4px; padding: 2px 7px;
}
.ve-ins-tag-ov { color: #0d9488; background: rgba(13, 148, 136, .12); }
.ve-form-sec { border-top: 1px solid var(--border); padding: 10px 0 2px; margin-top: 4px; }
.ve-sec-title {
    font-size: 11px; font-weight: 700; color: #9aa0a8; letter-spacing: .08em;
    margin-bottom: 8px;
}
.ve-fld {
    display: flex; align-items: center; gap: 8px;
    font-size: 12.5px; margin: 8px 0;
}
.ve-fld > label { flex: none; width: 62px; color: var(--text-2); }
.ve-fld input[type=range] { flex: 1; min-width: 0; accent-color: var(--brand); height: 18px; }
.ve-fv {
    flex: none; min-width: 46px; text-align: right;
    color: var(--text-1); font-size: 11.5px; font-variant-numeric: tabular-nums;
}
.ve-inspector .ve-num, .ve-inspector .ve-sel {
    flex: 1; min-width: 0;
    border: 1px solid var(--border); border-radius: 6px;
    background: var(--bg); color: var(--text-1);
    font-size: 12px; padding: 4px 7px; outline: none;
}
.ve-inspector .ve-num:focus, .ve-inspector .ve-sel:focus { border-color: var(--brand); }
.ve-area {
    width: 100%; box-sizing: border-box; resize: vertical;
    border: 1px solid var(--border); border-radius: 6px;
    background: var(--bg); color: var(--text-1);
    font-size: 12.5px; line-height: 1.6; padding: 6px 8px; outline: none;
}
.ve-area:focus { border-color: var(--brand); }
.ve-color {
    width: 40px; height: 24px; padding: 0; border: 1px solid var(--border);
    border-radius: 5px; background: var(--bg); cursor: pointer;
}
.ve-check {
    display: flex; align-items: center; gap: 6px;
    font-size: 12.5px; color: var(--text-2); margin: 8px 0; cursor: pointer;
}
.ve-check input { accent-color: var(--brand); }
.ve-preset-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ve-preset-btn {
    border: 1px solid var(--border); border-radius: 999px;
    background: var(--bg); color: var(--text-2);
    font-size: 11.5px; padding: 3px 11px; cursor: pointer;
    transition: all .15s;
}
.ve-preset-btn:hover { border-color: var(--brand); color: var(--brand); }
.ve-ins-btn { width: 100%; margin-top: 8px; }
.ve-inspector .btn:disabled { opacity: .5; cursor: not-allowed; }
.ve-fdis { opacity: .55; }
.ve-fdis .ve-fld { pointer-events: none; }
.ve-fdis-hint { font-size: 11px; color: #b3b8c0; line-height: 1.6; }

/* ========== 视频工厂·T7 配音（TTS 设置 / 录音 / 生成） ========== */
.ve-tts-panel {
    flex: none; margin: 8px 14px 0; padding: 10px 12px;
    border: 1px solid var(--border); border-radius: 10px;
    background: var(--card-bg, rgba(255, 255, 255, .72));
    backdrop-filter: blur(10px);
}
.ve-tts-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 5px 0; }
.ve-tts-row > label { flex: none; font-size: 12px; color: var(--text-2); }
.ve-tts-in { font-size: 12px; padding: 5px 9px; }
.ve-tts-row .ve-tts-in { flex: 1 1 180px; min-width: 140px; }
.ve-tts-row .ve-tts-model { flex: 0 1 260px; min-width: 180px; }
.ve-tts-voice { flex: 0 1 200px; font-size: 12px; padding: 5px 9px; }
.ve-tts-voice-custom { flex: 0 1 260px; font-size: 12px; padding: 5px 9px; }
.ve-tts-speed { flex: 0 1 150px; accent-color: var(--brand); }
.ve-tts-row label span.ve-tts-speed-v, #ve-tts-speed-v { font-variant-numeric: tabular-nums; color: var(--text-1); }
.ve-tts-state { font-size: 11.5px; color: var(--text-2); }
.ve-btn-record-on {
    color: #fff !important; background: #e53a68 !important; border-color: #e53a68 !important;
    animation: veRecPulse 1.1s ease-in-out infinite;
}
@keyframes veRecPulse { 0%,100% { opacity: 1; } 50% { opacity: .65; } }
.ve-tts-voice-row { display: flex; gap: 6px; align-items: center; margin: 8px 0; }
.ve-tts-voice-row .ve-sel { flex: 1; min-width: 0; }
.ve-tts-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.ve-tts-actions .ve-ins-btn { flex: 1 1 auto; width: auto; margin-top: 0; }
.ve-tts-prog { font-size: 11.5px; color: var(--text-2); margin-top: 7px; line-height: 1.6; }
.ve-tts-prog b { color: var(--brand); font-weight: 600; }
.ve-choice-dialog { max-width: 420px; }
.ve-choice-msg { font-size: 13px; color: var(--text-1); line-height: 1.7; margin: 4px 0 10px; }
.ve-choice-actions { display: flex; flex-direction: column; gap: 8px; }
.ve-choice-actions .btn { width: 100%; justify-content: center; }
.ve-choice-sub { font-size: 11.5px; color: var(--text-2); margin-top: 2px; display: block; }

/* vePrompt 输入弹窗 */
.ve-prompt-dialog .ve-prompt-input { margin: 6px 0 4px; }

/* ========== 视频工厂·T4 时间轴引擎 ========== */
/* 工具条：撤销/重做/分割/字幕/缩放 */
.ve-tl-bar {
    display: flex; align-items: center; gap: 6px;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--bg-soft); padding: 6px 10px;
}
.ve-tl-bar .btn {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px; font-size: 12px;
}
.ve-tl-bar .btn:disabled { opacity: .45; cursor: not-allowed; }
.ve-tl-sep { width: 1px; height: 16px; background: var(--border); margin: 0 5px; }
.ve-zoom-txt {
    min-width: 42px; text-align: center;
    font-size: 11.5px; color: var(--text-2);
    font-variant-numeric: tabular-nums;
}

/* 时间轴系统（标尺 + 4 轨），宽度由 JS 按 pps 内联给定 */
.ve-timeline { min-height: 198px; }
.ve-tl-sys { position: relative; min-width: 100%; }
.ve-tl-sys::before {
    content: ''; position: absolute; top: 0; bottom: 0; left: 45px; z-index: 1;
    border-right: 1px solid var(--border); pointer-events: none;
}
.ve-tl-ruler {
    position: relative; height: 22px; margin-left: 46px;
    border-bottom: 1px solid var(--border); cursor: pointer;
}
.ve-r-tick { position: absolute; top: 0; left: 0; height: 100%; }
.ve-r-tick i {
    position: absolute; left: 0; top: 13px;
    width: 1px; height: 5px; background: #c6cbd3;
}
.ve-r-tick em {
    position: absolute; left: 4px; top: 1px;
    font-size: 10px; font-style: normal; color: #9aa0a8;
    font-variant-numeric: tabular-nums; white-space: nowrap;
    pointer-events: none;
}
/* 播放头贯穿竖线（margin-left 46px 对齐轨道标签列） */
.ve-tl-phline {
    position: absolute; top: 22px; bottom: 0; left: 0;
    width: 1px; margin-left: 46px;
    background: var(--brand); opacity: .65;
    z-index: 6; pointer-events: none;
}

/* 片段左右边缘裁剪热区 */
.ve-clip-e {
    position: absolute; top: 0; bottom: 0; width: 6px;
    z-index: 4; cursor: ew-resize; font-style: normal;
}
.ve-clip-l { left: 0; }
.ve-clip-r { right: 0; }
.ve-clip-e::after {
    content: ''; position: absolute; top: 50%; left: 50%;
    width: 1px; height: 14px; transform: translate(-50%, -50%);
    background: rgba(255,255,255,.55); border-radius: 1px;
}
.ve-clip-e:hover::after { height: 19px; background: #fff; }

/* BGM 单曲块移除钮 / 空轨添加钮 */
.ve-clip-x {
    position: absolute; right: 3px; top: 3px; z-index: 5;
    width: 16px; height: 16px; padding: 0; line-height: 14px;
    border: none; border-radius: 50%;
    background: rgba(0,0,0,.28); color: #fff;
    font-size: 11px; cursor: pointer;
}
.ve-clip-x:hover { background: #e0403a; }
.ve-bgm-add {
    position: absolute; top: 4px; bottom: 4px; left: 0; right: 0;
    border: 1px dashed #a995ef; border-radius: 5px;
    background: transparent; color: #7a5fe0;
    font-size: 11.5px; cursor: pointer;
}
.ve-bgm-add:hover { background: #f1edff; }

/* 拖拽中禁选 + 时间气泡 */
body.ve-noselect { -webkit-user-select: none; user-select: none; }
.ve-drag-bub {
    display: none; position: fixed; z-index: 10000; pointer-events: none;
    background: rgba(28,31,38,.94); color: #fff;
    font-size: 12px; line-height: 1.5;
    padding: 6px 10px; border-radius: 6px;
    box-shadow: 0 4px 14px rgba(0,0,0,.32);
    font-variant-numeric: tabular-nums; white-space: nowrap;
}
.ve-drag-bub small { display: block; font-size: 10.5px; opacity: .72; margin-top: 1px; }

/* 检查器：字幕长文 */
.ve-ins-text { max-width: 62%; word-break: break-all; text-align: right; }

/* 多行字幕弹窗 */
.ve-prompt-textarea {
    margin: 8px 0 4px; width: 100%;
    min-height: 92px; resize: vertical;
    font-family: inherit; line-height: 1.6;
}

/* 音频选择弹窗 */
.ve-pick-audio-dialog .ve-pick-list {
    margin: 8px 0 6px; max-height: 280px; overflow-y: auto;
    border: 1px solid var(--border); border-radius: 8px; text-align: left;
}
.ve-pick-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; cursor: pointer;
    border-bottom: 1px solid var(--border); font-size: 13px;
}
.ve-pick-row:last-child { border-bottom: none; }
.ve-pick-row:hover { background: var(--bg-soft); }
.ve-pick-row.ve-pick-on { background: #fff0f4; }
.ve-pick-name {
    flex: 1; min-width: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    color: var(--text-1);
}
.ve-pick-dur { color: var(--text-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.ve-pick-play {
    flex-shrink: 0; width: 26px; height: 26px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); border-radius: 50%;
    background: #fff; color: var(--text-2); cursor: pointer;
}
.ve-pick-play:hover { color: var(--brand); border-color: var(--brand); }
.ve-pick-play.ve-playing { background: var(--brand); border-color: var(--brand); color: #fff; }
.ve-pick-audio-dialog .btn[disabled] { opacity: .5; cursor: not-allowed; }

/* 窄屏回退：检查器下沉 */
@media (max-width: 1280px) {
    .ve-body { grid-template-columns: 230px minmax(0, 1fr); }
    .ve-inspector { grid-column: 1 / -1; min-height: auto; max-height: none; }
}

/* ========== 视频工厂·T9 导出对话框 / 作品列表 ========== */
.ve-export-dialog { width: 440px; max-width: calc(100vw - 32px); max-height: 86vh; overflow-y: auto; }
.ve-ex-label { display: block; font-size: 12.5px; color: var(--text-2); margin: 12px 0 6px; font-weight: 600; }
.ve-ex-seg { display: flex; gap: 8px; }
.ve-ex-opt {
    flex: 1; border: 1.5px solid var(--border); background: #fff; border-radius: var(--radius-sm);
    padding: 8px 6px; font-size: 13px; color: var(--text-1); cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 2px; line-height: 1.3;
    transition: border-color .12s, background .12s;
}
.ve-ex-opt small { font-size: 10.5px; color: #9aa0a8; font-weight: 400; }
.ve-ex-opt:hover { border-color: #f08a98; }
.ve-ex-opt.on { border-color: var(--brand); background: #fff5f6; color: var(--brand); font-weight: 600; }
.ve-ex-opt.on small { color: #d9818c; }
.ve-ex-name { margin-top: 4px; }
.ve-ex-meta { font-size: 12px; color: #8a8f97; margin-top: 10px; line-height: 1.7; }
.ve-ex-meta b { color: var(--text-1); }
.ve-ex-err {
    margin-top: 10px; padding: 8px 10px; border-radius: var(--radius-sm);
    background: #fff1f0; border: 1px solid #ffd4d0; color: #cf2e20;
    font-size: 12.5px; line-height: 1.6; word-break: break-all;
}
.ve-ex-prog { padding: 14px 2px 4px; text-align: center; }
.ve-ex-pct { font-size: 34px; font-weight: 700; color: var(--brand); line-height: 1.2; }
.ve-ex-bar { height: 8px; border-radius: 5px; background: #f0f1f3; overflow: hidden; margin: 12px 0 8px; }
.ve-ex-bar-in { height: 100%; width: 0; background: var(--brand); border-radius: 5px; transition: width .3s ease; }
.ve-ex-stage { font-size: 12.5px; color: var(--text-2); }
/* 智能字幕（ASR） */
.ve-asr-btn { color: var(--brand); font-weight: 600; }
.ve-ex-opt.is-disabled { opacity: .42; cursor: not-allowed; }
.ve-ex-opt.is-disabled:hover { border-color: var(--border); }
.ve-asr-indet {
    width: 36%; animation: ve-asr-slide 1.15s ease-in-out infinite;
}
@keyframes ve-asr-slide {
    0% { margin-left: -38%; }
    100% { margin-left: 102%; }
}
.ve-ex-result { padding: 10px 2px 0; text-align: center; }
.ve-ex-result svg { width: 46px; height: 46px; }
.ve-ex-rok svg { color: #22a45c; }
.ve-ex-rerror svg { color: #e23d30; }
.ve-ex-rcancel svg { color: #9aa0a8; }
.ve-ex-rtitle { font-size: 16px; font-weight: 600; margin: 8px 0 6px; color: var(--text-1); }
.ve-ex-rmeta { font-size: 12px; color: var(--text-2); line-height: 1.8; word-break: break-all; }
.ve-ex-rmsg {
    margin-top: 6px; padding: 8px 10px; text-align: left; font-size: 12px; line-height: 1.6;
    color: #b3261e; background: #fdf3f2; border: 1px solid #f3d9d7; border-radius: var(--radius-sm);
    max-height: 150px; overflow-y: auto; white-space: pre-wrap; word-break: break-all;
}
.ve-exp-video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.ve-exp-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.ve-exp-ph svg { width: 36px; height: 36px; }
.ve-exp-ph-running { color: var(--brand); }
.ve-exp-ph-running svg { animation: ve-spin 1.4s linear infinite; }
.ve-exp-ph-error { color: #e23d30; }
.ve-exp-ph-canceled { color: #b6bac1; }
@keyframes ve-spin { to { transform: rotate(360deg); } }
.ve-exp-badge {
    position: absolute; left: 5px; top: 5px;
    font-size: 10.5px; line-height: 1; padding: 4px 7px; border-radius: 4px; color: #fff;
}
.ve-exp-badge-run { background: rgba(244,31,62,.88); }
.ve-exp-badge-err { background: rgba(226,61,48,.9); }
.ve-exp-badge-cancel { background: rgba(120,126,135,.85); }
.ve-exp-error .ve-card-thumb, .ve-exp-canceled .ve-card-thumb { opacity: .85; }

/* 成片加入笔记草稿：账号选择弹窗 */
.ve-draft-dialog { width: calc(100vw - 48px); max-width: 420px; }
.ve-draft-acct-list {
    display: flex; flex-direction: column; gap: 8px;
    margin: 14px 0 6px; max-height: 320px; overflow-y: auto;
}
.ve-draft-acct {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 9px 12px; border: 1px solid #e5e7eb; border-radius: 10px;
    background: #fff; cursor: pointer; text-align: left;
    transition: border-color .15s, background .15s;
}
.ve-draft-acct:hover { border-color: var(--brand); background: var(--brand-tint); }
.ve-draft-acct[disabled] { opacity: .65; cursor: default; }
.ve-draft-acct[disabled]:hover { border-color: #e5e7eb; background: #fff; }
.ve-draft-acct-ava {
    flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%;
    background: var(--brand-tint-2); color: var(--brand);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 600;
}
.ve-draft-acct-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ve-draft-acct-info strong { font-size: 13px; color: #222; }
.ve-draft-acct-info span { font-size: 11px; color: #999; }
.ve-da-loading {
    display: inline-block; width: 12px; height: 12px; margin-right: 6px;
    border: 2px solid currentColor; border-top-color: transparent;
    border-radius: 50%; vertical-align: -2px;
    animation: ne-spin .7s linear infinite;
}
