/* ========== 全局变量 ========== */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --primary-glow: rgba(99, 102, 241, 0.35);
    --accent: #f59e0b;
    --accent-light: #fbbf24;
    --accent-glow: rgba(245, 158, 11, 0.35);
    --success: #10b981;
    --success-light: #34d399;
    --danger: #ef4444;
    --danger-light: #f87171;

    --bg-page: #070b14;
    --bg-surface: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.65);
    --bg-card-solid: #1e293b;
    --bg-input: rgba(15, 23, 42, 0.7);
    --bg-hover: rgba(51, 65, 85, 0.6);

    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    --border: rgba(148, 163, 184, 0.18);
    --border-light: rgba(148, 163, 184, 0.1);
    --border-focus: rgba(99, 102, 241, 0.6);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.45);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;

    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== 基础重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ========== 登录页 ========== */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.18) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(245, 158, 11, 0.12) 0%, transparent 50%),
        linear-gradient(135deg, var(--bg-page) 0%, #111835 100%);
    position: relative;
    overflow: hidden;
}

.login-body::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%236366f1' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.6;
}

.login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    margin: 20px;
    padding: 48px 40px;
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.login-logo {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo .icon {
    font-size: 64px;
    display: block;
    margin-bottom: 16px;
    filter: drop-shadow(0 8px 24px rgba(99, 102, 241, 0.35));
}

.login-logo h1 {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.login-logo p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 10px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-form input {
    width: 100%;
    padding: 16px 20px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
    transition: var(--transition);
}

.login-form input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.login-form input::placeholder {
    color: var(--text-dim);
}

.login-form button {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

.login-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.45);
}

.login-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: var(--danger-light);
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
}

/* ========== 工作台页面 ========== */
.studio-body {
    background:
        radial-gradient(ellipse at 0% 0%, rgba(99, 102, 241, 0.12) 0%, transparent 45%),
        radial-gradient(ellipse at 100% 0%, rgba(245, 158, 11, 0.08) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 100%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        var(--bg-page);
    min-height: 100vh;
    padding-bottom: 60px;
}

.studio-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 32px;
    background: rgba(7, 11, 20, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.studio-header .logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-icon {
    font-size: 32px;
    filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.4));
}

.logo-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.logo-title {
    font-size: 18px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.3px;
}

.logo-subtitle {
    font-size: 12px;
    color: var(--text-dim);
    font-weight: 500;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ========== 步骤导航 ========== */
.step-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 28px 24px 12px;
    max-width: 1100px;
    margin: 0 auto;
}

.step-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: var(--radius);
    transition: var(--transition);
    opacity: 0.55;
}

.step-nav-item.active {
    opacity: 1;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.step-nav-num {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.step-nav-item.active .step-nav-num {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.step-nav-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.step-nav-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.step-nav-desc {
    font-size: 12px;
    color: var(--text-dim);
}

.step-nav-line {
    width: 40px;
    height: 1px;
    background: linear-gradient(90deg, var(--border), transparent);
}

/* ========== 容器 ========== */
.studio-container {
    max-width: 980px;
    margin: 0 auto;
    padding: 20px 24px 60px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ========== 卡片 ========== */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    border-color: rgba(148, 163, 184, 0.28);
    box-shadow: var(--shadow), 0 0 30px rgba(99, 102, 241, 0.06);
}

.card-header {
    padding: 22px 28px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.card-hint {
    font-size: 13px;
    color: var(--text-dim);
    background: rgba(148, 163, 184, 0.08);
    padding: 6px 12px;
    border-radius: 20px;
}

.step-badge {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.card-body {
    padding: 28px;
}

/* ========== 按钮 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    line-height: 1;
}

.btn span {
    font-size: 15px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.45);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent), #d97706);
    color: white;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.45);
}

.btn-secondary {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success-light);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.btn-secondary:hover {
    background: rgba(16, 185, 129, 0.2);
    transform: translateY(-1px);
}

.btn-ghost {
    background: rgba(148, 163, 184, 0.08);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-primary);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger-light);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

.btn-large {
    padding: 16px 32px;
    font-size: 16px;
    border-radius: 12px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ========== 表单 ========== */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 4px;
}

.form-row .form-group {
    flex: 1;
}

.form-row .form-group.large {
    flex: 1.6;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.label-tip {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-dim);
}

.field-hint {
    display: block;
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 13px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-dim);
}

.form-group select option {
    background: var(--bg-card-solid);
    color: var(--text-primary);
}

.form-group textarea {
    resize: vertical;
    min-height: 90px;
    line-height: 1.7;
}

/* ========== 上传区 ========== */
.upload-zone {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 52px 32px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background:
        linear-gradient(180deg, rgba(99, 102, 241, 0.04) 0%, transparent 100%),
        rgba(15, 23, 42, 0.4);
    overflow: hidden;
}

.upload-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    padding: 2px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(245, 158, 11, 0.15));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: var(--transition);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary-light);
    background: rgba(99, 102, 241, 0.08);
    transform: translateY(-2px);
}

