:root {
    --bg-page: #F7F8FA;
    --bg-card: #FFFFFF;
    --bg-card-hover: #FAFBFC;
    --bg-subtle: #F0F1F3;
    --bg-input: #F7F8FA;
    --text-primary: #1D1D1F;
    --text-secondary: #6E6E73;
    --text-tertiary: #AEAEB2;
    --text-on-primary: #FFFFFF;
    --border-default: #E5E5EA;
    --border-light: #F0F1F3;
    --border-focus: #8B2020;
    --primary: #8B2020;
    --primary-hover: #7A1C1C;
    --primary-active: #6A1818;
    --primary-subtle: rgba(139, 32, 32, 0.08);
    --accent-red: #8B2020;
    --success: #34C759;
    --success-bg: #E8F9ED;
    --error: #FF3B30;
    --error-bg: #FFECEA;
    --warning: #FF9500;
    --warning-bg: #FFF6E5;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px -1px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 8px -2px rgba(0,0,0,0.06), 0 2px 4px -2px rgba(0,0,0,0.04);
    --shadow-lg: 0 12px 32px -8px rgba(0,0,0,0.08), 0 4px 8px -4px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 48px -12px rgba(0,0,0,0.10);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    --font-family: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    --fs-display: 28px;
    --fs-title: 20px;
    --fs-body: 15px;
    --fs-caption: 13px;
    --fs-small: 12px;
    --lh-tight: 1.2;
    --lh-normal: 1.5;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 150ms;
    --duration-normal: 250ms;
}
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
body {
    font-family: var(--font-family);
    font-size: var(--fs-body);
    line-height: var(--lh-normal);
    color: var(--text-primary);
    background: var(--bg-page);
    min-height: 100vh;
    overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(44, 111, 206, 0.03), transparent),
                radial-gradient(ellipse 60% 40% at 80% 100%, rgba(139, 32, 32, 0.02), transparent);
    pointer-events: none;
    z-index: 0;
}
[hidden] { display: none !important; }
button, input { font-family: var(--font-family); }
img { max-width: 100%; }

.accent-bar {
    position: fixed; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent 5%, var(--accent-red) 30%, var(--accent-red) 70%, transparent 95%);
    z-index: 1000;
}
.back-home {
    position: fixed; top: 14px; left: 20px; z-index: 999;
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 14px; font-size: var(--fs-small); font-weight: var(--fw-medium);
    color: var(--text-secondary); text-decoration: none;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-default); border-radius: var(--radius-full);
    transition: all var(--duration-fast) var(--ease-out);
}
.back-home:hover {
    color: var(--primary); border-color: var(--primary);
    background: var(--bg-card); box-shadow: var(--shadow-sm);
}
.back-home svg { width: 14px; height: 14px; flex-shrink: 0; }

.contact-service { position: fixed; top: 16px; right: 16px; z-index: 999; }
.contact-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 16px; border: 1px solid var(--border-default); border-radius: var(--radius-full);
    background: rgba(255,255,255,0.85); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    color: var(--text-secondary); font-size: var(--fs-caption); font-weight: var(--fw-medium);
    cursor: pointer; transition: all var(--duration-fast) var(--ease-out);
    box-shadow: var(--shadow-sm);
}
.contact-btn:hover { color: var(--primary); border-color: var(--primary); background: var(--bg-card); box-shadow: var(--shadow-md); }
.contact-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.contact-dropdown {
    position: absolute; top: calc(100% + 10px); right: 0; width: 180px;
    background: var(--bg-card); border: 1px solid var(--border-light);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    padding: 14px 12px 12px; text-align: center;
    opacity: 0; visibility: hidden; transform: translateY(-4px);
    transition: all var(--duration-fast) var(--ease-out); pointer-events: none;
}
.contact-dropdown::before {
    content: ''; position: absolute; top: -5px; right: 22px;
    width: 9px; height: 9px; background: var(--bg-card);
    border-left: 1px solid var(--border-light); border-top: 1px solid var(--border-light);
    transform: rotate(45deg);
}
.contact-service:hover .contact-dropdown,
.contact-service.open .contact-dropdown {
    opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto;
}
.contact-dropdown img { width: 100%; border-radius: var(--radius-md); display: block; border: 1px solid var(--border-light); }
.qr-hint { margin-top: 10px; font-size: 12px; color: var(--text-secondary); font-weight: var(--fw-medium); }
.qr-sub { margin-top: 3px; font-size: 11px; color: var(--text-tertiary); }

