:root {
  --white: #ffffff;
  --canvas: #f5f6f8;
  --ink: #1a1d22;
  --muted: #646c78;
  --line: #e5e7eb;
  --accent: #3157d5;
  --display: "SF Pro Display", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  --body: "SF Pro Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", "Consolas", "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--white); color: var(--ink); font: 14px/1.6 var(--body); -webkit-font-smoothing: antialiased; }
button, input, a, summary, label { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; }
button:focus-visible, a:focus-visible, summary:focus-visible, .drop:focus-within { outline: 2px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }

.header { height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 max(32px, calc((100vw - 1280px) / 2)); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-size: 15px; font-weight: 600; letter-spacing: -.3px; }
.brand svg { width: 31px; height: 26px; fill: var(--ink); stroke: var(--ink); stroke-width: 1.6; }
.brand svg path { fill: none; }
.privacy { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.privacy svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.3; }

main { max-width: 1344px; margin: 0 auto; padding: 48px 32px 28px; }
.intro { margin-bottom: 32px; }
.eyebrow { margin: 0 0 10px; color: var(--muted); font-size: 12px; letter-spacing: .4px; }
h1 { margin: 0; font: 600 36px/1.25 var(--display); letter-spacing: -1.3px; }
h1 span { font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -1.7px; }
.intro-description { margin: 14px 0 0; color: var(--muted); font-size: 14px; }

.workspace { display: grid; grid-template-columns: 312px minmax(0, 1fr); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--white); box-shadow: 0 4px 24px #1a1d2204; }
.input-panel { padding: 28px 24px; border-right: 1px solid var(--line); min-width: 0; }
.section-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.section-head h2 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -.2px; }
.section-tag { margin-left: auto; color: var(--muted); font: 10px var(--mono); letter-spacing: .2px; }
.drop { position: relative; min-height: 206px; margin-top: 22px; padding: 24px 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 1px dashed #cbd0d8; border-radius: 10px; background: #fbfcfd; text-align: center; cursor: pointer; transition: border-color .16s, background .16s; }
.drop:hover, .drop.dragging { border-color: var(--accent); background: #f7f9ff; }
.drop[data-state="ready"] { border-style: solid; border-color: var(--line); background: var(--white); }
.drop[data-state="error"] { border-color: #ca857d; }
.upload-symbol { display: grid; place-items: center; width: 48px; height: 52px; margin-bottom: 9px; color: #777e89; }
.upload-symbol svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.35; stroke-linejoin: round; stroke-linecap: round; }
.file-state { position: absolute; top: 12px; right: 12px; display: none; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #edf3ef; color: #3f6d51; }
.file-state svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.drop[data-state="ready"] .file-state { display: grid; }
.drop strong { max-width: 100%; font-size: 13px; font-weight: 550; line-height: 1.65; overflow-wrap: anywhere; }
.drop > span:last-of-type { font-size: 12px; color: var(--muted); line-height: 1.65; }
.drop input, .hidden-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.input-limit { margin: 10px 0 20px; text-align: center; font-size: 10px; color: var(--muted); white-space: nowrap; }
.input-limit span { margin: 0 3px; color: #acb1b9; }
.picture-link { width: 100%; display: flex; align-items: center; gap: 9px; border: 0; background: none; padding: 4px 0; color: var(--muted); font-size: 12px; text-align: left; }
.picture-link:hover { color: var(--ink); }
.picture-link:disabled { color: #a5abb4; cursor: default; }
.picture-link svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.3; }
.link-arrow { margin-left: auto; font-size: 16px; }

.action { display: flex; flex-direction: column; gap: 10px; margin-top: 26px; }
.generate { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 46px; padding: 11px 16px; border: 1px solid var(--ink); border-radius: 8px; background: var(--ink); color: var(--white); font-size: 13px; font-weight: 550; transition: background .16s; }
.generate:not(:disabled):hover { background: #34383f; border-color: #34383f; }
.generate:disabled { background: #f0f1f3; color: #8a9099; border-color: #f0f1f3; }
.generate[aria-busy="true"] { background: var(--ink); color: var(--white); border-color: var(--ink); }
.generate-icon { margin-left: auto; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.generate[aria-busy="true"] .generate-icon { display: none; }
.button-spinner { display: none; width: 14px; height: 14px; border: 1.5px solid #ffffff55; border-top-color: var(--white); border-radius: 50%; animation: spin 1s linear infinite; }
.generate[aria-busy="true"] .button-spinner { display: block; }
.cancel { width: 100%; min-height: 36px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: var(--white); font-size: 12px; }
.cancel:hover { color: var(--ink); background: var(--canvas); }
.message { margin: 14px 0 0; color: var(--muted); font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.message[data-kind="error"] { color: #a3463b; }
.message[data-kind="success"] { color: #3f6d51; }
.progress { margin-top: 18px; }
.progress progress { appearance: none; display: block; width: 100%; height: 4px; border: 0; border-radius: 2px; overflow: hidden; background: var(--line); accent-color: var(--accent); }
.progress progress::-webkit-progress-bar { background: var(--line); }
.progress progress::-webkit-progress-value { background: var(--accent); }
.progress progress::-moz-progress-bar { background: var(--accent); }
.progress span { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.result { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.result-title { display: flex; align-items: center; gap: 7px; }
.result-title svg { width: 18px; height: 18px; fill: none; stroke: #3f6d51; stroke-width: 1.35; flex-shrink: 0; }
.result strong { font-size: 12px; font-weight: 550; }
.result p { margin: 8px 0 14px; color: var(--muted); font-size: 11px; line-height: 1.8; }
.download { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); text-decoration: none; color: var(--ink); font-size: 13px; font-weight: 500; }
.download:hover { background: var(--canvas); border-color: #c9ced6; }
.download svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.3; }

.batch-panel { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.batch-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.batch-head h3 { margin: 0; font-size: 12px; font-weight: 550; }
.batch-head > span { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.batch-note { margin: 7px 0 12px; color: var(--muted); font-size: 11px; }
.batch-list { list-style: none; margin: 0 -8px; padding: 0 5px 0 0; max-height: 220px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #c9ced6 transparent; }
.batch-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; column-gap: 8px; padding: 9px 8px; border-radius: 7px; }
.batch-item + .batch-item { margin-top: 2px; }
.batch-item.is-selected { background: var(--canvas); }
.batch-select { display: flex; flex-direction: column; gap: 3px; min-width: 0; border: 0; padding: 0; text-align: left; color: var(--ink); background: none; }
.batch-select:disabled { cursor: default; }
.batch-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; font-size: 11px; line-height: 1.6; }
.batch-meta { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.batch-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; padding-top: 1px; }
.batch-status { color: var(--muted); font-size: 10px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.batch-item[data-status="done"] .batch-status { color: #3f6d51; }
.batch-item[data-status="failed"] .batch-status { color: #a3463b; }
.batch-download { font-size: 10px; text-underline-offset: 3px; }
.batch-error { grid-column: 1 / -1; margin: 6px 0 0; color: #a3463b; font-size: 10px; line-height: 1.8; overflow-wrap: anywhere; }
.folder-export, .pack-completed { display: block; width: 100%; min-height: 38px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--white); color: var(--ink); font-size: 12px; }
.folder-export:not(:disabled):hover, .pack-completed:not(:disabled):hover { background: var(--canvas); }
.folder-export:disabled, .pack-completed:disabled { color: #a5abb4; cursor: default; }
.has-batch .drop { min-height: 136px; padding-top: 16px; padding-bottom: 16px; }
.has-batch .upload-symbol { width: 28px; height: 30px; margin-bottom: 3px; }
.has-batch .upload-symbol svg { width: 25px; height: 25px; }
.has-batch .action { margin-top: 18px; }
.workspace.has-batch { overflow: visible; }
.has-batch .preview-panel { align-self: start; position: sticky; top: 24px; }
.has-batch .preview-head { flex-shrink: 0; }
.has-batch .preview-stage { min-height: 400px; }
.has-batch .page-name { overflow-wrap: anywhere; }

.preview-panel { display: flex; flex-direction: column; min-width: 0; }
.preview-head { min-height: 72px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.preview-subtitle { font-size: 12px; color: var(--muted); }
.page-control { display: flex; align-items: center; gap: 3px; flex-shrink: 0; }
.page-control > span { min-width: 70px; text-align: center; color: var(--muted); font: 11px var(--mono); font-variant-numeric: tabular-nums; }
.page-control button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--ink); }
.page-control button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.3; }
.page-control button:disabled { color: #c0c5cd; }
.page-control button:not(:disabled):hover { background: var(--canvas); border-color: var(--line); }
.preview-stage { flex: 1; display: flex; flex-direction: column; padding: 21px 28px 29px; background: var(--canvas); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.page-name { margin: 0 0 31px; font-size: 12px; color: var(--muted); }
.comparison { display: grid; grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr); gap: 20px; align-items: center; margin: auto 0; }
.view { min-width: 0; }
.view-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 15px; color: #555d69; font-size: 12px; font-weight: 500; }
.view-label code { font: 10px var(--mono); color: var(--muted); white-space: nowrap; }
.canvas-slot { height: clamp(170px, 18vw, 245px); display: flex; align-items: center; }
.frame { position: relative; width: 100%; max-height: 100%; overflow: hidden; background: var(--white); border: 1px solid #dde1e7; box-shadow: 0 2px 7px #1a1d2207; }
.original-frame { aspect-ratio: 928 / 254; }
.output-frame { aspect-ratio: 16 / 9; }
.frame > img { position: absolute; inset: 0; display: none; width: 100%; height: 100%; }
.original-frame > img { object-fit: contain; }
.output-frame > img { object-fit: fill; }
.has-image .frame > img { display: block; }
.empty-page { position: absolute; inset: 0; }
.empty-page svg { width: 100%; height: 100%; display: block; }
.has-image .empty-page { display: none; }
.view-caption { margin: 15px 0 0; color: var(--muted); font-size: 11px; }
.transform-arrow { display: flex; align-items: center; justify-content: center; color: #a3aab5; }
.transform-arrow svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.screen-note { display: flex; align-items: flex-start; gap: 10px; padding: 18px 28px; color: var(--muted); }
.screen-note > svg { width: 16px; height: 16px; margin-top: 2px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.2; }
.screen-note p { margin: 0; font-size: 11px; line-height: 1.8; }
.screen-note strong { color: #555d69; font-weight: 500; }

footer { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding-top: 22px; color: var(--muted); font-size: 11px; }
.output-note { display: inline-flex; align-items: center; gap: 7px; padding-top: 2px; white-space: nowrap; }
.output-note svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.help { width: min(530px, 100%); }
.help summary { display: flex; align-items: center; justify-content: flex-end; gap: 7px; width: fit-content; margin-left: auto; cursor: pointer; list-style: none; }
.help summary::-webkit-details-marker { display: none; }
.help summary svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.2; transition: transform .16s; }
.help[open] summary svg { transform: rotate(180deg); }
.help-content { margin-top: 16px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfd; font-size: 12px; line-height: 1.8; }
.help-content p { margin: 0; }
.help-content p + p { margin-top: 10px; }
.render-stage { position: fixed; left: -20000px; top: 0; pointer-events: none; z-index: -1; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 1500px) {
  main { padding-top: 58px; }
  .intro { margin-bottom: 36px; }
  .canvas-slot { height: 265px; }
  .preview-stage { padding-top: 24px; padding-bottom: 38px; }
}
@media (max-width: 1100px) {
  .workspace { grid-template-columns: 288px minmax(0, 1fr); }
  .input-panel { padding: 25px 22px; }
  .preview-head { padding: 0 22px; }
  .preview-subtitle { display: none; }
  .preview-stage { padding: 21px 22px 29px; }
  .comparison { gap: 13px; grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr); }
  .view-label { display: block; font-size: 11px; }
  .view-label code { display: block; margin-top: 3px; }
  .view-caption { font-size: 10px; }
  .screen-note { padding: 18px 22px; }
}
@media (max-width: 800px) {
  .has-batch .preview-panel { position: static; }
  .header { height: 68px; padding: 0 24px; }
  main { padding: 34px 24px 24px; }
  .intro { margin-bottom: 26px; }
  h1 { font-size: 32px; }
  .workspace { grid-template-columns: 1fr; }
  .input-panel { border-right: 0; border-bottom: 1px solid var(--line); padding: 24px; }
  .drop { min-height: 160px; margin-top: 18px; }
  .upload-symbol { height: 35px; margin-bottom: 3px; }
  .input-limit { margin-bottom: 15px; }
  .picture-link { width: fit-content; gap: 9px; }
  .link-arrow { margin-left: 5px; }
  .action { margin-top: 22px; }
  .preview-head { min-height: 66px; padding: 0 24px; }
  .preview-stage { padding: 21px 24px 26px; }
  .canvas-slot { height: 200px; }
  .view-label { display: flex; font-size: 12px; }
  .view-label code { margin-top: 0; }
  .view-caption { font-size: 11px; }
}
@media (max-width: 540px) {
  .header { height: 64px; padding: 0 18px; gap: 12px; }
  .brand { gap: 9px; font-size: 14px; }
  .brand svg { width: 27px; }
  .privacy { font-size: 10px; gap: 4px; }
  .privacy svg { display: none; }
  main { padding: 29px 16px 22px; }
  .eyebrow { font-size: 11px; }
  h1 { font-size: 31px; }
  .intro-description { font-size: 12px; line-height: 1.85; max-width: 330px; }
  .workspace { border-radius: 12px; }
  .input-panel { padding: 22px 20px; }
  .preview-head { padding: 0 20px; }
  .preview-stage { padding: 20px; }
  .page-name { margin-bottom: 25px; font-size: 11px; }
  .page-control { gap: 0; }
  .page-control > span { min-width: 62px; }
  .comparison { grid-template-columns: 1fr; gap: 20px; }
  .canvas-slot { height: auto; }
  .frame { max-height: none; }
  .transform-arrow svg { transform: rotate(90deg); width: 20px; height: 20px; }
  .view-caption { margin-top: 10px; }
  .view-label { margin-bottom: 12px; }
  .screen-note { padding: 16px 20px; }
  footer { align-items: flex-start; gap: 16px; font-size: 10px; }
  .help { width: auto; }
  .help[open] { width: 100%; }
  footer:has(.help[open]) { flex-wrap: wrap; }
  .help-content { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
