/* ========== 短视频脚本创作工具 - 影视主题 ========== */

/* ========== 主容器 ========== */
.svsc-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #f8fafc;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
}

/* 全屏模式 */
.svsc-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
}

/* ========== 顶部工具栏 ========== */
.svsc-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 14px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 40%, #0f3460 100%);
    color: white;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 3px 12px rgba(15, 52, 96, 0.45);
    flex-shrink: 0;
    position: relative;
}

/* 电影胶片装饰条 */
.svsc-toolbar::before,
.svsc-toolbar::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    background: repeating-linear-gradient(
        90deg,
        #e94560 0px,
        #e94560 14px,
        transparent 14px,
        transparent 20px
    );
    opacity: 0.7;
}
.svsc-toolbar::before { top: 0; }
.svsc-toolbar::after  { bottom: 0; }

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    min-height: 30px;
}

.toolbar-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
    margin-right: 6px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.toolbar-btn {
    padding: 6px 11px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    transition: all 0.25s;
    white-space: nowrap;
    backdrop-filter: blur(4px);
}

.toolbar-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.45);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.toolbar-btn:active:not(:disabled) { transform: translateY(0); }

.toolbar-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.toolbar-btn-primary {
    background: linear-gradient(135deg, #e94560 0%, #c0392b 100%);
    border: none;
    box-shadow: 0 2px 10px rgba(233, 69, 96, 0.4);
}

.toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #ff5571 0%, #e0432e 100%);
    box-shadow: 0 4px 14px rgba(233, 69, 96, 0.55);
}

.toolbar-btn-primary.svsc-btn-loading {
    animation: svscPulse 1.2s ease-in-out infinite;
}

@keyframes svscPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.75; }
}

/* 进度条 */
#svscProgressBar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #e94560, #f5a623, #e94560);
    background-size: 200% 100%;
    animation: svscProgressShimmer 1.5s linear infinite;
    transition: width 0.3s ease;
    z-index: 10;
    display: none;
}

@keyframes svscProgressShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: 0 0; }
}

/* ========== 主内容区 ========== */
.svsc-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #f0f2f5;
}

/* ========== 左侧历史面板 ========== */
.svsc-history-panel {
    width: 200px;
    background: #fff;
    border-right: 1px solid #e4e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.svsc-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(to bottom, #fafbfc, #f4f6f9);
    border-bottom: 1px solid #e4e8f0;
    flex-shrink: 0;
}

.svsc-history-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.svsc-history-count {
    font-size: 11px;
    font-weight: 400;
    color: #6b7280;
    margin-left: 4px;
}

.svsc-history-clear-btn {
    background: #fff0f0;
    border: none;
    color: #ef4444;
    font-size: 13px;
    cursor: pointer;
    padding: 3px 7px;
    border-radius: 4px;
    transition: all 0.2s;
    line-height: 1;
}

.svsc-history-clear-btn:hover {
    background: #fde8e8;
}

.svsc-history-search {
    padding: 8px;
    border-bottom: 1px solid #e4e8f0;
    flex-shrink: 0;
}

.svsc-history-search input {
    width: 100%;
    padding: 5px 9px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #374151;
}

.svsc-history-search input:focus {
    border-color: #e94560;
    box-shadow: 0 0 0 2px rgba(233, 69, 96, 0.1);
}

.svsc-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
    -webkit-overflow-scrolling: touch;
}

.svsc-history-empty {
    text-align: center;
    color: #9ca3af;
    font-size: 12px;
    line-height: 1.8;
    padding: 24px 8px;
}

.svsc-history-item {
    display: flex;
    align-items: center;
    padding: 9px 10px;
    margin: 3px 0;
    background: #f8fafc;
    border: 1px solid #e8ecf0;
    border-left: 3px solid transparent; /* 防布局抖动预设 */
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    gap: 6px;
}

.svsc-history-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateX(2px);
}

.svsc-history-item.active {
    background: #fff3f4;
    border-left-color: #e94560; /* 仅改左边框颜色，宽度不变，避免重排 */
    box-shadow: 0 1px 4px rgba(233, 69, 96, 0.15);
}