.toast-container {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    z-index: 10001; display: flex; flex-direction: column; align-items: center; gap: var(--space-sm);
    pointer-events: none; width: max-content; max-width: 92%;
}
.toast {
    pointer-events: auto; padding: 12px 20px; border-radius: var(--radius-full);
    font-size: var(--fs-caption); font-weight: var(--fw-medium); box-shadow: var(--shadow-lg);
    opacity: 0; transform: translateY(-12px) scale(0.96);
    animation: toastIn var(--duration-normal) var(--ease-out) forwards;
    max-width: 90vw; text-align: center;
}
.toast.removing { animation: toastOut var(--duration-fast) ease-in forwards; }
.toast--error { background: var(--error); color: #fff; }
.toast--success { background: var(--success); color: #fff; }
.toast--warning { background: var(--warning); color: #fff; }
.toast--info { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-default); }
@keyframes toastIn { to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px) scale(0.96); } }

.container {
    position: relative; z-index: 1; width: 100%; max-width: 1420px;
    margin: 0 auto; padding: var(--space-3xl) var(--space-xl) var(--space-2xl);
    display: flex; flex-direction: column; align-items: center; gap: var(--space-lg);
    min-height: calc(100vh - 48px);
}
.header { text-align: center; animation: fadeUp 0.6s var(--ease-out) both; padding-top: 6px; }
.header h1 {
    font-size: var(--fs-display); font-weight: var(--fw-bold);
    letter-spacing: -0.02em; line-height: var(--lh-tight); color: var(--text-primary);
}
.header h1::after {
    content: ''; display: block; width: 32px; height: 2px;
    background: var(--accent-red); margin: var(--space-md) auto 0; border-radius: 1px;
}
.header p {
    font-size: var(--fs-caption); color: var(--text-secondary);
    margin-top: var(--space-md); letter-spacing: 0.01em; max-width: 680px;
}
.steps {
    display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
    gap: 6px; animation: fadeUp 0.6s var(--ease-out) 0.06s both;
}
.step {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 13px; border-radius: var(--radius-full);
    background: var(--bg-card); border: 1px solid var(--border-default);
    font-size: var(--fs-small); color: var(--text-secondary);
    transition: all var(--duration-normal) var(--ease-out);
}
.step b {
    width: 18px; height: 18px; border-radius: 50%; background: var(--bg-subtle);
    display: inline-grid; place-items: center; font-size: 10px; font-weight: 700;
    color: var(--text-secondary); transition: all var(--duration-normal);
}
.step.active { background: var(--primary-subtle); border-color: rgba(139,32,32,0.35); color: var(--primary); font-weight: var(--fw-semibold); }
.step.active b { background: var(--primary); color: #fff; }
.step.done { color: var(--text-primary); border-color: var(--border-default); }
.step.done b { background: var(--success); color: #fff; }
.step-sep { color: var(--text-tertiary); font-size: 11px; }

.guide-link {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 12px; border-radius: var(--radius-full);
    border: 1px solid var(--border-default); background: var(--bg-card);
    color: var(--text-secondary); font-size: 11px; cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}
.guide-link:hover { color: var(--primary); border-color: var(--primary); }
.guide-link svg { width: 12px; height: 12px; flex-shrink: 0; }

/* 上传区 */
.upload-zone {
    width: 100%; padding: var(--space-2xl) var(--space-lg);
    border: 2px dashed var(--border-default); border-radius: var(--radius-xl);
    background: var(--bg-card); text-align: center; cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
    animation: fadeUp 0.6s var(--ease-out) 0.1s both; position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    flex: 1 1 auto; min-height: 30vh;
}
.upload-zone:hover { border-color: var(--primary); background: var(--primary-subtle); box-shadow: var(--shadow-sm); }
.upload-zone.drag-over {
    border-color: var(--accent-red); background: rgba(139, 32, 32, 0.06);
    transform: scale(1.005); box-shadow: var(--shadow-md);
}
.upload-zone.has-file { padding: 0; border-style: dashed; flex: 0 0 auto; min-height: 0; max-height: 100px; }
.upload-compact {
    display: flex; align-items: center; gap: var(--space-md);
    padding: var(--space-md) var(--space-lg); color: var(--text-secondary);
    cursor: pointer; width: 100%;
}
.upload-compact-icon {
    width: 32px; height: 32px; border-radius: var(--radius-sm);
    background: var(--bg-subtle); border: 1px solid var(--border-default);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    color: var(--text-tertiary); transition: all var(--duration-fast);
}
.upload-compact-text {
    font-size: var(--fs-body); font-weight: var(--fw-medium);
    color: var(--text-secondary); transition: color var(--duration-fast); margin-left: auto;
}
.upload-compact-meta { font-size: var(--fs-small); color: var(--text-tertiary); }
.upload-zone.has-file:hover .upload-compact-icon { color: var(--primary); background: var(--primary-subtle); border-color: var(--primary); }
.upload-zone.has-file:hover .upload-compact-text { color: var(--primary); }
.upload-icon { width: 48px; height: 48px; margin: 0 auto var(--space-md); color: var(--text-tertiary); transition: all var(--duration-normal); }
.upload-zone:hover .upload-icon { color: var(--primary); transform: translateY(-2px); }
.upload-zone.drag-over .upload-icon { color: var(--accent-red); transform: translateY(-4px) scale(1.05); }
.upload-text { font-size: var(--fs-body); color: var(--text-primary); margin-bottom: var(--space-sm); }
.browse-btn {
    display: inline-block; padding: 8px 20px;
    font-size: var(--fs-caption); font-weight: var(--fw-semibold);
    color: var(--primary); background: var(--primary-subtle);
    border: none; border-radius: var(--radius-full); cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}
.browse-btn:hover { background: rgba(139, 32, 32, 0.14); }
.upload-hint { font-size: var(--fs-small); color: var(--text-tertiary); margin-top: var(--space-md); max-width: 760px; }
.upload-hint--sub { margin-top: 6px; font-size: 11px; opacity: 0.9; }

/* 功能条 */
.feature-grid {
    width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md); animation: fadeUp 0.6s var(--ease-out) 0.18s both;
}
.feature-card {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 16px 18px; background: var(--bg-card); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm); min-width: 0;
}
.feature-icon {
    width: 34px; height: 34px; border-radius: var(--radius-sm); flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-subtle); color: var(--primary);
}
.feature-icon svg { width: 18px; height: 18px; }
.feature-card h3 { font-size: var(--fs-caption); font-weight: var(--fw-semibold); margin-bottom: 2px; }
.feature-card p { font-size: var(--fs-small); color: var(--text-tertiary); }

