:root {
  color-scheme: dark;
  --ink: #f3eee3;
  --muted: #a9a39a;
  --line: #3a3d43;
  --surface: #202329;
  --surface-2: #292d34;
  --surface-3: #30353d;
  --navy: #1e5b76;
  --gold: #d39d47;
  --red: #c1695e;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; background: #17191d; color: var(--ink); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
.topbar { height: 60px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--line); background: #1c1f24; }
.brand-mark { color: #f4ddad; font-family: "UnifrakturCook", "UnifrakturMaguntia", "Microsoft YaHei", serif; font-size: 30px; letter-spacing: 1px; }
.brand-mark.compact { font-size: 24px; }
.top-actions { display: flex; align-items: center; gap: 16px; }
.app-shell { min-height: calc(100vh - 60px); display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.project-sidebar { display: flex; flex-direction: column; border-right: 1px solid var(--line); background: #1c1f24; padding: 20px 14px 14px; }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 12px; color: #e6e0d5; font-size: 14px; font-weight: 700; }
.project-list { display: grid; gap: 4px; overflow: auto; }
.project-item { display: grid; gap: 3px; padding: 11px 12px; border: 1px solid transparent; border-radius: 6px; color: #c9c6be; text-align: left; background: transparent; }
.project-item:hover { background: var(--surface-2); }
.project-item.active { border-color: #58626e; background: #30353d; color: #fff; }
.project-item small { color: var(--muted); font-size: 11px; }
.sidebar-foot { margin-top: auto; padding: 12px 8px 0; font-size: 11px; line-height: 1.5; }
.workspace { min-width: 0; padding: 26px 30px 50px; }
.empty-state { min-height: 65vh; display: grid; align-content: center; justify-items: center; text-align: center; color: #d5d0c6; }
.empty-state h1 { margin: 10px 0 6px; font-size: 30px; font-weight: 700; }
.empty-state p { margin: 0 0 22px; color: var(--muted); }
.empty-icon { display: grid; place-items: center; width: 68px; height: 68px; border: 1px solid #5a4b38; color: #e0b266; font-size: 30px; }
.editor-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.editor-toolbar h1 { display: inline; margin: 0 10px 0 0; font-size: 26px; letter-spacing: 0; }
.toolbar-actions { display: flex; gap: 10px; }
.status-chip { display: inline-block; padding: 4px 8px; border: 1px solid #555b63; border-radius: 4px; color: #bbb6aa; font-size: 11px; vertical-align: 4px; }
.status-chip.ready { border-color: #4c8269; color: #8fd1aa; }
.editor-grid { display: grid; grid-template-columns: minmax(420px, .88fr) minmax(420px, 1.12fr); gap: 26px; align-items: start; }
.preview-panel { position: sticky; top: 22px; min-width: 0; }
.preview-frame { width: min(100%, 650px); margin: 0 auto; padding: 10px; border: 1px solid #454a52; background: #111316; box-shadow: 0 18px 40px rgba(0,0,0,.25); }
#posterCanvas { display: block; width: 100%; height: auto; background: #eee3c9; }
.preview-caption { margin-top: 10px; color: var(--muted); text-align: center; font-size: 11px; }
.controls-panel { display: grid; gap: 14px; min-width: 0; }
.control-section { padding: 16px; border: 1px solid var(--line); background: var(--surface); }
.section-title { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 13px; color: #eee8dc; font-size: 14px; font-weight: 700; }
.muted { color: var(--muted); font-size: 12px; font-weight: 400; }
.groups-editor { display: grid; gap: 13px; }
.group-block { display: grid; gap: 8px; }
.group-label { display: flex; justify-content: space-between; align-items: center; color: #b7d9e4; font-size: 13px; }
.group-label .count { color: var(--muted); font-size: 11px; }
.role-list { display: grid; gap: 6px; min-height: 38px; padding: 6px; border: 1px dashed #4b525b; background: #24282e; }
.role-list.drag-over, .sortable-list.drag-over { border-color: var(--gold); background: #2c2b28; }
.drag-item { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 7px 8px; border: 1px solid #414750; border-radius: 4px; background: #30353d; color: #e7e0d5; font-size: 12px; user-select: none; }
.drag-item:hover { border-color: #7c8793; }
.drag-handle { color: #8e949c; font-size: 14px; }
.role-team { margin-left: auto; color: #939aa3; font-size: 10px; }
.mini-upload { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin: 0 0 0 4px; border: 1px solid #59616a; border-radius: 3px; color: #c9a568; font-size: 12px; cursor: pointer; }
.mini-upload:hover { border-color: #c9a568; background: #3b3933; }
.mini-upload input { display: none; }
.night-editors { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.night-editors h3 { margin: 0 0 7px; color: #c6c0b5; font-size: 12px; font-weight: 600; }
.sortable-list { display: grid; gap: 6px; min-height: 45px; padding: 6px; border: 1px dashed #4b525b; background: #24282e; }
label { display: grid; gap: 6px; margin-bottom: 11px; color: #bcb8ae; font-size: 12px; }
input, textarea { width: 100%; border: 1px solid #4a5058; border-radius: 4px; outline: none; background: #191c20; color: #f0ebe2; }
input { height: 38px; padding: 0 10px; }
textarea { resize: vertical; min-height: 48px; padding: 8px 10px; line-height: 1.5; }
input:focus, textarea:focus { border-color: #9d7b48; }
button { border: 0; border-radius: 4px; }
.primary, .secondary, .ghost { min-height: 38px; padding: 0 14px; font-weight: 700; }
.primary { background: #bd853d; color: #1c1711; }
.primary:hover { background: #d49b4f; }
.secondary { border: 1px solid #65707c; background: #30353d; color: #eee8dc; }
.secondary:hover { border-color: #b49a6d; }
.ghost { color: #b7b9ba; background: transparent; }
.ghost:hover { color: #fff; background: var(--surface-2); }
.icon-button { width: 28px; height: 28px; border: 1px solid #57606b; background: transparent; color: #d4a155; font-size: 21px; line-height: 1; }
.icon-button:hover { background: var(--surface-3); }
.text-button { margin-top: 13px; padding: 0; color: #d5a460; background: transparent; font-size: 12px; }
.text-button:hover { color: #f0c983; }
.wide { width: 100%; }
.file-control { display: flex; align-items: center; justify-content: space-between; padding: 9px 10px; border: 1px solid #4a5058; background: #191c20; }
.file-control input { width: auto; height: auto; padding: 0; border: 0; background: transparent; color: #aaa; font-size: 11px; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 22px; background: radial-gradient(circle at 50% -10%, #30343e, #17191d 55%); }
.auth-panel { width: min(100%, 380px); padding: 34px; border: 1px solid #494e57; background: #202329; box-shadow: 0 25px 80px rgba(0,0,0,.35); }
.auth-panel .brand-mark { margin-bottom: 6px; }
.auth-panel form { margin-top: 22px; }
.auth-panel .primary { width: 100%; margin-top: 4px; }
.error { min-height: 18px; margin: 12px 0 0; color: #df8d80; font-size: 12px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 20; max-width: 360px; padding: 10px 13px; border: 1px solid #5f584d; border-radius: 4px; background: #282a2d; color: #eee8dc; font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .18s, transform .18s; }
.toast.show { opacity: 1; transform: translateY(0); }
@media (max-width: 1080px) { .editor-grid { grid-template-columns: 1fr; } .preview-panel { position: static; } .preview-frame { width: min(100%, 600px); } }
@media (max-width: 720px) { .app-shell { grid-template-columns: 1fr; } .project-sidebar { border-right: 0; border-bottom: 1px solid var(--line); min-height: 0; } .project-list { display: flex; overflow-x: auto; } .project-item { min-width: 180px; } .workspace { padding: 18px 14px 35px; } .editor-toolbar { align-items: flex-start; flex-direction: column; } .toolbar-actions { width: 100%; } .toolbar-actions button { flex: 1; } .night-editors { grid-template-columns: 1fr; } }
