/* 四个新工作台（天鹅写真 / 孔雀绘画 / 蝉主播 / 河狸 3D）共享样式。
   结构沿用图像工作室既有布局；--accent 由各应用页内联覆盖。 */
:root {
  color-scheme: light;
  --paper: #f7f7f2;
  --surface: #fffefa;
  --ink: #2d3a37;
  --muted: #69756e;
  --line: #dfe4db;
  --accent: #356d60;
  --accent-light: #eaf1eb;
  --radius: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-underline-offset: 4px; }
button:disabled, input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; }
button:disabled { opacity: .48; }
button, select, textarea { color: var(--ink); }
button { border: 0; }
button, a, input, select, textarea, summary { touch-action: manipulation; }
:focus-visible { outline: 3px solid #6f9a8a; outline-offset: 4px; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
h1, h2, h3 { font-weight: 600; }
h2 { font-size: 15px; }
h3 { font-size: 17px; }
img { display: block; max-width: 100%; }
svg { flex-shrink: 0; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.page-width { width: min(1344px, calc(100% - 80px)); margin-inline: auto; }
.skip-link { position: fixed; top: -100px; left: 20px; z-index: 10; background: var(--surface); padding: 12px 20px; }
.skip-link:focus { top: 10px; }

.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.topbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font-size: 21px; font-weight: 650; letter-spacing: -.6px; }
.brand span { color: var(--muted); font-size: 13px; font-weight: 400; }
.back-link { padding: 10px 0 10px 12px; text-decoration: none; font-size: 13px; white-space: nowrap; }
.back-link span { margin-left: 10px; }
.back-link:hover, .site-footer a:hover { color: var(--accent); text-decoration: underline; }
.page-intro { padding: 36px 0 12px; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.eyebrow { font-size: 10px; font-weight: 600; letter-spacing: .15em; color: var(--muted); }
h1 { margin-top: 7px; font-size: clamp(27px, 3vw, 35px); letter-spacing: -.035em; line-height: 1.4; }
.page-intro > div > p { margin-top: 6px; color: var(--muted); font-size: 14px; }
.quota-note { color: var(--muted); font-size: 12px; line-height: 1.9; }
.status-line { min-height: 24px; margin: 0 0 17px; color: var(--accent); font-size: 12px; }
.notice { padding: 13px 17px; margin-bottom: 18px; border: 1px solid; border-radius: 9px; overflow-wrap: anywhere; font-size: 13px; }
.notice.error { color: #933e32; background: #fff1eb; border-color: #eccfc4; }
.notice.warning { color: #775723; background: #fbf3dc; border-color: #e6d8b4; }

.workspace { display: grid; grid-template-columns: 346px minmax(0, 1fr); gap: 24px; align-items: start; }
.workspace > *, .setting-section, .canvas-panel > * { min-width: 0; }
.settings-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.setting-section { padding: 20px 22px; border-bottom: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.step { margin-right: 10px; font-size: 10px; font-weight: 500; color: var(--muted); letter-spacing: .05em; }
.text-button { padding: 6px 0; min-height: 32px; background: transparent; font-size: 12px; color: var(--accent); text-align: left; text-decoration: underline; text-decoration-color: #c2d0c4; text-underline-offset: 4px; }
.text-button:hover:not(:disabled) { text-decoration-color: var(--accent); }
.drop-zone { margin-top: 12px; border: 1px dashed #becabf; border-radius: 9px; background: #f7f8f3; transition: background .15s, border-color .15s; }
.drop-zone:focus-within { outline: 3px solid #6f9a8a; outline-offset: 3px; }
.drop-zone:hover, .drop-zone.drag-over { background: var(--accent-light); border-color: var(--accent); }
.upload-target { padding: 17px 8px; min-height: 110px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; text-align: center; }
.upload-target strong { font-size: 13px; font-weight: 500; }
.upload-target span { color: var(--muted); font-size: 10px; margin-top: 4px; }
fieldset:disabled .upload-target { cursor: not-allowed; opacity: .55; }
.source-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.source-thumb { position: relative; }
.source-thumb img { border-radius: 6px; width: 66px; height: 66px; object-fit: cover; border: 1px solid var(--line); background: #f0f1eb; }
.source-thumb button { position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 1px solid var(--line); font-size: 11px; line-height: 1; color: var(--muted); display: grid; place-items: center; }
.source-thumb button:hover { color: #933e32; border-color: #aa5746; }
.field-help { color: var(--muted); font-size: 11px; line-height: 1.8; margin-top: 9px; overflow-wrap: anywhere; }
.inline-warning { margin-top: 12px; padding: 10px 12px; background: #fbf3dc; border: 1px solid #e6d8b4; border-radius: 7px; color: #775723; font-size: 11px; line-height: 1.8; }
.option-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 15px; }
.option-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.option-item { position: relative; min-width: 0; }
.option-item input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.option-card { display: flex; flex-direction: column; padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: #fffefa; cursor: pointer; transition: border-color .15s, background .15s; min-height: 44px; justify-content: center; }
.option-card img { width: 100%; height: 84px; object-fit: cover; border-radius: 4px; background: #eeece2; }
.option-card strong { font-size: 11px; font-weight: 500; margin-top: 5px; }
.option-card small { font-size: 9px; color: var(--muted); }
.option-item input:checked + .option-card { border-color: var(--accent); background: var(--accent-light); box-shadow: inset 0 0 0 1px var(--accent); }
.option-item input:focus-visible + .option-card { outline: 3px solid #6f9a8a; outline-offset: 3px; }
.option-item input:disabled + .option-card { opacity: .55; cursor: not-allowed; }
.option-item:hover .option-card { border-color: #8eac98; }
.field-label { display: block; margin: 15px 0 7px; font-size: 12px; font-weight: 500; }
.field-label span { margin-left: 5px; font-size: 10px; font-weight: 400; color: var(--muted); }
textarea, select, input[type="text"] { width: 100%; min-width: 0; background: #fffefa; border: 1px solid #d5dbd0; border-radius: 7px; padding: 10px; font-size: 12px; }
textarea { resize: vertical; min-height: 88px; line-height: 1.7; display: block; }
textarea::placeholder { color: #788278; }
[aria-invalid="true"] { outline: 2px solid #aa5746; outline-offset: 2px; }
.field-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; margin-top: 5px; }
.radio-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.radio-row label { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 7px; background: #fffefa; cursor: pointer; font-size: 12px; }
.radio-row input { accent-color: var(--accent); }
.generate-section { padding: 20px 22px; }
.consent-label { display: flex; align-items: flex-start; gap: 9px; font-size: 11px; line-height: 1.8; cursor: pointer; }
.consent-label input { accent-color: var(--accent); width: 16px; height: 16px; margin: 3px 0 0; flex-shrink: 0; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 10px 16px; background: var(--surface); border: 1px solid #cbd6ca; border-radius: 7px; font-size: 12px; font-weight: 500; }
.button:hover:not(:disabled) { background: var(--accent-light); border-color: var(--accent); }
.button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.button.primary:hover:not(:disabled) { filter: brightness(.92); }
.generate-button { width: 100%; margin-top: 17px; font-size: 13px; min-height: 46px; }

.canvas-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; position: sticky; top: 20px; }
.canvas-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.canvas-toolbar h2 { font-size: 16px; margin-top: 3px; }
.state-label { padding: 4px 9px; border-radius: 5px; background: var(--accent-light); color: var(--accent); font-size: 11px; white-space: nowrap; }
.empty-canvas { min-height: 520px; display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 50px 24px; text-align: center; background-image: radial-gradient(#a9b4a33d .7px, transparent .7px); background-size: 17px 17px; }
.empty-canvas h3 { font-size: 19px; font-weight: 500; letter-spacing: .03em; }
.empty-canvas p { margin-top: 12px; line-height: 1.9; color: var(--muted); font-size: 12px; }
.result-stage { padding: 20px; display: flex; align-items: center; justify-content: center; background: #eef0e8; min-height: 320px; }
.result-stage img { max-height: 560px; width: auto; max-width: 100%; object-fit: contain; }
.result-stage video { width: 100%; max-height: 560px; background: #101413; border-radius: 7px; }
model-viewer { width: 100%; height: clamp(340px, 44vw, 560px); background: linear-gradient(#eef0e8, #dfe4db); --poster-color: transparent; border-radius: 7px; }
.result-grid { padding: 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.result-grid img { width: 100%; height: clamp(240px, 26vw, 420px); object-fit: cover; border-radius: 7px; border: 1px solid var(--line); }
.waiting-panel { padding: 40px 24px; text-align: center; }
.waiting-panel strong { font-size: 15px; font-weight: 500; }
.waiting-panel p { margin-top: 10px; color: var(--muted); font-size: 12px; line-height: 1.9; }
.elapsed-time { color: var(--accent); font-variant-numeric: tabular-nums; font-size: 16px; }
.spinner { display: block; width: 24px; height: 24px; border: 2px solid #d6e1d4; border-top-color: var(--accent); border-radius: 50%; margin: 0 auto 20px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.action-bar { display: flex; flex-wrap: wrap; gap: 8px; padding: 15px 20px 0; justify-content: center; }
.action-bar .button { min-height: 36px; font-size: 11px; }
.segmented { display: flex; flex-wrap: wrap; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: #f3f5ee; }
.segmented button { font-size: 11px; min-height: 34px; padding: 6px 10px; border-radius: 4px; background: transparent; color: var(--muted); }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--accent); box-shadow: 0 1px 4px #20382012; }
.result-details { padding: 18px 20px; border-top: 1px solid var(--line); }
.result-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 9px; margin-bottom: 20px; }
.result-metadata { font-size: 10px; display: grid; gap: 5px; }
.result-metadata > div { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px; }
.result-metadata dt { color: var(--muted); }
.result-metadata dd { overflow-wrap: anywhere; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.parameter-details { margin-top: 10px; font-size: 11px; }
.parameter-details summary { cursor: pointer; color: var(--accent); padding: 5px 0; }
.parameter-details p { margin-top: 7px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); }
.prompt-list { list-style: none; padding: 20px; margin: 0; display: grid; gap: 10px; }
.prompt-list li { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fffefa; }
.prompt-list p { font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.prompt-list .button { min-height: 34px; font-size: 11px; justify-self: start; }
.anchor-list { list-style: none; padding: 16px; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.anchor-list button { padding: 0; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; text-align: left; }
.anchor-list button[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.anchor-list img { width: 100%; height: 108px; object-fit: cover; background: #e5e8e0; }
.anchor-list span { display: block; padding: 7px 8px; }
.anchor-list strong { display: block; font-size: 11px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.anchor-list small { display: block; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.history-section { margin-top: 38px; }
.history-heading { margin-bottom: 18px; display: flex; flex-wrap: wrap; gap: 14px; align-items: baseline; justify-content: space-between; }
.history-heading h2 { font-size: 18px; }
.local-badge { font-size: 10px; color: var(--muted); }
.history-heading p { margin-top: 7px; font-size: 11px; color: var(--muted); }
.history-empty { border-block: 1px solid var(--line); padding: 31px 16px; color: var(--muted); text-align: center; font-size: 12px; }
.history-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 16px; }
.history-list li { min-width: 0; }
.history-card { width: 100%; padding: 0; border-radius: 9px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; text-align: left; }
.history-card:hover:not(:disabled), .history-card[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.history-card img { width: 100%; height: 155px; object-fit: contain; background: #eaece3; }
.history-card .video-mark { width: 100%; height: 155px; object-fit: cover; background: linear-gradient(135deg, #2d3a37, #52655e); color: #fff; display: grid; place-items: center; font-size: 11px; letter-spacing: .08em; }
.history-card span { display: block; padding: 11px 12px; }
.history-card strong { display: block; font-size: 12px; font-weight: 500; }
.history-card small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.site-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px; padding: 25px 0; margin-top: 36px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.site-footer a { text-decoration: none; }
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; }

@media (min-width: 1600px) { .workspace { grid-template-columns: 364px minmax(0, 1fr); gap: 28px; } }
@media (max-width: 1100px) {
  .page-width { width: calc(100% - 40px); }
  .workspace { grid-template-columns: 310px minmax(0, 1fr); gap: 18px; }
  .setting-section, .generate-section { padding-inline: 17px; }
}
@media (max-width: 820px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .canvas-panel { position: static; }
  .setting-section, .generate-section { padding: 20px 24px; }
  .option-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .page-width { width: calc(100% - 28px); }
  .topbar { min-height: 62px; }
  .brand { font-size: 19px; }
  .brand span { display: none; }
  .page-intro { padding-top: 25px; display: block; }
  .status-line { margin-bottom: 13px; }
  .settings-panel, .canvas-panel { border-radius: 12px; }
  .setting-section, .generate-section { padding: 18px; }
  .option-grid, .option-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-grid { grid-template-columns: minmax(0, 1fr); }
  .result-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  .result-actions .button { width: 100%; }
  .history-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .history-card img, .history-card .video-mark { height: 145px; }
  .history-section { margin-top: 28px; }
  .site-footer { margin-top: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