.upload-zone:hover::before,
.upload-zone.dragover::before {
    opacity: 1;
}

.upload-zone input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-zone-content {
    position: relative;
    z-index: 1;
    pointer-events: none;
}

.upload-icon-wrap {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(245, 158, 11, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.upload-icon {
    font-size: 36px;
}

.upload-zone h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.upload-zone .hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.format-tags {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.format-tag {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid;
}

.format-tag.image {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
    border-color: rgba(99, 102, 241, 0.2);
}

.format-tag.video {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-light);
    border-color: rgba(245, 158, 11, 0.2);
}

.format-tag.doc {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-light);
    border-color: rgba(16, 185, 129, 0.2);
}

/* ========== 素材列表 ========== */
.media-section {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
}

.section-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.section-count {
    color: var(--text-dim);
    font-weight: 500;
    font-size: 13px;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
}

.media-item {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 3/4;
    background: var(--bg-input);
    border: 1px solid var(--border);
    cursor: grab;
    transition: var(--transition);
}

.media-item:hover {
    border-color: var(--primary-light);
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
}

.media-item img,
.media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-item .media-order {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    color: white;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-item .media-type-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    backdrop-filter: blur(4px);
    text-transform: uppercase;
}

.media-item .type-image { background: rgba(99, 102, 241, 0.85); color: white; }
.media-item .type-video { background: rgba(245, 158, 11, 0.85); color: white; }
.media-item .type-document { background: rgba(16, 185, 129, 0.85); color: white; }

.media-item .media-delete {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.85);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.2s;
}

.media-item:hover .media-delete {
    opacity: 1;
}

.media-item .doc-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

.media-item .doc-info .doc-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.media-item .doc-info .doc-name {
    font-size: 12px;
    color: var(--text-secondary);
    word-break: break-all;
    line-height: 1.4;
}

/* ========== 脚本编辑器 ========== */
.script-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 24px 0 16px;
    padding: 14px 18px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.script-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.toolbar-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.toolbar-hint {
    font-size: 12px;
    color: var(--text-dim);
}

