/* Video summary workspace
 * The page uses one visual system for the library, detail workspace and dialogs.
 * Layout values are fluid first; breakpoints only change interaction priority.
 */
:root {
    --vs-bg: #f7f7f8;
    --vs-browser-ui-inset-bottom: 0px;
    --vs-mobile-bottom-gap: 12px;
    --vs-surface: #ffffff;
    --vs-surface-soft: #fafafa;
    --vs-line: #e7e7e9;
    --vs-line-strong: #d9dadd;
    --vs-text: #202124;
    --vs-text-soft: #69717d;
    --vs-text-muted: #9399a3;
    --vs-blue: #2864d7;
    --vs-blue-soft: #edf3ff;
    --vs-danger: #bd3b3b;
    --vs-radius: 14px;
    --vs-shadow: 0 8px 24px rgba(17, 24, 39, .05);
    --vs-shadow-lg: 0 16px 42px rgba(17, 24, 39, .09);
    --vs-focus: 0 0 0 3px rgba(40, 100, 215, .13);
}

/* Shared page primitives */
.vs-wrap {
    box-sizing: border-box;
    width: min(1240px, calc(100% - 40px));
    margin: 0 auto;
    padding: 40px 0 48px;
    color: var(--vs-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

.vs-wrap *,
.vs-wrap *::before,
.vs-wrap *::after {
    box-sizing: border-box;
}

.vs-card {
    min-width: 0;
    background: var(--vs-surface);
    border: 1px solid var(--vs-line);
    border-radius: var(--vs-radius);
    box-shadow: var(--vs-shadow);
}

.vs-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 15px 18px;
    border-bottom: 1px solid var(--vs-line);
    background: var(--vs-surface);
}

.vs-card-head > div,
.vs-card-head h2 {
    min-width: 0;
}

.vs-card-head h2 {
    flex: 1;
    margin: 0;
    color: var(--vs-text);
    font-size: 14px;
    font-weight: 650;
}

.vs-card-body {
    padding: 16px 18px;
}

.vs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 34px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--vs-blue);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, color .16s ease, transform .16s ease;
}

.vs-btn:hover {
    background: #1f55bd;
    box-shadow: 0 5px 14px rgba(40, 100, 215, .18);
    transform: translateY(-1px);
}

.vs-btn:active {
    transform: translateY(0);
}

.vs-btn:disabled {
    cursor: not-allowed;
    opacity: .52;
    transform: none;
}

.vs-btn.ghost,
.vs-btn.secondary {
    border-color: var(--vs-line);
    background: #fff;
    box-shadow: none;
    color: var(--vs-text-soft);
}

.vs-btn.ghost:hover,
.vs-btn.secondary:hover {
    border-color: #c7d3e9;
    background: #f8faff;
    box-shadow: none;
    color: var(--vs-blue);
}

.vs-btn.danger {
    border-color: #f0cccc;
    background: #fff;
    box-shadow: none;
    color: var(--vs-danger);
}

.vs-btn.danger:hover {
    border-color: #e6a9a9;
    background: #fff5f5;
    box-shadow: none;
}

.vs-status-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1.45;
    white-space: nowrap;
}

.vs-status-tag::before {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    content: '';
}

.vs-status-pending { background: #fff7e0; color: #9a6b00; }
.vs-status-processing { background: #eaf2ff; color: #2860c8; font-variant-numeric: tabular-nums; }
.vs-status-completed { background: #e9f7ed; color: #19803c; }
.vs-status-failed { background: #fdeeee; color: #bd3b3b; cursor: help; }
.vs-status-failed:hover { background: #fbd6d6; color: #962828; }

.vs-task-item.is-failed { cursor: help; }
.vs-task-item.is-failed:hover { background: #fffbfb; }
.vs-task-card.is-failed { cursor: help; }
.vs-task-card.is-failed:hover { border-color: #f7c5c5; }

.vs-status-area {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--vs-text-muted);
    font-size: 12px;
}

.vs-status-loading {
    display: inline-block;
    width: 64px;
    height: 13px;
    border-radius: 99px;
    background: linear-gradient(90deg, #eef0f3 25%, #f8f9fb 37%, #eef0f3 63%);
    background-size: 400% 100%;
    animation: vs-sub-skeleton 1.2s ease infinite;
}

.vs-check {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--vs-text-soft);
    cursor: pointer;
    font-size: 12px;
    user-select: none;
}

.vs-check input {
    width: 13px;
    height: 13px;
    accent-color: var(--vs-blue);
}

.vs-empty {
    padding: 56px 20px;
    color: var(--vs-text-muted);
    font-size: 14px;
    text-align: center;
}

.vs-empty::before {
    display: block;
    width: 46px;
    height: 46px;
    margin: 0 auto 14px;
    border-radius: 14px;
    background: #f0f3f8;
    content: '';
}

/* Library */
.vs-home {
    width: min(1240px, calc(100% - 40px));
    padding-top: 46px;
}

.vs-home-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 126px;
    margin-bottom: 28px;
    padding: 28px 30px;
    overflow: hidden;
    border: 1px solid #e8edf5;
    border-radius: 18px;
    background: radial-gradient(420px 180px at 100% 0, rgba(66, 110, 220, .1), transparent 74%), #fff;
    box-shadow: 0 12px 32px rgba(26, 39, 63, .045);
}

.vs-home-header::after {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: radial-gradient(#dce5f8 1px, transparent 1px);
    background-position: right top;
    background-size: 18px 18px;
    content: '';
    mask-image: linear-gradient(90deg, transparent 48%, #000);
    pointer-events: none;
}

.vs-home-header > * {
    position: relative;
    z-index: 1;
}

.vs-home-header h1 {
    margin: 0;
    color: #172033;
    font-size: clamp(24px, 3vw, 30px);
    font-weight: 720;
    letter-spacing: -.04em;
}

.vs-home-header p {
    max-width: 620px;
    margin: 8px 0 0;
    color: #7b8598;
    font-size: 14px;
}

.vs-home-header .vs-btn {
    flex: 0 0 auto;
    min-width: 108px;
}

/* 本地文件处理进度条（header 下方） */
.vs-local-process-banner {
    margin-bottom: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: max-height .38s cubic-bezier(.4, 0, .2, 1),
                opacity .28s ease,
                margin-bottom .38s cubic-bezier(.4, 0, .2, 1);
}

.vs-local-process-banner.is-visible {
    max-height: 520px;
    margin-bottom: 20px;
    opacity: 1;
    pointer-events: auto;
}

.vs-local-process-banner[hidden] {
    display: block;
}

.vs-local-process-inner {
    padding: 18px 22px 20px;
    border: 1px solid #f5c26b;
    border-radius: 16px;
    background: linear-gradient(180deg, #fffaf0 0%, #fff 42%);
    box-shadow: 0 10px 28px rgba(180, 110, 20, .1);
}

.vs-local-process-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid #f6d28b;
    border-radius: 12px;
    background: #fff6df;
}

.vs-local-process-alert-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f59e0b;
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
}

.vs-local-process-alert strong {
    display: block;
    color: #9a3412;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
}

.vs-local-process-alert p {
    margin: 4px 0 0;
    color: #b45309;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.5;
}

.vs-local-process-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.vs-local-process-title {
    color: #172033;
    font-size: 14px;
    font-weight: 700;
}

.vs-local-process-status {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    color: #5c6880;
    font-size: 13px;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vs-local-process-track {
    height: 6px;
    margin-bottom: 14px;
    overflow: hidden;
    border-radius: 999px;
    background: #edf1f7;
}

.vs-local-process-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    transition: width .35s ease;
}

.vs-local-process-files {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.vs-local-process-file {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid #e8edf5;
    border-radius: 10px;
    background: #fafbfd;
    color: #5c6880;
    font-size: 13px;
}

.vs-local-process-file.is-active {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1e40af;
}

.vs-local-process-file.is-done {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.vs-local-process-file.is-failed {
    border-color: #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.vs-local-process-file-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #e9edf4;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
}

.vs-local-process-file.is-active .vs-local-process-file-icon {
    background: #dbeafe;
    color: #2563eb;
}

.vs-local-process-file.is-done .vs-local-process-file-icon {
    background: #dcfce7;
    color: #16a34a;
}

.vs-local-process-file.is-failed .vs-local-process-file-icon {
    background: #fee2e2;
    color: #dc2626;
}

.vs-local-process-file-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    font-weight: 550;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vs-local-process-file-state {
    flex: 0 0 auto;
    max-width: 42%;
    overflow: hidden;
    font-size: 12px;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vs-home > .vs-card {
    padding: 22px 24px 26px;
    border-radius: 18px;
    box-shadow: 0 12px 32px rgba(26, 39, 63, .045);
}

.vs-list-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 0 18px;
}

.vs-library-heading {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    gap: 2px;
    color: var(--vs-text);
    font-size: 16px;
    font-weight: 700;
}

.vs-library-heading small {
    color: var(--vs-text-muted);
    font-size: 12px;
    font-weight: 500;
}

.vs-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vs-btn.danger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border-radius: 7px;
    background: #fde8e8;
    color: #c81e1e;
    border: 1px solid #f8b4b4;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all .16s ease;
}

.vs-btn.danger:hover {
    background: #fbd5d5;
    color: #9b1c1c;
    border-color: #f98080;
}

.vs-task-check-all {
    width: 15px;
    height: 15px;
    accent-color: var(--vs-blue);
    cursor: pointer;
}

.vs-mode-toggle {
    display: inline-flex;
    flex: 0 0 auto;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--vs-line);
    border-radius: 8px;
    background: #f5f6f8;
}

.vs-mode-toggle-pending { visibility: hidden; }

.vs-mode-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #969ca5;
    cursor: pointer;
}

.vs-mode-btn.active {
    background: #fff;
    box-shadow: 0 1px 4px rgba(20, 24, 32, .12);
    color: var(--vs-blue);
}

.vs-mode-btn:hover:not(.active) {
    color: var(--vs-text-soft);
}

.vs-list-view-header {
    display: grid;
    grid-template-columns: 28px 76px minmax(0, 1.4fr) 72px 132px 118px;
    align-items: center;
    gap: 12px;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid var(--vs-line);
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
    background: #f7f8fa;
    color: var(--vs-text-soft);
    font-size: 12px;
    font-weight: 600;
}

.vs-list-view-header > span:nth-child(4),
.vs-list-view-header > span:nth-child(5) {
    text-align: center;
}

.vs-list-view-header > span:nth-child(6) {
    text-align: left;
}

.vs-list-view-header[hidden] { display: none; }
.vs-mode-changing { opacity: .35; transition: opacity .12s ease; }

.vs-task-list {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--vs-line);
    border-radius: 10px;
    overflow: hidden;
}

.vs-task-item {
    display: grid;
    grid-template-columns: 28px 76px minmax(0, 1.4fr) 72px 132px 118px;
    align-items: center;
    min-width: 0;
    gap: 12px;
    min-height: 84px;
    padding: 12px 16px;
    border: 0;
    border-bottom: 1px solid #e7ebf2;
    background: #fff;
    cursor: pointer;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.vs-task-item:hover {
    border-color: transparent;
    background: #f8faff;
    box-shadow: none;
    transform: none;
}

.vs-task-item > input[type="checkbox"] {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    accent-color: var(--vs-blue);
}

.vs-task-cover {
    flex: 0 0 auto;
    width: 76px;
    height: 46px;
    border: 0;
    border-radius: 7px;
    background: #eff1f5;
    object-fit: cover;
}

.vs-task-cover-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8eef8 0%, #f1f4fa 100%);
    position: relative;
    border: 1px solid rgba(40, 100, 215, 0.08);
}

.vs-task-cover-placeholder::before {
    content: '';
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(40, 100, 215, 0.12);
    display: block;
}

.vs-task-cover-placeholder::after {
    content: '▶';
    position: absolute;
    color: var(--vs-blue);
    font-size: 9px;
    line-height: 1;
    transform: translateX(1px);
}

.vs-task-main {
    min-width: 0;
    flex: 1 1 auto;
    transition: transform .16s ease;
}

.vs-task-col {
    min-width: 0;
    color: var(--vs-text-muted);
    font-size: 12px;
    line-height: 1.4;
}

.vs-task-col-duration {
    color: var(--vs-text-soft);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    text-align: center;
}

.vs-task-col-time {
    color: var(--vs-text-muted);
    font-size: 11px;
    white-space: nowrap;
    text-align: center;
}

.vs-task-col-status {
    display: flex;
    justify-content: flex-start;
}

.vs-task-inline-meta {
    display: none;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
    color: var(--vs-text-muted);
    font-size: 11px;
}

.vs-task-inline-meta .vs-inline-duration {
    color: var(--vs-text-soft);
    font-variant-numeric: tabular-nums;
}

.vs-task-mode-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.vs-mode-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f1f3f7;
    color: #5f6775;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
}

.vs-mode-tag.is-speaker {
    background: #edf3ff;
    color: #2864d7;
}

.vs-source-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    margin-top: 6px;
    padding: 2px 8px 2px 6px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: #f3f4f6;
    color: #7b8494;
    font-size: 11px;
    line-height: 1.4;
    cursor: pointer;
    transition: color .15s ease, background .15s ease, border-color .15s ease;
}

.vs-source-chip svg {
    width: 12px;
    height: 12px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.vs-source-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vs-source-chip:hover {
    border-color: #d7e3fb;
    background: #edf3ff;
    color: var(--vs-blue);
}

.vs-source-chip.is-local {
    cursor: default;
}

a.vs-source-chip {
    text-decoration: none;
    color: inherit;
}

a.vs-source-chip:hover {
    color: var(--vs-blue);
}

.vs-task-item:hover .vs-task-main {
    transform: translateX(2px);
}

.vs-task-title {
    display: block;
    overflow: hidden;
    color: #202c40;
    font-size: 13.5px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
}

.vs-task-title:hover { color: var(--vs-blue); }

.vs-task-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 7px;
    color: var(--vs-text-muted);
    font-size: 11px;
}

.vs-task-meta > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vs-task-row-meta {
    justify-content: flex-start;
    min-width: 0;
    margin-top: 0;
}

.vs-task-row-meta > span:last-child {
    max-width: 100%;
}

.vs-list-loading,
.vs-task-grid {
    display: grid;
    gap: 12px;
}

.vs-list-skeleton-row {
    display: grid;
    grid-template-columns: 28px 76px minmax(0, 1.4fr) 72px 132px 118px;
    align-items: center;
    gap: 12px;
    min-height: 84px;
    padding: 12px 16px;
    border-bottom: 1px solid #edf0f4;
}

.vs-list-skeleton-row i,
.vs-card-skeleton i {
    display: block;
    height: 12px;
    border-radius: 99px;
    background: linear-gradient(90deg, #eef1f5 25%, #f8f9fb 37%, #eef1f5 63%);
    background-size: 400% 100%;
    animation: vs-sub-skeleton 1.2s ease infinite;
}

.vs-list-skeleton-row i:nth-child(1) { width: 14px; height: 14px; border-radius: 4px; }
.vs-list-skeleton-row i:nth-child(2) { width: 68px; height: 44px; border-radius: 7px; }
.vs-list-skeleton-row i:nth-child(3) { width: 70%; }

.vs-card-skeleton {
    min-height: 230px;
    overflow: hidden;
    border: 1px solid #e7ebf2;
    border-radius: 13px;
    background: #fff;
}

.vs-card-skeleton i:nth-child(1) { height: 132px; border-radius: 0; }
.vs-card-skeleton i:nth-child(2) { width: 75%; margin: 16px 14px 10px; }
.vs-card-skeleton i:nth-child(3) { width: 45%; margin: 0 14px; }

.vs-task-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 245px), 1fr));
    gap: 16px;
}