.svsc-history-item-main {
    flex: 1;
    min-width: 0;
}

.svsc-history-item-title {
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 3px;
}

.svsc-history-item-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #6b7280;
}

.svsc-history-item-platform {
    background: #fef3c7;
    color: #92400e;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
    flex-shrink: 0;
}

.svsc-history-item-del {
    background: none;
    border: none;
    color: #cbd5e1;
    font-size: 13px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.2s;
    opacity: 0;
    flex-shrink: 0;
    line-height: 1;
}

.svsc-history-item:hover .svsc-history-item-del { opacity: 1; }
.svsc-history-item-del:hover { background: #fde8e8; color: #ef4444; }

/* ========== 中栏：输入面板 ========== */
.svsc-input-panel {
    width: 320px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #e4e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.svsc-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 16px;
    background: linear-gradient(to bottom, #fafbfc, #f4f6f9);
    border-bottom: 1px solid #e4e8f0;
    flex-shrink: 0;
}

.svsc-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.svsc-panel-tip {
    font-size: 11px;
    color: #9ca3af;
    background: rgba(156, 163, 175, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

.svsc-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    -webkit-overflow-scrolling: touch;
}

.svsc-field-group {
    margin-bottom: 14px;
}

.svsc-field-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 6px;
}

.svsc-required { color: #e94560; margin-left: 2px; }
.svsc-optional { color: #9ca3af; font-weight: 400; font-size: 11px; }

.svsc-topic-textarea,
.svsc-keypoints-textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #e0e4ec;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.6;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #374151;
    max-height: 160px;
}

.svsc-topic-textarea:focus,
.svsc-keypoints-textarea:focus {
    border-color: #e94560;
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.08);
}

/* ========== 亮色模式 placeholder 颜色规范 ========== */
.svsc-topic-textarea::placeholder,
.svsc-keypoints-textarea::placeholder,
.svsc-text-input::placeholder,
.svsc-history-search input::placeholder {
    color: #BCAAA4;
}

.svsc-text-input {
    width: 100%;
    padding: 8px 11px;
    border: 1px solid #e0e4ec;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #374151;
}

.svsc-text-input:focus {
    border-color: #e94560;
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.08);
}

.svsc-char-counter {
    text-align: right;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 3px;
}

.svsc-char-counter.warning { color: #f59e0b; }
.svsc-char-counter.limit   { color: #e94560; }

/* 平台选项 */
.svsc-platform-options,
.svsc-duration-options,
.svsc-style-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.svsc-platform-option,
.svsc-duration-option,
.svsc-style-option {
    padding: 5px 10px;
    border: 1px solid #e0e4ec;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: #4b5563;
    background: #fafbfc;
    user-select: none;
    white-space: nowrap;
}

.svsc-platform-option:hover,
.svsc-duration-option:hover,
.svsc-style-option:hover {
    border-color: #e94560;
    color: #e94560;
    background: #fff3f4;
}

.svsc-platform-option.selected,
.svsc-duration-option.selected,
.svsc-style-option.selected {
    background: linear-gradient(135deg, #e94560 0%, #c0392b 100%);
    border-color: #e94560;
    color: #fff;
    box-shadow: 0 2px 6px rgba(233, 69, 96, 0.3);
}

/* 快捷标签 */
.svsc-quick-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 6px;
}

.svsc-quick-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.svsc-quick-tag {
    padding: 4px 9px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 12px;
    font-size: 12px;
    color: #c2410c;
    cursor: pointer;
    transition: all 0.2s;
}

.svsc-quick-tag:hover,
.svsc-quick-tag.svsc-tag-active {
    background: #ffedd5;
    border-color: #fb923c;
    transform: scale(1.04);
}

/* 使用说明 */
.svsc-tips-box {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 11px 13px;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.7;
}

.svsc-tips-box p {
    margin: 0 0 6px 0;
    font-weight: 600;
    color: #374151;
}

.svsc-tips-box ul {
    margin: 0;
    padding-left: 16px;
}

.svsc-tips-box li { margin-bottom: 3px; }

/* ========== 右栏：结果面板 ========== */
.svsc-result-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    overflow: hidden;
    min-width: 300px;
}

.svsc-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 16px;
    background: linear-gradient(to bottom, #fafbfc, #f4f6f9);
    border-bottom: 1px solid #e4e8f0;
    flex-shrink: 0;
}

.svsc-result-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.svsc-result-meta {
    display: flex;
    gap: 6px;
    align-items: center;
}

.svsc-result-platform-badge,
.svsc-result-style-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.svsc-result-platform-badge {
    background: #fef3c7;
    color: #92400e;
}

.svsc-result-style-badge {
    background: #fce7f3;
    color: #be185d;
}

.svsc-result-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
}

/* 占位 */
.svsc-result-placeholder {
    flex: 1;  /* 配合父容器flex column铺满 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #9ca3af;
    padding: 40px 20px;
}

.svsc-placeholder-icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.6;
    animation: svscFloat 3s ease-in-out infinite;
}

@keyframes svscFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

.svsc-placeholder-title {
    font-size: 16px;
    font-weight: 600;
    color: #6b7280;
    margin: 0 0 8px 0;
}

.svsc-placeholder-desc {
    font-size: 13px;
    margin: 3px 0;
    color: #9ca3af;
}

/* 加载中 */
.svsc-result-loading {
    flex: 1;  /* 配合父容器flex column铺满 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

/* AI加载三点弹跳动画 */
.ai-loading-indicator {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.ai-loading-indicator span {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #e94560;
    border-radius: 50%;
    animation: svscBounce 1.2s ease-in-out infinite;
}

.ai-loading-indicator span:nth-child(2) { animation-delay: 0.2s; background: #c0392b; }
.ai-loading-indicator span:nth-child(3) { animation-delay: 0.4s; background: #e94560; }

@keyframes svscBounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.7; }
    40% { transform: translateY(-12px); opacity: 1; }
}

/* 呼吸闪烁加载文字 */
.svsc-loading-text {
    font-size: 14px;
    color: #6b7280;
    animation: svscBreath 1.8s ease-in-out infinite;
    margin: 0;
}

@keyframes svscBreath {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ========== AI生成的脚本结果样式 ========== */
.svsc-result-content {
    line-height: 1.7;
}

/* 脚本外层容器 */
.svsc-script-wrap {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 视频标题区 */
.svsc-titles-section {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 8px;
    padding: 16px 18px;
    color: #fff;
}

.svsc-section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
    margin-bottom: 8px;
}

.svsc-title-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 14px;
}

.svsc-title-item:last-child { border-bottom: none; }

.svsc-title-num {
    background: #e94560;
    color: #fff;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    flex-shrink: 0;
    margin-top: 2px;
}

/* 脚本段落卡片 */
.svsc-script-section {
    background: #fff;
    border: 1px solid #e8ecf0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
}

.svsc-script-section:hover {
    box-shadow: 0 3px 12px rgba(0,0,0,0.09);
}

.svsc-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: linear-gradient(to right, #f9fafb, #f3f4f6);
    border-bottom: 1px solid #e8ecf0;
}

.svsc-time-mark {
    background: #1a1a2e;
    color: #e94560;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
    flex-shrink: 0;
}

.svsc-section-name {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.svsc-section-body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.svsc-scene {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.svsc-scene-icon {
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 2px;
}

.svsc-scene-text {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.6;
    font-style: italic;
}

.svsc-narration {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.svsc-narration-icon {
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 2px;
}

.svsc-narration-text {
    font-size: 13px;
    color: #1e293b;
    line-height: 1.7;
    font-weight: 500;
}

/* 标签区 */
.svsc-tags-section {
    background: #f9fafb;
    border: 1px solid #e8ecf0;
    border-radius: 8px;
    padding: 14px 16px;
}

.svsc-tags-title {
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 10px;
}

.svsc-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.svsc-tag {
    background: linear-gradient(135deg, #1a1a2e 0%, #0f3460 100%);
    color: #93c5fd;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* 拍摄提示 */
.svsc-shoot-tips {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b;
    border-radius: 6px;
    padding: 12px 14px;
}

.svsc-shoot-tips-title {
    font-size: 12px;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 6px;
}

.svsc-shoot-tips ul {
    margin: 0;
    padding-left: 16px;
}

.svsc-shoot-tips li {
    font-size: 12px;
    color: #78350f;
    line-height: 1.7;
}

/* 错误提示 */
#svscResultError {
    flex: 1;                   /* 作为 flex item 撑满父容器 */
    display: flex;
    flex-direction: column;
}

.svsc-result-error {
    flex: 1;                   /* 撑满 #svscResultError，使内容能真正居中 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.svsc-result-error .error-icon { font-size: 40px; margin-bottom: 12px; }
.svsc-result-error .error-msg  { font-size: 14px; color: #ef4444; margin: 0 0 6px 0; }
.svsc-result-error .error-tip  { font-size: 12px; color: #9ca3af; margin: 0 0 16px 0; }

.svsc-retry-btn {
    padding: 8px 20px;
    background: linear-gradient(135deg, #e94560, #c0392b);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.svsc-retry-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(233, 69, 96, 0.35);
}

/* ========== 模态框 ========== */
.svsc-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 100000;
    backdrop-filter: blur(3px);
}

.svsc-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 10px;
    max-width: 720px;
    width: calc(100% - 40px);
    max-height: 80vh;
    overflow: hidden;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
    z-index: 100001;
    /* 入场动画：弹性缓动 */
    animation: svscModalIn 0.3s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}

.svsc-modal.svsc-entering {
    animation: none;
    transform: translate(-50%, -52%) scale(0.96);
    opacity: 0;
}

@keyframes svscModalIn {
    from { opacity: 0; transform: translate(-50%, -52%) scale(0.95); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.svsc-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    flex-shrink: 0;
}

.svsc-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.svsc-modal-close {
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.svsc-modal-close:hover {
    background: rgba(255,255,255,0.25);
}

.svsc-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.svsc-example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.svsc-example-card {
    padding: 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.svsc-example-card:hover {
    background: #fff3f4;
    border-color: #e94560;
    box-shadow: 0 3px 12px rgba(233, 69, 96, 0.12);
    transform: translateY(-1px);
}

.svsc-example-icon {
    font-size: 26px;
    flex-shrink: 0;
    line-height: 1;
}

.svsc-example-info { flex: 1; min-width: 0; }

.svsc-example-topic {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.svsc-example-badges {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 5px;
}

.svsc-example-platform-badge,
.svsc-example-style-badge2,
.svsc-example-duration-badge {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 500;
}

.svsc-example-platform-badge { background: #fef3c7; color: #92400e; }
.svsc-example-style-badge2   { background: #fce7f3; color: #be185d; }
.svsc-example-duration-badge { background: #dbeafe; color: #1e40af; }

.svsc-example-desc {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.5;
}

/* 示例加载占位 / 错误提示 */
.svsc-example-loading {
    text-align: center;
    padding: 32px;
    color: #9ca3af;
    font-size: 14px;
    grid-column: 1 / -1;
}
.svsc-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(26, 26, 46, 0.92);
    color: #fff;
    padding: 10px 22px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    z-index: 200000;
    opacity: 0;
    transition: all 0.3s ease;
    white-space: nowrap;
    pointer-events: none;
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    border-left: 3px solid transparent;
}

.svsc-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* warn 类型 Toast - 黄色警告 */
.svsc-toast.warn {
    background: rgba(120, 53, 15, 0.92);
    border-left-color: #f59e0b;
}

/* info 类型 Toast - 蓝色提示 */
.svsc-toast.info {
    background: rgba(15, 52, 96, 0.92);
    border-left-color: #60a5fa;
}

/* input shake 动画 */
@keyframes svscShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

.shake { animation: svscShake 0.4s ease; }

/* ========== 自定义滚动条 ========== */
.svsc-history-list::-webkit-scrollbar,
.svsc-input-body::-webkit-scrollbar,
.svsc-result-body::-webkit-scrollbar,
.svsc-modal-body::-webkit-scrollbar {
    width: 5px;
}

.svsc-history-list::-webkit-scrollbar-track,
.svsc-input-body::-webkit-scrollbar-track,
.svsc-result-body::-webkit-scrollbar-track,
.svsc-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.svsc-history-list::-webkit-scrollbar-thumb,
.svsc-input-body::-webkit-scrollbar-thumb,
.svsc-result-body::-webkit-scrollbar-thumb,
.svsc-modal-body::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.svsc-history-list::-webkit-scrollbar-thumb:hover,
.svsc-input-body::-webkit-scrollbar-thumb:hover,
.svsc-result-body::-webkit-scrollbar-thumb:hover,
.svsc-modal-body::-webkit-scrollbar-thumb:hover {
    background: #E07B00;
}

/* ========== 移动端适配 ========== */
@media (max-width: 768px) {
    .svsc-main-content {
        flex-direction: column;
    }

    .svsc-history-panel {
        width: 100%;
        height: 120px;
        border-right: none;
        border-bottom: 1px solid #e4e8f0;
    }

    .svsc-history-list { flex-direction: row; }

    .svsc-input-panel {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e4e8f0;
        max-height: 320px;
    }

    .svsc-result-panel { min-height: 300px; }

    .toolbar-title { display: none; }

    /* 移动端复制按钮强制可见 */
    .copy-reply-btn {
        opacity: 1;
    }
}

/* ========== 暗黑模式（body.dark） ========== */
body.dark .svsc-container {
    background: #0f172a;
}

body.dark .svsc-main-content {
    background: #0f172a;
}

body.dark .svsc-toolbar {
    background: linear-gradient(135deg, #0d0d1a 0%, #0a0e1f 40%, #07203d 100%);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.6);
}

body.dark .svsc-history-panel,
body.dark .svsc-input-panel,
body.dark .svsc-result-panel {
    background: #111827;
    border-color: rgba(55, 65, 81, 0.6);
}

body.dark .svsc-history-header {
    background: linear-gradient(to bottom, #1a2234, #151e2e);
    border-bottom-color: rgba(55, 65, 81, 0.6);
}

body.dark .svsc-history-header h3,
body.dark .svsc-panel-header h3,
body.dark .svsc-result-header h3 {
    color: #e2e8f0;
}

body.dark .svsc-history-count { color: #6b7280; }

body.dark .svsc-history-search input {
    background: #0f172a;
    border-color: #374151;
    color: #e2e8f0;
}

body.dark .svsc-history-search input::placeholder { color: #6b7280; }

body.dark .svsc-history-search input:focus {
    border-color: #e94560;
    box-shadow: 0 0 0 2px rgba(233, 69, 96, 0.15);
}

body.dark .svsc-history-item {
    background: #1a2234;
    border-color: rgba(55, 65, 81, 0.5);
}

body.dark .svsc-history-item:hover {
    background: #1e2a3d;
    border-color: #374151;
}

body.dark .svsc-history-item.active {
    background: #2d1a22;
    border-left-color: #e94560; /* 与亮色模式保持一致，仅改左边框色 */
}

body.dark .svsc-history-item-title { color: #e2e8f0; }
body.dark .svsc-history-item-meta  { color: #6b7280; }
body.dark .svsc-history-empty      { color: #6b7280; }
body.dark .svsc-history-item-platform {
    background: #1e3a5f;
    color: #93c5fd;
}

body.dark .svsc-panel-header {
    background: linear-gradient(to bottom, #1a2234, #151e2e);
    border-bottom-color: rgba(55, 65, 81, 0.6);
}

body.dark .svsc-panel-tip { color: #6b7280; background: rgba(107, 114, 128, 0.15); }

body.dark .svsc-field-label { color: #9ca3af; }

body.dark .svsc-topic-textarea,
body.dark .svsc-keypoints-textarea,
body.dark .svsc-text-input {
    background: #0f172a;
    border-color: #374151;
    color: #e2e8f0;
}

body.dark .svsc-topic-textarea::placeholder,
body.dark .svsc-keypoints-textarea::placeholder,
body.dark .svsc-text-input::placeholder { color: #6b7280; }

body.dark .svsc-topic-textarea:focus,
body.dark .svsc-keypoints-textarea:focus,
body.dark .svsc-text-input:focus {
    border-color: #e94560;
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.12);
}

body.dark .svsc-platform-option,
body.dark .svsc-duration-option,
body.dark .svsc-style-option {
    background: #1a2234;
    border-color: #374151;
    color: #9ca3af;
}

body.dark .svsc-platform-option:hover,
body.dark .svsc-duration-option:hover,
body.dark .svsc-style-option:hover {
    border-color: #e94560;
    color: #e94560;
    background: #2d1a22;
}

body.dark .svsc-quick-tag {
    background: #1a2234;
    border-color: #374151;
    color: #9ca3af;
}

body.dark .svsc-quick-tag:hover { background: #2d1a22; border-color: #e94560; color: #e94560; }

body.dark .svsc-tips-box {
    background: #1a2234;
    border-color: #374151;
    color: #6b7280;
}

body.dark .svsc-tips-box p { color: #e2e8f0; }

body.dark .svsc-result-header {
    background: linear-gradient(to bottom, #1a2234, #151e2e);
    border-bottom-color: rgba(55, 65, 81, 0.6);
}

body.dark .svsc-placeholder-title { color: #6b7280; }
body.dark .svsc-placeholder-desc  { color: #6b7280; }

body.dark .svsc-loading-text { color: #6b7280; }

body.dark .svsc-script-section {
    background: #1a2234;
    border-color: rgba(55, 65, 81, 0.5);
}

body.dark .svsc-section-header {
    background: linear-gradient(to right, #151e2e, #1a2234);
    border-bottom-color: rgba(55, 65, 81, 0.5);
}

body.dark .svsc-section-name { color: #e2e8f0; }
body.dark .svsc-scene-text { color: #6b7280; }
body.dark .svsc-narration-text { color: #d1d5db; }

body.dark .svsc-tags-section {
    background: #1a2234;
    border-color: rgba(55, 65, 81, 0.5);
}

body.dark .svsc-tags-title { color: #9ca3af; }

body.dark .svsc-shoot-tips {
    background: linear-gradient(135deg, #1e1a0f, #1f1a09);
    border-color: #78350f;
}

body.dark .svsc-shoot-tips-title { color: #fbbf24; }
body.dark .svsc-shoot-tips li    { color: #d97706; }

body.dark .svsc-modal-body  { background: #111827; }
body.dark .svsc-modal       { background: #111827; }

body.dark .svsc-example-card {
    background: #1a2234;
    border-color: #374151;
}

body.dark .svsc-example-card:hover {
    background: #2d1a22;
    border-color: #e94560;
}

body.dark .svsc-example-topic { color: #e2e8f0; }
body.dark .svsc-example-desc  { color: #6b7280; }
body.dark .svsc-example-loading { color: #9ca3af; }

/* AI loading indicator 暗黑对比度 */
body.dark .ai-loading-indicator span { background: #e94560; }
body.dark .ai-loading-indicator span:nth-child(2) { background: #ff6b80; }

/* 暗黑模式自定义滚动条 */
body.dark .svsc-history-list::-webkit-scrollbar-thumb,
body.dark .svsc-input-body::-webkit-scrollbar-thumb,
body.dark .svsc-result-body::-webkit-scrollbar-thumb,
body.dark .svsc-modal-body::-webkit-scrollbar-thumb {
    background: #374151;
}

body.dark .svsc-history-list::-webkit-scrollbar-thumb:hover,
body.dark .svsc-input-body::-webkit-scrollbar-thumb:hover,
body.dark .svsc-result-body::-webkit-scrollbar-thumb:hover,
body.dark .svsc-modal-body::-webkit-scrollbar-thumb:hover {
    background: #e94560;
}

/* 暗黑模式错误提示 */
body.dark .svsc-result-error .error-msg { color: #f87171; }
body.dark .svsc-result-error .error-tip { color: #6b7280; }

/* 暗黑模式重试按钮 */
body.dark .svsc-retry-btn {
    background: linear-gradient(135deg, #7f1d1d, #991b1b);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}
body.dark .svsc-retry-btn:hover {
    background: linear-gradient(135deg, #991b1b, #b91c1c);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
}

/* 暗黑模式历史清空按钮 */
body.dark .svsc-history-clear-btn {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
}
body.dark .svsc-history-clear-btn:hover {
    background: rgba(239, 68, 68, 0.22);
}
