:root {
  color-scheme: light;
  --ink: #19202a;
  --muted: #677080;
  --line: #d9dee7;
  --panel: #ffffff;
  --bg: #f3f6fa;
  --primary: #0f766e;
  --danger: #b42318;
  --accent: #2563eb;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, "Microsoft YaHei", sans-serif; color: var(--ink); background: var(--bg); }
button, input, select, textarea { font: inherit; }
button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 8px 12px; cursor: pointer; }
button:hover { border-color: var(--primary); }
button.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
button.danger { color: var(--danger); border-color: #efb3ad; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; background: #fff; }
textarea { min-height: 82px; resize: vertical; }
label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; margin: 14px 0 10px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 20px 28px; background: #fff; border-bottom: 1px solid var(--line); }
.topbar p { margin-top: 6px; color: var(--muted); }
.toolbar, .asset-tools, .asset-group-tools, .asset-group-create, .asset-add, .row, footer { display: flex; align-items: center; gap: 10px; }
.page { padding: 24px 28px; }
.panel, .modal-body, .drawer-body { background: var(--panel); }
.panel { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.data-table th, .data-table td { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; vertical-align: middle; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-table th { background: #eef3f8; color: #344054; }
.data-table img, .data-table video { width: 58px; height: 40px; object-fit: cover; border-radius: 4px; background: #dce3ea; }
.data-table audio { width: 120px; }
#outputVideo { width: 100%; max-height: 68vh; background: #111827; border-radius: 8px; }
.output-list { display: flex; flex-wrap: wrap; gap: 8px; }
.output-list button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.badge { display: inline-block; min-width: 64px; text-align: center; border-radius: 999px; padding: 4px 8px; font-size: 12px; background: #e8eef8; color: #344054; }
.badge.running { background: #dbeafe; color: #1d4ed8; }
.badge.success { background: #dcfce7; color: #15803d; }
.badge.failed { background: #fee2e2; color: #b91c1c; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.actions button { padding: 5px 8px; font-size: 12px; }
dialog { border: 0; padding: 0; border-radius: 8px; box-shadow: 0 24px 60px rgba(15, 23, 42, .22); }
dialog::backdrop { background: rgba(15, 23, 42, .36); }
.modal { width: min(960px, calc(100vw - 48px)); }
.modal.small { width: min(520px, calc(100vw - 48px)); }
.modal.wide { width: min(1280px, calc(100vw - 28px)); }
.modal-body { padding: 18px; display: grid; gap: 14px; max-height: 86vh; overflow: auto; }
.modal-body header, .drawer-body header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.modal-body header button, .drawer-body header button { width: 34px; height: 34px; padding: 0; font-size: 22px; }
.drawer { width: min(1180px, calc(100vw - 20px)); height: calc(100vh - 20px); margin-left: auto; margin-right: 10px; }
.drawer-body { position: relative; min-height: 100%; padding: 18px; display: grid; grid-template-rows: auto 1fr auto; gap: 14px; overflow: hidden; }
.drawer-header-actions { display: flex; align-items: center; gap: 8px; }
.drawer-page-switch { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; }
.drawer-page-switch button { width: auto; min-width: 104px; height: 32px; padding: 0 12px; border-radius: 6px; font-size: 14px; line-height: 1; white-space: nowrap; }
.drawer-page-switch button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.task-page[hidden] { display: none !important; }
.drawer-grid { display: grid; grid-template-columns: 1fr 1fr 360px; gap: 18px; overflow: hidden; }
.drawer-grid section { overflow: auto; padding-right: 6px; }
.batch-settings-page { overflow: auto; display: grid; grid-template-rows: auto 1fr; gap: 14px; padding-right: 4px; }
.batch-settings-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; }
.batch-settings-hero p { margin-top: 4px; color: var(--muted); font-size: 13px; }
.batch-settings-hero button { width: auto; height: 34px; padding: 0 14px; font-size: 13px; }
.batch-settings-content { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.template-settings-page { overflow: auto; display: grid; grid-template-rows: auto 1fr; gap: 14px; padding-right: 4px; }
.template-settings-content { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.batch-settings-block { border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: #f8fafc; display: grid; gap: 10px; }
.batch-settings-block h3 { margin-top: 0; }
.batch-settings-block:first-child { grid-column: 1 / -1; }
.template-enable { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.template-preset-grid label { display: grid; grid-template-columns: auto 1fr; gap: 5px 8px; align-items: start; color: var(--ink); padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.template-enable input, .template-preset-grid input { width: auto; }
.template-preset-grid span { grid-column: 2; color: var(--muted); font-size: 12px; line-height: 1.45; }
.template-preset-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.template-preview-layer { position: absolute; pointer-events: none; z-index: 1; }
.template-preview-band { left: 0; width: 100%; background: rgba(17, 24, 39, .9); background-size: cover; background-position: center; }
.template-preview-window { border: 1px solid rgba(255,255,255,.55); box-shadow: 0 0 0 999px rgba(17,24,39,.22); border-radius: 10px; }
.batch-bgm-panel { display: grid; gap: 10px; }
.batch-bgm-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.batch-bgm-actions button { flex: 0 0 auto; }
.batch-bgm-actions span { color: var(--muted); font-size: 12px; text-align: right; }
.row > label { flex: 1; }
.switches { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.switches label { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.switches input { width: auto; }
.effect-options { margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; display: grid; gap: 10px; }
.effect-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.effect-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.effect-grid label { display: flex; align-items: center; gap: 7px; color: var(--ink); font-size: 12px; }
.effect-grid input { width: auto; }
.effect-options.disabled .effect-grid { opacity: .48; }
.asset-section { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: grid; gap: 10px; background: #f8fafc; }
.asset-section-title { display: flex; justify-content: space-between; gap: 12px; align-items: center; color: var(--ink); }
.asset-section-title span { color: var(--muted); font-size: 12px; }
.asset-tools { display: grid; grid-template-columns: 150px 130px 1fr auto auto auto auto; }
.asset-manage-grid { display: grid; grid-template-columns: minmax(420px, 1fr) minmax(260px, 360px); gap: 12px; align-items: start; }
.asset-group-tools { display: grid; grid-template-columns: 1fr auto; }
.asset-group-create { display: grid; grid-template-columns: 1fr auto; }
.asset-group-list { display: grid; gap: 8px; max-height: 180px; overflow: auto; }
.asset-group-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; }
.asset-group-row button { padding: 6px 10px; font-size: 12px; }
.asset-row-group { min-width: 112px; padding: 5px 8px; font-size: 12px; }
.asset-add { padding: 12px; background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; }
.asset-add.compact { display: grid; grid-template-columns: 1fr auto; margin: 10px 0; }
.task-material-section { margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; display: grid; gap: 10px; }
.task-material-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.task-material-head span { color: var(--muted); font-size: 12px; text-align: right; }
.task-note { color: var(--muted); font-size: 12px; line-height: 1.45; padding: 8px 10px; border-left: 3px solid #93c5fd; background: #eff6ff; border-radius: 6px; }
.task-bgm-actions { display: grid; gap: 10px; }
.task-bgm-actions > button { width: 100%; }
.task-bgm-upload { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.task-bgm-upload input { min-width: 0; }
.task-bgm-rotate { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.task-bgm-rotate input { width: auto; }
.upload-progress { grid-column: 1 / -1; display: grid; gap: 6px; min-width: 240px; }
.upload-progress[hidden] { display: none; }
.upload-progress-head, .pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; }
.upload-progress-bar { height: 8px; border-radius: 999px; background: #e5e7eb; overflow: hidden; }
.upload-progress-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--primary); transition: width .18s ease; }
.pager { justify-content: center; padding: 8px 0 0; }
.pager button:disabled { opacity: .45; cursor: not-allowed; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; min-height: 36px; padding: 8px; border: 1px dashed var(--line); border-radius: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: #edf7f6; color: #0f766e; border-radius: 999px; padding: 5px 9px; font-size: 12px; }
#selectedAssets[hidden] { display: none !important; }
.asset-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; min-height: 36px; padding: 8px; border: 1px dashed var(--line); border-radius: 6px; background: #fff; }
.asset-card-grid .hint { grid-column: 1 / -1; align-self: center; }
.selected-asset-card { position: relative; min-width: 0; display: grid; grid-template-columns: 48px minmax(0, 1fr) 30px; gap: 8px; align-items: center; padding: 8px; border: 1px solid #dbe3ee; border-radius: 8px; background: #fdfefe; }
.selected-asset-thumb { width: 48px; height: 42px; border-radius: 6px; overflow: hidden; background: #edf2f7; display: grid; place-items: center; color: var(--primary); font-weight: 700; font-size: 18px; }
.selected-asset-thumb img, .selected-asset-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.selected-asset-info { min-width: 0; display: grid; gap: 3px; }
.selected-asset-type { color: var(--primary); font-size: 12px; line-height: 1; }
.selected-asset-name { color: var(--ink); font-size: 12px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-all; }
.selected-asset-remove { width: 30px; height: 30px; padding: 0; border-radius: 6px; }
.tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.tabs button.active { background: #e6f4f2; border-color: var(--primary); color: var(--primary); }
.text-panel { display: none; gap: 10px; }
.text-panel.active { display: grid; }
.inline-options { border: 1px solid var(--line); border-radius: 6px; padding: 10px; display: grid; gap: 8px; }
.inline-options legend { color: var(--accent); font-weight: 600; }
.inline-options label { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.inline-options input { width: auto; }
.pronunciation-box { border: 1px solid var(--line); border-radius: 6px; padding: 10px; display: grid; gap: 8px; background: #f8fafc; }
.pronunciation-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pronunciation-head button, .pronunciation-row button { padding: 6px 10px; font-size: 12px; }
.pronunciation-rows { display: grid; gap: 8px; }
.pronunciation-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 8px; align-items: center; }
.title-variants, .subtitle-variants { margin-top: 14px; border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #f8fafc; display: grid; gap: 10px; }
.title-motion-box { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fff; display: grid; gap: 10px; }
.title-variant-enable, .title-variant-controls > label, .subtitle-variant-enable, .subtitle-variant-controls > label, .title-motion-enable, .title-motion-targets label, .motion-effect-grid label { display: flex; align-items: center; justify-content: flex-start; gap: 8px; color: var(--ink); line-height: 1.45; }
.title-variant-enable input, .title-variant-controls > label input, .subtitle-variant-enable input, .subtitle-variant-controls > label input, .title-motion-enable input, .title-motion-targets input, .motion-effect-grid input { width: auto; flex: 0 0 auto; margin: 0; }
.title-variant-controls, .subtitle-variant-controls { display: grid; gap: 10px; }
.title-motion-controls { display: grid; gap: 10px; }
.title-motion-targets { display: flex; gap: 16px; flex-wrap: wrap; }
.motion-group-title { color: var(--ink); font-size: 13px; margin-top: 4px; }
.motion-effect-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; max-height: 210px; overflow: auto; padding-right: 4px; }
.motion-effect-grid label { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: #f8fafc; font-size: 12px; }
.tabs.compact { margin-bottom: 0; }
.tabs.compact button { padding: 7px 10px; font-size: 13px; }
.title-variant-head, .subtitle-variant-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.title-variant-head button, .subtitle-variant-head button, #btnApplyTitleVariantImport, #btnApplySubtitleVariantImport { padding: 6px 10px; font-size: 12px; }
.title-variant-rows, .subtitle-variant-rows { display: grid; gap: 8px; max-height: 260px; overflow: auto; padding-right: 4px; }
.title-variant-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: start; }
.subtitle-variant-row { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; align-items: start; }
.title-variant-index, .subtitle-variant-index { color: var(--muted); font-size: 13px; text-align: right; }
.title-variant-row textarea, .subtitle-variant-row textarea { min-height: 74px; resize: vertical; }
#titleVariantImportText, #subtitleVariantImportText { min-height: 140px; }
.phone { box-sizing: content-box; position: relative; width: 260px; height: 462px; margin: 0 auto 14px; border: 10px solid #111827; border-radius: 30px; background: linear-gradient(180deg, #9ad7e5, #f3d2a0 42%, #424b55); overflow: hidden; }
.phone.horizontal { width: 340px; height: 191px; border-radius: 24px; }
.phone .preview-text { position: absolute; z-index: 3; box-sizing: border-box; min-height: 1em; padding: 0 2px; margin: 0; text-align: center; white-space: pre; overflow-wrap: normal; word-break: keep-all; line-height: 1.18; text-shadow: 0 1px 2px rgba(0,0,0,.26); }
#previewTitle { font-weight: 700; color: #111; background: rgba(255,255,255,.8); }
#previewTitle2 { color: #fff; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,.9), 0 0 4px rgba(0,0,0,.55); }
#previewSubtitle { color: #fff; }
.preview-motion-heartbeat { animation: previewHeartbeat 1.2s ease-in-out infinite; }
.preview-motion-jump { animation: previewJump 1s ease-in-out infinite; }
.preview-motion-wave { animation: previewWave 1.4s ease-in-out infinite; }
.preview-motion-swing { animation: previewSwing 1.4s ease-in-out infinite; transform-origin: center top; }
.preview-motion-inout { animation: previewInOut 2.4s ease-in-out infinite; }
@keyframes previewHeartbeat { 0%, 100% { scale: 1; } 42% { scale: 1.08; } 62% { scale: .98; } }
@keyframes previewJump { 0%, 100% { translate: 0 0; } 45% { translate: 0 -8px; } }
@keyframes previewWave { 0%, 100% { translate: 0 0; } 35% { translate: 0 -4px; } 70% { translate: 0 3px; } }
@keyframes previewSwing { 0%, 100% { rotate: 0deg; } 30% { rotate: 2deg; } 70% { rotate: -2deg; } }
@keyframes previewInOut { 0% { opacity: .15; scale: .92; } 22%, 78% { opacity: 1; scale: 1; } 100% { opacity: .2; scale: .96; } }
pre { min-height: 210px; max-height: 320px; overflow: auto; background: #101828; color: #d1fadf; border-radius: 8px; padding: 12px; font-size: 12px; white-space: pre-wrap; }
.style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.style-card { min-height: 74px; border: 1px solid var(--line); border-radius: 8px; padding: 12px; cursor: pointer; display: grid; place-items: center; text-align: center; background: #fff; }
.fx-cyan { color: #00c2ff; text-shadow: 0 0 8px #00c2ff; }
.fx-red { color: #ef4444; text-shadow: 1px 1px #fff, 2px 2px #111; }
.fx-rainbow { background: linear-gradient(90deg, #ef4444, #f59e0b, #22c55e, #2563eb); -webkit-background-clip: text; color: transparent; font-weight: 700; }
.fx-yellow { color: #facc15; text-shadow: 2px 2px #111; }
.fx-blue { color: #60a5fa; text-shadow: 1px 1px #fff; }
.fx-black { color: #111; text-shadow: 1px 1px #fff; }
.fx-silver { color: #94a3b8; text-shadow: 1px 1px #475569; }
.fx-pink { color: #ec4899; text-shadow: 0 0 8px #f9a8d4; }
.fx-green { color: #22c55e; text-shadow: 1px 1px #064e3b; }
.fx-purple { color: #a855f7; text-shadow: 0 0 8px #c084fc; }
.fx-gold { color: #f8c44f; text-shadow: 0 2px #7c3f00, 0 0 10px #f59e0b; font-weight: 800; }
.fx-neon { color: #34f5c5; text-shadow: 0 0 5px #34f5c5, 0 0 12px #0ea5e9; font-weight: 800; }
.fx-heavy-white { color: #fff; text-shadow: 0 2px #111827, 2px 0 #111827, 0 0 8px #64748b; font-weight: 800; }
.fx-orange-pop { color: #fb923c; text-shadow: 2px 2px #7c2d12, -1px -1px #fff7ed; font-weight: 800; }
.fx-electric { color: #c4b5fd; text-shadow: 0 0 6px #7c3aed, 0 0 14px #2563eb; font-weight: 800; }
.fx-red-gold { color: #ef4444; text-shadow: 1px 1px #fef3c7, 3px 3px #92400e; font-weight: 800; }
.fx-cream-pink { color: #fff1f2; text-shadow: 0 2px #f472b6, 0 0 8px #fb7185; font-weight: 800; }
.fx-black-gold { color: #111827; text-shadow: 1px 1px #fde68a, 3px 3px #b45309; font-weight: 900; }
.fx-aqua { color: #bae6fd; text-shadow: 0 2px #0369a1, 0 0 9px #38bdf8; font-weight: 800; }
.fx-live-blue { color: #eff6ff; text-shadow: 2px 2px #1d4ed8, 0 0 8px #60a5fa; font-weight: 800; }
.fx-strong-red { color: #ff3b30; text-shadow: 0 2px #7f1d1d, 0 0 10px #f97316; font-weight: 900; }
.fx-strong-blue { color: #38bdf8; text-shadow: 0 2px #1e3a8a, 0 0 12px #2563eb; font-weight: 900; }
.fx-strong-gold { color: #facc15; text-shadow: 0 2px #713f12, 0 0 12px #f59e0b; font-weight: 900; }
.fx-strong-green { color: #4ade80; text-shadow: 0 2px #064e3b, 0 0 10px #22c55e; font-weight: 900; }
.fx-strong-purple { color: #c084fc; text-shadow: 0 2px #581c87, 0 0 12px #a855f7; font-weight: 900; }
.fx-strong-orange { color: #fb923c; text-shadow: 0 2px #7c2d12, 0 0 12px #f97316; font-weight: 900; }
.fx-strong-pink { color: #f472b6; text-shadow: 0 2px #831843, 0 0 12px #ec4899; font-weight: 900; }
.fx-strong-cyan { color: #22d3ee; text-shadow: 0 2px #155e75, 0 0 12px #06b6d4; font-weight: 900; }
.fx-strong-fire { color: #f43f5e; text-shadow: 0 2px #7f1d1d, 0 0 14px #fb923c; font-weight: 900; }
.fx-strong-lime { color: #bef264; text-shadow: 0 2px #365314, 0 0 12px #84cc16; font-weight: 900; }
.fx-strong-royal { color: #818cf8; text-shadow: 0 2px #312e81, 0 0 13px #4f46e5; font-weight: 900; }
.fx-strong-magenta { color: #e879f9; text-shadow: 0 2px #701a75, 0 0 12px #d946ef; font-weight: 900; }
.hint { color: var(--muted); font-size: 13px; }
@media (max-width: 980px) {
  .topbar, .toolbar { align-items: stretch; flex-direction: column; }
  .drawer-grid { grid-template-columns: 1fr; }
  .asset-tools, .asset-manage-grid, .asset-group-tools, .asset-group-create, .asset-group-row, .asset-add, .task-bgm-upload, .pronunciation-row, .title-variant-row, .subtitle-variant-row { grid-template-columns: 1fr; display: grid; }
  .drawer-body header, .batch-settings-hero, .batch-bgm-actions { align-items: stretch; flex-direction: column; }
  .drawer-header-actions { align-items: stretch; width: 100%; }
  .drawer-page-switch { flex: 1; }
  .drawer-page-switch button { flex: 1; }
  .batch-settings-content, .template-settings-content { grid-template-columns: 1fr; }
  .batch-settings-block:first-child { grid-column: auto; }
  .template-preset-grid { grid-template-columns: 1fr; }
  .batch-bgm-actions span { text-align: left; }
  .task-material-head { align-items: flex-start; flex-direction: column; }
  .task-material-head span { text-align: left; }
  .asset-card-grid, .motion-effect-grid { grid-template-columns: 1fr; }
}