.vs-task-card {
    position: relative;
    min-width: 0;
    min-height: 230px;
    overflow: hidden;
    border: 1px solid #e5eaf1;
    border-radius: 13px;
    background: #fff;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.vs-task-card:hover {
    border-color: #cbd8ed;
    box-shadow: 0 14px 28px rgba(23, 42, 77, .12);
    transform: translateY(-3px);
}

.vs-task-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.vs-task-card-cover {
    position: relative;
    aspect-ratio: 16 / 8.6;
    overflow: hidden;
    background: #eff3f9;
}

.vs-duration-badge {
    position: absolute;
    right: 8px;
    bottom: 8px;
    z-index: 2;
    padding: 2px 7px;
    border-radius: 6px;
    background: rgba(15, 23, 42, .72);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1.4;
    pointer-events: none;
}

.vs-card-status-corner {
    position: absolute;
    top: 8px;
    right: 8px;
    left: auto;
    z-index: 2;
    max-width: calc(100% - 16px);
    pointer-events: none;
}

.vs-card-status-corner .vs-status-tag {
    box-shadow: 0 4px 12px rgba(15, 23, 42, .18);
}

.vs-task-card-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .24s ease;
}

.vs-task-card:hover .vs-task-card-cover img {
    transform: scale(1.04);
}

.vs-task-card-cover.no-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    position: relative;
}

.vs-task-card-cover.no-cover::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 12px 12px;
}

.vs-task-card-cover.no-cover::after {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    content: '▶';
    font-size: 16px;
    padding-left: 2px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.vs-task-card-body {
    padding: 14px 15px 15px;
}

.vs-task-card-title {
    display: -webkit-box;
    min-height: 2.95em;
    overflow: hidden;
    color: #202c40;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.48;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.vs-task-card-body .vs-task-mode-tags {
    margin-top: 0;
}

.vs-task-card-tags-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.vs-task-card-tags-row .vs-source-chip {
    margin-top: 0;
}

.vs-task-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    margin-top: 10px;
}

.vs-task-card-time {
    flex: 0 0 auto;
    color: var(--vs-text-muted);
    font-size: 11px;
    white-space: nowrap;
}

.vs-task-card-duration {
    flex: 0 0 auto;
    margin-left: auto;
    padding: 2px 7px;
    border-radius: 6px;
    background: #f1f3f7;
    color: #5f6775;
    font-size: 11px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.vs-task-card-footer .vs-source-chip {
    margin-top: 0;
    flex: 0 1 auto;
    min-width: 0;
}

.vs-task-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    margin-top: 12px;
    color: var(--vs-text-muted);
    font-size: 11px;
}

.vs-card-continue {
    display: block;
    margin-top: 11px;
    color: var(--vs-blue);
    font-size: 12px;
    font-weight: 650;
}

.vs-task-card-check {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    width: 16px;
    height: 16px;
    accent-color: var(--vs-blue);
    cursor: pointer;
}

.vs-list-foot {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 24px 0 0;
}

.pagination-section {
    flex: 1 1 auto;
    text-align: center;
    overflow: visible;
}

.vs-list-foot .pager {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: auto;
    margin: 0 auto;
    padding: 0;
    font-size: 13px;
}

.vs-list-foot .pager .page_num,
.vs-list-foot .pager .page_num:first-child,
.vs-list-foot .pager .page_num:last-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    background: #fff;
    color: #374151;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    margin: 0 !important;
    box-sizing: border-box;
    transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}

.vs-list-foot .pager .page_num:hover {
    border-color: var(--vs-blue) !important;
    color: var(--vs-blue);
    background: #f0f7ff;
}

.vs-list-foot .pager .page_num.on1,
.vs-list-foot .pager .page_num.on1:first-child,
.vs-list-foot .pager .page_num.on1:last-child {
    border-color: var(--vs-blue) !important;
    background-color: var(--vs-blue) !important;
    color: #fff !important;
    box-shadow: 0 2px 6px rgba(59, 130, 246, .25);
}

.vs-list-foot .pager .page_ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 32px;
    padding: 0 2px;
    color: #9ca3af;
    font-size: 13px;
}

/* Create dialog and standalone create page */
.vs-hero {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 72px;
    margin-bottom: 20px;
    padding: 20px 24px;
    overflow: hidden;
    border: 1px solid #e8edf5;
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--vs-shadow);
}

.vs-hero::after {
    position: absolute;
    inset: 0 0 0 50%;
    background-image: radial-gradient(#dce5f8 1px, transparent 1px);
    background-size: 18px 18px;
    content: '';
    mask-image: linear-gradient(90deg, transparent, #000);
    pointer-events: none;
}

.vs-hero > * { position: relative; z-index: 1; }

.vs-hero-title {
    margin: 0;
    color: #172033;
    font-size: clamp(21px, 3vw, 28px);
    font-weight: 720;
}

.vs-back {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    min-height: 30px;
    padding: 0 9px;
    border-radius: 7px;
    color: #6c7585;
    font-size: 13px;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}

.vs-back:hover {
    background: #f3f5f8;
    color: var(--vs-text);
}

.vs-create-card {
    width: min(600px, 100%);
    margin: 6px auto 0;
}

.vs-form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}

.vs-form-label {
    color: var(--vs-text-soft);
    font-size: 13px;
    font-weight: 600;
}

.vs-input,
.vs-select,
.vs-textarea {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    padding: 8px 11px;
    border: 1px solid var(--vs-line);
    border-radius: 8px;
    outline: 0;
    background: #fbfcfe;
    color: var(--vs-text);
    font: inherit;
    font-size: 13px;
}

.vs-input:focus,
.vs-select:focus,
.vs-textarea:focus {
    border-color: #8dabed;
    background: #fff;
    box-shadow: var(--vs-focus);
}

.vs-form-inline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.vs-form-inline .vs-select {
    width: auto;
    min-width: 160px;
    flex: 1 1 160px;
}

.vs-form-foot {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 6px;
}

.vs-list-foot .vs-btn {
    flex: 0 0 auto;
}

.vs-create-dialog {
    width: min(520px, calc(100vw - 28px));
    max-height: calc(100dvh - 28px);
    padding: 0;
    overflow: auto;
    border: 0;
    border-radius: 14px;
    color: var(--vs-text);
    box-shadow: 0 24px 80px rgba(18, 28, 45, .22);
}

.vs-create-dialog::backdrop,
.vs-prompt-dialog::backdrop {
    background: rgba(15, 23, 42, .42);
    backdrop-filter: blur(3px);
}

.vs-create-dialog-inner {
    padding: 26px;
}

.vs-dialog-head,
.vs-prompt-dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.vs-dialog-head { margin-bottom: 24px; }
.vs-dialog-head h2,
.vs-prompt-dialog-head h2 { margin: 0; font-size: 18px; line-height: 1.35; }
.vs-dialog-head p,
.vs-prompt-dialog-head p { margin: 6px 0 0; color: var(--vs-text-soft); font-size: 13px; }

.vs-dialog-close,
.vs-prompt-dialog-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: #f2f4f8;
    color: var(--vs-text-soft);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.vs-dialog-close:hover,
.vs-prompt-dialog-close:hover {
    background: #e9edf3;
    color: var(--vs-text);
}

.vs-dialog-label {
    display: block;
    margin-bottom: 8px;
    color: var(--vs-text);
    font-size: 13px;
    font-weight: 600;
}

.vs-dialog-status {
    min-height: 20px;
    margin-top: 8px;
    color: var(--vs-danger);
    font-size: 12px;
}

.vs-dialog-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

/* Detail workspace — 百分比宽度，主体居中，两侧留白给提示框 */
.vs-wrap.vs-detail-page {
    position: relative;
    --vs-content-width: 75%;
    --vs-header-height: 70px;
    --vs-detail-vpad: 16px;
    --vs-viewport-height: 100dvh;
    width: var(--vs-content-width);
    max-width: none;
    height: 100%;
    max-height: 100%;
    margin-inline: auto;
    padding: var(--vs-detail-vpad) 0;
    overflow: hidden;
    box-sizing: border-box;
}

.vs-detail-page::before {
    position: fixed;
    inset: var(--vs-header-height) 0 0;
    z-index: -1;
    background: var(--vs-bg);
    content: '';
}

body.vs-detail-body {
    overflow: hidden;
}

html.vs-detail-root {
    overflow: hidden;
    height: var(--vs-viewport-height, 100dvh);
}

body.vs-detail-body .main.vs-detail-main {
    min-height: 0;
    overflow: hidden;
    height: calc(var(--vs-viewport-height, 100dvh) - var(--vs-header-height, 70px));
    max-height: calc(var(--vs-viewport-height, 100dvh) - var(--vs-header-height, 70px));
}

.vs-detail-topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 52px;
    margin-bottom: 14px;
}

.vs-detail-topbar .vs-page-title {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: #1c2638;
    font-size: 18px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vs-detail-grid.vs-workspace {
    --vs-source-width: 30%;
    position: relative;
    display: grid;
    grid-template-columns: var(--vs-source-width) minmax(0, 1fr);
    align-items: stretch;
    gap: 1.6%;
    height: 100%;
    min-height: 0;
}

.vs-detail-grid.vs-workspace.vs-source-collapsed {
    grid-template-columns: 0px minmax(0, 1fr);
}

/* Floating Client Promo Widget — 固定展示在主体右侧空白 */
.vs-client-float-promo {
    position: fixed;
    z-index: 120;
    width: 52px;
    height: 52px;
    padding: 0;
    border-radius: 14px;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: default;
    
    /* 阶段 0：初始未显示状态 */
    opacity: 0;
    transform: scale(0.3) translateY(24px) rotate(var(--vs-promo-tilt, 0deg));
    filter: blur(5px);
    pointer-events: none;
    transition: opacity .45s ease,
                transform .5s cubic-bezier(0.34, 1.56, 0.64, 1),
                width .6s cubic-bezier(0.34, 1.35, 0.64, 1),
                height .6s cubic-bezier(0.34, 1.35, 0.64, 1),
                border-radius .5s cubic-bezier(0.34, 1.35, 0.64, 1),
                padding .45s ease,
                background .4s ease,
                box-shadow .45s ease,
                border-color .4s ease,
                filter .35s ease,
                right .25s ease,
                top .25s ease;
}

.vs-client-float-promo::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3.5px;
    background: linear-gradient(90deg, #3b82f6 0%, #6366f1 100%);
    opacity: 0;
    transition: opacity .35s ease;
}

/* 阶段 1：客户端图标弹入显示 (Icon popped) */
.vs-client-float-promo.is-icon-popped {
    opacity: 1;
    transform: scale(1) translateY(0) rotate(var(--vs-promo-tilt, 0deg));
    filter: blur(0);
    pointer-events: auto;
}

.vs-client-promo-morph-icon {
    position: absolute;
    top: 0;
    left: 0;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity .22s ease, transform .25s ease;
}

.vs-client-morph-svg {
    width: 52px;
    height: 52px;
    display: block;
    border-radius: 14px;
    overflow: hidden;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 14px rgba(37, 99, 235, .38));
}

.vs-client-morph-spark {
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 13px;
    animation: vsSparklePulse 1.8s infinite ease-in-out;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.8));
}

@keyframes vsSparklePulse {
    0%, 100% { transform: scale(1); opacity: 0.85; }
    50% { transform: scale(1.35); opacity: 1; filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.9)); }
}

.vs-client-promo-inner {
    display: none;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    opacity: 0;
    transform: scale(0.9) translateY(10px);
    pointer-events: none;
    transition: opacity .35s cubic-bezier(0.16, 1, 0.3, 1) .1s,
                transform .38s cubic-bezier(0.34, 1.4, 0.64, 1) .1s;
}

