:root {
  color-scheme: light;
  --ink: #18231f;
  --muted: #647069;
  --line: #dfe4df;
  --panel: #ffffff;
  --canvas: #eef1ed;
  --accent: #b9f34a;
  --accent-dark: #5f850f;
  --danger: #c24444;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: #f6f8f5; font-size: 16px; }
button, input { font: inherit; }
.topbar { height: 68px; padding: 0 clamp(20px, 4vw, 64px); display: flex; align-items: center; justify-content: space-between; background: var(--ink); color: white; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 720; }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: var(--ink); background: var(--accent); font-size: 21px; }
.phase { color: #bdc7c1; font-size: .875rem; }
.workspace { width: min(1420px, calc(100% - 40px)); margin: 0 auto; padding: 44px 0 56px; }
.intro { margin-bottom: 28px; }
.eyebrow { margin: 0 0 8px; color: var(--accent-dark); font-size: .8125rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.75rem); line-height: 1.15; letter-spacing: -.035em; }
.intro > p:last-child { margin: 12px 0 0; color: var(--muted); }
.tool-grid { display: grid; grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); gap: 20px; align-items: start; }
.control-panel, .preview-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 16px 40px rgba(24,35,31,.06); }
.control-panel { padding: 18px; }
.dropzone { min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; text-align: center; border: 1.5px dashed #aab5ad; border-radius: 13px; background: #fafcf9; cursor: pointer; transition: .18s ease; }
.dropzone:hover, .dropzone:focus-visible, .dropzone.dragging { outline: none; border-color: var(--accent-dark); background: #f4fbe8; }
.upload-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--accent); font-size: 25px; }
.dropzone span, .file-card span { color: var(--muted); font-size: .875rem; }
.file-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 4px; border-bottom: 1px solid var(--line); }
.file-card div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.file-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-button { border: 0; padding: 8px; color: #476809; background: transparent; cursor: pointer; font-weight: 700; }
.status-card { display: flex; gap: 12px; padding: 18px 5px 4px; }
.status-card p { margin: 5px 0 0; color: var(--muted); font-size: .875rem; line-height: 1.5; }
.status-dot { flex: 0 0 auto; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: #aab2ad; }
.status-dot.loading { border: 2px solid #d1d7d2; border-top-color: var(--accent-dark); background: transparent; animation: spin .8s linear infinite; }
.status-dot.success { background: #6b9e16; }
.status-dot.error { background: var(--danger); }
@keyframes spin { to { transform: rotate(360deg); } }
.qr-list { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.qr-item { width: 100%; display: flex; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: white; cursor: pointer; text-align: left; }
.qr-item:hover, .qr-item.active { border-color: #6f9e1c; box-shadow: 0 0 0 2px rgba(185,243,74,.25); }
.qr-item span { color: var(--muted); font-size: .8125rem; }
.adjust-menu { margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.adjust-menu summary { cursor: pointer; font-weight: 750; }
.adjust-menu p { margin: 9px 0; color: var(--muted); font-size: .875rem; }
.scale-control { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; margin-top: 10px; font-size: .875rem; }
.advisor-section { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.advisor-section > label { display: block; margin-bottom: 10px; font-weight: 750; }
.advisor-picker { display: grid; grid-template-columns: 1fr 74px; gap: 10px; align-items: stretch; }
.advisor-picker select { width: 100%; padding: 0 12px; border: 1px solid #b8c1ba; border-radius: 10px; color: var(--ink); background: white; }
.advisor-picker img { width: 74px; height: 74px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; image-rendering: pixelated; }
.remember-option { display: flex; align-items: flex-start; gap: 9px; margin-top: 12px; color: var(--muted); font-size: .875rem; line-height: 1.45; cursor: pointer; }
.remember-option input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: #6f9e1c; flex: 0 0 auto; }
.primary-button, .secondary-button { min-height: 46px; display: inline-grid; place-items: center; width: 100%; margin-top: 12px; padding: 0 16px; border-radius: 10px; cursor: pointer; font-weight: 780; text-decoration: none; }
.primary-button { border: 1px solid var(--ink); color: var(--ink); background: var(--accent); box-shadow: 0 3px 0 var(--ink); }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--ink); }
.primary-button:disabled { cursor: wait; opacity: .58; transform: none; }
.secondary-button { border: 1px solid var(--line); color: var(--ink); background: white; }
.result-actions { margin-top: 18px; padding-top: 6px; }
.preview-panel { overflow: hidden; }
.preview-head { min-height: 58px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.preview-head span { color: var(--muted); font-size: .875rem; }
.preview-stage { min-height: 570px; padding: 24px; display: grid; place-items: center; background: var(--canvas); overflow: auto; }
.empty-preview { color: var(--muted); text-align: center; }
.poster-ghost { width: 128px; height: 166px; margin: 0 auto 18px; padding: 14px; border: 2px solid #cbd2cc; border-radius: 7px; background: #f8faf7; }
.poster-ghost span { display: block; width: 43px; height: 43px; margin: 80px 0 0 auto; background: repeating-conic-gradient(#9aa49c 0 25%, transparent 0 50%) 0 / 8px 8px; }
.canvas-wrap { position: relative; max-width: 100%; line-height: 0; box-shadow: 0 10px 30px rgba(24,35,31,.18); }
#posterCanvas { max-width: 100%; height: auto; }
#posterCanvas.selecting { cursor: crosshair; touch-action: none; }
.hidden { display: none !important; }

@media (max-width: 820px) {
  .workspace { width: min(100% - 24px, 680px); padding-top: 28px; }
  .tool-grid { grid-template-columns: 1fr; }
  .dropzone { min-height: 170px; }
  .preview-stage { min-height: 420px; padding: 12px; }
  .phase { display: none; }
}
