:root {
    color-scheme: light;
    --ink: #0f172a;
    --muted: #64748b;
    --soft: #f8fafc;
    --canvas: #eef2f7;
    --line: #dfe5ec;
    --line-strong: #cbd5e1;
    --panel: #ffffff;
    --accent: #2563eb;
    --accent-dark: #1d4ed8;
    --accent-soft: #eff6ff;
    --shadow: 0 8px 24px rgba(15, 23, 42, .07);
}

* { box-sizing: border-box; }
html, body { width: 100%; min-width: 320px; height: 100%; margin: 0; overflow: hidden; }
body { color: var(--ink); background: var(--canvas); font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif; letter-spacing: 0; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.topbar { position: relative; display: grid; grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr); align-items: center; height: 60px; padding: 0 32px; border-bottom: 1px solid #dbe7f5; background: rgba(255, 255, 255, .94); box-shadow: 0 1px 12px rgba(37, 99, 235, .05); backdrop-filter: blur(12px); }
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: var(--ink); font-size: 14px; font-weight: 750; text-decoration: none; }
.brand img { width: 30px; height: 30px; border-radius: 7px; object-fit: cover; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-nav { display: flex; height: 100%; align-items: center; gap: 4px; }
.product-nav a { display: grid; min-width: auto; height: 34px; padding: 0 10px; place-items: center; border-radius: 6px; color: #515154; font-size: 12px; font-weight: 500; text-decoration: none; white-space: nowrap; transition: color .18s ease, background .18s ease; }
.product-nav a:hover { color: #1d1d1f; background: rgba(0, 0, 0, .04); }
.product-nav a.active { color: #1d1d1f; background: rgba(37, 99, 235, .1); font-weight: 700; }
.top-actions { display: flex; justify-content: flex-end; gap: 6px; }

.app-shell { display: grid; grid-template-columns: 372px minmax(0, 1fr) 220px; height: calc(100vh - 58px); min-height: 0; gap: 12px; padding: 12px; }
.settings-panel, .workspace, .slide-rail { min-width: 0; min-height: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); box-shadow: var(--shadow); }
.settings-panel { z-index: 20; display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
.panel-heading { display: flex; min-height: 62px; padding: 13px 14px 11px; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--line); }
.panel-heading h1 { margin: 0; font-size: 18px; line-height: 1.2; }
.panel-heading p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }

#pptForm { display: grid; min-height: 0; padding: 10px 12px 12px; grid-template-rows: auto auto auto minmax(108px, 1fr) auto; gap: 8px; overflow: hidden; }
.form-section { min-width: 0; padding: 9px 10px; border: 1px solid #e5eaf0; border-radius: 8px; background: var(--soft); }
.field-label { display: block; margin: 0 0 6px; color: #334155; font-size: 11px; font-weight: 750; }
.field-row, .field-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.field-row .field-label { margin-bottom: 0; }
.field-meta, .quiet-label { color: #8894a3; font-size: 10px; }

input, select, textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 7px; color: var(--ink); background: #fff; transition: border-color .15s ease, box-shadow .15s ease; }
input, select { height: 34px; padding: 0 9px; font-size: 12px; }
textarea { height: 78px; min-height: 78px; padding: 8px 10px; resize: none; font-size: 12px; line-height: 1.5; }
input:hover, select:hover, textarea:hover { border-color: #aeb9c6; }
input:focus, select:focus, textarea:focus { border-color: #7aa7f8; box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.field-meta { margin-top: 4px; }

.page-options { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: end; gap: 8px 12px; }
.page-options .field-label { margin-bottom: 4px; }
.auto-design-note { display: inline-flex; min-width: 0; height: 34px; align-items: center; gap: 6px; color: #64748b; font-size: 10px; }
.auto-design-note svg { width: 14px; height: 14px; flex: 0 0 auto; color: var(--accent); }
.field-warning { display: block; grid-column: 1 / -1; margin-top: -2px; color: #a15c05; font-size: 9px; line-height: 1.25; white-space: nowrap; }
.field-warning[hidden] { display: none; }
.advanced-settings { min-width: 0; border: 1px solid #dce4ed; border-radius: 8px; background: #fff; }
.advanced-settings summary { display: flex; height: 39px; padding: 0 10px; align-items: center; justify-content: space-between; color: #334155; cursor: pointer; list-style: none; }
.advanced-settings summary::-webkit-details-marker { display: none; }
.advanced-settings summary > span { display: inline-flex; align-items: center; gap: 7px; }
.advanced-settings summary svg { width: 15px; height: 15px; color: var(--accent); }
.advanced-settings summary strong { font-size: 11px; }
.advanced-settings summary small { color: #94a3b8; font-size: 9px; font-weight: 500; }
.advanced-settings .summary-chevron { color: #7c8998; transition: transform .16s ease; }
.advanced-settings[open] .summary-chevron { transform: rotate(180deg); }
.advanced-body { display: grid; padding: 9px 10px 10px; grid-template-columns: 1fr 1fr; gap: 8px; border-top: 1px solid #e7ecf2; background: #f8fafc; }
.advanced-body label { min-width: 0; }
.palette-control { grid-column: 1 / -1; }
.toggle-row { display: flex; min-height: 30px; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; }
.toggle-row > span { display: grid; gap: 1px; }
.toggle-row strong { color: #334155; font-size: 10px; }
.toggle-row small { color: #8995a4; font-size: 9px; }
.toggle-row input { position: relative; width: 32px; height: 18px; padding: 0; flex: 0 0 auto; border: 0; border-radius: 10px; appearance: none; background: #cbd5e1; cursor: pointer; transition: background .15s ease; }
.toggle-row input::after { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .25); content: ""; transition: transform .15s ease; }
.toggle-row input:checked { background: var(--accent); }
.toggle-row input:checked::after { transform: translateX(14px); }
.style-swatch { display: grid; grid-template-columns: repeat(4, 1fr); height: 20px; margin-top: 5px; gap: 4px; }
.style-swatch[hidden] { display: none; }
.style-swatch input[type="color"] { width: 100%; height: 20px; padding: 0; overflow: hidden; border: 0; border-radius: 4px; background: transparent; cursor: pointer; }
.style-swatch input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.style-swatch input[type="color"]::-webkit-color-swatch { border: 1px solid #cbd5e1; border-radius: 4px; }
.style-swatch input[type="color"]::-moz-color-swatch { border: 1px solid #cbd5e1; border-radius: 4px; }

.assets-section { display: flex; min-height: 0; flex-direction: column; }
.asset-upload-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.purpose-upload { position: relative; display: grid; min-width: 0; min-height: 58px; padding: 8px; grid-template-columns: 18px minmax(0, 1fr); align-items: start; gap: 6px; border: 1px solid #d7e0eb; border-radius: 7px; color: #334155; background: #fff; cursor: pointer; text-align: left; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.purpose-upload:hover { border-color: #7ba8ef; background: var(--accent-soft); box-shadow: 0 0 0 2px rgba(37, 99, 235, .08); }
.purpose-upload.is-loading { border-color: #93b4ea; color: #1d4ed8; background: #eff6ff; cursor: wait; pointer-events: none; }
.purpose-upload svg { width: 17px; height: 17px; margin-top: 1px; color: var(--accent); }
.purpose-upload span { display: grid; min-width: 0; gap: 3px; }
.purpose-upload strong { font-size: 11px; }
.purpose-upload small { color: #7b8796; font-size: 9px; line-height: 1.35; }
.purpose-upload .upload-spinner { display: none; position: absolute; top: 8px; right: 8px; width: 13px; height: 13px; border: 2px solid #bfdbfe; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.purpose-upload.is-loading .upload-spinner { display: block; }
.asset-option { display: flex; min-height: 34px; margin-top: 6px; padding: 5px 7px; align-items: center; gap: 7px; border: 1px solid #e1e7ef; border-radius: 6px; color: #475569; background: #fff; cursor: pointer; }
.asset-option input { width: 15px; height: 15px; margin: 0; flex: 0 0 auto; accent-color: var(--accent); }
.asset-option span { display: grid; min-width: 0; gap: 1px; }
.asset-option strong { font-size: 10px; }
.asset-option small { color: #8995a4; font-size: 9px; }
.asset-option:has(input:disabled) { opacity: .52; cursor: default; }
.source-summary { margin-top: 6px; padding: 6px 8px; border-left: 3px solid #2f7c77; border-radius: 0 5px 5px 0; color: #4f5b65; background: #edf8f6; font-size: 10px; line-height: 1.35; }
.asset-list { display: grid; min-height: 0; margin-top: 6px; flex: 1 1 auto; align-content: start; gap: 5px; overflow-y: auto; scrollbar-width: thin; }
.asset-item { display: grid; grid-template-columns: 38px minmax(0, 1fr) 28px; align-items: center; gap: 7px; min-width: 0; padding: 5px; border: 1px solid #e0e6ec; border-radius: 6px; background: #fff; }
.asset-item img { width: 38px; height: 29px; border-radius: 4px; object-fit: cover; background: #edf1f5; }
.asset-copy { min-width: 0; }
.asset-name { overflow: hidden; font-size: 10px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.asset-meta { margin-top: 2px; color: #8994a2; font-size: 9px; }
.asset-kind { display: inline-block; margin-right: 4px; padding: 1px 4px; border-radius: 3px; color: #fff; font-size: 8px; font-weight: 750; }
.asset-kind.reference { background: #3b82f6; }
.asset-kind.design { background: #1d4ed8; }

.form-footer { padding: 9px 10px; border: 1px solid #dbe5f3; border-radius: 8px; background: #f7faff; }
.task-status-bar { display: flex; min-height: 30px; margin: -2px -3px 8px; padding: 6px 8px; align-items: center; gap: 8px; border: 1px solid #d8e4f4; border-radius: 6px; color: #405168; background: #fff; font-size: 10px; line-height: 1.4; }
.task-status-bar #taskStatus { min-width: 0; flex: 1 1 auto; }
.task-status-bar button { width: auto; height: 24px; padding: 0 7px; flex: 0 0 auto; border: 1px solid #bfdbfe; border-radius: 5px; color: #1d4ed8; background: #eff6ff; font-size: 9px; cursor: pointer; }
.task-status-bar button[hidden] { display: none; }
.status-spinner { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #94a3b8; }
.task-status-bar.is-active .status-spinner { width: 13px; height: 13px; border: 2px solid #bfdbfe; border-top-color: var(--accent); background: transparent; animation: spin .8s linear infinite; }
.model-field { display: grid; grid-template-columns: 66px minmax(0, 1fr); align-items: center; gap: 8px; }
.model-field .field-label { margin: 0; }
.model-hint { overflow: hidden; margin: 4px 0 0 74px; color: var(--muted); font-size: 9px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.submit-row { display: block; margin-top: 8px; }
.primary-btn { display: flex; width: 100%; height: 38px; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 7px; color: #fff; background: var(--accent); font-size: 12px; font-weight: 750; cursor: pointer; box-shadow: 0 5px 12px rgba(37, 99, 235, .2); }
.primary-btn:hover { background: var(--accent-dark); }
.primary-btn:disabled { opacity: .55; cursor: wait; }
.primary-btn svg { width: 16px; height: 16px; }

.workspace { display: grid; grid-template-rows: 50px minmax(0, 1fr) 3px; overflow: hidden; }
.workspace-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 12px; border-bottom: 1px solid var(--line); background: #fbfcfe; }
.slide-nav-controls, .document-actions { display: flex; align-items: center; gap: 6px; }
.slide-nav-controls span { min-width: 62px; color: #56616f; font-size: 11px; text-align: center; font-variant-numeric: tabular-nums; }
.icon-btn { display: inline-grid; width: 34px; height: 34px; padding: 0; place-items: center; border: 1px solid transparent; border-radius: 7px; color: #536170; background: transparent; cursor: pointer; text-decoration: none; }
.icon-btn:hover { border-color: var(--line); background: #f3f6f9; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn svg { width: 17px; height: 17px; }
.secondary-btn, .toolbar-btn { display: inline-flex; height: 34px; padding: 0 11px; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line-strong); border-radius: 7px; color: #455468; background: #fff; cursor: pointer; }
.secondary-btn:hover, .toolbar-btn:hover { border-color: #aeb8c4; background: #f8fafc; }
.secondary-btn svg, .toolbar-btn svg { width: 15px; height: 15px; }
.toolbar-btn.primary { border-color: var(--accent); color: #fff; background: var(--accent); }
.toolbar-btn.primary:hover { background: var(--accent-dark); }
.toolbar-btn:disabled { opacity: .4; cursor: default; }
.export-menu { position: relative; }
.menu-chevron { width: 13px !important; height: 13px !important; margin-left: -2px; }
.export-menu-popover { position: absolute; top: calc(100% + 6px); right: 0; z-index: 100; display: grid; width: 244px; padding: 5px; gap: 3px; border: 1px solid #d9e1ea; border-radius: 7px; background: #fff; box-shadow: 0 16px 38px rgba(15, 23, 42, .16); }
.export-menu-popover[hidden] { display: none; }
.export-menu-popover button { display: grid; width: 100%; min-height: 52px; padding: 7px 8px; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 8px; border: 0; border-radius: 5px; color: #334155; background: transparent; cursor: pointer; text-align: left; }
.export-menu-popover button:hover { background: var(--accent-soft); }
.export-menu-popover button > svg { width: 18px; height: 18px; color: var(--accent); }
.export-menu-popover button span { display: grid; gap: 2px; }
.export-menu-popover button strong { font-size: 11px; }
.export-menu-popover button small { color: #7b8796; font-size: 9px; line-height: 1.35; }
.editable-export-frame { position: fixed; left: -20000px; top: 0; width: 1920px; height: 1080px; border: 0; visibility: hidden; pointer-events: none; }
.ppt-edit-open { overflow: hidden; }
.ppt-edit-overlay { position: fixed; inset: 0; z-index: 1100; padding: 10px; background: #eaf0f7; }
.ppt-edit-overlay[hidden] { display: none; }
.ppt-edit-shell { display: grid; width: 100%; height: 100%; min-width: 0; min-height: 0; grid-template-rows: 58px minmax(0, 1fr); overflow: hidden; border: 1px solid #cfd9e6; border-radius: 8px; background: #fff; box-shadow: 0 18px 54px rgba(15, 23, 42, .18); }
.ppt-edit-header { display: flex; min-width: 0; padding: 8px 12px 8px 16px; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid #dbe3ed; background: #f8fbff; }
.ppt-edit-header > div:first-child { min-width: 0; }
.ppt-edit-header span { color: #2563eb; font-size: 9px; font-weight: 750; }
.ppt-edit-header h2 { margin: 2px 0 0; overflow: hidden; font-size: 16px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.ppt-edit-header-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.ppt-edit-header-actions > span { padding: 5px 8px; border: 1px solid #bfdbfe; border-radius: 5px; color: #1d4ed8; background: #eff6ff; font-size: 10px; }
.ppt-edit-body { display: grid; min-width: 0; min-height: 0; grid-template-columns: 238px minmax(420px, 1fr) 350px; overflow: hidden; }
.ppt-edit-pages, .ppt-edit-controls { min-width: 0; min-height: 0; background: #fff; }
.ppt-edit-pages { display: grid; padding: 12px; grid-template-rows: 34px minmax(0, 1fr); border-right: 1px solid #dbe3ed; }
.ppt-edit-section-title { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 10px; }
.ppt-edit-section-title strong { font-size: 11px; }
.ppt-edit-section-title small { color: #8290a2; font-size: 9px; }
.ppt-edit-section-title button { width: auto; height: 26px; padding: 0 7px; border: 0; color: #2563eb; background: transparent; font-size: 10px; cursor: pointer; }
.ppt-edit-slide-list { display: grid; min-height: 0; padding-right: 2px; align-content: start; gap: 5px; overflow-y: auto; scrollbar-width: thin; }
.ppt-edit-slide-row { display: grid; min-width: 0; min-height: 43px; padding: 6px 7px; grid-template-columns: 16px minmax(0, 1fr); align-items: center; gap: 6px; border: 1px solid #dde5ee; border-radius: 6px; color: #435269; background: #fff; }
.ppt-edit-slide-row:hover { border-color: #9dbcf0; background: #f8fbff; }
.ppt-edit-slide-row.current { border-color: #2563eb; box-shadow: 0 0 0 1px #2563eb; }
.ppt-edit-slide-row input { width: 15px; height: 15px; margin: 0; padding: 0; accent-color: #2563eb; }
.ppt-edit-slide-target { display: grid; width: 100%; min-width: 0; height: 29px; padding: 0; grid-template-columns: 23px minmax(0, 1fr); align-items: center; gap: 6px; border: 0; color: inherit; background: transparent; text-align: left; cursor: pointer; }
.ppt-edit-slide-index { color: #8b97a7; font-size: 9px; font-variant-numeric: tabular-nums; }
.ppt-edit-slide-name { overflow: hidden; font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.ppt-edit-preview { display: grid; min-width: 0; min-height: 0; grid-template-rows: 48px minmax(0, 1fr); background: #eaf0f7; }
.ppt-edit-preview-toolbar { display: flex; padding: 7px 12px; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid #d7e0eb; background: #f8fafc; }
.segmented-control { display: inline-flex; height: 32px; padding: 2px; border: 1px solid #d3dce7; border-radius: 6px; background: #eef2f7; }
.segmented-control button { width: auto; height: 26px; padding: 0 10px; border: 0; border-radius: 4px; color: #637083; background: transparent; font-size: 10px; cursor: pointer; }
.segmented-control button.active { color: #1d4ed8; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .12); font-weight: 750; }
.segmented-control button:disabled { opacity: .45; cursor: default; }
.ppt-edit-preview-viewport { position: relative; min-width: 0; min-height: 0; margin: 18px; overflow: hidden; }
#editPreviewFrame { position: absolute; left: 50%; top: 50%; width: 1920px; height: 1080px; border: 0; background: #fff; box-shadow: 0 18px 44px rgba(15, 23, 42, .19); transform-origin: center; }
.ppt-edit-controls { display: grid; grid-template-rows: minmax(0, 1fr) auto; border-left: 1px solid #dbe3ed; }
.ppt-edit-control-scroll { min-height: 0; padding: 13px 14px; overflow-y: auto; scrollbar-width: thin; }
.ppt-edit-status { position: sticky; top: -13px; z-index: 2; display: grid; min-height: 58px; margin: -13px -14px 14px; padding: 11px 14px 9px 34px; align-content: center; gap: 8px; border-bottom: 1px solid #bfdbfe; color: #1e3a8a; background: linear-gradient(180deg, #eff6ff 0%, #f8fbff 100%); font-size: 12px; font-weight: 750; line-height: 1.4; box-shadow: 0 5px 14px rgba(37, 99, 235, .08); }
.ppt-edit-status::before { position: absolute; left: 14px; top: 15px; width: 11px; height: 11px; border: 2px solid #93c5fd; border-top-color: #2563eb; border-radius: 50%; content: ''; opacity: .42; }
.ppt-edit-status.is-active::before { animation: ppt-edit-spin .8s linear infinite; opacity: 1; }
.ppt-edit-status-label { min-width: 0; overflow-wrap: anywhere; }
.ppt-edit-progress { height: 4px; overflow: hidden; border-radius: 99px; background: #dbeafe; }
.ppt-edit-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: #2563eb; transition: width .25s ease; }
.ppt-edit-scope { margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid #e1e7ef; }
.ppt-edit-scope-options { display: grid; margin-top: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.ppt-edit-scope-option { display: grid; min-width: 0; min-height: 56px; padding: 8px 9px; grid-template-columns: 15px minmax(0, 1fr); align-items: start; gap: 7px; border: 1px solid #d8e1ec; border-radius: 7px; color: #526174; background: #fff; cursor: pointer; }
.ppt-edit-scope-option:hover { border-color: #93b7ed; background: #f8fbff; }
.ppt-edit-scope-option.active { border-color: #2563eb; color: #1d4ed8; background: #eff6ff; box-shadow: 0 0 0 1px rgba(37, 99, 235, .1); }
.ppt-edit-scope-option input { width: 14px; height: 14px; margin: 1px 0 0; accent-color: #2563eb; }
.ppt-edit-scope-option span { display: grid; min-width: 0; gap: 3px; }
.ppt-edit-scope-option strong { font-size: 10px; }
.ppt-edit-scope-option small { color: #7b8796; font-size: 8px; line-height: 1.35; }
.ppt-edit-scope-option.active small { color: #5072b1; }
.ppt-edit-control-scroll textarea { height: 128px; min-height: 128px; }
.ppt-edit-presets { display: flex; margin: 8px 0 16px; flex-wrap: wrap; gap: 5px; }
.ppt-edit-presets label { display: inline-flex; width: auto; min-height: 27px; padding: 0 7px; align-items: center; gap: 5px; border: 1px solid #dbe3ed; border-radius: 5px; color: #536174; background: #f8fafc; cursor: pointer; font-size: 9px; }
.ppt-edit-presets input { width: 13px; height: 13px; margin: 0; padding: 0; accent-color: #2563eb; }
.ppt-edit-materials { padding-top: 12px; border-top: 1px solid #e1e7ef; }
.ppt-edit-upload-row { display: grid; margin-top: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.ppt-edit-upload-row button { display: inline-flex; width: 100%; height: 35px; padding: 0 5px; align-items: center; justify-content: center; gap: 5px; border: 1px solid #ced9e6; border-radius: 6px; color: #435269; background: #fff; cursor: pointer; font-size: 10px; }
.ppt-edit-upload-row button:hover { border-color: #8fb4ef; color: #1d4ed8; background: #eff6ff; }
.ppt-edit-upload-row svg { width: 14px; height: 14px; }
.ppt-edit-asset-list { display: grid; max-height: 190px; margin-top: 7px; align-content: start; gap: 5px; overflow-y: auto; }
.ppt-edit-asset-row { display: grid; min-width: 0; padding: 4px; grid-template-columns: 42px minmax(0, 1fr) 28px; align-items: center; gap: 7px; border: 1px solid #e0e7ef; border-radius: 6px; background: #fff; }
.ppt-edit-asset-row img { width: 42px; height: 32px; border-radius: 4px; object-fit: cover; background: #edf2f7; }
.ppt-edit-asset-row > span { display: grid; min-width: 0; gap: 2px; }
.ppt-edit-asset-row strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.ppt-edit-asset-row small { overflow: hidden; color: #8290a2; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.ppt-edit-actions { padding: 11px 14px 13px; border-top: 1px solid #dbe3ed; background: #f8fbff; }
.ppt-edit-actions > .primary-btn { min-height: 42px; font-size: 12px; }
.ppt-edit-apply-row { display: grid; margin-top: 6px; grid-template-columns: 1fr 1.35fr; gap: 6px; }
.ppt-edit-apply-row .secondary-btn, .ppt-edit-apply-row .primary-btn { width: 100%; }
.ppt-edit-confirm-dialog { width: min(700px, calc(100vw - 32px)); }
.ppt-edit-confirm-dialog .confirm-body pre { max-height: 190px; }
@keyframes ppt-edit-spin { to { transform: rotate(360deg); } }
.preview-area { position: relative; display: grid; min-width: 0; min-height: 0; padding: 22px; place-items: center; overflow: hidden; background: var(--canvas); }
.empty-state { max-width: 390px; color: var(--muted); text-align: center; }
.empty-mark { display: grid; width: 58px; height: 58px; margin: 0 auto 14px; place-items: center; border: 1px solid var(--line-strong); border-radius: 8px; color: #64748b; background: rgba(255, 255, 255, .75); box-shadow: 0 8px 24px rgba(15, 23, 42, .05); }
.empty-mark svg { width: 27px; height: 27px; }
.empty-state h2 { margin: 0; color: #334155; font-size: 17px; }
.empty-state p { margin: 7px 0 0; font-size: 11px; }
.stage-viewport { position: relative; width: 100%; height: 100%; overflow: hidden; }
#previewFrame { position: absolute; left: 50%; top: 50%; width: 1920px; height: 1080px; border: 0; background: #fff; box-shadow: 0 18px 44px rgba(15, 23, 42, .18); transform-origin: center center; }
.progress-line { height: 3px; overflow: hidden; background: #dce3eb; }
.progress-line span { display: block; width: 0; height: 100%; background: var(--accent); transition: width .25s ease; }

.slide-rail { display: grid; grid-template-rows: 50px minmax(150px, 1fr) minmax(190px, .72fr); overflow: hidden; }
.rail-heading { display: flex; height: 50px; padding: 0 13px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); font-size: 11px; }
.rail-heading span { color: var(--muted); font-variant-numeric: tabular-nums; }
.slide-list { display: grid; min-height: 0; max-height: none; padding: 9px; align-content: start; gap: 7px; overflow-y: auto; scrollbar-width: thin; }
.rail-empty { margin: 24px 0; color: #929ba3; font-size: 10px; text-align: center; }
.slide-list-item { display: grid; grid-template-columns: 22px minmax(0, 1fr); min-height: 50px; padding: 7px; align-items: center; gap: 6px; border: 1px solid #d7dfe7; border-radius: 6px; color: #465468; background: #fff; cursor: pointer; text-align: left; }
.slide-list-item:hover { border-color: #9cb9ea; background: #f8fbff; }
.slide-list-item.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.slide-number { color: #8a95a3; font-size: 9px; font-variant-numeric: tabular-nums; }
.slide-title { overflow: hidden; font-size: 10px; font-weight: 750; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }

.toast { visibility: hidden; position: fixed; left: 50%; bottom: 24px; z-index: 1000; max-width: min(520px, calc(100vw - 32px)); padding: 10px 14px; border-radius: 7px; color: #fff; background: #26323b; font-size: 11px; opacity: 0; transform: translate(-50%, 8px); transition: .18s ease; }
.toast.show { visibility: visible; opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #a23728; }
.confirm-overlay { position: fixed; inset: 0; z-index: 1150; display: grid; padding: 24px; place-items: center; background: rgba(15, 23, 42, .52); backdrop-filter: blur(3px); }
.confirm-overlay[hidden] { display: none; }
.confirm-dialog { display: grid; width: min(760px, calc(100vw - 32px)); max-height: min(780px, calc(100vh - 32px)); grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; border: 1px solid #dce3ec; border-radius: 8px; background: #fff; box-shadow: 0 24px 70px rgba(15, 23, 42, .26); }
.confirm-header { display: flex; min-height: 68px; padding: 13px 16px 12px 18px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: #fbfcfe; }
.confirm-header span { color: var(--accent); font-size: 10px; font-weight: 750; }
.confirm-header h2 { margin: 3px 0 0; font-size: 17px; }
.confirm-body { display: grid; min-height: 0; padding: 16px 18px; align-content: start; gap: 14px; overflow-y: auto; }
.confirm-section { min-width: 0; }
.confirm-label { display: flex; margin-bottom: 6px; align-items: center; justify-content: space-between; gap: 12px; color: #334155; font-size: 11px; font-weight: 750; }
.confirm-label small { color: #8793a2; font-size: 9px; font-weight: 500; }
.confirm-section pre { max-height: 180px; margin: 0; padding: 12px 13px; overflow: auto; border: 1px solid #dce4ed; border-radius: 7px; color: #27364a; background: #f8fafc; font: 11px/1.65 "Segoe UI", "Microsoft YaHei", sans-serif; white-space: pre-wrap; overflow-wrap: anywhere; }
.confirm-section pre.document-text { max-height: 300px; }
.confirm-options { display: flex; flex-wrap: wrap; gap: 6px; }
.confirm-options span { padding: 4px 7px; border: 1px solid #d9e3ef; border-radius: 5px; color: #536376; background: #f8fafc; font-size: 9px; }
.confirm-options span.active { border-color: #bfdbfe; color: #1d4ed8; background: #eff6ff; }
.confirm-actions { display: flex; padding: 12px 18px; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); background: #fbfcfe; }
.confirm-actions .secondary-btn, .confirm-actions .primary-btn { width: auto; min-width: 108px; padding: 0 16px; }
.export-overlay { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; background: rgba(15, 23, 42, .5); }
.export-overlay[hidden] { display: none; }
.export-dialog { width: min(380px, calc(100vw - 32px)); padding: 26px; border-radius: 8px; background: #fff; text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .22); }
.export-dialog svg { width: 28px; height: 28px; color: var(--accent); }
.export-dialog h2 { margin: 13px 0 5px; font-size: 17px; }
.export-dialog p { margin: 0; color: var(--muted); font-size: 11px; }
.export-progress { height: 5px; margin-top: 18px; overflow: hidden; border-radius: 3px; background: #e3e8ee; }
.export-progress span { display: block; width: 0; height: 100%; background: var(--accent); transition: width .2s ease; }
.ppt-share-overlay { position: fixed; inset: 0; z-index: 1220; display: grid; padding: 24px; place-items: center; background: rgba(15, 23, 42, .54); backdrop-filter: blur(4px); }
.ppt-share-overlay[hidden] { display: none; }
.ppt-share-dialog { display: grid; width: min(920px, calc(100vw - 32px)); max-height: min(740px, calc(100vh - 32px)); grid-template-rows: auto minmax(0, 1fr); overflow: hidden; border: 1px solid #d7e0eb; border-radius: 8px; background: #fff; box-shadow: 0 28px 80px rgba(15, 23, 42, .3); }
.ppt-share-header { display: flex; min-height: 68px; padding: 13px 16px 12px 18px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: #fbfcfe; }
.ppt-share-header span { color: var(--accent); font-size: 10px; font-weight: 750; }
.ppt-share-header h2 { margin: 3px 0 0; color: #1e293b; font-size: 17px; }
.ppt-share-body { display: grid; min-height: 0; grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr); }
.ppt-share-form { display: grid; min-height: 0; padding: 18px; align-content: start; gap: 13px; overflow-y: auto; border-right: 1px solid var(--line); }
.ppt-share-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.ppt-share-form-grid label { display: grid; gap: 5px; color: #475569; font-size: 10px; font-weight: 700; }
.ppt-share-form-grid label.wide { grid-column: 1 / -1; }
.ppt-share-form-grid input, .ppt-share-form-grid select, .ppt-share-url-row input { width: 100%; height: 38px; min-width: 0; padding: 0 10px; border: 1px solid #d6dee8; border-radius: 6px; color: #253347; outline: 0; background: #fff; font-size: 11px; }
.ppt-share-form-grid input:focus, .ppt-share-form-grid select:focus { border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.ppt-share-toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.ppt-share-toggles label { display: grid; min-width: 0; min-height: 55px; padding: 9px; grid-template-columns: 17px minmax(0, 1fr); align-items: start; gap: 7px; border: 1px solid #dce4ed; border-radius: 6px; color: #334155; background: #f8fafc; cursor: pointer; }
.ppt-share-toggles input { width: 15px; height: 15px; margin: 1px 0 0; accent-color: #2563eb; }
.ppt-share-toggles span { display: grid; gap: 2px; }
.ppt-share-toggles strong { font-size: 10px; }
.ppt-share-toggles small { color: #8290a2; font-size: 8px; line-height: 1.4; }
.ppt-share-pricing { padding: 9px 10px; border: 1px solid #dbe7f6; border-radius: 6px; color: #53657b; background: #f5f9ff; font-size: 9px; line-height: 1.55; }
.ppt-share-submit { width: 100%; }
.ppt-share-progress-wrap { display: grid; gap: 6px; }
.ppt-share-progress-wrap > div:first-child { display: flex; justify-content: space-between; color: #64748b; font-size: 9px; }
.ppt-share-progress { height: 5px; overflow: hidden; border-radius: 3px; background: #e2e8f0; }
.ppt-share-progress span { display: block; width: 0; height: 100%; background: #2563eb; transition: width .2s ease; }
.ppt-share-result { padding: 11px; border: 1px solid #bbf7d0; border-radius: 7px; background: #f0fdf4; }
.ppt-share-result > div:first-child { display: flex; align-items: center; gap: 8px; color: #166534; }
.ppt-share-result > div:first-child svg { width: 18px; height: 18px; }
.ppt-share-result > div:first-child span { display: grid; gap: 1px; }
.ppt-share-result strong { font-size: 10px; }
.ppt-share-result small { color: #4b7c59; font-size: 8px; }
.ppt-share-qr { display: grid; width: 132px; height: 132px; margin: 10px auto 3px; padding: 6px; place-items: center; border: 1px solid #d9eadf; border-radius: 6px; background: #fff; }
.ppt-share-qr:empty { display: none; }
.ppt-share-qr img, .ppt-share-qr canvas { width: 120px !important; height: 120px !important; }
.ppt-share-url-row { display: grid; margin-top: 9px; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; }
.ppt-share-url-row .secondary-btn, .ppt-share-url-row .primary-btn { width: auto; min-width: 70px; padding: 0 9px; }
.ppt-share-history { display: grid; min-width: 0; min-height: 0; grid-template-rows: 52px minmax(0, 1fr); background: #f8fafc; }
.ppt-history-panel { display:grid; min-height:0; max-height:none; grid-template-rows:42px minmax(0,1fr); border-top:1px solid var(--line); background:#fff; }
.ppt-history-heading { display:flex; align-items:center; justify-content:space-between; padding:0 10px; border-bottom:1px solid var(--line); color:#27364a; font-size:11px; }
.ppt-history-heading .icon-btn { width:28px; height:28px; }
.ppt-history-list { min-height:0; overflow:auto; padding:8px; scrollbar-width:thin; }
.ppt-history-item { display:grid; gap:4px; width:100%; min-height:54px; margin:0 0 6px; padding:9px 10px; border:1px solid #dbe5f2; border-radius:8px; background:#fff; color:#334155; text-align:left; cursor:pointer; transition:border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.ppt-history-item:hover { border-color:#93b4e9; background:#f8fbff; box-shadow:0 2px 8px rgba(37,99,235,.08); }
.ppt-history-item strong { overflow:hidden; color:#334155; text-overflow:ellipsis; white-space:nowrap; font-size:11px; line-height:1.35; }
.ppt-history-item small { color:#718096; font-size:9px; line-height:1.25; }
.ppt-history-item.is-expired { cursor:not-allowed; opacity:.62; background:#f8fafc; }
.ppt-history-item.is-expired:hover { border-color:#e2e8f0; background:#f8fafc; }
.ppt-history-empty { padding:14px 8px; color:#94a3b8; font-size:10px; text-align:center; }
.ppt-share-history-heading { display: flex; padding: 0 13px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.ppt-share-history-heading > div { display: flex; align-items: center; gap: 7px; color: #27364a; font-size: 11px; }
.ppt-share-history-heading span { display: inline-grid; min-width: 20px; height: 20px; padding: 0 5px; place-items: center; border-radius: 4px; color: #2563eb; background: #dbeafe; font-size: 9px; }
.ppt-share-list { display: grid; min-height: 0; padding: 10px; align-content: start; gap: 7px; overflow-y: auto; }
.ppt-share-list > p { margin: 26px 0; color: #8793a2; font-size: 10px; text-align: center; }
.ppt-share-item { display: grid; min-width: 0; padding: 10px; gap: 8px; border: 1px solid #dce4ed; border-radius: 7px; background: #fff; }
.ppt-share-item-head { display: flex; min-width: 0; justify-content: space-between; gap: 9px; }
.ppt-share-item-head > span { display: grid; min-width: 0; gap: 2px; }
.ppt-share-item-head strong { overflow: hidden; color: #334155; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.ppt-share-item-head small, .ppt-share-item-meta { color: #8290a2; font-size: 8px; }
.ppt-share-item-status { flex: none; padding: 3px 5px; border-radius: 4px; color: #166534; background: #dcfce7; font-size: 8px; }
.ppt-share-item-status.inactive { color: #64748b; background: #e2e8f0; }
.ppt-share-item-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.ppt-share-item-actions button { width: auto; height: 27px; padding: 0 7px; border: 1px solid #d6dee8; border-radius: 5px; color: #475569; background: #fff; cursor: pointer; font-size: 9px; }
.ppt-share-item-actions button:hover { border-color: #93b4e9; color: #1d4ed8; }
.ppt-share-item-actions button.revoke { margin-left: auto; color: #b42318; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.mobile-only, .settings-backdrop { display: none; }

@media (max-height: 820px) and (min-width: 761px) {
    .topbar { height: 52px; padding: 0 18px; }
    .app-shell { height: calc(100vh - 52px); padding: 8px; gap: 8px; }
    .panel-heading { min-height: 52px; padding: 9px 12px; }
    .panel-heading h1 { font-size: 16px; }
    #pptForm { padding: 7px 9px 9px; gap: 6px; }
    .form-section, .form-footer { padding: 7px 8px; }
    textarea { height: 60px; min-height: 60px; }
    .purpose-upload { min-height: 52px; padding: 6px; }
    .model-hint { display: none; }
    .submit-row { margin-top: 6px; }
}

@media (max-width: 1120px) {
    .topbar { grid-template-columns: minmax(150px, 1fr) auto; }
    .product-nav { display: none; }
    .app-shell { grid-template-columns: 350px minmax(0, 1fr); }
    .slide-rail { display: none; }
    .ppt-edit-body { grid-template-columns: 205px minmax(360px, 1fr) 320px; }
}

@media (max-width: 760px) {
    .mobile-only { display: inline-grid; }
    .topbar { height: 52px; padding: 0 10px; }
    .brand span { max-width: 150px; }
    .app-shell { display: block; height: calc(100vh - 52px); padding: 0; }
    .settings-panel { position: fixed; top: 52px; bottom: 0; left: 0; width: min(360px, 94vw); border-width: 0 1px 0 0; border-radius: 0; overflow-y: auto; box-shadow: 12px 0 36px rgba(15, 23, 42, .16); transform: translateX(-102%); transition: transform .2s ease; }
    .settings-panel.open { transform: translateX(0); }
    #pptForm { display: flex; min-height: auto; padding: 10px 12px 12px; flex-direction: column; gap: 8px; overflow: visible; }
    textarea { height: 60px; min-height: 60px; }
    .page-options { grid-template-columns: 72px minmax(0, 1fr); }
    .advanced-body { grid-template-columns: 1fr; }
    .palette-control { grid-column: 1; }
    .assets-section { min-height: 150px; }
    .asset-list { max-height: 120px; }
    #pptForm.slide-count-caution .assets-section { min-height: 128px; }
    .model-hint { display: block; }
    .settings-backdrop { position: fixed; inset: 52px 0 0; z-index: 15; display: block; background: rgba(15, 23, 42, .34); }
    .settings-backdrop[hidden] { display: none; }
    .workspace { height: 100%; border: 0; border-radius: 0; box-shadow: none; }
    .workspace-toolbar { padding: 7px 9px; }
    .toolbar-btn span { display: none; }
    .toolbar-btn { width: 34px; padding: 0; }
    .preview-area { padding: 10px; }
    .ppt-edit-overlay { padding: 0; }
    .ppt-edit-shell { border: 0; border-radius: 0; }
    .ppt-edit-body { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
    .ppt-edit-pages { min-width: 210px; }
    .ppt-edit-preview { min-width: calc(100vw - 28px); scroll-snap-align: center; }
    .ppt-edit-controls { min-width: min(350px, calc(100vw - 18px)); scroll-snap-align: start; }
    .ppt-edit-preview-viewport { margin: 8px; }
    .ppt-share-overlay { padding: 0; }
    .ppt-share-dialog { width: 100%; max-height: 100%; height: 100%; border: 0; border-radius: 0; }
    .ppt-share-body { display: block; overflow-y: auto; }
    .ppt-share-form { overflow: visible; border-right: 0; }
    .ppt-share-history { min-height: 300px; border-top: 1px solid var(--line); }
    .ppt-history-panel { max-height:none; min-height:220px; }
    .ppt-share-form-grid, .ppt-share-toggles { grid-template-columns: 1fr; }
    .ppt-share-form-grid label.wide { grid-column: 1; }
}