/* 工作区 */
.workspace {
    width: 100%; display: grid; grid-template-columns: 380px minmax(0, 1fr);
    gap: var(--space-md); align-items: start;
    animation: fadeUp 0.5s var(--ease-out) both;
}
.card {
    background: var(--bg-card); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm); min-width: 0;
}
.card-head {
    display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-light);
}
.card-title { font-size: var(--fs-caption); font-weight: var(--fw-semibold); color: var(--text-secondary); }
.head-right { margin-left: auto; display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; }
.reset-btn {
    padding: 4px 12px; font-size: var(--fs-small);
    font-weight: var(--fw-medium); color: var(--text-secondary); background: var(--bg-subtle);
    border: none; border-radius: var(--radius-full); cursor: pointer; transition: all var(--duration-fast);
    white-space: nowrap;
}
.reset-btn:hover:not(:disabled) { color: var(--primary); background: var(--primary-subtle); }
.reset-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.mini-primary {
    padding: 5px 13px; font-size: var(--fs-small); font-weight: var(--fw-semibold);
    color: var(--primary); background: var(--primary-subtle); border: none;
    border-radius: var(--radius-full); cursor: pointer; transition: all var(--duration-fast);
    white-space: nowrap;
}
.mini-primary:hover:not(:disabled) { background: rgba(139,32,32,0.14); }
.mini-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.mini-plain {
    padding: 5px 13px; font-size: var(--fs-small); font-weight: var(--fw-medium);
    color: var(--text-secondary); background: var(--bg-card); border: 1px solid var(--border-default);
    border-radius: var(--radius-full); cursor: pointer; transition: all var(--duration-fast);
    white-space: nowrap; text-decoration: none;
}
.mini-plain:hover:not(:disabled) { color: var(--primary); border-color: var(--primary); }
.mini-plain:disabled { opacity: 0.45; cursor: not-allowed; }
.settings-card { position: sticky; top: 16px; }