.script-toolbar-right {
    display: flex;
    align-items: center;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

.toggle-label input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.script-empty {
    text-align: center;
    padding: 52px 24px;
    background: rgba(15, 23, 42, 0.3);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 14px;
    opacity: 0.7;
}

.script-empty h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.script-empty p {
    font-size: 13px;
    color: var(--text-dim);
}

.script-segment {
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 16px;
    transition: var(--transition);
}

.script-segment:hover {
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

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

.seg-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.seg-number {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.seg-media-label {
    font-size: 12px;
    color: var(--text-dim);
    font-weight: 500;
}

.seg-delete {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-light);
    border: 1px solid rgba(239, 68, 68, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.seg-delete:hover {
    background: rgba(239, 68, 68, 0.2);
}

.seg-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.seg-grid .form-group {
    margin-bottom: 0;
}

.seg-grid .form-group.full-width {
    grid-column: 1 / -1;
}

.seg-grid .form-group textarea {
    min-height: 70px;
}

.seg-grid .form-group textarea.narration {
    min-height: 90px;
}

.seg-grid .form-group input::placeholder,
.seg-grid .form-group textarea::placeholder {
    color: var(--text-dim);
    font-size: 14px;
}

.field-example {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 6px;
}

/* ========== 生成区 ========== */
.generate-start {
    text-align: center;
    padding: 36px 24px;
}

.generate-info {
    margin-bottom: 24px;
}

.generate-info h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.generate-info p {
    font-size: 14px;
    color: var(--text-muted);
}

/* ========== 进度条 ========== */
.progress-container {
    text-align: center;
    padding: 40px 20px;
}

.progress-ring {
    width: 100px;
    height: 100px;
    margin: 0 auto 24px;
    position: relative;
}

.progress-ring svg {
    transform: rotate(-90deg);
}

.progress-ring circle {
    fill: none;
    stroke-width: 7;
}

.progress-ring .bg-ring {
    stroke: var(--border);
}

.progress-ring .progress-ring-circle {
    stroke: url(#progressGradient);
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 22px;
    font-weight: 800;
    color: var(--primary-light);
}

.progress-message {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.progress-detail {
    font-size: 13px;
    color: var(--text-dim);
}

/* ========== 视频结果 ========== */
.video-result {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    align-items: start;
}

.video-player-wrap {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: #000;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.video-player-wrap::before {
    content: '';
    display: block;
    padding-top: 177.78%;
}

.video-player-wrap video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.video-meta-card {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.video-info {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 28px;
}

.video-info .info-item {
    padding: 14px 16px;
    background: rgba(148, 163, 184, 0.06);
    border-radius: var(--radius-sm);
}

.video-info .info-item .label {
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.video-info .info-item .value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.result-actions .btn {
    width: 100%;
}

/* ========== 视频下方跳转链接 ========== */
.video-link-bar {
    margin-top: 16px;
    border-radius: var(--radius);
    overflow: hidden;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(124, 58, 237, 0.15));
    border: 1px solid rgba(99, 102, 241, 0.3);
    transition: var(--transition);
}

.video-link-bar:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(124, 58, 237, 0.25));
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.2);
}

.video-link-bar a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 700;
}

.video-link-bar .link-icon {
    font-size: 20px;
}

.video-link-bar .link-text {
    flex: 1;
    text-align: center;
}

.video-link-bar .link-arrow {
    font-size: 18px;
    color: var(--primary-light);
    transition: transform 0.25s ease;
}

.video-link-bar:hover .link-arrow {
    transform: translateX(4px);
}

/* ========== 知识库面板 ========== */
.kb-panel {
    position: fixed;
    top: 0;
    right: -480px;
    width: 460px;
    height: 100vh;
    background: rgba(11, 16, 28, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-left: 1px solid var(--border);
    z-index: 200;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.kb-panel.open {
    right: 0;
}

.kb-panel-header {
    padding: 22px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kb-panel-header h2 {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.kb-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.kb-list-header {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 28px 0 14px;
}

.kb-item {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 12px;
    transition: var(--transition);
}

.kb-item:hover {
    border-color: rgba(99, 102, 241, 0.4);
}

.kb-item .kb-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.kb-item .kb-content-preview {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.kb-item .kb-meta {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kb-item .kb-actions {
    display: flex;
    gap: 8px;
}

.kb-form .form-group {
    margin-bottom: 14px;
}

.kb-form .form-group textarea {
    min-height: 120px;
}

/* ========== 遮罩 ========== */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.overlay.show {
    opacity: 1;
    visibility: visible;
}

/* ========== Toast ========== */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    background: rgba(30, 41, 59, 0.98);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 24px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    z-index: 300;
    box-shadow: var(--shadow-lg);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.success { border-color: rgba(16, 185, 129, 0.4); color: var(--success-light); }
.toast.error { border-color: rgba(239, 68, 68, 0.4); color: var(--danger-light); }

/* ========== 知识库选择行 ========== */
.kb-select-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.kb-select-row select {
    flex: 1;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ========== 营销推广字段 ========== */
.seg-marketing {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--border);
}

.seg-marketing-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-light);
}

.seg-marketing-header .label-tip {
    font-weight: 400;
}

/* ========== 图片库 ========== */
.gallery-upload-zone {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: rgba(15, 23, 42, 0.4);
}

.gallery-upload-zone:hover,
.gallery-upload-zone.dragover {
    border-color: var(--accent-light);
    background: rgba(245, 158, 11, 0.06);
}

.gallery-upload-zone input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.gallery-upload-zone .upload-zone-content {
    position: relative;
    z-index: 1;
    pointer-events: none;
}

/* 图片库操作选项卡 */
.gallery-ops {
    margin: 20px 0;
}

.gallery-ops-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 16px;
}

.gallery-op-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 6px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.4);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.gallery-op-tab:hover {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-primary);
}

.gallery-op-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.gallery-op-tab span {
    font-size: 16px;
}

.gallery-op-panel {
    padding: 16px;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.op-desc {
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 12px;
    line-height: 1.5;
}

.op-options {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-secondary);
}

.op-options label {
    white-space: nowrap;
}

.op-options select,
.op-options input[type="number"] {
    padding: 6px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
}

.op-options input[type="range"] {
    accent-color: var(--primary);
}

.gallery-op-btn {
    width: 100%;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.gallery-item:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    backdrop-filter: blur(4px);
}

.gallery-badge.done {
    background: rgba(16, 185, 129, 0.85);
    color: white;
}

.gallery-badge.pending {
    background: rgba(148, 163, 184, 0.7);
    color: white;
}

.gallery-delete {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.85);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s;
}

.gallery-item:hover .gallery-delete {
    opacity: 1;
}

.gallery-dl {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.9);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    text-decoration: none;
    transition: var(--transition);
}

.gallery-dl:hover {
    background: var(--primary);
    transform: scale(1.1);
}

.gallery-progress {
    padding: 14px 16px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

/* ========== 响应式 ========== */
@media (max-width: 900px) {
    .step-nav {
        display: none;
    }

    .video-result {
        grid-template-columns: 1fr;
    }

    .seg-grid {
        grid-template-columns: 1fr;
    }

    .kb-panel {
        width: 100%;
        right: -100%;
    }
}

@media (max-width: 640px) {
    .studio-header {
        padding: 12px 16px;
    }

    .logo-subtitle {
        display: none;
    }

    .studio-container {
        padding: 16px 12px 40px;
    }

    .card-body {
        padding: 20px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .card-header .header-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }

    .script-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}