/* 阶段 2：由图标丝滑延展展开为完整卡片 (Card expanded) */
.vs-client-float-promo.is-card-expanded {
    width: var(--vs-promo-width, max(220px, 15vw));
    height: auto;
    padding: var(--vs-promo-padding, 16px);
    border-radius: var(--vs-promo-radius, 16px);
    background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
    border: 1px solid #dce6f5;
    box-shadow: 0 16px 42px rgba(36, 84, 180, .13), 0 2px 8px rgba(0, 0, 0, .03);
    align-items: stretch;
    justify-content: flex-start;
    /* 展开态清除旋转，确保文字锐利清晰。
       图标阶段有旋转却无文字，过渡动画平滑连接两个状态 */
    transform: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

.vs-client-float-promo.is-card-expanded::before {
    opacity: 1;
}

.vs-client-float-promo.is-card-expanded .vs-client-promo-morph-icon {
    display: none;
    opacity: 0;
    transform: scale(0.5);
}

.vs-client-float-promo.is-card-expanded .vs-client-promo-inner {
    display: flex;
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

/* 阶段 3：点击关闭后潇洒直接飞走消失（保持卡片形态直接平滑飞散，无需缩回按钮） */
.vs-client-float-promo.is-dismissing {
    opacity: 0 !important;
    transform: translateY(-20px) translateX(36px) scale(0.9) rotate(calc(var(--vs-promo-tilt, 0deg) + 6deg)) !important;
    filter: blur(8px) !important;
    pointer-events: none !important;
    transition: opacity .35s cubic-bezier(0.4, 0, 0.2, 1),
                transform .35s cubic-bezier(0.4, 0, 0.2, 1),
                filter .32s ease !important;
}

/* Theme 1: Aurora Blue (极光晶蓝) */
.vs-client-float-promo.theme-aurora::before { background: linear-gradient(90deg, #3b82f6 0%, #6366f1 100%); }
.vs-client-float-promo.theme-aurora .vs-client-promo-badge { background: #eef4ff; color: #2563eb; }
.vs-client-float-promo.theme-aurora .vs-client-promo-btn {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 3px 12px rgba(37, 99, 235, .28);
}

/* Theme 2: Cyber Purple (赛博紫霓) */
.vs-client-float-promo.theme-cyber::before { background: linear-gradient(90deg, #8b5cf6 0%, #ec4899 100%); }
.vs-client-float-promo.theme-cyber .vs-client-promo-badge { background: #faf5ff; color: #7c3aed; }
.vs-client-float-promo.theme-cyber .vs-client-promo-btn {
    background: linear-gradient(135deg, #7c3aed 0%, #9333ea 100%);
    box-shadow: 0 3px 12px rgba(124, 58, 237, .28);
}

/* Theme 3: Emerald Cyan (翡翠极速) */
.vs-client-float-promo.theme-emerald::before { background: linear-gradient(90deg, #06b6d4 0%, #0d9488 100%); }
.vs-client-float-promo.theme-emerald .vs-client-promo-badge { background: #ecfeff; color: #0891b2; }
.vs-client-float-promo.theme-emerald .vs-client-promo-btn {
    background: linear-gradient(135deg, #0284c7 0%, #0d9488 100%);
    box-shadow: 0 3px 12px rgba(2, 132, 199, .28);
}

/* Theme 4: Amber Star (琥珀曜金) */
.vs-client-float-promo.theme-amber::before { background: linear-gradient(90deg, #f59e0b 0%, #ef4444 100%); }
.vs-client-float-promo.theme-amber .vs-client-promo-badge { background: #fffbeb; color: #d97706; }
.vs-client-float-promo.theme-amber .vs-client-promo-btn {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
    box-shadow: 0 3px 12px rgba(234, 88, 12, .28);
}

/* Theme 5: Sunset Rose (晚霞落樱) */
.vs-client-float-promo.theme-sunset::before { background: linear-gradient(90deg, #f43f5e 0%, #8b5cf6 100%); }
.vs-client-float-promo.theme-sunset .vs-client-promo-badge { background: #fff1f2; color: #e11d48; }
.vs-client-float-promo.theme-sunset .vs-client-promo-btn {
    background: linear-gradient(135deg, #e11d48 0%, #9333ea 100%);
    box-shadow: 0 3px 12px rgba(225, 29, 72, .28);
}

/* Theme 6: Midnight Sapphire (暗夜琉璃) */
.vs-client-float-promo.theme-midnight::before { background: linear-gradient(90deg, #1e293b 0%, #3b82f6 100%); }
.vs-client-float-promo.theme-midnight .vs-client-promo-badge { background: #f1f5f9; color: #0f172a; }
.vs-client-float-promo.theme-midnight .vs-client-promo-btn {
    background: linear-gradient(135deg, #1e293b 0%, #2563eb 100%);
    box-shadow: 0 3px 12px rgba(30, 41, 59, .28);
}

/* 卡片顶部标题栏（徽标与关闭按钮在同一水平行对齐） */
.vs-client-promo-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 2px;
}

.vs-client-promo-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2.5px 8px;
    border-radius: 20px;
    background: #eef4ff;
    color: #2563eb;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
}

.vs-client-promo-close {
    position: static;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: rgba(148, 163, 184, .14);
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all .15s ease;
    flex-shrink: 0;
}

.vs-client-promo-close:hover {
    background: rgba(239, 68, 68, .14);
    color: #ef4444;
}

.vs-client-promo-title {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #1a2233;
    line-height: 1.4;
    padding-right: 4px;
}

.vs-client-promo-desc {
    margin: 0;
    font-size: 12.5px;
    color: #4a5568;
    line-height: 1.6;
}

.vs-client-promo-features {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 2px 0;
    padding: 9px 11px;
    background: rgba(240, 246, 255, .75);
    border-radius: 10px;
    border: 1px solid #e2ecfa;
}

.vs-client-promo-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.vs-client-promo-feature-item .vs-client-feature-icon {
    font-size: 14px;
    line-height: 1.3;
    flex-shrink: 0;
    margin-top: 1px;
}

.vs-client-feature-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.vs-client-feature-info strong {
    font-size: 12.5px;
    color: #1e293b;
    font-weight: 600;
}

.vs-client-feature-info small {
    font-size: 12px;
    color: #4a5568;
    margin-top: 2px;
    line-height: 1.5;
}

.vs-client-promo-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 12px;
    margin-top: 2px;
    border-radius: 9px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff !important;
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none !important;
    box-shadow: 0 3px 12px rgba(37, 99, 235, .28);
    transition: all .18s ease;
}

.vs-client-promo-btn:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 4px 16px rgba(37, 99, 235, .38);
    transform: translateY(-1px);
}

.vs-side {
    display: flex;
    min-width: 0;
    height: 100%;
    max-height: 100%;
    flex-direction: column;
    gap: 10px;
    position: relative;
    top: auto;
    min-height: 0;
}

.vs-side .vs-card {
    min-width: 0;
    margin: 0;
    overflow: hidden;
}

.vs-source-card {
    flex: 0 0 auto;
}

.vs-source-card .vs-card-body,
#vsPlayback {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.vs-source-card .vs-card-body {
    padding: 12px;
}

.vs-video,
.vs-cover {
    display: block;
    width: 100%;
    max-height: 200px;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    object-position: center;
    border-radius: 10px;
    background: #0f141c;
}

.vs-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    align-self: flex-start;
    max-width: 100%;
    margin: 0;
    padding: 6px 12px;
    border: 1px solid var(--vs-line);
    border-radius: 999px;
    background: #fff;
    color: var(--vs-text-soft);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
    text-decoration: none;
    transition: color .15s ease, border-color .15s ease, background .15s ease;
}

.vs-link-btn:hover {
    border-color: #c7d3e9;
    background: #f8faff;
    color: var(--vs-blue);
    text-decoration: none;
}

.vs-no-video {
    padding: 32px 12px;
    border: 1px dashed var(--vs-line-strong);
    border-radius: 10px;
    background: #f7f8fa;
    color: var(--vs-text-muted);
    font-size: 13px;
    text-align: center;
}

.vs-transcript-card {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    border-radius: 12px;
    background: #f7f7f8;
}

.vs-sub-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: auto;
    min-width: 120px;
    flex: 1 1 auto;
    min-height: 44px;
    padding: 0 14px;
    border: 0;
    background: transparent;
    color: var(--vs-text);
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.vs-sub-toggle h2 {
    flex: 1;
    margin: 0;
    font-size: 14px;
    font-weight: 650;
}

.vs-sub-count,
.vs-chevron {
    color: #8a909b;
    font-size: 12px;
}

.vs-chevron {
    transition: transform .18s ease;
}

.vs-sub-open .vs-chevron { transform: rotate(180deg); }

.vs-sub-header {
    display: flex;
    align-items: center;
    min-width: 0;
    min-height: 44px;
    overflow: visible;
}

.vs-sub-body {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    border-top: 1px solid #ececef;
}

.vs-sub-title {
    display: flex;
    align-items: center;
    min-width: 120px;
    flex: 1 1 auto;
    padding: 0 14px;
}

.vs-sub-title h2 {
    margin: 0;
    color: var(--vs-text);
    font-size: 14px;
    font-weight: 650;
}

.vs-sub-toolbar {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 6px;
    min-height: 44px;
    padding: 0 10px 0 0;
    border: 0;
    background: transparent;
}

.vs-sub-tools {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
    padding: 3px;
    border-radius: 8px;
    background: #f0f2f6;
}

.vs-sub-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #7b8798;
    cursor: pointer;
    font: inherit;
    font-size: 15px;
    line-height: 1;
}

.vs-sub-tool svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.vs-sub-tool .vs-speaker-icon-off { display: none; }
.vs-sub-tool:not(.is-active) .vs-speaker-icon-on { display: none; }
.vs-sub-tool:not(.is-active) .vs-speaker-icon-off { display: block; }

.vs-sub-tool:hover,
.vs-sub-tool.is-active {
    background: #fff;
    color: #2860cb;
}

.vs-sub-tool.is-loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.vs-sub-tool.is-loading svg {
    visibility: hidden;
}

.vs-sub-tool.is-loading::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border: 2px solid #6d7785;
    border-top-color: transparent;
    border-radius: 50%;
    content: '';
    animation: vs-spin 1s linear infinite;
}

@keyframes vs-spin {
    to { transform: rotate(360deg); }
}

.vs-subtitle-list {
    min-height: 0;
    flex: 1 1 auto;
    max-height: none;
    margin: 0 8px 8px;
    padding: 5px 4px;
    overflow-y: auto;
    border-radius: 8px;
    background: #fff;
    color: #343a45;
}

.vs-sub-item {
    position: relative;
    padding: 7px 5px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.7;
    white-space: pre-line;
}

.vs-sub-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 20px;
    gap: 6px;
}

.vs-sub-meta {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 4px;
}

.vs-sub-item:hover,
.vs-sub-item.active {
    background: #f0f4fb;
    box-shadow: inset 2px 0 0 #5b7fc8;
}

.vs-sub-time {
    margin-right: 6px;
    color: #5672a8;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.vs-sub-speaker {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    margin: 0;
    padding: 2px 6px 2px 3px;
    border: 0;
    border-radius: 6px;
    background: color-mix(in srgb, var(--vs-speaker-color) 14%, #fff);
    color: var(--vs-speaker-color);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
}

.vs-speaker-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--vs-speaker-color);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
}

.vs-sub-speaker:hover { filter: brightness(.96); }
.vs-speaker-edit,
.vs-sub-item-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #8c96a5;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    line-height: 1;
}

.vs-speaker-edit:hover,
.vs-sub-item-action:hover {
    background: #edf2fb;
    color: #2860cb;
}

.vs-sub-item-action svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.vs-sub-item-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 1px;
}

.vs-sub-item-action.is-loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.vs-sub-item-action.is-loading svg {
    visibility: hidden;
}

.vs-sub-item-action.is-loading::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
    border: 2px solid #7c8797;
    border-top-color: transparent;
    border-radius: 50%;
    content: '';
    animation: vs-spin 1s linear infinite;
}
.vs-sub-item-action.is-copied { color: #1a9e5c; }
.vs-sub-item-action.is-copied:hover { background: #edfaf3; color: #1a9e5c; }

.vs-sub-content {
    min-width: 0;
    color: var(--vs-text);
    font-size: 13px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.vs-sub-content.is-editable {
    padding: 2px 4px;
    border-radius: 6px;
    outline: none;
    cursor: text;
}

.vs-sub-content.is-editable:focus {
    background: #fff;
    box-shadow: inset 0 0 0 1px #8dabed;
}

.vs-speaker-editor,
.vs-sub-item-menu {
    position: absolute;
    z-index: 30;
    padding: 10px;
    border: 1px solid #e1e4ea;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(20, 31, 49, .16);
}

.vs-speaker-editor {
    top: 29px;
    left: 8px;
    width: 220px;
}

.vs-speaker-editor input {
    width: 100%;
    height: 30px;
    padding: 0 8px;
    border: 1px solid #d6dce6;
    border-radius: 6px;
    outline: 0;
    font: inherit;
    font-size: 12px;
}

.vs-speaker-editor input:focus { border-color: #8dabed; box-shadow: var(--vs-focus); }
.vs-speaker-editor-actions { display: flex; gap: 5px; margin-top: 8px; }
.vs-speaker-editor-actions button { flex: 1; min-height: 27px; border: 1px solid #dce1e9; border-radius: 5px; background: #fff; color: #566174; cursor: pointer; font: inherit; font-size: 11px; }
.vs-speaker-editor-actions button:hover { border-color: #8dabed; background: #f3f7ff; color: #2860cb; }
.vs-speaker-editor-list { display: grid; gap: 3px; max-height: 120px; margin-top: 8px; overflow-y: auto; }
.vs-speaker-editor-list button { padding: 5px 6px; border: 0; border-radius: 5px; background: transparent; color: #586274; cursor: pointer; font: inherit; font-size: 12px; text-align: left; }
.vs-speaker-editor-list button:hover { background: #f2f5fa; color: #2860cb; }

.vs-sub-item-menu {
    top: 28px;
    right: 4px;
    width: 142px;
    max-height: 190px;
    overflow-y: auto;
}

.vs-sub-item-menu button { display: block; width: 100%; padding: 6px 7px; border: 0; border-radius: 5px; background: transparent; color: #586274; cursor: pointer; font: inherit; font-size: 12px; text-align: left; }
.vs-sub-item-menu button:hover { background: #f2f5fa; color: #2860cb; }

.vs-sub-translation {
    margin-top: 4px;
    color: #697586;
    font-size: 12px;
    line-height: 1.5;
}

.vs-sub-empty {
    padding: 28px 10px;
    color: var(--vs-text-muted);
    font-size: 13px;
    text-align: center;
}

.vs-sub-loading {
    display: grid;
    gap: 12px;
    padding: 14px 8px;
}

.vs-sub-loading i {
    display: block;
    height: 13px;
    border-radius: 99px;
    background: linear-gradient(90deg, #f0f2f5 25%, #f8f9fb 37%, #f0f2f5 63%);
    background-size: 400% 100%;
    animation: vs-sub-skeleton 1.2s ease infinite;
}

.vs-sub-loading i:nth-child(2) { width: 82%; }
.vs-sub-loading i:nth-child(3) { width: 67%; }

@keyframes vs-sub-skeleton {
    0% { background-position: 100% 0; }
    100% { background-position: 0 0; }
}

.vs-sub-translate,
.vs-sub-download {
    position: relative;
}

.vs-translate-panel {
    position: absolute;
    z-index: 20;
    top: calc(100% + 8px);
    right: -38px;
    width: 230px;
    padding: 14px;
    border: 1px solid #e2e6ed;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 14px 36px rgba(20, 31, 49, .16);
    color: #2c3542;
}

.vs-translate-panel strong { display: block; margin-bottom: 11px; font-size: 13px; }
.vs-translate-panel label { display: block; color: #7b8492; font-size: 12px; }
.vs-translate-panel select { display: block; width: 100%; margin-top: 5px; padding: 7px 8px; border: 1px solid #cfd8e7; border-radius: 6px; background: #fff; color: #344052; font: inherit; font-size: 12px; }
.vs-translate-modes { display: flex; gap: 4px; margin-top: 10px; }
.vs-translate-modes button { flex: 1; padding: 5px 2px; border: 0; border-radius: 5px; background: #f2f4f7; color: #657082; cursor: pointer; font-size: 11px; }
.vs-translate-modes button.is-active { background: #e8f0ff; color: #2860cb; }
.vs-translate-confirm { width: 100%; margin-top: 10px; padding: 7px; border: 0; border-radius: 6px; background: #2860cb; color: #fff; cursor: pointer; font-size: 12px; }
.vs-translate-confirm:disabled { opacity: .65; cursor: wait; }

.vs-sub-download-menu {
    position: absolute;
    z-index: 20;
    top: calc(100% + 5px);
    right: 0;
    display: none;
    min-width: 108px;
    padding: 4px;
    border: 1px solid #e4e5e8;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(20, 25, 34, .12);
}

.vs-sub-download.open .vs-sub-download-menu { display: block; }
.vs-sub-download-menu button { display: block; width: 100%; padding: 7px 8px; border: 0; border-radius: 5px; background: transparent; color: #3f4652; cursor: pointer; font: inherit; font-size: 12px; text-align: left; }
.vs-sub-download-menu button:hover { background: #f3f5f8; }

.vs-workspace-toggle {
    position: absolute;
    z-index: 10;
    top: 50%;
    left: calc(var(--vs-source-width) + 12px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 48px;
    padding: 0;
    border: 1px solid #e1e3e7;
    border-radius: 8px;
    background: #fff;
    color: #545b66;
    cursor: pointer;
    font: inherit;
    font-size: 20px;
    line-height: 1;
    transform: translate(-50%, -50%);
    transition: background .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.vs-workspace-toggle:hover {
    background: #f7f7f8;
    color: var(--vs-blue);
    box-shadow: 0 7px 18px rgba(20, 24, 32, .14);
    transform: translate(-50%, -50%) scale(1.05);
}

.vs-workspace-toggle::after {
    position: absolute;
    top: 50%;
    left: calc(100% + 9px);
    padding: 6px 8px;
    border-radius: 6px;
    background: #202124;
    color: #fff;
    content: attr(aria-label);
    font-size: 12px;
    line-height: 1;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) translateX(-3px);
    transition: opacity .15s ease, transform .15s ease;
    white-space: nowrap;
}

.vs-workspace-toggle:hover::after,
.vs-workspace-toggle:focus-visible::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.vs-source-collapsed {
    --vs-source-width: 0px !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0 !important;
}

.vs-source-collapsed .vs-side { display: none; }
.vs-source-collapsed .vs-main { display: block; grid-column: 1; min-width: 0; width: 100%; }
.vs-source-collapsed .vs-chat-card { width: 100%; }
.vs-source-collapsed .vs-workspace-toggle { left: 14px; }

/* Chat */
.vs-main {
    display: flex;
    min-width: 0;
    min-height: 0;
    height: 100%;
    flex-direction: column;
}

.vs-chat-card {
    display: flex;
    height: 100%;
    min-height: 0;
    max-height: none;
    flex: 1 1 auto;
    flex-direction: column;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(17, 24, 39, .05);
}

.vs-chat-card .vs-card-head {
    flex: 0 0 auto;
    min-height: 58px;
    padding: 16px 20px;
}

.vs-chat-title-block {
    min-width: 0;
    flex: 1 1 auto;
}

.vs-chat-title {
    margin: 0;
    overflow: hidden;
    color: var(--vs-text);
    font-size: 15px;
    font-weight: 650;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vs-chat-head-actions {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 8px;
}

.vs-chat-head-actions .vs-status-area {
    font-size: 12px;
}

.vs-chat-list {
    position: relative;
    min-height: 0;
    flex: 1 1 auto;
    padding: 26px clamp(16px, 2.5vw, 28px);
    overflow-y: auto;
    overscroll-behavior: contain;
    overflow-anchor: none;
    background: #fff;
    scrollbar-gutter: stable;
    scroll-behavior: auto;
}

.vs-chat-list::-webkit-scrollbar { width: 6px; }
.vs-chat-list::-webkit-scrollbar-track { background: transparent; }
.vs-chat-list::-webkit-scrollbar-thumb { border-radius: 99px; background: #d7deea; }

.vs-msg {
    display: flex;
    flex-direction: column;
    margin-bottom: 24px;
    animation: vs-message-in .2s ease both;
}

@keyframes vs-message-in {
    from { opacity: 0; transform: translateY(4px); }
}

.vs-msg.user { align-items: flex-end; }
.vs-msg.assistant { position: relative; align-items: flex-start; padding-left: 0; }

.vs-msg.assistant::before {
    position: absolute;
    top: 2px;
    left: 0;
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border-radius: 8px;
    background: #1f58c5;
    box-shadow: 0 4px 10px rgba(31, 88, 197, .16);
    color: #fff;
    content: 'AI';
    font-size: 8px;
    font-weight: 700;
    display: none;
}

.vs-bubble {
    max-width: 100%;
    padding: 0;
    border-radius: 0;
    color: #263247;
    font-size: 14px;
    line-height: 1.8;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.vs-msg.assistant .vs-bubble {
    border: 0;
    background: transparent;
    box-shadow: none;
}

.vs-msg.user .vs-bubble {
    max-width: min(82%, 560px);
    padding: 10px 14px;
    border-radius: 11px 11px 3px 11px;
    background: #edf3ff;
    box-shadow: none;
    color: #244a97;
}

.vs-msg.assistant .vs-bubble h1,
.vs-msg.assistant .vs-bubble h2,
.vs-msg.assistant .vs-bubble h3,
.vs-msg.assistant .vs-bubble h4,
.vs-msg.assistant .vs-bubble h5,
.vs-msg.assistant .vs-bubble h6 {
    margin: 16px 0 6px;
    color: #1a2536;
    font-weight: 700;
    line-height: 1.4;
}

.vs-msg.assistant .vs-bubble h1 { font-size: 20px; border-bottom: 1px solid var(--vs-line); padding-bottom: 6px; }
.vs-msg.assistant .vs-bubble h2 { font-size: 17px; border-bottom: 1px solid #eef0f4; padding-bottom: 4px; }
.vs-msg.assistant .vs-bubble h3 { font-size: 15.5px; }
.vs-msg.assistant .vs-bubble h4 { font-size: 14.5px; color: #2c3e56; }
.vs-msg.assistant .vs-bubble h5 { font-size: 13.5px; color: #3d4f68; font-weight: 600; }
.vs-msg.assistant .vs-bubble h6 { font-size: 12.5px; color: #546880; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.vs-msg.assistant .vs-bubble > :first-child { margin-top: 0; }
.vs-msg.assistant .vs-bubble > :last-child { margin-bottom: 0; }
.vs-msg.assistant .vs-bubble p { margin: 7px 0; }
.vs-msg.assistant .vs-bubble ul,
.vs-msg.assistant .vs-bubble ol { margin: 7px 0; padding-left: 22px; }
.vs-msg.assistant .vs-bubble li { margin: 3px 0; }
.vs-msg.assistant .vs-bubble blockquote { margin: 9px 0; padding: 7px 13px; border-left: 3px solid #7c9ee3; border-radius: 0 8px 8px 0; background: #f2f6ff; color: #59677c; }
.vs-msg.assistant .vs-bubble a { color: var(--vs-blue); }
.vs-msg.assistant .vs-bubble table { width: 100%; margin: 9px 0; border-collapse: collapse; font-size: 13px; }
.vs-msg.assistant .vs-bubble th,
.vs-msg.assistant .vs-bubble td { padding: 5px 9px; border: 1px solid var(--vs-line); text-align: left; }
.vs-msg.assistant .vs-bubble th { background: #f6f8fc; }

.vs-msg .vs-bubble pre {
    margin: 9px 0;
    padding: 12px;
    overflow-x: auto;
    border-radius: 10px;
    background: #161d2e;
    color: #dbe4f0;
    font-size: 12.5px;
    line-height: 1.55;
}

.vs-msg .vs-bubble code {
    padding: 1px 5px;
    border-radius: 5px;
    background: #eef2fa;
    color: #2456d6;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 12.5px;
}

.vs-msg .vs-bubble pre code { padding: 0; background: transparent; color: inherit; }
.vs-msg.user .vs-bubble code { background: rgba(40, 100, 215, .1); color: #244a97; }
.vs-msg .vs-bubble img { display: block; width: auto; max-width: min(100%, 360px); max-height: min(420px, 55vh); margin: 8px 0; border: 1px solid var(--vs-line); border-radius: 10px; object-fit: contain; background: var(--vs-bg-subtle, #f8fafc); }
.vs-msg .vs-bubble img:not([src]),
.vs-msg .vs-bubble img[src=""] { display: none !important; }
.vs-message-images { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; max-width: 100%; }

.vs-msg-meta {
    margin: 5px 0 0;
    color: var(--vs-text-muted);
    font-size: 11px;
}

.vs-msg-meta:empty {
    display: none;
}

.vs-msg-meta.vs-meta-thinking {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--vs-blue);
    font-size: 12px;
    line-height: 18px;
}

.vs-thinking-dots {
    display: inline-flex;
    align-items: center;
    gap: 3.5px;
    margin-left: 1px;
}

.vs-thinking-dots span {
    display: inline-block;
    width: 3.5px;
    height: 3.5px;
    border-radius: 50%;
    background-color: currentColor;
    opacity: 0.3;
    animation: vs-dot-pulse 1.4s ease-in-out infinite;
}

.vs-thinking-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.vs-thinking-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes vs-dot-pulse {
    0%, 100% {
        opacity: 0.25;
        transform: scale(0.85);
    }
    50% {
        opacity: 1;
        transform: scale(1.15);
    }
}

.vs-msg-error { margin: 6px 0 0; padding: 7px 10px; border-radius: 8px; background: #fdeeee; color: var(--vs-danger); font-size: 13px; }

/* Flashcard Q/A grid (aligned with Electron MessageFlashcards) */
.vs-fc-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 4px 0;
    width: 100%;
}

.vs-fc-item {
    perspective: 800px;
    min-width: 0;
}

.vs-fc-card {
    position: relative;
    width: 100%;
    min-height: 110px;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.45s cubic-bezier(0.4, 0.2, 0.2, 1);
    border-radius: 12px;
    outline: none;
}

.vs-fc-card.flipped {
    transform: rotateY(180deg);
}

.vs-fc-front,
.vs-fc-back {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 14px 16px;
    gap: 8px;
}

.vs-fc-front {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
}

.vs-fc-back {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #86efac;
    transform: rotateY(180deg);
}

.vs-fc-num {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.55;
    line-height: 1;
}

.vs-fc-front .vs-fc-num { color: #1d4ed8; }
.vs-fc-back .vs-fc-num { color: #15803d; }

.vs-fc-text {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    color: var(--vs-text);
    flex: 1;
    user-select: text;
    word-break: break-word;
}

.vs-fc-hint {
    font-size: 11px;
    color: #93c5fd;
    align-self: flex-end;
    margin-top: 4px;
}

.vs-fc-hint-back {
    color: #6ee7b7;
}

@media (max-width: 640px) {
    .vs-fc-grid {
        grid-template-columns: 1fr;
    }
}
.vs-divider { display: flex; align-items: center; gap: 12px; margin: 24px 0; color: #9aa1ac; font-size: 12px; text-align: center; }
.vs-divider::before, .vs-divider::after { height: 1px; flex: 1; background: #e6e8ec; content: ''; }
.vs-capture-box {
    display: block;
    margin: 10px 0;
    max-width: min(100%, 420px);
}

.vs-capture-box.is-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px dashed #cfd4de;
    border-radius: 8px;
    background: #f8f9fb;
    color: #555e6d;
    font-size: 12px;
}

.vs-capture-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #7c8798;
    border-top-color: transparent;
    border-radius: 50%;
    animation: vs-spin 1s linear infinite;
    flex-shrink: 0;
}

.vs-capture-img {
    display: block;
    max-width: min(100%, 400px);
    max-height: min(440px, 50vh);
    margin: 8px 0;
    border: 1px solid var(--vs-line);
    border-radius: 10px;
    object-fit: contain;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
}

.vs-capture-fail {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    border-radius: 6px;
    background: #fff0f0;
    color: var(--vs-danger);
    font-size: 12px;
    margin: 6px 0;
}

/* Message action buttons — GPT style: icon-only, no border, appears on hover */
.vs-msg-actions {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    margin-top: 4px;
    opacity: 0;
    transition: opacity .16s ease;
}

.vs-msg:hover .vs-msg-actions,
.vs-msg-actions:focus-within,
.vs-msg-actions.is-persistent {
    opacity: 1;
}

.vs-msg-actions.is-persistent {
    pointer-events: auto;
}

.vs-act-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #8a9099;
    cursor: pointer;
    font: inherit;
    line-height: 1;
    transition: background .13s ease, color .13s ease;
}

.vs-act-btn:hover {
    background: #f0f2f5;
    color: #2c3542;
}

.vs-act-btn svg {
    flex: 0 0 auto;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.vs-act-link {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #5b6b84;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: background .13s ease, color .13s ease;
}

.vs-act-link:hover {
    background: #f0f6ff;
    color: var(--vs-blue);
}

.vs-act-copy.is-copied {
    color: #1a9e5c;
}

.vs-act-copy.is-copied:hover {
    background: #edfaf3;
    color: #1a9e5c;
}


/* Composer: shortcuts are part of the same action rail, never a separate desktop row. */
.vs-chat-composer-wrap {
    position: relative;
    flex: 0 0 auto;
    width: 100%;
    overflow: visible;
    z-index: 2;
    padding-bottom: calc(var(--vs-mobile-bottom-gap, 12px) + env(safe-area-inset-bottom, 0px) + var(--vs-browser-ui-inset-bottom, 0px));
    background: #fff;
}

.vs-scroll-bottom-btn {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 12px);
    transform: translateX(-50%) translateY(8px) scale(0.88);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.09);
    border-radius: 50%;
    background: #ffffff;
    color: #475467;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    z-index: 20;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.22s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.vs-scroll-bottom-btn:hover {
    background: #f8fafc;
    color: #1e293b;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16), 0 2px 6px rgba(0, 0, 0, 0.08);
    transform: translateX(-50%) translateY(-2px) scale(1.04);
}

.vs-scroll-bottom-btn:active {
    transform: translateX(-50%) translateY(0) scale(0.96);
}

.vs-scroll-bottom-btn.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0) scale(1);
}

/* 超限截断提示条 */
.vs-context-truncation-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 16px 8px;
    padding: 8px 12px;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    background: #fffbeb;
    color: #9a3412;
    font-size: 12px;
    line-height: 1.4;
    box-sizing: border-box;
}

.vs-truncation-banner-inner {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.vs-truncation-banner-inner svg {
    flex-shrink: 0;
    color: #ea580c;
}

.vs-truncation-banner-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vs-truncation-banner-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.vs-banner-action-btn {
    border: none;
    background: transparent;
    color: #c2410c;
    font-size: 12px;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}

.vs-banner-action-btn:hover {
    color: #9a3412;
}

.vs-banner-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #9a3412;
    font-size: 15px;
    cursor: pointer;
    line-height: 1;
}

.vs-banner-close-btn:hover {
    background: rgba(154, 52, 18, 0.12);
}

/* 预算调节组件 */
.vs-budget-wrap {
    position: relative;
    display: inline-flex;
}

.vs-composer-actions .vs-budget-wrap {
    order: 5;
}

.vs-chat-budget-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 28px;
    padding: 0 8px;
    border: 1px solid #e1e4e9;
    border-radius: 6px;
    background: #fafafa;
    color: #555d68;
    font-size: 11.5px;
    font-weight: 550;
    cursor: pointer;
    transition: all .15s ease;
}

.vs-chat-budget-btn:hover,
.vs-chat-budget-btn.is-active {
    border-color: var(--vs-blue);
    background: #f0f6ff;
    color: var(--vs-blue);
}

.vs-budget-popover {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    width: 320px;
    padding: 14px 16px;
    border: 1px solid #e5e9f2;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12), 0 3px 6px rgba(0, 0, 0, 0.04);
    z-index: 99;
    text-align: left;
}

.vs-budget-popover-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--vs-text);
}

.vs-budget-popover-desc {
    margin-top: 5px;
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
}

.vs-budget-popover-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.vs-budget-input {
    flex: 1;
    min-width: 0;
    height: 30px;
    padding: 0 10px;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    font-size: 13px;
    color: var(--vs-text);
    background: #fafbfe;
}

.vs-budget-input:focus {
    border-color: var(--vs-blue);
    background: #fff;
}

.vs-budget-save-btn {
    border: none;
    border-radius: 6px;
    background: #2563eb;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    padding: 0 12px;
    height: 30px;
    cursor: pointer;
    transition: opacity .15s ease;
}

.vs-budget-save-btn:hover {
    opacity: 0.9;
}

.vs-budget-reset-btn {
    border: none;
    background: transparent;
    color: #2563eb;
    font-size: 12px;
    padding: 0 4px;
    height: 30px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.vs-budget-reset-btn:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.vs-budget-popover-hint {
    margin-top: 8px;
    font-size: 11px;
    color: #94a3b8;
}

.vs-chat-input-row {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: end;
    gap: 0 8px;
    flex: 0 0 auto;
    margin: 0 16px 16px;
    padding: 8px 10px 7px;
    border: 1px solid #dcdde1;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 -12px 24px rgba(255, 255, 255, .96);
    overflow: visible;
}

.vs-chat-input-row:focus-within {
    border-color: #8dabed;
    box-shadow: 0 0 0 3px rgba(62, 113, 220, .1), 0 -12px 24px rgba(255, 255, 255, .96);
}

.vs-chat-image-btn {
    display: inline-flex;
    grid-column: 1;
    grid-row: 1;
    align-items: center;
    justify-content: center;
    align-self: end;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 8px;
    background: #f4f6fa;
    color: #6e7785;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.vs-chat-image-btn:hover {
    background: #eaf0ff;
    color: var(--vs-blue);
}

.vs-chat-input {
    display: block;
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    min-width: 0;
    min-height: 38px;
    max-height: 144px;
    padding: 8px 4px 7px;
    overflow-y: auto;
    border: 0;
    border-radius: 8px;
    outline: 0;
    resize: none;
    background: transparent;
    color: var(--vs-text);
    font: inherit;
    font-size: 14px;
    line-height: 1.55;
}

.vs-chat-input::placeholder { color: #a0a6af; }
.vs-chat-input:focus { box-shadow: none; }

.vs-composer-actions {
    display: flex;
    grid-column: 1 / -1;
    grid-row: 2;
    align-items: center;
    min-width: 0;
    gap: 6px;
    min-height: 30px;
    padding-top: 5px;
    overflow: visible;
}

.vs-composer-actions .vs-quick-actions-wrap {
    position: relative;
    flex: 0 0 auto;
    z-index: 30;
    order: 2;
    margin-left: auto;
}

.vs-composer-actions .vs-chat-model {
    order: 1;
}

.vs-composer-actions .vs-chat-library:not(.vs-quick-actions-btn) {
    order: 3;
}

.vs-composer-actions .vs-chat-new-topic {
    order: 4;
}

.vs-composer-actions .vs-chat-send {
    order: 6;
}

.vs-quick-actions-btn::after {
    content: '▾';
    margin-left: 2px;
    font-size: 10px;
    color: #8b919a;
}

.vs-quick-actions-btn[aria-expanded="true"] {
    background: #e9eaec;
    color: var(--vs-text);
}

.vs-quick-actions-menu {
    position: absolute;
    left: 0;
    bottom: calc(100% + 6px);
    z-index: 200;
    min-width: 210px;
    max-width: 280px;
    padding: 6px;
    border: 1px solid #e5e6e9;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(20, 24, 32, .12);
}

.vs-quick-actions-menu[hidden] {
    display: none !important;
}

.vs-quick-action-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--vs-text);
    cursor: pointer;
    font: inherit;
    text-align: left;
    transition: background .15s ease;
}

.vs-quick-action-item:hover {
    background: #f4f6fa;
}

.vs-quick-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
    color: #69717d;
    flex-shrink: 0;
}

.vs-quick-action-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.vs-quick-action-copy strong {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--vs-text);
}

.vs-quick-action-copy span {
    font-size: 11px;
    line-height: 1.4;
    color: var(--vs-text-muted);
}

.vs-chat-model {
    flex: 0 0 180px;
    width: 180px;
    max-width: 180px;
    min-width: 170px;
    min-height: 30px;
    padding: 4px 22px 4px 4px;
    border: 0;
    border-radius: 5px;
    outline: 0;
    background: transparent;
    color: #737985;
    font: inherit;
    font-size: 11px;
}

.vs-chat-model:focus { box-shadow: var(--vs-focus); }

.vs-chat-library,
.vs-chat-new-topic,
.vs-quick-actions-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    gap: 4px;
    min-height: 30px;
    padding: 0 9px;
    border: 0;
    border-radius: 7px;
    background: #f4f4f5;
    color: #555b65;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    white-space: nowrap;
}

.vs-composer-btn-icon {
    display: none;
    flex-shrink: 0;
}

.vs-chat-library:hover,
.vs-chat-new-topic:hover,
.vs-quick-actions-btn:hover {
    background: #e9eaec;
    color: var(--vs-text);
}

.vs-chat-new-topic {
    position: relative;
    overflow: hidden;
}

.vs-chat-new-topic.is-loading {
    color: transparent;
    pointer-events: none;
}

.vs-chat-new-topic.is-loading::after {
    position: absolute;
    inset: 0;
    width: 12px;
    height: 12px;
    margin: auto;
    border: 2px solid #7a818c;
    border-top-color: transparent;
    border-radius: 50%;
    content: '';
    animation: vs-spin 1s linear infinite;
}

.vs-chat-send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: #202124;
    color: #fff;
    cursor: pointer;
    font-size: 0;
}

.vs-chat-send::after {
    color: #fff;
    content: '↑';
    font-size: 18px;
    font-weight: 500;
    line-height: 1;
}

.vs-chat-send:hover { background: #383a3e; }
.vs-chat-send:disabled { cursor: not-allowed; opacity: .45; }

.vs-image-preview {
    display: none;
    grid-column: 1 / -1;
    grid-row: 1;
    gap: 6px;
    margin-bottom: 3px;
}

.vs-image-preview.has-images { display: flex; flex-wrap: wrap; }
.vs-chat-input-row.vs-has-images .vs-chat-image-btn,
.vs-chat-input-row.vs-has-images .vs-chat-input { grid-row: 2; }
.vs-chat-input-row.vs-has-images .vs-composer-actions { grid-row: 3; }
.vs-image-chip { position: relative; width: 42px; height: 42px; border: 1px solid #dfe4ea; border-radius: 7px; background: #fff; }
.vs-image-chip img { display: block; width: 100%; height: 100%; border-radius: 6px; object-fit: cover; }
.vs-image-remove { position: absolute; top: -6px; right: -6px; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; padding: 0; border: 1px solid #fff; border-radius: 50%; background: #30343a; color: #fff; cursor: pointer; font-size: 14px; line-height: 1; }
.vs-chat-busy .vs-chat-input, .vs-chat-busy .vs-chat-image-btn { opacity: .58; }
.vs-chat-busy .vs-chat-image-btn { pointer-events: none; }
.vs-chat-loading-state .vs-chat-composer-wrap,
.vs-chat-loading-state .vs-chat-input-row { display: none; }
.vs-chat-auth-required .vs-chat-composer-wrap,
.vs-chat-auth-required .vs-chat-input-row { display: none; }

/* Drag & Drop overlay & styles for chat */
.vs-chat-card { position: relative; }
.vs-chat-input-row.is-dragover {
    border-color: var(--vs-blue) !important;
    border-style: dashed !important;
    background: #f0f7ff !important;
    box-shadow: 0 0 0 3px rgba(40, 100, 215, .2), 0 -12px 24px rgba(255, 255, 255, .96) !important;
}
.vs-drag-drop-overlay {
    position: absolute;
    inset: 6px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--vs-blue);
    border-radius: calc(var(--vs-radius) - 4px);
    z-index: 40;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: scale(0.98);
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.vs-chat-card.vs-drop-active > .vs-drag-drop-overlay,
.vs-chat-composer-wrap.vs-drop-active > .vs-drag-drop-overlay {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}
.vs-drag-drop-modal {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px 28px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(40, 100, 215, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(40, 100, 215, 0.18);
}
.vs-drag-drop-icon {
    color: var(--vs-blue);
    animation: vsDropBounce 1.2s infinite ease-in-out;
}
.vs-drag-drop-text {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--vs-blue);
    letter-spacing: 0.2px;
}
@keyframes vsDropBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.vs-login-state {
    display: flex;
    min-height: 100%;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    color: var(--vs-text-soft);
    text-align: center;
}

.vs-login-state strong { color: var(--vs-text); font-size: 15px; font-weight: 600; }
.vs-login-state a { display: inline-flex; min-height: 32px; align-items: center; padding: 0 14px; border-radius: 7px; background: #2864d7; color: #fff; font-size: 13px; text-decoration: none; }
.vs-login-state a:hover { background: #1f55bd; }

/* Prompt library: same behavior as the desktop client, with a compact web dialog. */
.vs-prompt-dialog {
    width: min(760px, calc(100vw - 28px));
    max-height: calc(100dvh - 28px);
    padding: 0;
    overflow: auto;
    border: 0;
    border-radius: 16px;
    color: var(--vs-text);
    box-shadow: 0 24px 72px rgba(20, 24, 32, .2);
    scroll-behavior: smooth;
}

.vs-prompt-dialog-inner { position: relative; padding: 24px; }
.vs-prompt-dialog-head { margin-bottom: 20px; }
.vs-prompt-dialog-head h2 { font-size: 18px; }
.vs-prompt-dialog-head p { margin-top: 5px; }

.vs-prompt-library-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.vs-prompt-library-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    min-height: 0;
    padding: 14px 16px;
    overflow: hidden;
    border: 1px solid #e5e6e9;
    border-radius: 8px;
    background: #fafafa;
    color: #30343a;
    cursor: pointer;
    text-align: left;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.vs-prompt-library-item:hover {
    border-color: #cdd2da;
    background: #f3f4f6;
    box-shadow: 0 4px 12px rgba(20, 24, 32, .05);
}

.vs-prompt-library-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    font-size: 14px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vs-prompt-library-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.vs-prompt-help-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #9aa0a9;
    cursor: pointer;
    transition: color .16s ease, background .16s ease;
}

.vs-prompt-help-btn:hover {
    color: var(--vs-blue);
    background: rgba(40, 100, 215, .08);
}

.vs-prompt-popover {
    position: fixed;
    z-index: 10060;
    max-height: 260px;
    overflow-y: auto;
    padding: 12px 14px;
    border: 1px solid var(--vs-line);
    border-radius: 10px;
    background: #fff;
    box-shadow: var(--vs-shadow-lg);
    color: var(--vs-text-soft);
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.vs-msg.assistant .vs-bubble.vs-bubble-flashcards {
    width: 100%;
    max-width: 100%;
}

.vs-prompt-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #8a9099;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

.vs-prompt-delete:hover { background: #fff0f0; color: var(--vs-danger); }
.vs-prompt-delete.is-loading { color: transparent; cursor: wait; pointer-events: none; }
.vs-prompt-delete.is-loading::after { position: absolute; width: 11px; height: 11px; border: 2px solid #8a9099; border-top-color: transparent; border-radius: 50%; content: ''; animation: vs-spin 1s linear infinite; }

.vs-confirm-modal {
    padding: 0;
    border: 0;
    background: transparent;
    border-radius: 14px;
    box-shadow: none;
}

.vs-confirm-modal::backdrop {
    background: rgba(20, 24, 32, .45);
    backdrop-filter: blur(2px);
}

.vs-prompt-confirm {
    position: absolute;
    z-index: 30;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(247, 248, 250, .72);
    backdrop-filter: blur(3px);
}

.vs-prompt-confirm[hidden] { display: none; }

.vs-prompt-confirm-card {
    width: min(340px, 100%);
    padding: 22px;
    border: 1px solid #e1e4ea;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(20, 24, 32, .16);
    text-align: center;
}

.vs-prompt-confirm-icon {
    display: grid;
    width: 34px;
    height: 34px;
    margin: 0 auto 10px;
    place-items: center;
    border-radius: 50%;
    background: #fff4df;
    color: #b36b00;
    font-size: 18px;
    font-weight: 700;
}

.vs-prompt-confirm-card h3 { margin: 0; color: var(--vs-text); font-size: 15px; }
.vs-prompt-confirm-card p { margin: 7px 0 18px; color: var(--vs-text-soft); font-size: 13px; }
.vs-prompt-confirm-actions { display: flex; justify-content: center; gap: 8px; }
.vs-prompt-confirm-actions button { min-width: 76px; min-height: 34px; padding: 0 14px; border: 1px solid var(--vs-line); border-radius: 8px; background: #fff; color: var(--vs-text-soft); cursor: pointer; font: inherit; font-size: 13px; }
.vs-prompt-confirm-actions button:hover { background: #f6f7f9; color: var(--vs-text); }
.vs-prompt-confirm-actions button:last-child { border-color: #202124; background: #202124; color: #fff; }
.vs-prompt-confirm-actions button:last-child:hover { background: #383a3e; }
.vs-prompt-confirm-actions button:disabled { cursor: wait; opacity: .55; }
.vs-prompt-confirm-actions button.is-loading { position: relative; color: transparent; }
.vs-prompt-confirm-actions button.is-loading::after { position: absolute; top: 50%; left: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border: 2px solid rgba(255, 255, 255, .78); border-top-color: transparent; border-radius: 50%; content: ''; animation: vs-spin 1s linear infinite; }

.vs-custom-prompt {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #ececef;
}

.vs-custom-prompt-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.vs-custom-prompt-head h3 { margin: 0; font-size: 14px; }
.vs-custom-prompt-head button { padding: 5px 8px; border: 0; border-radius: 7px; background: #f3f4f6; color: #4e5560; cursor: pointer; font-size: 12px; }
.vs-custom-prompt-head button:hover { background: #e9eaec; color: var(--vs-text); }

.vs-custom-prompt-status {
    min-height: 18px;
    margin: 0 0 8px;
    color: transparent;
    font-size: 12px;
    line-height: 18px;
}

.vs-custom-prompt-status.is-loading { color: #6d7785; }
.vs-custom-prompt-status.is-success { color: #24834a; }
.vs-custom-prompt-status.is-error { color: var(--vs-danger); }

.vs-custom-prompt-form {
    display: grid;
    gap: 7px;
    margin-top: 14px;
    padding: 14px;
    border: 1px solid #e5e6e9;
    border-radius: 10px;
    background: #fafafa;
}

.vs-custom-prompt-form label { margin: 0; color: #565d68; font-size: 12px; font-weight: 600; }
.vs-custom-prompt-form input { width: 100%; height: 36px; padding: 0 10px; border: 1px solid #dcdde1; border-radius: 8px; outline: 0; background: #fff; color: var(--vs-text); font: inherit; font-size: 13px; }
.vs-custom-prompt-form input:focus, .vs-custom-prompt-form textarea:focus { border-color: #aeb4be; box-shadow: 0 0 0 3px rgba(42, 45, 52, .08); }
.vs-custom-prompt-form textarea { width: 100%; min-height: 100px; padding: 9px 11px; border: 1px solid #dcdde1; border-radius: 9px; outline: 0; background: #fff; color: var(--vs-text); font: inherit; font-size: 13px; line-height: 1.5; resize: vertical; }
.vs-custom-prompt-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 3px; }
.vs-custom-prompt-actions button { min-height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: #202124; color: #fff; cursor: pointer; font: inherit; font-size: 12px; }
.vs-custom-prompt-actions button:first-child { background: #eeeef0; color: #555b65; }
.vs-custom-prompt-actions button:disabled { cursor: wait; opacity: .65; }
.vs-custom-prompt-actions button.is-loading { position: relative; color: transparent; pointer-events: none; }
.vs-custom-prompt-actions button.is-loading::after { position: absolute; top: 50%; left: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border: 2px solid rgba(255, 255, 255, .75); border-top-color: transparent; border-radius: 50%; content: ''; animation: vs-spin 1s linear infinite; }

.vs-feedback-toast {
    position: fixed;
    z-index: 1000;
    top: 86px;
    left: 50%;
    padding: 9px 13px;
    border-radius: 8px;
    background: rgba(28, 31, 36, .92);
    color: #fff;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -8px);
    transition: opacity .18s ease, transform .18s ease;
}

.vs-feedback-toast.is-in-dialog {
    top: 20px;
    z-index: 2;
}

.vs-feedback-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* Loading placeholders keep the media and conversation columns visually complete. */
.vs-media-loading {
    position: relative;
    max-height: 180px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 10px;
    background: linear-gradient(90deg, #eef1f5 25%, #f8f9fb 37%, #eef1f5 63%);
    background-size: 400% 100%;
    animation: vs-sub-skeleton 1.2s ease infinite;
}

.vs-media-loading svg {
    position: absolute;
    inset: 0;
    width: 44px;
    height: 44px;
    margin: auto;
    fill: none;
    stroke: rgba(126, 143, 169, .55);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.2;
}

.vs-media-loading i {
    position: absolute;
    right: 18px;
    bottom: 14px;
    left: 18px;
    height: 7px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .5);
}

.vs-chat-loading {
    display: flex;
    width: min(620px, 100%);
    min-height: 100%;
    margin: 0 auto;
    flex-direction: column;
    justify-content: center;
    gap: 24px;
}

.vs-chat-loading > div {
    display: grid;
    gap: 9px;
    width: 72%;
}

.vs-chat-loading > div:last-child {
    align-self: flex-end;
    width: 84%;
}

.vs-chat-loading i {
    display: block;
    height: 12px;
    border-radius: 99px;
    background: linear-gradient(90deg, #f0f2f5 25%, #f8f9fb 37%, #f0f2f5 63%);
    background-size: 400% 100%;
    animation: vs-sub-skeleton 1.2s ease infinite;
}

.vs-chat-loading i:nth-child(2) { width: 78%; }
.vs-chat-loading i:nth-child(3) { width: 62%; }

.vs-history-loading {
    position: absolute;
    z-index: 4;
    top: 8px;
    left: 50%;
    padding: 4px 10px;
    border: 1px solid #e5e8ee;
    border-radius: 99px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 3px 10px rgba(20, 24, 32, .08);
    color: var(--vs-text-muted);
    font-size: 11px;
    text-align: center;
    transform: translateX(-50%);
}

/* Responsive behavior: preserve readable controls instead of squeezing them. */
@media (max-width: 1100px) and (min-width: 901px) {
    .vs-detail-grid.vs-workspace { --vs-source-width: 34%; gap: 1.4%; }
    .vs-chat-list { padding-right: 30px; padding-left: 30px; }
}

@media (max-width: 900px) {
    html.vs-detail-root,
    body.vs-detail-body {
        overflow: hidden;
        height: var(--vs-viewport-height, 100dvh);
        max-height: var(--vs-viewport-height, 100dvh);
    }

    body.vs-detail-body .main.vs-detail-main {
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
        height: calc(var(--vs-viewport-height, 100dvh) - var(--vs-header-height, 70px));
        max-height: calc(var(--vs-viewport-height, 100dvh) - var(--vs-header-height, 70px));
    }

    .vs-wrap.vs-detail-page {
        --vs-content-width: 85%;
        --vs-detail-vpad: 8px;
        --vs-mobile-bottom-gap: max(28px, 4.8dvh);
        --vs-viewport-height: 100svh;
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        height: 100%;
        max-height: 100%;
        min-height: 0;
        padding-top: var(--vs-detail-vpad);
        padding-bottom: 0;
        overflow: hidden;
    }
    .vs-detail-grid.vs-workspace,
    .vs-detail-grid.vs-workspace.vs-source-collapsed {
        display: flex;
        flex-direction: column;
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
        overflow: hidden;
    }
    /* 移动端：side 移到顶部，main 在下 */
    .vs-side {
        position: static;
        order: 1;
        height: auto;
        max-height: none;
        flex: 0 0 auto;
    }
    .vs-main {
        order: 2;
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }
    .vs-workspace-toggle { display: none; }
    .vs-source-collapsed .vs-side { display: block; }
    .vs-chat-card {
        height: 100%;
        min-height: 0;
        max-height: none;
    }
    .vs-chat-list { flex: 1 1 auto; min-height: 0; padding: 12px 14px 6px; }
    .vs-detail-topbar .vs-page-title { white-space: normal; }
    .vs-chat-composer-wrap {
        padding-top: 4px;
        padding-bottom: calc(
            var(--vs-mobile-bottom-gap, 28px)
            + env(safe-area-inset-bottom, 0px)
            + var(--vs-browser-ui-inset-bottom, 0px)
        );
    }
    .vs-chat-input-row {
        margin: 0 10px 0;
    }

    /* 移动端：隐藏浮窗推广卡片（无空间展示） */
    .vs-client-float-promo { display: none !important; }

    /* 移动端：视频区折叠 toggle（对齐客户端 media-collapsed-bar） */
    .vs-mobile-source-toggle {
        display: flex;
        align-items: center;
        gap: 10px;
        justify-content: flex-start;
        width: 100%;
        padding: 10px 14px;
        margin: 0;
        border: 1px solid var(--vs-line);
        background: var(--vs-bg);
        color: var(--vs-text-soft);
        cursor: pointer;
        font: inherit;
        font-size: 13px;
        font-weight: 500;
        text-align: left;
        border-radius: 10px;
        box-shadow: var(--vs-shadow);
        transition: background 0.2s ease;
    }
    .vs-mobile-source-toggle:active {
        background: #efeff1;
    }
    .vs-mobile-source-toggle-media-icon {
        display: inline-flex;
        align-items: center;
        flex-shrink: 0;
        color: var(--vs-blue);
    }
    .vs-mobile-source-toggle-media-icon svg { display: block; }
    .vs-mobile-source-toggle-label {
        flex: 1;
        min-width: 0;
    }
    .vs-mobile-source-toggle-icon {
        display: inline-flex;
        align-items: center;
        width: 16px;
        height: 16px;
        margin-left: auto;
        transition: transform 0.22s ease;
        color: var(--vs-text-muted);
        flex-shrink: 0;
    }
    .vs-mobile-source-toggle-icon svg { display: block; }
    /* 展开时箭头朝上 */
    .vs-mobile-source-expanded .vs-mobile-source-toggle-icon { transform: rotate(180deg); }

    /* 折叠时只保留 toggle 条；#vsPlayback 有独立 display 规则需更高优先级 */
    .vs-side:not(.vs-mobile-source-expanded) .vs-source-card,
    .vs-side:not(.vs-mobile-source-expanded) .vs-transcript-card {
        display: none !important;
    }
    .vs-side:not(.vs-mobile-source-expanded) #vsPlayback {
        display: none !important;
    }
    .vs-side:not(.vs-mobile-source-expanded) {
        gap: 0;
        border: none;
        border-radius: 0;
        overflow: visible;
        background: transparent;
        box-shadow: none;
    }

    /* 展开时展示视频与字幕 */
    .vs-mobile-source-expanded .vs-source-card,
    .vs-mobile-source-expanded .vs-transcript-card {
        display: flex !important;
    }
    .vs-mobile-source-expanded .vs-source-card .vs-card-body,
    .vs-mobile-source-expanded #vsPlayback {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
    }
    .vs-mobile-source-expanded .vs-link-btn {
        align-self: center;
    }
    .vs-mobile-source-expanded .vs-transcript-card {
        flex-direction: column;
        max-height: 320px;
    }

    /* 侧边栏整体：展开时为单个折叠面板 */
    .vs-side.vs-mobile-source-expanded {
        gap: 0;
        border: 1px solid var(--vs-line);
        border-radius: 12px;
        overflow: hidden;
        background: var(--vs-surface);
        box-shadow: var(--vs-shadow);
    }
    .vs-side.vs-mobile-source-expanded .vs-mobile-source-toggle {
        border: none;
        border-bottom: 1px solid var(--vs-line);
        border-radius: 0;
        box-shadow: none;
        background: var(--vs-surface);
        color: var(--vs-text);
        font-weight: 600;
    }
    .vs-side .vs-card { border: none; border-radius: 0; box-shadow: none; }
    .vs-side.vs-mobile-source-expanded .vs-source-card { border-bottom: 1px solid var(--vs-line); }

    /* H5 composer：工具栏仅显示图标 */
    .vs-composer-actions {
        flex-wrap: nowrap;
        overflow: visible;
    }
    .vs-composer-actions .vs-quick-actions-wrap {
        overflow: visible;
    }
    .vs-quick-actions-menu:not([hidden]) {
        box-shadow: 0 10px 28px rgba(20, 24, 32, .16);
    }
    .vs-composer-btn-label { display: none; }
    .vs-composer-btn-icon { display: block; }
    .vs-composer-actions .vs-chat-library,
    .vs-composer-actions .vs-quick-actions-btn,
    .vs-composer-actions .vs-chat-new-topic {
        width: 28px;
        height: 28px;
        min-height: 28px;
        padding: 0;
        flex-shrink: 0;
    }
    .vs-quick-actions-btn::after { display: none; }
    .vs-chat-budget-btn {
        width: 28px;
        height: 28px;
        padding: 0;
        justify-content: center;
        gap: 0;
        flex-shrink: 0;
    }
    .vs-chat-budget-btn #vsBudgetBadge { display: none; }
    .vs-chat-model {
        width: 88px;
        max-width: 88px;
        min-width: 72px;
        flex-basis: 88px;
        flex-shrink: 0;
        padding-right: 12px;
        font-size: 10px;
    }

    /* H5 聊天区：收紧消息/回答间距与段落间距 */
    .vs-msg {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        margin-bottom: 6px;
        gap: 0;
    }
    .vs-msg.user { justify-items: end; }
    .vs-msg:last-child { margin-bottom: 0; }
    .vs-msg .vs-bubble {
        grid-column: 1;
        grid-row: 1;
    }
    .vs-msg-meta {
        grid-column: 1;
        grid-row: 2;
        margin: 2px 0 0;
    }
    .vs-msg-actions {
        grid-column: 1;
        grid-row: 1;
        align-self: end;
        justify-self: end;
        margin-top: 0;
        opacity: 0;
        pointer-events: none;
    }
    .vs-msg.user .vs-msg-actions { justify-self: end; }
    .vs-msg:active .vs-msg-actions,
    .vs-msg:focus-within .vs-msg-actions,
    .vs-msg-actions.is-persistent {
        opacity: 1;
        pointer-events: auto;
    }
    .vs-act-btn {
        width: 24px;
        height: 24px;
    }
    .vs-bubble { line-height: 1.58; }
    .vs-msg.assistant .vs-bubble p { margin: 3px 0; }
    .vs-msg.assistant .vs-bubble ul,
    .vs-msg.assistant .vs-bubble ol { margin: 3px 0; padding-left: 18px; }
    .vs-msg.assistant .vs-bubble li { margin: 1px 0; }
    .vs-msg.assistant .vs-bubble h1,
    .vs-msg.assistant .vs-bubble h2,
    .vs-msg.assistant .vs-bubble h3,
    .vs-msg.assistant .vs-bubble h4 { margin: 6px 0 2px; }
    .vs-msg.assistant .vs-bubble blockquote,
    .vs-msg.assistant .vs-bubble table { margin: 5px 0; }
    .vs-msg .vs-bubble img { margin: 4px 0; }
    .vs-msg.user .vs-bubble { padding: 6px 10px; }
    .vs-divider { margin: 8px 0; }
    .vs-message-images { gap: 6px; }
}

@media (max-width: 760px) {
    .vs-wrap,
    .vs-home { width: min(100% - 24px, 680px); padding-top: 24px; }
    .vs-detail-page { --vs-content-width: 88%; --vs-detail-vpad: 10px; }
    .vs-home-header { align-items: flex-start; flex-direction: column; gap: 18px; margin-bottom: 20px; padding: 24px 20px; }
    .vs-home-header .vs-btn { width: 100%; }
    .vs-local-process-banner.is-visible { margin-bottom: 16px; }
    .vs-local-process-inner { padding: 14px 14px 16px; border-radius: 14px; }
    .vs-local-process-meta { flex-direction: column; align-items: flex-start; gap: 4px; }
    .vs-local-process-status { width: 100%; text-align: left; white-space: normal; }
    .vs-local-process-file { flex-wrap: wrap; }
    .vs-local-process-file-state { max-width: 100%; text-align: left; }
    .vs-home > .vs-card { padding: 16px 14px 20px; }
    .vs-list-toolbar { flex-wrap: wrap; padding-bottom: 14px; }
    .vs-library-heading { flex: 1 1 calc(100% - 52px); }
    .vs-list-toolbar .vs-btn.ghost { padding-right: 10px; padding-left: 10px; }
    .vs-mode-toggle { margin-left: auto; }
    .vs-list-view-header { display: none; }
    .vs-task-list { grid-template-columns: 1fr; }
    .vs-task-item { grid-template-columns: 24px 68px minmax(0, 1fr); gap: 8px; }
    .vs-task-col-duration,
    .vs-task-col-time,
    .vs-task-col-status { display: none; }
    .vs-task-inline-meta { display: flex; }
    .vs-list-skeleton-row { grid-template-columns: 24px 68px minmax(0, 1fr); gap: 8px; }
    .vs-task-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; }
    .vs-list-foot { align-items: flex-start; flex-wrap: wrap; }
    .pagination-section { width: 100%; order: 2; }
    .vs-list-foot > .vs-btn { order: 1; }
    .vs-detail-topbar { align-items: flex-start; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 14px; }
    .vs-detail-topbar .vs-page-title { order: 3; width: 100%; font-size: 18px; }
    .vs-detail-topbar .vs-status-area { order: 2; margin-left: auto; }
    .vs-chat-card {
        min-height: 0;
        height: 100%;
        max-height: none;
        border-radius: 12px;
    }
    .vs-chat-card .vs-card-head { padding: 14px 16px; }
    .vs-chat-list { flex: 1 1 auto; min-height: 0; padding: 12px 14px 6px; }
    .vs-msg.user .vs-bubble { max-width: 88%; }
    .vs-context-truncation-banner { margin: 0 10px 8px; }
    .vs-chat-composer-wrap {
        padding-top: 4px;
        padding-bottom: calc(
            var(--vs-mobile-bottom-gap, 28px)
            + env(safe-area-inset-bottom, 0px)
            + var(--vs-browser-ui-inset-bottom, 0px)
        );
    }
    .vs-chat-input-row { margin: 0 10px 0; }
    .vs-chat-model { width: 116px; max-width: 116px; min-width: 104px; flex-basis: 116px; }
    .vs-prompt-dialog-inner { padding: 18px; }
    .vs-prompt-library-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .vs-wrap:not(.vs-detail-page),
    .vs-home { width: calc(100% - 20px); padding-top: 16px; padding-bottom: 28px; }
    .vs-detail-page { --vs-content-width: 92%; --vs-detail-vpad: 8px; --vs-mobile-bottom-gap: max(32px, 5.5dvh); padding-top: var(--vs-detail-vpad); padding-bottom: 0; }
    .vs-home-header { padding: 20px 16px; border-radius: 14px; }
    .vs-home-header h1 { font-size: 24px; }
    .vs-home > .vs-card { padding: 14px 10px 16px; border-radius: 14px; }
    .vs-list-toolbar { gap: 7px; }
    .vs-list-toolbar .vs-btn { min-height: 32px; padding: 0 10px; font-size: 12px; }
    .vs-task-item { grid-template-columns: 22px 60px minmax(0, 1fr); gap: 7px; min-height: 76px; padding: 9px 6px; }
    .vs-list-skeleton-row { grid-template-columns: 22px 60px minmax(0, 1fr); gap: 7px; }
    .vs-task-cover { width: 60px; height: 40px; }
    .vs-task-title { font-size: 13px; }
    .vs-task-meta { gap: 5px; font-size: 10px; }
    .vs-status-tag { padding: 2px 7px; font-size: 10px; }
    .vs-card-continue { margin-top: 7px; }
    .page_num { min-width: 30px; padding: 0 7px; }
    .vs-detail-page .vs-detail-topbar .vs-status-area { width: auto; }
    .vs-chat-card { height: 100%; min-height: 0; max-height: none; }
    .vs-chat-card .vs-card-head { min-height: 52px; padding: 12px; }
    .vs-chat-title { font-size: 14px; }
    .vs-chat-list { padding: 10px 12px 4px; }
    .vs-msg.assistant { padding-left: 0; }
    .vs-msg.assistant::before { display: none; }
    .vs-bubble { font-size: 13px; line-height: 1.55; }
    .vs-msg { margin-bottom: 5px; }
    .vs-context-truncation-banner { margin: 0 6px 8px; }
    .vs-chat-composer-wrap {
        padding-top: 4px;
        padding-bottom: calc(
            var(--vs-mobile-bottom-gap, 32px)
            + env(safe-area-inset-bottom, 0px)
            + var(--vs-browser-ui-inset-bottom, 0px)
        );
    }
    .vs-chat-input-row { grid-template-columns: 32px minmax(0, 1fr); gap: 0 5px; margin: 0 8px 0; padding: 7px; }
    .vs-chat-image-btn { width: 32px; height: 34px; }
    .vs-chat-input { min-height: 34px; padding: 7px 2px; font-size: 13px; }
    .vs-composer-actions { gap: 4px; }
    .vs-chat-send { width: 28px; height: 28px; }
    .vs-chat-send::after { font-size: 16px; }
    .vs-hero { align-items: flex-start; flex-direction: column; gap: 8px; padding: 16px; }
    .vs-create-dialog-inner { padding: 20px 16px; }
    .vs-dialog-foot { flex-direction: column-reverse; }
    .vs-dialog-foot .vs-btn { width: 100%; }
    .vs-custom-prompt-actions { flex-direction: column-reverse; }
    .vs-custom-prompt-actions button { width: 100%; }
}

/* ---- 增强版新建总结弹窗 & 模板弹窗样式（自适应） ---- */
.vs-create-dialog.vs-create-dialog-enhanced,
.vs-create-dialog.vs-template-dialog {
    width: min(580px, calc(100vw - 32px)) !important;
    max-width: 580px !important;
    box-sizing: border-box !important;
    overflow: hidden;
}

.vs-create-dialog.vs-create-dialog-enhanced .vs-create-dialog-inner,
.vs-create-dialog.vs-template-dialog .vs-create-dialog-inner {
    width: 100% !important;
    max-width: 100% !important;
    padding: 22px 24px;
    box-sizing: border-box !important;
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
}

.vs-create-dialog-enhanced .vs-create-body,
.vs-template-dialog .vs-template-dialog-body {
    width: 100%;
    box-sizing: border-box;
}

.vs-create-dialog-enhanced .vs-url-single-input {
    width: 100%;
    height: 44px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 13.5px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid #d4dbe8;
    background: #fff;
    color: var(--vs-text);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.vs-create-dialog-enhanced .vs-url-single-input:focus {
    border-color: var(--vs-blue);
    box-shadow: 0 0 0 3px rgba(30, 75, 184, .12);
}

.vs-create-dialog-enhanced .vs-textarea,
.vs-template-dialog .vs-textarea {
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.5;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #d4dbe8;
    background: #fff;
    color: var(--vs-text);
    resize: vertical;
    min-height: 72px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.vs-create-dialog-enhanced .vs-textarea:focus,
.vs-template-dialog .vs-textarea:focus {
    border-color: var(--vs-blue);
    box-shadow: 0 0 0 3px rgba(30, 75, 184, .12);
}

.vs-create-tabs {
    display: flex;
    gap: 8px;
    margin: 14px 0 12px;
    padding: 4px;
    border-radius: 10px;
    background: #f1f3f7;
    width: 100%;
    box-sizing: border-box;
}

.vs-create-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
    min-height: 38px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #5c6880;
    font-size: 13.5px;
    font-weight: 550;
    cursor: pointer;
    transition: all .18s ease;
}

.vs-create-tab:hover {
    color: var(--vs-text);
}

.vs-create-tab.is-active {
    background: #fff;
    color: var(--vs-blue);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

.vs-create-pane {
    display: none;
}

.vs-create-pane.is-active {
    display: block;
}

.vs-upload-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 18px 16px;
    border: 2px dashed #d1d8e5;
    border-radius: 12px;
    background: #fafbfe;
    text-align: center;
    cursor: pointer;
    transition: all .2s ease;
}

.vs-upload-dropzone:hover,
.vs-upload-dropzone.is-dragover {
    border-color: var(--vs-blue);
    background: #f0f6ff;
}

/* URL 批量输入框 */
.vs-link-input-wrap {
    position: relative;
    width: 100%;
}

.vs-url-batch-input {
    width: 100%;
    min-height: 96px;
    max-height: 160px;
    padding: 10px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 10px;
    background: #fafbfe;
    color: var(--vs-text);
    font-size: 13.5px;
    line-height: 1.6;
    resize: vertical;
    transition: all .2s ease;
}

.vs-url-batch-input:focus {
    border-color: var(--vs-blue);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.vs-recognized-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--vs-blue);
}

.vs-recognized-hint svg {
    flex-shrink: 0;
}

/* 多文件列表区域 */
.vs-file-list-wrap {
    width: 100%;
    text-align: left;
}

.vs-file-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 0 2px;
}

.vs-file-count-badge {
    font-size: 12px;
    font-weight: 600;
    color: var(--vs-text-muted);
}

.vs-file-add-more {
    border: none;
    background: transparent;
    color: var(--vs-blue);
    font-size: 12px;
    font-weight: 550;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all .15s ease;
}

.vs-file-add-more:hover {
    background: rgba(37, 99, 235, 0.08);
    text-decoration: underline;
}

.vs-upload-file-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 160px;
    overflow-y: auto;
    padding-right: 2px;
}

.vs-file-card-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid #e5e9f2;
    border-radius: 8px;
    background: #ffffff;
    transition: all .15s ease;
}

.vs-file-card-item:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.vs-file-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 7px;
    flex-shrink: 0;
    font-size: 16px;
}

.vs-file-card-icon.is-video {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}

.vs-file-card-icon.is-audio {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.vs-file-card-info {
    flex: 1;
    min-width: 0;
}

.vs-file-card-name {
    font-size: 13px;
    font-weight: 550;
    color: var(--vs-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vs-file-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
    font-size: 11.5px;
    color: var(--vs-text-muted);
}

.vs-file-card-del {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #94a3b8;
    font-size: 16px;
    cursor: pointer;
    transition: all .15s ease;
}

.vs-file-card-del:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.vs-file-card-status {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #f1f5f9;
    color: #64748b;
    white-space: nowrap;
}

.vs-file-card-status.is-done {
    background: #ecfdf5;
    color: #059669;
}

.vs-file-card-status.is-processing {
    background: #eff6ff;
    color: #2563eb;
}

.vs-upload-icon {
    margin-bottom: 8px;
    color: var(--vs-blue);
}

.vs-upload-text {
    color: var(--vs-text);
    font-size: 13.5px;
    font-weight: 550;
}

.vs-upload-tip {
    margin-top: 4px;
    color: var(--vs-text-muted);
    font-size: 11.5px;
}

.vs-settings-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f8f9fc;
    border: 1px solid #e9edf5;
}

.vs-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.vs-setting-desc {
    display: flex;
    flex-direction: column;
}

.vs-setting-desc small {
    color: var(--vs-text-muted);
    font-size: 11px;
}

.vs-setting-label {
    color: var(--vs-text);
    font-size: 13px;
    font-weight: 550;
}

.vs-pill-group {
    display: inline-flex;
    padding: 2px;
    border-radius: 8px;
    background: #e9edf4;
}

.vs-pill {
    padding: 4px 11px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #55627a;
    font-size: 12px;
    font-weight: 550;
    cursor: pointer;
    transition: all .16s ease;
}

.vs-pill.is-active {
    background: #fff;
    color: var(--vs-blue);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
}

.vs-switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 22px;
    flex-shrink: 0;
}

.vs-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.vs-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd3e1;
    transition: .2s;
    border-radius: 22px;
}

.vs-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .2s;
    border-radius: 50%;
}

.vs-switch input:checked + .vs-slider {
    background-color: var(--vs-blue);
}

.vs-switch input:checked + .vs-slider:before {
    transform: translateX(16px);
}

.vs-balance-board {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    background: #f0f5ff;
    border: 1px solid #dbe6fe;
}

.vs-balance-item {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.vs-balance-title {
    color: #597099;
    font-size: 11.5px;
}

.vs-balance-val {
    color: #174092;
    font-size: 13.5px;
    font-weight: 650;
    margin-top: 2px;
}

.vs-dual-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 18px;
}

.vs-foot-actions {
    display: inline-flex;
    gap: 8px;
}

.vs-btn.secondary {
    background: #edf2fc;
    color: #3b5998;
    border: 1px solid #d4e0fa;
}

.vs-btn.secondary:hover {
    background: #e2ecfd;
}

.vs-btn.primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--vs-blue);
    color: #fff;
}

.vs-btn.primary:hover {
    filter: brightness(1.06);
}

/* ---- 总结模板选择弹窗 ---- */
.vs-template-dialog {
    width: min(680px, calc(100vw - 32px));
}

.vs-template-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0 16px;
    max-height: 260px;
    overflow-y: auto;
    padding: 2px;
}

.vs-template-loading {
    grid-column: 1 / -1;
    padding: 30px;
    text-align: center;
    color: var(--vs-text-muted);
    font-size: 13px;
}

.vs-template-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1.5px solid #e3e8f2;
    background: #fff;
    cursor: pointer;
    text-align: left;
    transition: all .16s ease;
}

.vs-template-card:hover {
    border-color: #a8c4fb;
    background: #f8faff;
    transform: translateY(-1px);
}

.vs-template-card.is-active {
    border-color: var(--vs-blue);
    background: #f0f6ff;
    box-shadow: 0 0 0 1px var(--vs-blue);
}

.vs-template-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.vs-template-card-title {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--vs-text);
    font-size: 13.5px;
    font-weight: 650;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vs-template-card-icon {
    font-size: 14px;
    line-height: 1;
}

.vs-template-card-badge {
    flex-shrink: 0;
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 10.5px;
    font-weight: 600;
    background: #e9edf5;
    color: #4b5870;
}

.vs-template-card.is-active .vs-template-card-badge {
    background: #dce7fe;
    color: var(--vs-blue);
}

.vs-template-card-desc {
    color: var(--vs-text-muted);
    font-size: 11.5px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.vs-custom-prompt-wrap {
    margin-top: 10px;
}

.vs-custom-prompt-label {
    display: block;
    margin-bottom: 6px;
    color: var(--vs-text);
    font-size: 12.5px;
    font-weight: 600;
}

.vs-dialog-status {
    min-height: 20px;
    margin: 8px 0 2px;
    color: #475569;
    font-size: 12.5px;
    line-height: 1.4;
    text-align: center;
    transition: opacity .15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.vs-dialog-status.is-error {
    color: #dc2626;
}

.vs-dialog-status.is-loading {
    color: #2563eb;
}

.vs-dialog-status.is-loading::before {
    content: '';
    display: inline-block;
    width: 13px;
    height: 13px;
    border: 2px solid rgba(37, 99, 235, 0.25);
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: vs-spin 0.7s linear infinite;
    flex-shrink: 0;
}

.vs-dialog-status:empty {
    margin: 0;
    min-height: 0;
    display: none;
}

.vs-btn.is-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
    cursor: not-allowed;
    opacity: 0.85;
}

.vs-btn.is-loading svg {
    visibility: hidden;
}

.vs-btn.is-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: calc(50% - 8px);
    left: calc(50% - 8px);
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: vs-spin 0.7s linear infinite;
}

.vs-btn.ghost.is-loading::after,
.vs-btn.secondary.is-loading::after {
    border-color: rgba(37, 99, 235, 0.25);
    border-top-color: #2563eb;
}

.vs-btn[disabled]:not(.is-loading) {
    opacity: .65;
    cursor: not-allowed;
    pointer-events: none;
}

@keyframes vs-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Mermaid / Mind Map Diagram Styles
   ========================================================================== */
.vs-mermaid-wrapper {
    margin: 16px 0;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
}

.vs-mermaid-stage {
    padding: 18px;
    overflow-x: auto;
    background:
        radial-gradient(circle at 18px 18px, rgba(99, 102, 241, 0.06) 0 1.2px, transparent 1.2px),
        #ffffff;
    background-size: 18px 18px;
}

.vs-mermaid-stage svg {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 auto;
}

.vs-mermaid-stage .node rect,
.vs-mermaid-stage .node circle,
.vs-mermaid-stage .node ellipse,
.vs-mermaid-stage .node polygon,
.vs-mermaid-stage .node path {
    fill: #eef2ff !important;
    stroke: #6366f1 !important;
    stroke-width: 2px !important;
    filter: drop-shadow(0 3px 6px rgba(99, 102, 241, 0.12));
}

.vs-mermaid-stage .node .label,
.vs-mermaid-stage .nodeLabel,
.vs-mermaid-stage text,
.vs-mermaid-stage tspan {
    color: #1e1b4b !important;
    fill: #1e1b4b !important;
    font-weight: 600;
}

.vs-mermaid-stage .edgePath .path,
.vs-mermaid-stage .flowchart-link {
    stroke: #94a3b8 !important;
    stroke-width: 2px !important;
}

.vs-mermaid-stage .marker {
    fill: #94a3b8 !important;
    stroke: #94a3b8 !important;
}

/* ---- Mermaid 加载骨架（生成中状态）---- */
.vs-mermaid-wrapper.is-loading {
    min-height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(90deg, #f4f6fb 25%, #f9fafd 50%, #f4f6fb 75%);
    background-size: 400% 100%;
    animation: vs-mermaid-shimmer 1.6s ease infinite;
    border: 1px solid #e8ecf4;
    box-shadow: none;
}

.vs-mermaid-wrapper.is-loading::after {
    content: '';
    display: block;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid #e2e8f4;
    border-top-color: #6366f1;
    animation: vs-mermaid-spin 0.9s linear infinite;
}

@keyframes vs-mermaid-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

@keyframes vs-mermaid-spin {
    to { transform: rotate(360deg); }
}

/* ---- SVG 淡入过渡 + hover 缩放 ---- */
.vs-mermaid-wrapper {
    cursor: zoom-in;
}

.vs-mermaid-wrapper .vs-mermaid-stage {
    opacity: 0;
    transform: scale(0.98);
    transform-origin: center center;
    transition: opacity 0.35s ease, transform 0.25s ease;
    cursor: zoom-in;
}

.vs-mermaid-wrapper.is-ready .vs-mermaid-stage {
    opacity: 1;
    transform: scale(1);
}

.vs-mermaid-wrapper.is-ready:hover .vs-mermaid-stage {
    transform: scale(1.012);
}

/* ---- 聊天气泡内图片 hover 缩放 ---- */
.vs-bubble img,
.vs-message-images img {
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    transform-origin: center center;
    cursor: zoom-in !important;
}

.vs-bubble img:hover,
.vs-message-images img:hover {
    transform: scale(1.025);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

/* ==========================================================================
   Lightbox（图片 / 思维导图放大预览 - GPT 风格）
   ========================================================================== */
.vs-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(10, 14, 23, 0.86);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    cursor: zoom-out;
}

.vs-lightbox.is-open {
    opacity: 1;
    pointer-events: auto;
}

.vs-lightbox-inner {
    position: relative;
    max-width: min(1160px, calc(100vw - 48px));
    max-height: calc(100dvh - 48px);
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: scale(0.94) translateY(12px);
    transition: transform 0.28s cubic-bezier(0.34, 1.4, 0.64, 1);
    cursor: default;
}

.vs-lightbox.is-open .vs-lightbox-inner {
    transform: scale(1) translateY(0);
}

.vs-lightbox-close {
    position: absolute;
    top: -16px;
    right: -16px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    background: rgba(20, 24, 33, 0.75);
    color: #f1f5f9;
    font-size: 18px;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transition: background 0.16s ease, transform 0.16s ease, color 0.16s ease;
}

.vs-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    transform: scale(1.08) rotate(90deg);
}

.vs-lightbox-content {
    max-height: calc(100dvh - 72px);
    max-width: 100%;
    overflow: auto;
    border-radius: 14px;
    box-shadow: 0 28px 72px rgba(0, 0, 0, 0.6);
    background: transparent;
}

/* 图片预览 */
.vs-lightbox-img {
    display: block;
    max-width: 100%;
    max-height: calc(100dvh - 80px);
    width: auto;
    height: auto;
    border-radius: 12px;
    object-fit: contain;
    cursor: default;
    user-select: none;
}

/* 思维导图预览（含背景点阵）*/
.vs-lightbox-diagram {
    padding: 32px 36px;
    min-width: min(720px, 90vw);
    background:
        radial-gradient(circle at 18px 18px, rgba(99, 102, 241, 0.08) 0 1.2px, transparent 1.2px),
        #ffffff;
    background-size: 18px 18px;
    border-radius: 14px;
    cursor: default;
    box-sizing: border-box;
}

.vs-lightbox-diagram svg {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 auto;
}

@media (max-width: 600px) {
    .vs-lightbox-diagram { min-width: 0; padding: 18px 14px; }
    .vs-lightbox-close { top: -10px; right: -10px; width: 32px; height: 32px; font-size: 15px; }
}

/* 本地视频标记 Badge */
.vs-local-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 5px 12px;
    border-radius: 6px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    user-select: none;
}

.vs-local-badge svg {
    color: #64748b;
    flex-shrink: 0;
}
