:root {
  --ink: #202124; --muted: #687076; --surface: #fff; --canvas: #f5f6f7;
  --line: #dfe3e6; --soft: #eef1f2; --coral: #e94f3d;
  --coral-dark: #c93d2e; --yellow: #f4c84a; --green: #16845b;
  --focus: rgba(233,79,61,.16); --shadow: 0 10px 28px rgba(32,33,36,.08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Inter, "Noto Sans SC", "Microsoft YaHei", sans-serif; letter-spacing: 0; overflow-x: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.topbar { height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(12px); }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand strong { font-size: 15px; }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 6px; background: var(--coral); color: white; font-weight: 900; box-shadow: inset 0 -2px 0 rgba(0,0,0,.12); }
.top-actions { display: flex; align-items: center; gap: 12px; }
.status { padding: 6px 9px; border: 1px solid #cfe7dc; border-radius: 5px; background: #f3fbf7; font-size: 12px; color: #28664d; }
.status i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 6px; }
.status.warning { border-color: #ead59a; background: #fffaf0; color: #745c16; }
.status.warning i { background: #b57800; }
.status.error { border-color: #efc7c1; background: #fff5f3; color: #9d3023; }
.status.error i { background: var(--coral); }
.icon-link { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; color: inherit; text-decoration: none; background: white; }
.icon-link:hover { border-color: #9da5aa; background: var(--soft); }
.connection-trigger { min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px; background: white; font-size: 12px; font-weight: 750; }
.connection-trigger:hover { border-color: var(--coral); color: var(--coral-dark); }
main { overflow: hidden; }
.creator, .workspace, .proof, .recent-jobs { max-width: 1240px; margin: 0 auto; padding-left: 28px; padding-right: 28px; }
.creator { padding-top: 34px; padding-bottom: 46px; display: grid; grid-template-columns: 270px minmax(0,1fr); gap: 28px; align-items: stretch; min-width: 0; }
.creator-copy { width: 100%; min-width: 0; min-height: 430px; padding: 30px 28px; border: 1px solid #2e3034; border-radius: 7px; background: #27292d; color: white; position: relative; overflow: hidden; }
.creator-copy::after { content: "来"; position: absolute; right: -20px; bottom: -48px; color: rgba(244,200,74,.15); font: 900 180px/1 Georgia, serif; }
.eyebrow { margin: 0 0 10px; color: var(--coral); font-size: 11px; font-weight: 800; }
.creator-copy .eyebrow { color: var(--yellow); }
h1 { margin: 0; font-size: 44px; line-height: 1.08; font-weight: 850; }
.creator-copy > p:last-child { position: relative; z-index: 1; max-width: 210px; margin: 22px 0 0; color: #c8cdd0; font-size: 14px; line-height: 1.75; }
.prompt-panel { width: 100%; min-width: 0; min-height: 430px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; box-shadow: var(--shadow); padding: 28px; }
.prompt-label { display: block; margin-bottom: 10px; font-size: 14px; font-weight: 750; }
textarea { width: 100%; min-width: 0; min-height: 138px; padding: 15px 16px; resize: vertical; border: 1px solid #bbc2c7; background: white; font-size: 16px; line-height: 1.65; border-radius: 5px; }
textarea::placeholder { color: #969da2; }
textarea:focus, input:focus, select:focus { border-color: var(--coral); box-shadow: 0 0 0 3px var(--focus); outline: none; }
.examples { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.examples button { min-height: 30px; padding: 0 10px; border: 1px solid var(--line); background: var(--canvas); border-radius: 4px; color: #555e63; font-size: 12px; }
.examples button:hover { border-color: var(--coral); color: var(--coral-dark); background: #fff7f5; }
.controls { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-top: 22px; }
.controls label { color: #545d62; font-size: 12px; font-weight: 700; }
.controls input, .controls select { width: 100%; height: 40px; margin-top: 6px; padding: 0 10px; border: 1px solid var(--line); border-radius: 4px; background: white; }
.form-footer { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.form-footer p { margin: 0; max-width: 340px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.primary, .secondary { min-height: 42px; border-radius: 5px; font-weight: 750; }
.primary { display: flex; align-items: center; gap: 20px; padding: 0 16px; border: 1px solid var(--coral-dark); background: var(--coral); color: white; white-space: nowrap; box-shadow: 0 3px 0 var(--coral-dark); }
.primary:hover { background: var(--coral-dark); transform: translateY(1px); box-shadow: 0 2px 0 #a92f23; }
.primary:disabled { opacity: .55; cursor: wait; transform: none; box-shadow: none; }
.secondary { padding: 0 14px; border: 1px solid #aab1b6; background: white; }
.secondary:hover { border-color: var(--ink); background: var(--soft); }
.workspace { padding-top: 28px; padding-bottom: 60px; }
.hidden { display: none; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); }
.tabs button { min-width: 76px; padding: 12px 16px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-weight: 700; }
.tabs button.active { color: var(--ink); border-bottom-color: var(--coral); }
.workspace-head { display: flex; justify-content: space-between; align-items: end; gap: 28px; padding: 28px 0 22px; }
h2 { margin: 0 0 8px; font-size: 30px; line-height: 1.2; }
.workspace-head p:last-child { margin: 0; color: var(--muted); }
.tab-view { display: none; }
.tab-view.active { display: block; }
.story-grid, .prompt-grid, .publish-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.beat, .prompt-card, .publish-card { min-height: 176px; padding: 18px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.beat time, .prompt-card span, .publish-card span { color: var(--coral-dark); font-size: 11px; font-weight: 800; }
.beat h3, .prompt-card h3, .publish-card h3 { margin: 16px 0 8px; font-size: 17px; }
.beat p, .prompt-card p, .publish-card p { color: var(--muted); font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.prompt-card { position: relative; min-height: 245px; }
.copy { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border: 1px solid var(--line); background: white; border-radius: 4px; }
.copy:hover { border-color: var(--coral); color: var(--coral); }
.video-prompt { display: grid; grid-template-columns: 1fr .65fr; gap: 12px; }
.video-prompt pre { margin: 0; padding: 20px; border: 1px solid var(--line); border-radius: 6px; background: white; white-space: pre-wrap; font: 13px/1.75 inherit; }
.video-meta { padding: 20px; border-radius: 6px; background: #303236; color: white; }
.video-meta dl { margin: 0; }
.video-meta div { padding: 10px 0; border-bottom: 1px solid #4d5055; }
.video-meta dt { color: #afb5b9; font-size: 11px; }
.video-meta dd { margin: 5px 0 0; line-height: 1.5; }
.generation-studio { display: grid; grid-template-columns: minmax(0,1fr) 220px 190px auto; gap: 16px; align-items: end; scroll-margin-top: 74px; margin-bottom: 10px; padding: 20px; border: 1px solid #d9c681; border-radius: 6px; background: #fffaf0; }
.generation-copy h3 { margin: 6px 0; font-size: 19px; }
.generation-copy p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.model-select { color: #545d62; font-size: 12px; font-weight: 750; }
.model-select select { width: 100%; height: 42px; margin-top: 6px; padding: 0 10px; border: 1px solid #b9b09a; border-radius: 4px; background: white; }
.frame-upload { display: grid; gap: 6px; color: #545d62; font-size: 12px; font-weight: 750; }
.frame-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.frame-upload b { min-height: 42px; display: flex; align-items: center; padding: 0 10px; overflow: hidden; border: 1px dashed #a99b72; border-radius: 4px; background: white; color: #5d5642; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.frame-upload b:hover { border-color: var(--coral); color: var(--coral-dark); }
.generation-link { min-height: 42px; color: white; text-decoration: none; }
.workflow-summary { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr; column-gap: 9px; align-items: baseline; padding: 12px 14px; border-left: 3px solid var(--coral); background: white; }
.workflow-summary strong { font-size: 14px; }
.workflow-summary p { grid-column: 1 / -1; margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.workflow-config { grid-column: 1 / -1; border-top: 1px solid #e2d6ad; }
.workflow-config summary { padding: 13px 0 0; color: #62583d; font-size: 12px; font-weight: 800; cursor: pointer; }
.advanced-workflow { display: grid; grid-template-columns: 1.25fr repeat(3,minmax(130px,1fr)); gap: 12px; align-items: end; padding-top: 14px; }
.advanced-workflow > div h4 { margin: 5px 0 0; font-size: 14px; }
.advanced-workflow label { display: grid; gap: 6px; color: #545d62; font-size: 11px; font-weight: 750; }
.advanced-workflow input { width: 100%; min-width: 0; height: 40px; padding: 0 10px; border: 1px solid #b9b09a; border-radius: 4px; background: white; }
.advanced-workflow > p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.advanced-workflow.hidden, .job-status.hidden { display: none; }
.job-status { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding-top: 14px; border-top: 1px solid #e2d6ad; }
.job-status strong { font-size: 13px; }
.job-status span { color: var(--muted); font-size: 12px; }
.mode-note { display: flex; gap: 10px; margin-bottom: 14px; padding: 10px 12px; border-left: 3px solid #9f8842; background: #f5f1e5; color: var(--muted); font-size: 12px; line-height: 1.55; }
.mode-note strong { flex: 0 0 auto; color: var(--ink); }
.video-result { display: grid; gap: 14px; }
.result-player { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(180px,.75fr); gap: 18px; align-items: center; padding: 16px; border: 1px solid var(--line); background: white; border-radius: 6px; }
.result-player video { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #111; border-radius: 5px; }
.result-player p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.generation-bar { margin-top: 14px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid #ead59a; background: #fffaf0; border-radius: 6px; }
.generation-bar div { display: grid; gap: 4px; }
.generation-bar span { color: var(--muted); font-size: 12px; }
dialog { width: min(760px,calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 7px; box-shadow: 0 24px 80px rgba(0,0,0,.24); }
dialog::backdrop { background: rgba(23,25,28,.58); }
.dialog-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; padding: 24px 24px 16px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: 23px; }
.dialog-close { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 4px; background: white; font-size: 22px; }
.connection-intro { margin: 0; padding: 16px 24px 4px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.security-notice { margin: 12px 24px 4px; padding: 11px 12px; border-left: 3px solid #b57800; background: #fff7df; color: #684c12; font-size: 12px; line-height: 1.6; }
.provider-list { padding: 12px 24px 24px; }
.provider-row { min-height: 98px; display: grid; grid-template-columns: minmax(0,1fr) minmax(180px,280px); gap: 18px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.provider-row:last-child { border-bottom: 0; }
.provider-row h3 { margin: 5px 0; font-size: 16px; }
.provider-row p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.provider-badge { color: var(--coral-dark); font-size: 10px; font-weight: 850; }
.key-form { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 7px; }
.key-form input, .key-form select { min-width: 0; height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: 4px; background: white; }
.action-link { display: grid; place-items: center; color: inherit; text-decoration: none; font-size: 13px; }
.proof { padding-top: 54px; padding-bottom: 70px; border-top: 1px solid var(--line); }
.section-head { display: grid; grid-template-columns: 1.2fr .8fr; gap: 40px; align-items: end; margin-bottom: 24px; }
.section-head > p { color: var(--muted); line-height: 1.65; font-size: 13px; }
.section-head.compact { align-items: center; margin-bottom: 14px; }
.section-head.compact .secondary { justify-self: end; }
.recent-jobs { padding-top: 30px; padding-bottom: 44px; border-top: 1px solid var(--line); }
.job-history { border-top: 1px solid var(--ink); }
.history-row { min-height: 72px; display: grid; grid-template-columns: minmax(0,1.4fr) minmax(150px,.6fr) auto; gap: 18px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.history-row h3 { margin: 0 0 5px; font-size: 14px; }
.history-row p, .storage-note { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
.history-state { font-size: 12px; font-weight: 800; }
.history-state.succeeded { color: var(--green); }
.history-state.failed { color: var(--coral-dark); }
.history-actions { display: flex; gap: 7px; }
.history-actions .secondary { min-height: 34px; font-size: 12px; text-decoration: none; display: grid; place-items: center; }
.storage-note { margin-top: 10px; }
.proof-grid { display: grid; grid-template-columns: 1.45fr .55fr; gap: 18px; }
.proof video { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; background: #111; }
.proof-notes { border-top: 1px solid var(--ink); }
.proof-notes > div { display: grid; grid-template-columns: 34px 1fr; column-gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.proof-notes span { color: var(--coral); font-weight: 800; }
.proof-notes h3 { margin: 0; font-size: 15px; }
.proof-notes p { grid-column: 2; margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
footer { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 5vw; border-top: 1px solid var(--line); background: white; color: var(--muted); font-size: 12px; }
footer a { color: var(--ink); }
footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
.legal { max-width: 820px; min-height: calc(100vh - 122px); margin: 0 auto; padding: 64px 28px 80px; }
.legal h1 { margin-bottom: 34px; }
.legal h2 { margin-top: 34px; font-size: 20px; }
.legal p { color: #4f575c; font-size: 14px; line-height: 1.9; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%,16px); padding: 10px 14px; background: #27292d; color: white; border-radius: 5px; opacity: 0; pointer-events: none; transition: .2s; z-index: 20; }
#toast.show { opacity: 1; transform: translate(-50%,0); }
@media (max-width: 860px) {
  .creator { grid-template-columns: minmax(0,1fr); }
  .creator-copy { min-height: 190px; }
  .creator-copy > p:last-child { max-width: 540px; }
  .controls { grid-template-columns: repeat(2,1fr); }
  .story-grid, .prompt-grid, .publish-grid { grid-template-columns: 1fr; }
  .video-prompt, .proof-grid, .section-head, .result-player, .generation-studio { grid-template-columns: 1fr; }
  .advanced-workflow { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .advanced-workflow > div, .advanced-workflow > p { grid-column: 1 / -1; }
  .workspace-head { align-items: start; flex-direction: column; }
}
@media (max-width: 560px) {
  .topbar { padding: 0 16px; }
  .status { display: none; }
  .creator, .workspace, .proof, .recent-jobs { padding-left: 16px; padding-right: 16px; }
  .creator { padding-top: 18px; gap: 14px; }
  .creator-copy { padding: 22px; min-height: 170px; }
  h1 { font-size: 36px; }
  .prompt-panel { padding: 18px; }
  .controls { grid-template-columns: 1fr; }
  .form-footer { align-items: stretch; flex-direction: column; }
  .primary { justify-content: space-between; }
  .tabs { overflow-x: auto; }
  .provider-row { grid-template-columns: 1fr; }
  .key-form { grid-template-columns: 1fr; }
  .generation-bar { align-items: stretch; flex-direction: column; }
  .advanced-workflow { grid-template-columns: 1fr; }
  .advanced-workflow > div, .advanced-workflow > p { grid-column: auto; }
  .history-row { grid-template-columns: 1fr; gap: 7px; }
  .history-actions { align-items: stretch; }
  .section-head.compact { grid-template-columns: 1fr auto; }
  footer { align-items: flex-start; flex-direction: column; }
}
