:root {
  color-scheme: dark;
  --bg: #090a12;
  --panel: rgba(20, 22, 37, 0.88);
  --panel-light: #1b1e31;
  --line: rgba(221, 227, 255, 0.12);
  --text: #f4f6ff;
  --muted: #9ca5c7;
  --cyan: #47e8ea;
  --violet: #a879ff;
  --pink: #fb5fb8;
  --green: #6be1a8;
  --amber: #ffc46a;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { overscroll-behavior-y: none; }
body { margin: 0; min-width: 320px; color: var(--text); background: radial-gradient(circle at 78% -10%, rgba(137, 79, 255, .25), transparent 28rem), radial-gradient(circle at 10% 30%, rgba(48, 193, 224, .14), transparent 25rem), var(--bg); }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px); background-size: 28px 28px; mask-image: linear-gradient(to bottom, black, transparent 74%); }
button, select, input { font: inherit; }
button { cursor: pointer; }
main { width: min(1440px, calc(100% - 48px)); margin: 0 auto 72px; }
.topbar { height: 68px; display: flex; align-items: center; gap: 24px; padding: 0 max(24px, calc((100% - 1440px) / 2)); border-bottom: 1px solid var(--line); background: rgba(8, 9, 16, .72); backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 20; }
.brand { color: var(--text); text-decoration: none; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; font-weight: 800; font-size: 18px; letter-spacing: .02em; white-space: nowrap; line-height: 1.05; }
.brand small { display: block; color: var(--cyan); font-size: 9px; font-weight: 600; letter-spacing: .04em; }
.topbar-note { margin-left: auto; color: var(--muted); font-size: 13px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.quota-status { color: var(--cyan); font-size: 12px; font-weight: 700; white-space: nowrap; }
.dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); margin-right: 8px; }
.guide-link { color: #c9d0f6; font-size: 13px; text-decoration: none; border: 1px solid var(--line); padding: 8px 11px; border-radius: 8px; }
.hero { display: flex; gap: 36px; justify-content: space-between; align-items: end; padding: 70px 0 30px; }
.eyebrow { color: var(--cyan); font-size: 11px; font-weight: 750; letter-spacing: .14em; margin: 0 0 8px; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { max-width: 820px; margin-bottom: 13px; font-size: clamp(34px, 5vw, 66px); letter-spacing: -.055em; line-height: 1.04; }
h1 strong { color: transparent; background: linear-gradient(100deg, var(--cyan), #bba1ff 55%, var(--pink)); background-clip: text; }
h2 { font-size: 20px; margin-bottom: 8px; letter-spacing: -.025em; }
.hero-copy { max-width: 650px; color: var(--muted); font-size: 15px; line-height: 1.7; margin-bottom: 0; }
.output-spec { min-width: 220px; padding: 18px 20px; border: 1px solid rgba(71, 232, 234, .28); border-radius: 12px; background: linear-gradient(135deg, rgba(32, 183, 194, .10), rgba(168, 121, 255, .12)); }
.output-spec span, .output-spec small { color: var(--muted); display: block; font-size: 12px; }
.output-spec b { display: block; margin: 7px 0; color: var(--cyan); font-size: 17px; }
.output-spec.all-ok b { color: #4ade80; }
.model-status-card { width: min(360px, 100%); padding: 15px 18px; }
.model-status-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-top: 10px; }
.model-status-row + .model-status-row { margin-top: 9px; border-top: 1px solid rgba(121, 137, 214, .18); }
.model-status-row b { margin: 0; color: var(--text); font-size: 14px; white-space: nowrap; }
.model-status-row small { color: var(--muted); text-align: right; white-space: nowrap; }
.model-status-row small.connected { color: #4ade80; }
.model-status-row small.unavailable { color: #fb7185; }
.panel { border: 1px solid var(--line); background: var(--panel); box-shadow: 0 18px 60px rgba(0, 0, 0, .18); border-radius: 14px; }
.upload-section { padding: 14px; }
.upload-drop { min-height: 170px; border: 1px dashed rgba(121, 137, 214, .45); border-radius: 10px; display: grid; align-content: center; justify-items: center; gap: 7px; color: var(--muted); cursor: pointer; background: rgba(5, 7, 14, .22); transition: .2s ease; }
.upload-drop:hover, .upload-drop.dragover { border-color: var(--cyan); background: rgba(71, 232, 234, .06); transform: translateY(-1px); }
.upload-drop input { display: none; }
.upload-icon { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; color: var(--cyan); border: 1px solid rgba(71,232,234,.4); }
.upload-title { color: var(--text); font-size: 16px; font-weight: 650; }
.upload-help, .upload-state { font-size: 12px; }
.upload-state { padding: 10px 3px 0; color: var(--muted); }
.workspace { margin-top: 44px; }
.hidden { display: none !important; }
.workflow-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 15px; }
.workflow-head h2 { margin: 0; }
.ai-state, .result-hint { color: var(--muted); font-size: 12px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); }
.analysis-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-bottom: 40px; }
.analysis-card { position: relative; overflow: hidden; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(155deg, rgba(28, 31, 49, .92), rgba(13, 15, 26, .92)); cursor: pointer; transition: border .2s ease, transform .2s ease; }
.analysis-card:hover, .analysis-card.active { border-color: rgba(71, 232, 234, .62); transform: translateY(-2px); }
.analysis-card.active::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--cyan), var(--violet)); }
.analysis-card.failed { border-color: rgba(251, 95, 184, .42); }
.analysis-card-head { display: flex; gap: 10px; align-items: center; }
.thumb { width: 52px; height: 42px; border-radius: 5px; object-fit: cover; background: #06070d; }
.filename { max-width: 150px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; font-weight: 650; }
.dimension { color: var(--muted); font-size: 11px; margin-top: 3px; }
.batch-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.batch-select { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; cursor: pointer; }
.batch-select input { accent-color: var(--cyan); }
.compact-button { padding: 5px 7px; font-size: 10px; }
.score { margin-left: auto; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; font-weight: 800; font-size: 13px; color: var(--green); background: rgba(107,225,168,.08); border: 1px solid rgba(107,225,168,.3); }
.score.warn { color: var(--amber); border-color: rgba(255,196,106,.35); background: rgba(255,196,106,.08); }
.recommendation { min-height: 42px; color: #dce1f7; font-size: 12px; line-height: 1.5; margin: 12px 0 8px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { padding: 4px 6px; border-radius: 5px; background: rgba(139, 151, 222, .12); color: #c3cbed; font-size: 10px; }
.tag.good { color: var(--green); background: rgba(107,225,168,.09); }
.editor-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 14px; }
.settings, .preview-panel { padding: 20px; }
.settings h2 { margin-bottom: 18px; }
.field-label { display: block; color: #ccd2eb; font-size: 12px; font-weight: 700; margin: 18px 0 7px; }
select { width: 100%; color: var(--text); background: #121524; border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; outline: none; }
select:focus { border-color: var(--cyan); }
textarea, input[type="password"], .login-card input[type="text"] { width: 100%; color: var(--text); background: #121524; border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; outline: none; resize: vertical; line-height: 1.5; }
textarea:focus, input[type="password"]:focus, .login-card input[type="text"]:focus { border-color: var(--cyan); }
.template-copy, .safety-note { color: var(--muted); font-size: 12px; line-height: 1.55; }
.template-copy { min-height: 36px; margin: 8px 0 4px; }
.provider-options { display: grid; gap: 7px; }
.provider-option { display: flex; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.025); cursor: pointer; }
.provider-option.active { border-color: rgba(71,232,234,.6); background: rgba(71,232,234,.07); }
.provider-option.unavailable { cursor: not-allowed; opacity: .55; }
.provider-option input { accent-color: var(--cyan); }
.provider-option b, .provider-option small { display: block; }
.provider-option b { font-size: 12px; }
.provider-option small, .provider-hint { color: var(--muted); font-size: 10px; line-height: 1.45; }
.provider-hint { margin: 7px 0 0; }
.provider-login { margin-top: 8px; }
.force-row { display: flex; gap: 10px; padding: 13px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.force-row b, .force-row small { display: block; font-size: 12px; }
.force-row small { color: var(--muted); line-height: 1.45; margin-top: 3px; }
.switch { position: relative; width: 36px; height: 20px; flex: 0 0 auto; margin-top: 2px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #3c4058; border-radius: 999px; transition: .18s; }
.switch span::before { content: ""; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; background: white; border-radius: 50%; transition: .18s; }
.switch input:checked + span { background: linear-gradient(90deg, var(--cyan), var(--violet)); }
.switch input:checked + span::before { transform: translateX(16px); }
.operation-list { display: grid; gap: 7px; }
.operation, .operation-option { position: relative; display: flex; align-items: flex-start; gap: 9px; padding: 10px; border: 1px solid transparent; background: rgba(255,255,255,.025); border-radius: 8px; cursor: pointer; }
.operation:hover, .operation-option:hover { border-color: var(--line); }
.operation input, .operation-option input { accent-color: var(--cyan); margin-top: 2px; }
.operation b, .operation small, .operation-option b, .operation-option small { display: block; }
.operation b, .operation-option b { font-size: 12px; }
.operation small, .operation-option small { margin-top: 2px; font-size: 10px; line-height: 1.4; color: var(--muted); }
.safety-note { margin: 13px 0 0; padding: 9px 10px; border-radius: 7px; background: rgba(255,196,106,.06); border-left: 2px solid var(--amber); }
.preview-panel { min-width: 0; }
.preview-head { display: flex; gap: 16px; justify-content: space-between; align-items: start; margin-bottom: 14px; }
.preview-head h2 { max-width: 480px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mode-tabs { display: flex; gap: 5px; flex-wrap: wrap; justify-content: end; }
.mode-button, .text-button { color: #c9d0ec; background: transparent; border: 1px solid var(--line); border-radius: 7px; padding: 8px 9px; font-size: 11px; }
.mode-button.active { border-color: rgba(71,232,234,.7); color: var(--cyan); background: rgba(71,232,234,.08); }
.canvas-wrap { min-height: 390px; max-height: 620px; position: relative; overflow: hidden; display: grid; place-items: center; background: #06070d; border-radius: 10px; border: 1px solid var(--line); }
.canvas-wrap img { max-width: 100%; max-height: 610px; object-fit: contain; display: none; }
.canvas-wrap canvas { position: absolute; max-width: 100%; max-height: 610px; display: none; pointer-events: none; cursor: default; }
.canvas-wrap canvas.marking-enabled { pointer-events: auto; cursor: crosshair; touch-action: none; }
.empty-preview { color: #7d85a7; font-size: 13px; }
.preview-actions { display: flex; justify-content: space-between; align-items: center; gap: 15px; color: var(--muted); font-size: 12px; padding-top: 10px; }
.preview-action-buttons { display: flex; flex: 0 0 auto; gap: 8px; }
.preview-action-buttons .active { border-color: rgba(71,232,234,.7); color: var(--cyan); background: rgba(71,232,234,.08); }
.text-button:hover { color: var(--pink); border-color: rgba(251,95,184,.55); }
.runbar { margin-top: 14px; padding: 15px 16px; display: flex; align-items: center; gap: 20px; justify-content: space-between; color: var(--muted); font-size: 13px; }
.runbar-actions { display: flex; flex: 0 0 auto; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.primary-button { flex: 0 0 auto; border: 0; border-radius: 9px; padding: 12px 17px; font-weight: 780; color: #0b0d14; background: linear-gradient(100deg, var(--cyan), #a7a1ff); box-shadow: 0 10px 24px rgba(71,232,234,.18); }
.primary-button:hover { filter: brightness(1.08); }
.primary-button:disabled { cursor: wait; opacity: .65; }
.results { margin-top: 42px; }
.delivery-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.results-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 13px; }
.result-card { overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: #111321; }
.result-preview { display: block; width: 100%; margin: 0; padding: 0; border: 0; background: #06070d; cursor: zoom-in; }
.result-preview:focus-visible { outline: 2px solid var(--cyan); outline-offset: -3px; }
.result-card img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: #06070d; transition: transform .2s ease, filter .2s ease; }
.result-preview:hover img { transform: scale(1.015); filter: brightness(1.04); }
.result-info { padding: 12px; }
.result-info h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0 0 7px; font-size: 13px; }
.result-info p { color: var(--muted); font-size: 11px; line-height: 1.55; min-height: 34px; margin-bottom: 9px; }
.download-link { display: inline-block; color: var(--cyan); font-size: 12px; font-weight: 700; text-decoration: none; }
.result-feedback { display: grid; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.result-feedback .field-label { margin: 0; }
.result-feedback textarea { min-height: 88px; font-size: 12px; }
.result-regenerate-button { justify-self: start; padding: 8px 11px; font-size: 12px; }
.result-history-toggle { display: block; margin-top: 12px; }
.result-history { display: grid; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.result-history > strong { color: #dce1f7; font-size: 11px; }
.result-history-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(82px, 1fr)); gap: 7px; }
.result-history-item { overflow: hidden; color: var(--muted); border: 1px solid var(--line); border-radius: 7px; text-decoration: none; font-size: 10px; line-height: 1.35; }
.result-history-item:hover { border-color: rgba(71,232,234,.58); color: var(--cyan); }
.result-history-item img { width: 100%; height: 56px; aspect-ratio: auto; object-fit: cover; }
.result-history-item span { display: block; padding: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast { position: fixed; right: 24px; bottom: 76px; max-width: min(440px, calc(100% - 48px)); padding: 12px 14px; color: #111524; background: #e4e9ff; border-radius: 9px; box-shadow: 0 12px 34px rgba(0,0,0,.35); font-size: 13px; z-index: 30; }
.toast.error { color: #fff5f7; background: #a82351; }
.workflow-status { position: fixed; z-index: 25; right: 24px; bottom: 24px; display: flex; align-items: center; gap: 10px; max-width: min(520px, calc(100% - 48px)); padding: 9px 11px; color: #6c748f; background: rgba(233, 236, 246, .96); border: 1px solid rgba(255,255,255,.8); border-radius: 8px; box-shadow: 0 8px 28px rgba(0,0,0,.2); font-size: 12px; line-height: 1.45; }
.workflow-status.is-error { color: #a9234e; background: #fff0f3; border-color: #ffc1d0; }
.status-retry { flex: 0 0 auto; border: 1px solid currentColor; border-radius: 6px; padding: 4px 7px; color: inherit; background: transparent; font-size: 11px; font-weight: 700; }

.diagnosis-panel { padding: 20px; margin: 0 0 14px; }
.diagnosis-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.diagnosis-head h2 { margin-bottom: 0; }
.diagnosis-navigation { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: -4px 0 13px; color: var(--muted); font-size: 11px; }
.quality-pill { color: var(--amber); border: 1px solid rgba(255,196,106,.36); background: rgba(255,196,106,.08); border-radius: 999px; padding: 7px 10px; font-size: 11px; white-space: nowrap; }
.quality-pill.good { color: var(--green); border-color: rgba(107,225,168,.35); background: rgba(107,225,168,.08); }
.quality-pill.excellent { color: var(--green); border-color: rgba(107,225,168,.35); background: rgba(107,225,168,.08); }
.quality-pill.needs-work { color: var(--amber); border-color: rgba(255,196,106,.36); background: rgba(255,196,106,.08); }
.diagnosis-report { margin-top: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: rgba(6,7,13,.35); color: #dce1f7; font-size: 13px; line-height: 1.7; }
.diagnosis-report p { margin: 0 0 12px; white-space: pre-wrap; }
.diagnosis-report h3 { color: var(--cyan); margin: 18px 0 7px; font-size: 12px; }
.diagnosis-report h3:first-of-type { margin-top: 0; }
.diagnosis-report ul { margin: 0; padding-left: 19px; }
.diagnosis-raw { color: #cbd3ee; }
.requirements-box { margin-top: 16px; padding-top: 4px; }
.requirements-box .field-label { margin-top: 0; }
.reference-upload { margin-top: 14px; padding: 12px; border: 1px dashed rgba(121,137,214,.42); border-radius: 9px; background: rgba(7,9,16,.22); }
.reference-upload-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.reference-upload-head .field-label { margin: 0 0 4px; }
.reference-upload-head small { display: block; max-width: 520px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.reference-upload input { display: none; }
.style-consistency-card { margin-top: 14px; padding: 12px; border: 1px solid rgba(71,232,234,.28); border-radius: 9px; background: rgba(71,232,234,.045); }
.style-consistency-toggle { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.style-consistency-toggle input { margin-top: 3px; accent-color: var(--cyan); }
.style-consistency-toggle b, .style-consistency-toggle small { display: block; }
.style-consistency-toggle b { color: #dfefff; font-size: 13px; }
.style-consistency-toggle small, .style-consistency-card > p { color: var(--muted); font-size: 11px; line-height: 1.5; }
.style-consistency-card > p { margin: 9px 0 0 25px; }
.scene-recognition { color: var(--cyan); font-weight: 700; }
.scene-notice { color: var(--amber); font-size: 12px; }
.reference-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 8px; margin-top: 12px; }
.reference-item { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: #0b0d16; }
.reference-item img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.reference-item-name { display: block; overflow: hidden; padding: 6px 25px 6px 7px; color: #dce1f7; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.reference-remove { position: absolute; right: 5px; bottom: 5px; width: 20px; height: 20px; padding: 0; color: #ffb2c9; border: 0; border-radius: 50%; background: rgba(20,22,37,.9); line-height: 1; }
.instruction-actions { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 10px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.secondary-button { flex: 0 0 auto; color: var(--cyan); background: rgba(71,232,234,.08); border: 1px solid rgba(71,232,234,.45); border-radius: 8px; padding: 10px 12px; font-weight: 700; }
.secondary-button:disabled { opacity: .6; cursor: wait; }
.instruction-result { margin-top: 13px; padding: 13px; background: rgba(168,121,255,.08); border: 1px solid rgba(168,121,255,.25); border-radius: 9px; }
.instruction-result h3 { margin: 0 0 7px; color: #cbb7ff; font-size: 13px; }
.instruction-result p { white-space: pre-wrap; color: #e4e7fb; font-size: 12px; line-height: 1.65; margin: 0 0 7px; }
.instruction-result small { color: var(--muted); font-size: 11px; }
.modal-backdrop, .login-overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 22px; background: rgba(4,5,10,.76); backdrop-filter: blur(10px); }
.modal-card, .login-card { width: min(100%, 510px); padding: 26px; border: 1px solid rgba(172,181,255,.25); border-radius: 15px; background: #151829; box-shadow: 0 26px 80px rgba(0,0,0,.45); }
.upload-confirm-card { width: min(100%, 660px); }
.selected-files { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 9px; max-height: min(48vh, 360px); margin-top: 16px; overflow: auto; }
.selected-file { position: relative; display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 9px; align-items: center; min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 9px; background: rgba(5,7,14,.38); }
.selected-file img { width: 58px; height: 48px; border-radius: 5px; object-fit: cover; background: #080a12; }
.selected-file-name, .selected-file-meta { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selected-file-name { padding-right: 20px; color: #e5e9f8; font-size: 12px; font-weight: 700; }
.selected-file-meta { margin-top: 4px; color: var(--muted); font-size: 10px; }
.remove-selected-file { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; padding: 0; color: #ffb2c9; border: 0; border-radius: 50%; background: rgba(251,95,184,.12); line-height: 1; }
.modal-card h2, .login-card h1 { margin-bottom: 10px; font-size: 26px; line-height: 1.28; letter-spacing: -.03em; }
.modal-card > p:not(.eyebrow), .login-card > p { color: var(--muted); font-size: 14px; line-height: 1.65; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.changelog-card { display: flex; flex-direction: column; max-height: min(78vh, 680px); overflow: hidden; }
.changelog-scroll { min-height: 0; overflow: auto; padding-right: 4px; }
.changelog-card .modal-actions { flex: 0 0 auto; margin: 14px -28px -28px; padding: 14px 28px; border-top: 1px solid var(--border); background: #111421; }
.changelog-items { margin: 18px 0 0; color: var(--muted); font-size: 14px; line-height: 1.75; }
.changelog-release { border-top: 1px solid var(--border); padding: 16px 0; }
.changelog-release:first-child { border-top: 0; padding-top: 0; }
.changelog-release h3 { margin: 0; color: var(--text); font-size: 16px; }
.changelog-release small { display: block; margin-top: 3px; color: var(--muted); }
.changelog-release ul { margin: 9px 0 0; padding-left: 22px; }
.changelog-release li + li { margin-top: 7px; }
.login-card { width: min(100%, 400px); }
.login-card h1 { font-size: 28px; }
.login-card form { display: grid; gap: 10px; margin-top: 20px; }
.login-card .field-label { margin: 0; }
.login-card .primary-button { width: 100%; margin-top: 4px; }
.dreamina-login-link { display: inline-block; margin: 8px 0 0; color: var(--cyan); font-size: 13px; font-weight: 700; }
.login-code { margin-top: 12px; padding: 10px; color: #e8ecfc; border: 1px dashed rgba(71,232,234,.45); border-radius: 8px; background: rgba(71,232,234,.06); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 16px; letter-spacing: .08em; text-align: center; }
.admin-panel-card { width: min(100%, 980px); max-height: min(88vh, 860px); overflow: auto; }
.admin-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.admin-panel-head h2 { margin-bottom: 0; }
.admin-create-form { display: grid; grid-template-columns: 1.1fr 1.1fr .7fr auto; gap: 10px; align-items: end; margin: 22px 0 10px; }
.admin-create-form label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; }
.admin-create-form input, .admin-user-row input { min-width: 0; width: 100%; color: var(--text); background: #0b0d17; border: 1px solid var(--line); border-radius: 7px; padding: 9px 10px; }
.admin-message { min-height: 22px; margin: 10px 0; color: var(--cyan) !important; font-size: 12px !important; }
.admin-user-list { display: grid; gap: 8px; margin-top: 10px; }
.admin-user-row { display: grid; grid-template-columns: minmax(170px, 1.3fr) 100px minmax(150px, 1fr) auto auto; gap: 9px; align-items: center; padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: rgba(7, 9, 17, .42); }
.modal-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex: 0 0 auto; }
.modal-panel-head h2 { margin: 0; }
.history-card { width: min(100%, 720px); display: flex; flex-direction: column; max-height: min(82vh, 760px); overflow: hidden; }
.history-list { min-height: 0; overflow-y: auto; margin-top: 16px; padding-right: 4px; }
.history-record { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 11px; align-items: center; padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: rgba(7, 9, 17, .42); }
.history-thumbnail { display: grid; place-items: center; width: 76px; height: 56px; overflow: hidden; padding: 0; color: var(--muted); border: 1px solid rgba(172,181,255,.22); border-radius: 7px; background: #090b13; font: inherit; font-size: 10px; line-height: 1.25; text-align: center; }
button.history-thumbnail { cursor: zoom-in; }
button.history-thumbnail:hover { border-color: var(--cyan); }
.history-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.history-preview-card { width: min(100%, 900px); max-height: min(90vh, 900px); overflow: auto; }
.history-preview-card h2 { margin-bottom: 0; font-size: 18px; }
.history-preview-card img { display: block; width: 100%; max-height: min(72vh, 760px); margin-top: 16px; border-radius: 9px; object-fit: contain; background: #090b13; }
.admin-user-identity { min-width: 0; }
.admin-user-identity b, .admin-user-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-user-identity small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.admin-active-toggle { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; }
.admin-active-toggle input { width: auto; }
.admin-provider-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-top: 18px; padding: 14px; border: 1px solid rgba(71,232,234,.22); border-radius: 9px; background: rgba(71,232,234,.04); }
.admin-provider-row b, .admin-provider-row small { display: block; }
.admin-provider-row small { margin-top: 4px; color: var(--muted); font-size: 11px; }

@media (max-width: 760px) {
  main { width: min(100% - 28px, 1440px); }
  .topbar { min-height: 62px; height: auto; padding: 10px 14px; gap: 9px; }
  .brand { font-size: 15px; white-space: normal; }
  .brand small { font-size: 8px; }
  .topbar-note { display: none; }
  .guide-link { margin-left: auto; padding: 7px; font-size: 11px; }
  .topbar-actions { margin-left: auto; gap: 6px; }
  .topbar-actions .guide-link { margin-left: 0; }
  .quota-status { max-width: 150px; overflow: hidden; font-size: 10px; text-overflow: ellipsis; }
  .hero { display: block; padding-top: 42px; }
  .model-status-card { margin-top: 21px; width: 100%; }
  .output-spec { min-width: 0; }
  .editor-layout { grid-template-columns: 1fr; }
  .canvas-wrap { min-height: 260px; }
  .preview-head, .runbar { display: block; }
  .runbar-actions { display: grid; grid-template-columns: 1fr; margin-top: 12px; }
  .runbar-actions .text-button, .runbar-actions .secondary-button, .runbar-actions .primary-button { width: 100%; }
  .mode-tabs { justify-content: start; margin-top: 10px; }
  .runbar .primary-button { width: 100%; margin-top: 12px; }
  .delivery-actions { display: grid; grid-template-columns: 1fr; width: 100%; margin-top: 10px; }
  .delivery-actions .secondary-button { width: 100%; }
  .diagnosis-head, .instruction-actions, .modal-actions { display: block; }
  .quality-pill { display: inline-block; margin-top: 10px; }
  .instruction-actions .secondary-button { width: 100%; margin-top: 10px; }
  .reference-upload-head { align-items: flex-start; }
  .modal-actions .primary-button, .modal-actions .text-button { width: 100%; margin-top: 9px; }
  .workflow-status { right: 14px; bottom: 14px; max-width: calc(100% - 28px); }
  .toast { right: 14px; bottom: 68px; max-width: calc(100% - 28px); }
  .selected-files { grid-template-columns: 1fr; }
  .admin-panel-card { max-height: 94vh; }
  .admin-panel-head, .admin-provider-row { display: block; }
  .admin-panel-head .text-button, .admin-provider-row .secondary-button { width: 100%; margin-top: 10px; }
  .history-card { max-height: calc(100dvh - 28px); }
  .modal-panel-head { align-items: flex-start; }
  .modal-panel-head .text-button { flex: 0 0 auto; margin: 0; }
  .admin-create-form, .admin-user-row { grid-template-columns: 1fr; }
  .history-record { grid-template-columns: 66px minmax(0, 1fr); }
  .history-record .secondary-button, .history-record > small { grid-column: 2; justify-self: start; }
  .history-thumbnail { width: 66px; height: 50px; }
}