/* 设置 */
.filter-body { padding: var(--space-sm) var(--space-lg) var(--space-lg); }
.rule-block { padding: var(--space-md) 0; border-bottom: 1px solid var(--border-light); }
.rule-block:last-of-type { border-bottom: none; padding-bottom: var(--space-sm); }
.rule-label {
    font-size: var(--fs-small); font-weight: var(--fw-semibold); color: var(--text-tertiary);
    letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 10px;
}
.pill-group {
    display: flex; background: var(--bg-subtle); border-radius: var(--radius-full);
    padding: 3px; gap: 2px; border: 1px solid var(--border-light); align-self: flex-start;
    max-width: 100%;
}
.pill-group--wrap { flex-wrap: wrap; align-self: stretch; }
.pill-group--sm .pill { padding: 5px 13px; font-size: var(--fs-small); }
.pill {
    padding: 7px 15px; font-size: var(--fs-caption);
    font-weight: var(--fw-medium); color: var(--text-secondary); background: transparent;
    border: none; border-radius: var(--radius-full); cursor: pointer;
    transition: all var(--duration-normal) var(--ease-spring);
    white-space: nowrap; user-select: none; -webkit-user-select: none;
}
.pill:hover:not(.active):not(:disabled) { color: var(--text-primary); background: rgba(0,0,0,0.03); }
.pill:active:not(.active):not(:disabled) { transform: scale(0.96); }
.pill.active {
    background: var(--bg-card); color: var(--primary); font-weight: var(--fw-semibold);
    box-shadow: var(--shadow-sm), 0 0 0 1px rgba(139, 32, 32, 0.08);
}
.pill:disabled { opacity: 0.5; cursor: not-allowed; }
.slider-row { min-width: 0; }
.slider-head {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    font-size: var(--fs-small); color: var(--text-secondary); margin-bottom: 6px;
}
.slider-val {
    font-size: var(--fs-small); font-weight: var(--fw-semibold); color: var(--primary);
    font-variant-numeric: tabular-nums; white-space: nowrap;
}
.range {
    -webkit-appearance: none; appearance: none; width: 100%; height: 20px;
    background: transparent; cursor: pointer; outline: none; display: block;
}
.range::-webkit-slider-runnable-track {
    height: 4px; border-radius: 2px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary) var(--p, 50%), var(--border-default) var(--p, 50%), var(--border-default) 100%);
}
.range::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; width: 16px; height: 16px; margin-top: -6px;
    border-radius: 50%; background: #fff; border: 2px solid var(--primary);
    box-shadow: 0 1px 4px rgba(0,0,0,0.16); transition: transform var(--duration-fast);
}
.range:active::-webkit-slider-thumb { transform: scale(1.12); }
.range::-moz-range-track { height: 4px; border-radius: 2px; background: var(--border-default); }
.range::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--primary); }
.range::-moz-range-thumb {
    width: 14px; height: 14px; border-radius: 50%; background: #fff;
    border: 2px solid var(--primary); box-shadow: 0 1px 4px rgba(0,0,0,0.16);
}
.range:disabled { opacity: 0.45; cursor: not-allowed; }
.hint-line { font-size: 11px; color: var(--text-tertiary); line-height: 1.5; margin-top: 10px; }
.switch-row {
    display: flex; align-items: center; gap: var(--space-sm); cursor: pointer;
    font-size: var(--fs-caption); color: var(--text-secondary); font-weight: var(--fw-medium);
    user-select: none; -webkit-user-select: none; margin-top: 12px;
}
.switch-row:first-child { margin-top: 0; }
.switch-input { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
.switch {
    width: 38px; height: 22px; border-radius: var(--radius-full);
    background: var(--bg-subtle); border: 1px solid var(--border-default);
    position: relative; transition: all var(--duration-fast); flex-shrink: 0;
}
.switch::after {
    content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
    border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm);
    transition: all var(--duration-normal) var(--ease-spring);
}
.switch-input:checked + .switch { background: var(--primary); border-color: var(--primary); }
.switch-input:checked + .switch::after { transform: translateX(16px); }
.switch-input:disabled + .switch { opacity: 0.5; cursor: not-allowed; }
.model-entry {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-top: 4px; padding: 12px; border-radius: var(--radius-md);
    background: var(--bg-page); border: 1px solid var(--border-light);
}
.model-entry-text { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.model-entry-title { font-size: var(--fs-small); font-weight: var(--fw-semibold); color: var(--text-secondary); }
.model-entry-status { font-size: 11px; color: var(--text-tertiary); }
.model-entry-status.ready { color: #1F8B3B; }
.model-entry-status.error { color: var(--error); }

/* 队列 */
.work-col { display: flex; flex-direction: column; gap: var(--space-md); min-width: 0; }
.file-count { font-size: var(--fs-small); color: var(--text-tertiary); }
.file-count strong { color: var(--primary); font-weight: var(--fw-semibold); }
.queue-note { font-size: 11px; color: var(--text-tertiary); white-space: nowrap; }
.queue-list { display: flex; flex-direction: column; }
.queue-list:empty { display: none; }
.file-row {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 20px; border-bottom: 1px solid var(--border-light);
    min-width: 0; content-visibility: auto; contain-intrinsic-size: 68px;
}
.file-row:last-child { border-bottom: none; }
.file-row.is-active { background: rgba(139, 32, 32, 0.025); }
.file-icon {
    width: 36px; height: 36px; border-radius: var(--radius-sm); flex-shrink: 0;
    display: grid; place-items: center; background: var(--primary-subtle); color: var(--primary);
}
.file-icon svg { width: 18px; height: 18px; }
.file-icon.is-video { background: rgba(44, 111, 206, 0.09); color: #2C6FCE; }
.file-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.file-name {
    font-size: var(--fs-caption); font-weight: var(--fw-semibold); color: var(--text-primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-meta {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    font-size: 11px; color: var(--text-tertiary); font-variant-numeric: tabular-nums;
}
.file-meta .sep { opacity: 0.5; }
.file-bar {
    height: 3px; border-radius: 2px; background: var(--bg-subtle);
    overflow: hidden; margin-top: 3px; display: none;
}
.file-row.is-converting .file-bar,
.file-row.is-done .file-bar { display: block; }
.file-bar span {
    display: block; height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--accent-red), #A52A2A);
    border-radius: 2px; transition: width 0.2s linear;
}
.file-row.is-done .file-bar span { background: var(--success); }
.status-tag {
    flex-shrink: 0; font-size: 10.5px; padding: 3px 9px; border-radius: var(--radius-full);
    background: var(--bg-subtle); color: var(--text-secondary); white-space: nowrap;
    font-weight: var(--fw-medium);
}
.status-tag.waiting { background: var(--bg-subtle); color: var(--text-secondary); }
.status-tag.converting { background: var(--primary-subtle); color: var(--primary); }
.status-tag.done { background: var(--success-bg); color: #1F8B3B; }
.status-tag.error { background: var(--error-bg); color: var(--error); }
.status-tag.stopped { background: var(--warning-bg); color: #A86A00; }
.row-btn {
    flex-shrink: 0; width: 26px; height: 26px; border: none; border-radius: 50%;
    background: transparent; color: var(--text-tertiary); cursor: pointer;
    display: grid; place-items: center; transition: all var(--duration-fast);
}
.row-btn:hover { background: var(--error-bg); color: var(--error); }
.row-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.row-btn svg { width: 14px; height: 14px; }
.error-text {
    font-size: 10.5px; color: var(--error); line-height: 1.4;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.grid-empty {
    padding: var(--space-2xl) var(--space-md); text-align: center;
    font-size: var(--fs-small); color: var(--text-tertiary); line-height: 1.6;
}
.grid-empty span { font-size: 11px; color: var(--text-tertiary); opacity: 0.8; }

/* 结果 */
.results-card { width: 100%; animation: fadeUp 0.5s var(--ease-out); }
.results-meta { font-size: var(--fs-small); color: var(--text-tertiary); }
.results-meta strong { color: var(--primary); font-weight: var(--fw-semibold); }
.result-row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 20px; border-bottom: 1px solid var(--border-light); min-width: 0;
}
.result-row:last-child { border-bottom: none; }
.result-name {
    font-size: 12.5px; font-weight: var(--fw-semibold); color: var(--text-primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.result-sub { font-size: 10.5px; color: var(--text-tertiary); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-actions { margin-left: auto; display: flex; gap: 6px; flex-shrink: 0; }

/* 按钮 */
.action-row {
    width: 100%; display: flex; align-items: center; justify-content: center;
    gap: var(--space-md); flex-wrap: wrap; margin-top: var(--space-md);
    animation: fadeUp 0.5s var(--ease-out) 0.05s both;
}
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px 28px; border-radius: var(--radius-full); border: none;
    font-size: var(--fs-body); font-weight: var(--fw-semibold);
    cursor: pointer; transition: all var(--duration-normal) var(--ease-out);
    white-space: nowrap; min-width: 0;
}
.btn-primary {
    background: var(--primary); color: var(--text-on-primary);
    box-shadow: 0 2px 8px rgba(139,32,32,0.20);
}
.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover); box-shadow: 0 4px 16px rgba(139,32,32,0.25);
    transform: translateY(-1px);
}
.btn-primary:active:not(:disabled) { background: var(--primary-active); transform: translateY(0); }
.btn-outline {
    background: var(--bg-card); color: var(--primary);
    border: 1px solid var(--primary); box-shadow: none;
}
.btn-outline:hover:not(:disabled) { background: var(--primary-subtle); box-shadow: var(--shadow-sm); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.btn-sm { padding: 9px 20px; font-size: var(--fs-caption); }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.retouch-num { font-size: var(--fs-small); font-weight: var(--fw-medium); opacity: 0.85; }

/* 进度 */
.progress-section { width: 100%; max-width: 560px; animation: fadeScale var(--duration-normal) var(--ease-spring); }
.progress-track { width: 100%; height: 4px; background: var(--bg-subtle); border-radius: 2px; overflow: hidden; }
.progress-fill {
    height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent-red), #A52A2A);
    border-radius: 2px; transition: width 0.3s var(--ease-out); position: relative;
}
.progress-fill::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 1.5s ease-in-out infinite;
}
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.progress-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; gap: 8px; }
.progress-text { font-size: var(--fs-small); color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-percent { font-size: var(--fs-caption); font-weight: var(--fw-semibold); color: var(--primary); font-variant-numeric: tabular-nums; }
.foot-note { font-size: 11px; color: var(--text-tertiary); text-align: center; }

/* 弹窗 */
.modal-overlay {
    position: fixed; inset: 0; z-index: 9998; display: flex; align-items: center; justify-content: center;
    padding: 20px; background: rgba(22,22,24,0.42);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    opacity: 0; visibility: hidden; transition: opacity var(--duration-normal), visibility var(--duration-normal);
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
    width: min(680px, 100%); max-height: calc(100vh - 40px);
    background: var(--bg-card); border-radius: var(--radius-xl); box-shadow: var(--shadow-xl);
    display: flex; flex-direction: column; overflow: hidden; min-width: 0;
    transform: translateY(10px) scale(0.985); transition: transform var(--duration-normal) var(--ease-out);
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal--wide { width: min(1040px, 100%); }
.modal--slim { width: min(480px, 100%); }

/* 文件超限弹窗：桌面端下载按钮 */
.dl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.dl-btn {
    display: flex; align-items: center; gap: 11px; padding: 12px 14px; min-width: 0;
    background: var(--bg-page); border: 1px solid var(--border-default);
    border-radius: var(--radius-lg); color: var(--text-primary); text-decoration: none;
    transition: all var(--duration-fast) var(--ease-out); cursor: pointer;
}
.dl-btn:hover { border-color: var(--primary); background: var(--primary-subtle); box-shadow: var(--shadow-sm); }
.dl-btn svg { width: 20px; height: 20px; color: var(--text-secondary); flex-shrink: 0; }
.dl-btn:hover svg { color: var(--primary); }
.dl-btn-text { display: flex; flex-direction: column; min-width: 0; }
.dl-btn-text strong { font-size: 13px; font-weight: var(--fw-semibold); line-height: 1.3; }
.dl-btn-text em { font-style: normal; font-size: 11px; color: var(--text-tertiary); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-head {
    padding: 20px 24px 14px; display: flex; align-items: flex-start; gap: 12px;
    border-bottom: 1px solid var(--border-light); flex-shrink: 0; min-width: 0;
}
.modal-head-text { min-width: 0; }
.modal-head h2 { font-size: var(--fs-title); font-weight: var(--fw-semibold); letter-spacing: -0.01em; line-height: 1.25; }
.modal-head p { font-size: var(--fs-small); color: var(--text-tertiary); margin-top: 3px; }
.modal-close {
    margin-left: auto; width: 32px; height: 32px; border: none; background: var(--bg-subtle);
    border-radius: 50%; color: var(--text-secondary); cursor: pointer; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; transition: all var(--duration-fast);
}
.modal-close:hover { background: var(--error-bg); color: var(--error); }
.modal-close svg { width: 15px; height: 15px; }
.modal-body {
    padding: 18px 24px 8px; overflow-y: auto; overscroll-behavior: contain;
    flex: 1; min-height: 0;
}
.modal-foot {
    padding: 14px 24px 20px; display: flex; align-items: center; gap: 10px;
    border-top: 1px solid var(--border-light); flex-shrink: 0; flex-wrap: wrap;
    position: relative;
}
.foot-hint { font-size: 11px; color: var(--text-tertiary); }
.foot-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* 引擎 */
.model-intro {
    padding: 12px 14px; border-radius: var(--radius-md); background: var(--bg-page);
    border: 1px solid var(--border-light); font-size: var(--fs-small); color: var(--text-secondary);
    line-height: 1.6; margin-bottom: 16px;
}
.model-intro strong { color: var(--primary); font-weight: var(--fw-semibold); }
.engine-status-card {
    padding: 14px 16px; border: 1px solid var(--border-default); border-radius: var(--radius-md);
    background: var(--bg-page); display: flex; flex-direction: column; gap: 10px;
}
.engine-status-main { display: flex; align-items: center; gap: 12px; }
.dot {
    width: 8px; height: 8px; border-radius: 50%; background: var(--text-tertiary); flex-shrink: 0;
    box-shadow: 0 0 0 4px rgba(174,174,178,0.14);
}
.dot.green { background: var(--success); box-shadow: 0 0 0 4px rgba(52,199,89,0.12); }
.dot.amber { background: var(--warning); box-shadow: 0 0 0 4px rgba(255,149,0,0.12); }
.dot.red { background: var(--error); box-shadow: 0 0 0 4px rgba(255,59,48,0.10); }
.engine-status-text { min-width: 0; }
.engine-state-title { font-size: var(--fs-caption); font-weight: var(--fw-semibold); color: var(--text-primary); }
.engine-state-sub { font-size: 11px; color: var(--text-tertiary); margin-top: 1px; }
.engine-meta { font-size: 11px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.model-progress { display: none; height: 4px; background: var(--bg-subtle); border-radius: 2px; overflow: hidden; }
.model-progress.show { display: block; }
.model-progress-fill { height: 100%; width: 0%; background: var(--primary); transition: width 0.2s var(--ease-out); }
.engine-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.guide-tip {
    padding: 12px 14px; border-radius: var(--radius-md); background: var(--bg-page);
    border: 1px solid var(--border-light); font-size: 12px; color: var(--text-secondary); line-height: 1.7;
}
.guide-tip strong { display: block; color: var(--text-primary); margin-bottom: 4px; }

/* 使用说明 */
.guide-step { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-light); }
.guide-step:last-child { border-bottom: none; padding-bottom: 0; }
.guide-num {
    width: 22px; height: 22px; border-radius: 50%; background: var(--primary-subtle);
    color: var(--primary); font-size: 11px; font-weight: var(--fw-bold);
    display: grid; place-items: center; flex-shrink: 0; margin-top: 1px;
}
.guide-step h3 { font-size: 13px; font-weight: var(--fw-semibold); color: var(--text-primary); margin-bottom: 3px; }
.guide-step p { font-size: 12px; color: var(--text-secondary); line-height: 1.65; }
.guide-step ul { margin: 5px 0 0 16px; padding: 0; font-size: 12px; color: var(--text-secondary); line-height: 1.65; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeScale { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }

/* 平板 */
@media (max-width: 980px) {
    .workspace { grid-template-columns: 1fr; }
    .settings-card { position: static; }
    .feature-grid { grid-template-columns: repeat(3, 1fr); }
}
/* 手机 */
@media (max-width: 640px) {
    .container { padding: var(--space-2xl) var(--space-md) var(--space-xl); gap: var(--space-md); }
    .header { padding-top: 10px; }
    .header h1 { font-size: 24px; }
    .header p { font-size: var(--fs-small); }
    .steps { gap: 4px; }
    .step { padding: 5px 10px; font-size: 11px; }
    .step-sep { display: none; }
    .upload-zone { padding: var(--space-xl) var(--space-md); }
    .upload-compact { padding: var(--space-md); gap: 10px; }
    .feature-grid { grid-template-columns: 1fr; }
    .card-head { padding: var(--space-md); gap: 6px; }
    .filter-body { padding: 0 var(--space-md) var(--space-md); }
    .file-row, .result-row { padding: 12px var(--space-md); gap: 10px; }
    .file-icon { width: 32px; height: 32px; }
    .queue-note { display: none; }
    .action-row { gap: 8px; }
    .btn { flex: 1 1 46%; padding: 12px 16px; font-size: var(--fs-caption); }
    .back-home { position: absolute; top: 8px; left: 8px; padding: 4px 8px; font-size: 11px; gap: 3px; }
    .back-home svg { width: 12px; height: 12px; }
    .contact-service { top: 8px; right: 8px; }
    .contact-btn { padding: 4px 10px; font-size: 11px; gap: 4px; }
    .contact-btn svg { width: 12px; height: 12px; }
    .contact-dropdown { width: 150px; }
    .modal-overlay { padding: 10px; align-items: flex-end; }
    .modal { max-height: calc(100vh - 20px); border-radius: var(--radius-xl) var(--radius-xl) 14px 14px; }
    .modal-head { padding: 16px 18px 12px; }
    .modal-head h2 { font-size: 18px; }
    .modal-body { padding: 14px 18px 6px; }
    .modal-foot { padding: 12px 18px calc(14px + env(safe-area-inset-bottom, 0px)); gap: 8px; }
    .foot-hint { display: none; }
    .foot-actions { margin-left: 0; width: 100%; }
    .foot-actions .btn { flex: 1; padding: 10px 14px; }
    .results-card .head-right { width: 100%; margin-left: 0; }
    .results-card .head-right .mini-primary,
    .results-card .head-right .mini-plain { flex: 1; text-align: center; }
    .result-actions { margin-left: 0; width: 100%; }
    .result-actions .mini-btn { flex: 1; }
    .result-row { flex-wrap: wrap; }
    .dl-grid { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
    .upload-hint { font-size: 11px; }
    .pill { padding: 6px 12px; }
    .pill-group--sm .pill { padding: 5px 10px; }
    .steps { gap: 3px; }
    .step { padding: 4px 8px; font-size: 10px; gap: 4px; }
    .step b { width: 15px; height: 15px; font-size: 9px; }
    .file-name { font-size: 12px; }
    .status-tag { font-size: 10px; padding: 2px 7px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
