:root {
  color-scheme: light;
  --ink: #18201e; --muted: #66716d; --line: #dfe5e2; --paper: #ffffff;
  --canvas: #f3f5f2; --brand: #176b5b; --brand-dark: #0f5145; --accent: #d85d48;
  --warning: #b6761e; --danger: #aa4038; --shadow: 0 10px 28px rgba(24,32,30,.08);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--canvas); letter-spacing: 0; }
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
a { color: inherit; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 236px minmax(0,1fr); }
.sidebar { background: #14231f; color: #eef4f1; padding: 22px 16px; display: flex; flex-direction: column; min-height: 100vh; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 24px; font-weight: 760; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid #4b635d; background: #203a33; border-radius: 7px; }
.brand small { display: block; color: #9fb2ac; font-weight: 500; font-size: 11px; margin-top: 2px; }
.nav { display: grid; gap: 5px; }
.nav button { color: #adbbb7; background: transparent; border: 0; padding: 11px 12px; text-align: left; border-radius: 6px; display: flex; gap: 10px; align-items: center; }
.nav button.active, .nav button:hover { background: #263b35; color: white; }
.nav-link { color: #adbbb7; text-decoration: none; background: transparent; border: 0; padding: 11px 12px; text-align: left; border-radius: 6px; display: flex; gap: 10px; align-items: center; font-size: 13px; }
.nav-link.active, .nav-link:hover { background: #263b35; color: white; }
.side-foot { margin-top: auto; border-top: 1px solid #30453f; padding: 17px 8px 0; color: #a8b6b2; font-size: 12px; line-height: 1.6; }
.main { min-width: 0; }
.topbar { height: 68px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); padding: 0 28px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 10; backdrop-filter: blur(12px); }
.topbar h1 { font-size: 20px; margin: 0; }
.topbar p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.content { padding: 24px 28px 50px; max-width: 1450px; margin: auto; }
.btn { border: 1px solid var(--line); background: white; color: var(--ink); min-height: 40px; padding: 9px 14px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 650; }
.btn:hover { border-color: #aab8b3; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: white; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.danger { color: var(--danger); }
.btn.small { min-height: 34px; padding: 6px 10px; font-size: 13px; }
.btn.icon { width: 40px; padding: 0; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); border: 1px solid var(--line); background: var(--paper); margin-bottom: 20px; }
.stat { padding: 18px 20px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat b { display: block; font-size: 27px; margin-top: 7px; }
.stat span { color: var(--muted); font-size: 12px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.search { min-width: 240px; flex: 1; max-width: 420px; border: 1px solid var(--line); background: white; min-height: 40px; border-radius: 6px; padding: 0 12px; }
.segmented { display: flex; background: #e8ece9; padding: 3px; border-radius: 6px; gap: 2px; overflow-x: auto; }
.segmented button { border: 0; white-space: nowrap; background: transparent; padding: 7px 11px; border-radius: 4px; color: var(--muted); }
.segmented button.active { background: white; color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.table-wrap { border: 1px solid var(--line); background: white; overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 12px 14px; background: #f8faf8; color: var(--muted); font-size: 12px; font-weight: 650; }
td { padding: 14px; border-top: 1px solid var(--line); font-size: 14px; }
tbody tr { cursor: pointer; } tbody tr:hover { background: #f8faf8; }
.order-main { font-weight: 700; } .order-sub { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; background: #eef2ef; border-radius: 4px; font-size: 12px; white-space: nowrap; }
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #84908c; }
.status.pending_review::before, .status.ready_to_generate::before { background: var(--warning); }
.status.generating::before { background: #5168a5; }
.status.pending_delivery::before { background: var(--accent); }
.status.delivered::before { background: var(--brand); }
.empty { padding: 65px 20px; text-align: center; color: var(--muted); }
.empty svg { opacity: .45; margin-bottom: 8px; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(13,20,18,.52); display: grid; place-items: center; z-index: 50; padding: 18px; }
.modal { width: min(680px, 100%); max-height: calc(100vh - 36px); overflow: auto; background: white; border-radius: 8px; box-shadow: var(--shadow); }
.modal.wide { width: min(1120px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 20px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; background: white; }
.modal-head h2 { margin: 0; font-size: 19px; } .modal-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.modal-body { padding: 22px; } .modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 7px; } .field.full { grid-column: 1/-1; }
.field label { font-weight: 650; font-size: 13px; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid #ccd5d1; border-radius: 6px; padding: 10px 11px; background: white; color: var(--ink); }
.field textarea { min-height: 100px; resize: vertical; }
.service-grid { grid-column: 1/-1; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.service-choice { border: 1px solid var(--line); background: white; text-align: left; padding: 14px; min-height: 95px; border-radius: 6px; }
.service-choice.selected { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: #f3faf7; }
.service-choice b { display: block; margin-bottom: 5px; } .service-choice span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.share-box { display: grid; grid-template-columns: 1fr 190px; gap: 18px; align-items: center; }
.share-url { display: flex; gap: 8px; } .share-url input { flex: 1; min-width: 0; } .qr { width: 180px; height: 180px; border: 1px solid var(--line); }
.detail-grid { display: grid; grid-template-columns: minmax(0,1.05fr) minmax(320px,.75fr); gap: 20px; }
.section { border-top: 1px solid var(--line); padding: 18px 0; } .section:first-child { border-top: 0; padding-top: 0; }
.section h3 { font-size: 14px; margin: 0 0 13px; }
.brief-list { display: grid; grid-template-columns: 145px 1fr; gap: 8px 14px; margin: 0; font-size: 13px; }
.brief-list dt { color: var(--muted); } .brief-list dd { margin: 0; white-space: pre-wrap; }
.asset-grid, .result-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
.asset, .result { position: relative; aspect-ratio: 1/1; overflow: hidden; background: #e8ece9; border: 1px solid var(--line); }
.asset img, .result img { width: 100%; height: 100%; object-fit: cover; display: block; }
.asset img, .result img { cursor: zoom-in; }
.asset span { position: absolute; left: 5px; bottom: 5px; background: rgba(15,26,23,.78); color: white; padding: 3px 6px; border-radius: 3px; font-size: 10px; }
.result.selected { outline: 3px solid var(--brand); outline-offset: -3px; }
.result input { position: absolute; top: 8px; right: 8px; width: 20px; height: 20px; accent-color: var(--brand); }
.generate-panel { background: #f7f9f7; border: 1px solid var(--line); padding: 16px; }
.version { border-left: 2px solid #becac5; padding: 0 0 18px 16px; margin-left: 7px; }
.version:last-child { padding-bottom: 0; } .version-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.version-head b { font-size: 13px; } .version-head small { color: var(--muted); }
.prompt-details { margin: 10px 0 12px; border: 1px solid var(--line); background: #f8faf8; border-radius: 5px; }
.prompt-details summary { cursor: pointer; padding: 9px 11px; color: var(--brand-dark); font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.prompt-details summary svg { width: 14px; height: 14px; }
.prompt-meta { padding: 0 11px 9px; color: var(--muted); font-size: 11px; }
.prompt-block { border-top: 1px solid var(--line); padding: 9px 11px; }
.prompt-block label { display: block; color: var(--muted); font-size: 11px; font-weight: 700; margin-bottom: 5px; }
.prompt-block p { margin: 0; white-space: pre-wrap; word-break: break-word; font-size: 12px; line-height: 1.55; }
.toast { position: fixed; right: 22px; bottom: 22px; background: #17241f; color: white; padding: 12px 16px; border-radius: 6px; z-index: 100; box-shadow: var(--shadow); max-width: 360px; }
.hidden { display: none !important; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: #edf0eb url('/assets/login-studio.png') center / cover no-repeat; }
.login-card { width: min(420px, 100%); background: white; border: 1px solid var(--line); border-radius: 8px; padding: 30px; box-shadow: var(--shadow); }
.login-brand { color: var(--ink); padding: 0 0 28px; }
.login-card h1 { font-size: 22px; margin: 0 0 7px; }
.login-error { min-height: 18px; color: var(--danger); font-size: 12px; margin: 12px 0 0; }
.public-page { min-height: 100vh; background: #eef2ef; padding: 28px 16px 60px; }
.public-shell { width: min(760px,100%); margin: auto; }
.public-head { background: #193a32; color: white; padding: 28px; border-radius: 8px 8px 0 0; position: relative; overflow: hidden; }
.public-head::after { content: ''; position: absolute; width: 160px; height: 160px; border: 26px solid rgba(255,255,255,.08); right: -58px; top: -70px; border-radius: 50%; }
.public-head .eyebrow { color: #a9c6bc; font-size: 12px; } .public-head h1 { font-size: 25px; margin: 8px 0 7px; } .public-head p { margin: 0; color: #ccdad5; font-size: 13px; }
.public-body { background: white; border: 1px solid var(--line); border-top: 0; padding: 6px 28px 28px; }
.form-section { padding: 24px 0; border-bottom: 1px solid var(--line); } .form-section:last-child { border-bottom: 0; }
.form-section h2 { font-size: 16px; margin: 0 0 7px; } .required::after { content: ' 必填'; color: var(--accent); font-size: 10px; font-weight: 600; }
.help { color: var(--muted); font-size: 12px; margin: 0 0 12px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { border: 1px solid #cfd8d4; background: white; padding: 9px 12px; border-radius: 5px; min-height: 40px; color: #37423f; }
.choice.selected { background: #e9f4f0; border-color: var(--brand); color: var(--brand-dark); box-shadow: inset 0 0 0 1px var(--brand); }
.choice.visual { min-width: 140px; padding-top: 48px; position: relative; overflow: hidden; }
.choice.visual::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 38px; background: #dce9e3; }
.form-section input[type=text], .form-section textarea { width: 100%; border: 1px solid #cfd8d4; padding: 11px 12px; border-radius: 5px; }
.form-section textarea { min-height: 92px; resize: vertical; }
.dropzone { border: 1px dashed #9eaea8; background: #f8faf8; padding: 22px; text-align: center; border-radius: 6px; position: relative; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-previews { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; margin-top: 10px; }
.file-preview { aspect-ratio: 1; background: #e8ece9; overflow: hidden; position: relative; } .file-preview img { width: 100%; height: 100%; object-fit: cover; }
.sticky-submit { position: sticky; bottom: 0; padding: 14px 0 0; background: white; border-top: 1px solid var(--line); } .sticky-submit .btn { width: 100%; min-height: 50px; }
.success { padding: 55px 28px; text-align: center; background: white; border: 1px solid var(--line); }
.success-mark { width: 58px; height: 58px; display: grid; place-items: center; background: #e6f3ee; color: var(--brand); margin: auto auto 18px; border-radius: 50%; font-size: 28px; }
.delivery-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.delivery-item { background: white; border: 1px solid var(--line); overflow: hidden; } .delivery-item img { width: 100%; display: block; } .delivery-item div { padding: 11px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.delivery-image-button { display: block; position: relative; width: 100%; border: 0; padding: 0; background: #edf1ee; cursor: zoom-in; }
.delivery-image-button img { aspect-ratio: 1 / 1; object-fit: contain; }
.zoom-badge { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 5px; color: white; background: rgba(15,26,23,.82); border-radius: 5px; padding: 6px 8px; font-size: 11px; }
.zoom-badge svg { width: 14px; height: 14px; }
.lightbox-backdrop { position: fixed; inset: 0; z-index: 120; background: rgba(8,14,12,.9); display: grid; place-items: center; padding: 22px; cursor: zoom-out; }
.lightbox-image { max-width: min(96vw, 1400px); max-height: 88vh; width: auto; height: auto; object-fit: contain; box-shadow: 0 18px 70px rgba(0,0,0,.35); cursor: default; }
.lightbox-close { position: fixed; right: 18px; top: 18px; color: white; background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); z-index: 2; }
.lightbox-caption { position: fixed; bottom: 16px; left: 0; right: 0; text-align: center; color: rgba(255,255,255,.72); font-size: 12px; pointer-events: none; }
.prompt-preview-section { background: #f4faf7; border: 1px solid #cfe3da; padding: 14px; }
.prompt-preview-title { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.prompt-preview-title h3 { margin-bottom: 4px; } .prompt-preview-title > svg { color: var(--brand); width: 18px; height: 18px; }
@media (max-width: 800px) {
  .app-shell { display: block; } .sidebar { min-height: auto; height: 58px; position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; top: auto; padding: 6px 10px; }
  .brand, .side-foot { display: none; } .nav { display: grid; grid-template-columns: repeat(3,1fr); } .nav button { justify-content: center; padding: 9px 6px; font-size: 12px; }
  .topbar { height: 62px; padding: 0 16px; } .topbar p { display: none; } .topbar h1 { font-size: 18px; }
  .content { padding: 16px 12px 82px; } .stats { grid-template-columns: 1fr 1fr; } .stat:nth-child(2) { border-right: 0; } .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .stat { padding: 13px 14px; } .stat b { font-size: 22px; } .toolbar { align-items: stretch; flex-direction: column; } .search { max-width: none; width: 100%; }
  .table-wrap { border: 0; background: transparent; } table,thead,tbody,tr,th,td { display: block; } thead { display: none; } tbody { display: grid; gap: 9px; } tbody tr { background: white; border: 1px solid var(--line); padding: 13px; } td { border: 0; padding: 3px 0; } td[data-label]::before { content: attr(data-label); color: var(--muted); width: 76px; display: inline-block; font-size: 12px; }
  .form-grid, .detail-grid, .share-box { grid-template-columns: 1fr; } .service-grid { grid-template-columns: 1fr; } .qr { margin: auto; } .modal { max-height: 92vh; } .modal-head,.modal-body,.modal-actions { padding-left: 16px; padding-right: 16px; }
  .asset-grid,.result-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .public-page { padding: 0 0 40px; } .public-shell { width: 100%; } .public-head { border-radius: 0; padding: 24px 18px; } .public-body { padding: 4px 18px 24px; border-left: 0; border-right: 0; } .file-previews { grid-template-columns: repeat(3,1fr); } .delivery-grid { grid-template-columns: 1fr; } .delivery-item div { padding: 10px; } .zoom-badge { right: 8px; bottom: 8px; }
}
