:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #687184;
  --line: #dfe4ec;
  --paper: #ffffff;
  --wash: #f3f5f8;
  --navy: #121b2c;
  --blue: #1d5eff;
  --teal: #0c9b8c;
  --orange: #d36b22;
  --red: #c2414c;
  --shadow: 0 18px 50px rgba(19, 30, 50, .09);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--wash); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }

.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: 92px; padding: 20px 10px; display: flex; flex-direction: column; align-items: center; background: #fff; border-right: 1px solid #e8ebf0; }
.sidebar-logo { display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 13px; color: #fff; background: var(--blue); font-weight: 900; box-shadow: 0 8px 20px rgba(29,94,255,.22); }
.sidebar-nav { width: 100%; margin-top: 42px; display: grid; gap: 9px; }
.sidebar-link { width: 100%; min-height: 64px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border: 0; border-radius: 12px; color: #7a8495; background: transparent; }
.sidebar-link[hidden], .quick-tool-card[hidden] { display: none !important; }
.sidebar-link span { font-size: 21px; line-height: 1; }
.sidebar-link b { font-size: 11px; line-height: 1.18; font-weight: 700; text-align: center; white-space: normal; }
.sidebar-link:hover, .sidebar-link.active { color: var(--blue); background: #eef3ff; }
.sidebar .system-status { width: 100%; margin-top: auto; padding: 10px 2px; flex-direction: column; gap: 5px; color: #7a8495; text-align: center; }
.sidebar .system-status b { font-size: 10px; font-weight: 700; }
.app-shell { min-height: 100vh; margin-left: 92px; }
.app-header { height: 70px; padding: 0 34px; display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,.9); border-bottom: 1px solid #e8ebf0; backdrop-filter: blur(14px); }
.app-header .brand-mark { display: none; }
.header-actions { display: flex; align-items: center; gap: 9px; }
.header-history-button { padding: 10px 15px; border: 1px solid #d8e1f1; border-radius: 10px; color: #315fd2; background: #f7f9ff; font-weight: 800; }
.header-video-button { padding: 10px 15px; border: 0; border-radius: 10px; color: #fff; background: var(--blue); font-weight: 800; }
.shell-main { width: min(1240px, calc(100% - 56px)); margin: 0 auto; padding: 44px 0 84px; }
.app-view[hidden] { display: none !important; }
.shell-main.studio-mode { width: min(1040px, calc(100% - 28px)); max-width: 1040px; padding: 12px 0 28px; display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.studio-mode #workflowView { order: 1; width: 100%; min-width: 0; }
.studio-mode #videoView { order: 2; position: static; width: 100%; min-width: 0; max-height: none; overflow: visible; }
.studio-mode .video-prompt-editor, .studio-mode .copy-script-button { display: none !important; }
.studio-mode .page-heading { min-height: 0; margin-bottom: 5px; padding: 0 2px; align-items: start; }
.studio-mode .page-heading h1 { font-size: 23px; }
.studio-mode .page-heading p:last-child { font-size: 13px; line-height: 1.55; }
.studio-mode .rule-badge { max-width: 190px; text-align: center; }
.studio-mode .video-generation-card { margin-top: 0; min-height: 0; padding: 12px; border-radius: 14px; }
.studio-mode .workflow-inline-generator {
  margin-top: 7px;
  padding: 8px 0 0;
  border: 0;
  border-top: 1px solid rgba(105,117,155,.12);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.studio-mode .workflow-inline-generator .video-generation-head { display: none; }
.studio-mode .workflow-inline-generator > .unified-material-upload {
  min-height: 58px;
  padding: 7px 10px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 9px;
  text-align: left;
}
.studio-mode .workflow-inline-generator > .unified-material-upload .unified-upload-icon {
  grid-column: 1;
  grid-row: 1 / 3;
  width: 28px;
  height: 28px;
  font-size: 18px;
}
.studio-mode .workflow-inline-generator > .unified-material-upload strong { grid-column: 2; align-self: end; margin: 0; font-size: 13px; }
.studio-mode .workflow-inline-generator > .unified-material-upload small { grid-column: 2; align-self: start; margin: 1px 0 0; font-size: 10px; }
.studio-mode .video-settings-grid { grid-template-columns: 1fr 1fr; }
.studio-mode .generator-assets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.studio-mode .workspace-card, .studio-mode .results { padding: 10px; border-radius: 13px; }
.studio-mode .workflow-material-entry-grid { gap: 7px; }
.studio-mode .workflow-material-entry-grid .unified-material-upload { min-height: 86px; padding: 10px; border-radius: 12px; }
.studio-mode .workflow-material-entry-grid .unified-upload-icon { width: 28px; height: 28px; font-size: 18px; }
.studio-mode .workflow-material-entry-grid .unified-material-upload strong { margin-top: 5px; font-size: 13px; }
.studio-mode .workflow-material-entry-grid .unified-material-upload small { margin-top: 2px; font-size: 10px; }
.studio-mode .unified-material-preview { margin-top: 6px; gap: 7px; }
.studio-mode .upload-grid { gap: 10px; margin-top: 14px; }
.studio-mode .upload-zone { min-height: 88px; padding: 8px; border-radius: 11px; }
.studio-mode .upload-icon { width: 24px; height: 24px; margin-bottom: 4px; border-radius: 7px; font-size: 10px; }
.studio-mode .upload-zone strong { font-size: 13px; }
.studio-mode .upload-zone p { margin: 3px 0 2px; font-size: 10px; }
.studio-mode .upload-zone small { font-size: 9px; }
.studio-mode .upload-state { margin-top: 9px; padding: 5px 9px; font-size: 10px; }
.studio-mode .run-row { margin-top: 7px; padding-top: 7px; }
.run-row.compact-run-row { justify-content: flex-end; }
.studio-mode .results-head h2 { font-size: 20px; }
.studio-mode .progress-panel { margin-top: 7px; }
.studio-mode .results { margin-top: 7px; }
.studio-mode .script-result-panel {
  margin-top: 6px;
  padding: 6px;
  border: 1px solid #d5dce8;
  border-radius: 12px;
  background: #fbfcfe;
}
.studio-mode .script-result-panel:focus-within { border-color: #7e9fff; box-shadow: 0 0 0 3px rgba(29,94,255,.08); }
.studio-mode .workflow-inline-material-dock { margin: 0 0 6px; }
.studio-mode .workflow-inline-material-dock > .unified-material-upload {
  min-height: 54px;
  padding: 6px 9px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 8px;
  border-radius: 9px;
  text-align: left;
}
.studio-mode .workflow-inline-material-dock > .unified-material-upload .unified-upload-icon {
  grid-column: 1;
  grid-row: 1 / 3;
  width: 26px;
  height: 26px;
  font-size: 17px;
}
.studio-mode .workflow-inline-material-dock > .unified-material-upload strong { grid-column: 2; align-self: end; margin: 0; font-size: 12px; }
.studio-mode .workflow-inline-material-dock > .unified-material-upload small { grid-column: 2; align-self: start; margin: 1px 0 0; font-size: 9px; }
.studio-mode .workflow-inline-material-dock .unified-material-preview { margin-top: 5px; }
.studio-mode .script-result-panel > .material-mention-menu {
  position: static;
  width: 100%;
  max-height: 190px;
  margin: 0 0 6px;
  box-shadow: 0 8px 22px rgba(24,38,65,.12);
}
.studio-mode .unified-script-editor {
  min-height: 400px;
  padding: 10px 8px 7px;
  border: 0;
  border-top: 1px solid rgba(105,117,155,.12);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  line-height: 1.62;
}
.studio-mode .unified-script-editor:focus { border-color: rgba(105,117,155,.12); background: transparent; box-shadow: none; }
.studio-mode .basic-video-settings { margin: 7px 0; }
.studio-mode .visual-parameters { gap: 7px; padding: 8px; }
.studio-mode #videoView .unified-material-upload { min-height: 82px; padding: 10px; }
.home-view { min-height: calc(100vh - 190px); }
.home-intro { padding: 34px 0 22px; text-align: center; }
.home-intro h1 { margin: 0; font-size: clamp(34px, 4vw, 54px); letter-spacing: -.05em; }
.home-intro > p:last-child { margin: 14px 0 0; color: var(--muted); }
.home-command-card { width: min(840px, 100%); min-height: 154px; margin: 22px auto 42px; padding: 18px 20px; display: grid; grid-template-columns: 58px 1fr; grid-template-rows: 1fr auto; gap: 8px 16px; border: 1px solid #e6e9ef; border-radius: 22px; background: #fff; box-shadow: 0 20px 55px rgba(32,48,75,.10); }
.home-add-button { grid-row: 1 / 3; align-self: start; width: 54px; height: 54px; border: 0; border-radius: 15px; color: #263246; background: #e8f8ff; font-size: 24px; transform: rotate(-5deg); }
.home-command-card textarea { min-height: 65px; padding: 7px 0; resize: none; border: 0; outline: 0; color: var(--ink); font-size: 15px; }
.home-command-card > div { display: flex; align-items: center; justify-content: space-between; color: #576176; font-size: 13px; font-weight: 700; }
.home-command-card > div button { width: 36px; height: 36px; border: 0; border-radius: 50%; color: #fff; background: var(--blue); font-size: 20px; }
.quick-tools { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; width: min(980px, 100%); margin: 0 auto; }
.quick-tool-card { min-height: 145px; padding: 24px; display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 18px; border: 1px solid #e1e5ec; border-radius: 18px; color: var(--ink); background: #fff; text-align: left; box-shadow: 0 10px 30px rgba(32,48,75,.06); transition: .2s ease; }
.quick-tool-card:hover { transform: translateY(-3px); border-color: #bfd0ff; box-shadow: 0 16px 38px rgba(32,48,75,.1); }
.quick-tool-card div { display: grid; gap: 7px; }
.quick-tool-card strong { font-size: 19px; }
.quick-tool-card small { color: var(--muted); line-height: 1.5; }
.quick-tool-card i { color: var(--blue); font-size: 12px; font-style: normal; font-weight: 800; }
.quick-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 15px; color: #fff; font-size: 25px; }
.quick-icon.blue { background: linear-gradient(135deg, #2f6cff, #5e8cff); }
.quick-icon.purple { background: linear-gradient(135deg, #6d48d8, #906cf0); }
.quick-icon.cyan { background: linear-gradient(135deg, #08a8ba, #39c8d5); }
.quick-icon.orange { background: linear-gradient(135deg, #dd7328, #f0a044); }
.home-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: min(980px, 100%); margin: 34px auto 0; }
.home-steps article { padding: 17px 20px; display: grid; gap: 4px; border-top: 1px solid #dfe4ec; }
.home-steps span { color: var(--blue); font-size: 11px; font-weight: 900; }
.home-steps b { font-size: 14px; }
.home-steps small { color: var(--muted); }
.history-view { max-width: 1180px; margin: 0 auto; }
.history-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 18px 0 24px; }
.history-heading h1 { margin: 0; font-size: 34px; letter-spacing: -.04em; }
.history-heading p { margin: 9px 0 0; color: var(--muted); }
.history-heading > button { min-width: 76px; min-height: 38px; border: 1px solid #d9e0ea; border-radius: 9px; color: #445066; background: #fff; }
.history-toolbar { margin-bottom: 14px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; border: 1px solid #e1e6ee; border-radius: 12px; background: #fff; }
.history-toolbar > span { color: var(--muted); font-size: 12px; }
.history-filters { display: flex; gap: 5px; }
.history-filters button { min-width: 68px; padding: 8px 13px; border: 0; border-radius: 8px; color: #647086; background: transparent; font-size: 12px; }
.history-filters button.active { color: var(--blue); background: #edf3ff; font-weight: 800; }
.history-list { display: grid; gap: 10px; }
.history-card { padding: 16px; display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 14px; border: 1px solid #e0e5ed; border-radius: 14px; background: #fff; box-shadow: 0 8px 24px rgba(24,38,63,.04); }
.history-type { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: #fff; font-size: 11px; font-weight: 900; }
.history-type.script { background: linear-gradient(135deg, #2d67ff, #6e91ff); }
.history-type.video { background: linear-gradient(135deg, #6c48d8, #9271ee); }
.history-main { min-width: 0; }
.history-title { display: flex; align-items: center; gap: 9px; }
.history-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.history-main p { margin: 5px 0; overflow: hidden; color: #5f6b7e; font-size: 12px; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
.history-main small { color: #929aaa; font-size: 10px; }
.history-status { padding: 3px 7px; border-radius: 999px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.history-status.success { color: #087e69; background: #e8f8f3; }
.history-status.working { color: #a95d0b; background: #fff4df; }
.history-status.failed { color: #af3341; background: #ffebed; }
.history-status.unknown { color: #687184; background: #edf0f4; }
.history-error { margin-top: 7px; padding: 7px 9px; border-radius: 7px; color: #9d2e39; background: #fff0f1; font-size: 11px; }
.history-actions { display: flex; gap: 7px; }
.history-actions button { min-height: 34px; padding: 0 12px; border: 1px solid #cbd7f7; border-radius: 8px; color: var(--blue); background: #f7f9ff; font-size: 11px; font-weight: 700; }
.history-actions button.danger { border-color: #ead9dc; color: #9d4651; background: #fffafa; }
.history-empty { padding: 70px 20px; border: 1px dashed #d3dae5; border-radius: 14px; color: #8b94a5; background: rgba(255,255,255,.65); text-align: center; }

.skills-view { max-width: 1180px; margin: 0 auto; }
.skills-heading { margin-bottom: 24px; padding: 12px 2px 0; }
.skills-heading h1 { margin: 0; font-size: 34px; letter-spacing: -.04em; }
.skills-heading p { margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.skill-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.skill-card { min-height: 128px; padding: 20px; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 15px; border: 1px solid #e0e5ed; border-radius: 16px; color: var(--ink); background: #fff; text-align: left; box-shadow: 0 9px 28px rgba(32,48,75,.05); transition: .2s ease; }
.skill-card:hover { transform: translateY(-2px); border-color: #bfd0ff; box-shadow: 0 15px 34px rgba(32,48,75,.09); }
.skill-card-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 13px; color: #fff; font-size: 15px; font-weight: 900; }
.skill-card-icon.blue { background: linear-gradient(135deg, #2f6cff, #6d91ff); }
.skill-card-icon.purple { background: linear-gradient(135deg, #6845d2, #9c76ee); }
.skill-card-icon.orange { background: linear-gradient(135deg, #dd7328, #f0a044); }
.skill-card h2 { margin: 0; font-size: 18px; }
.skill-card p { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.skill-card i { color: var(--blue); font-size: 10px; font-style: normal; font-weight: 800; white-space: nowrap; }
.skill-workspace { margin-top: 0; padding: 32px; border: 1px solid #e0e4eb; border-radius: 22px; background: #fff; box-shadow: var(--shadow); }
.skill-workspace-head { margin-bottom: 18px; display: flex; align-items: end; justify-content: space-between; gap: 22px; }
.skill-workspace-head span { color: var(--blue); font-size: 10px; font-weight: 900; }
.skill-workspace-head h2 { margin: 4px 0 0; font-size: 23px; }
.skill-workspace-head p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.skill-workspace-head > button { min-height: 36px; padding: 0 13px; border: 1px solid #d7dfeb; border-radius: 9px; color: #556176; background: #f8f9fb; font-size: 11px; font-weight: 700; }
.preset-skill-form { display: grid; gap: 14px; }
.preset-skill-form[hidden], .skill-media-preview[hidden], .skill-media-gallery[hidden] { display: none !important; }
.skill-upload-grid { display: grid; gap: 12px; }
.skill-upload-grid.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.skill-upload-grid.four-columns { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.skill-upload { position: relative; min-height: 220px; padding: 18px 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1.5px dashed #cbd4e1; border-radius: 16px; background: #fafbfc; text-align: center; cursor: pointer; transition: .2s ease; overflow: hidden; }
.skill-upload-grid.two-columns .skill-upload { min-height: 330px; }
.skill-upload:hover { border-color: #8faaff; background: #f6f8ff; }
.skill-upload.loaded { justify-content: flex-start; border-style: solid; border-color: #86b9aa; background: #f7fbfa; }
.skill-upload input { position: absolute; opacity: 0; pointer-events: none; }
.skill-upload > span { width: 30px; height: 30px; margin-bottom: 9px; display: grid; place-items: center; border-radius: 9px; color: #fff; background: var(--blue); font-size: 10px; font-weight: 900; }
.skill-upload.loaded > span { display: none; }
.skill-upload:nth-child(2) > span { background: #6d48d8; }
.skill-upload:nth-child(3) > span { background: #0c9b8c; }
.skill-upload:nth-child(4) > span { background: #d36b22; }
.skill-upload strong { font-size: 13px; }
.skill-upload small { max-width: 100%; margin-top: 6px; overflow: hidden; color: #8a94a5; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.face-library-folder { width: 100%; min-height: 76px; padding: 13px 16px; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 14px; border: 1px solid #dce4f0; border-radius: 14px; color: #253149; background: linear-gradient(135deg, #f8faff, #f3f6fc); text-align: left; transition: .18s ease; }
.face-library-folder:hover { border-color: #9bb3fa; background: #f3f6ff; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(41,56,85,.08); }
.face-library-folder.has-selection { border-color: #72ad9d; background: #f2faf7; }
.face-folder-icon { position: relative; width: 46px; height: 34px; display: block; border-radius: 5px 7px 7px 7px; background: linear-gradient(145deg, #f5b83f, #e89516); box-shadow: inset 0 -4px 8px rgba(130,76,4,.13); }
.face-folder-icon::before { content: ""; position: absolute; left: 3px; top: -7px; width: 21px; height: 10px; border-radius: 5px 5px 0 0; background: #f2ad2b; }
.face-library-folder > span:nth-child(2) { min-width: 0; }
.face-library-folder strong, .face-library-folder small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.face-library-folder strong { font-size: 13px; }
.face-library-folder small { margin-top: 5px; color: #7c8799; font-size: 10px; }
.face-library-folder b { color: var(--blue); font-size: 11px; white-space: nowrap; }
.face-library-open { overflow: hidden; }
.face-library-modal { position: fixed; inset: 0; z-index: 1120; display: grid; place-items: center; padding: 24px; background: rgba(15,23,42,.58); backdrop-filter: blur(4px); }
.face-library-modal[hidden] { display: none; }
.face-library-dialog { width: min(940px, 100%); max-height: min(820px, calc(100vh - 48px)); display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; overflow: hidden; border: 1px solid #dfe6ef; border-radius: 20px; background: #f8fafe; box-shadow: 0 28px 80px rgba(15,23,42,.28); }
.face-library-head { margin: 0; padding: 20px 22px 16px; display: flex; align-items: start; justify-content: space-between; gap: 18px; border-bottom: 1px solid #e4e9f1; background: #fff; }
.face-library-head > div > span { color: var(--blue); font-size: 9px; font-weight: 850; letter-spacing: .12em; }
.face-library-head h2 { margin: 4px 0 0; font-size: 22px; }
.face-library-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.face-library-head > button { width: 34px; height: 34px; border: 0; border-radius: 9px; color: #5d6879; background: #f1f4f8; font-size: 22px; line-height: 1; }
.face-library-toolbar { padding: 12px 22px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid #e6ebf2; background: #fbfcfe; }
.face-library-toolbar > small { color: #8993a3; font-size: 10px; }
.face-library-filters { display: flex; gap: 6px; }
.face-library-filters button { min-width: 48px; min-height: 30px; padding: 0 12px; border: 1px solid #d7dfeb; border-radius: 999px; color: #5b6679; background: #fff; font-size: 11px; font-weight: 700; }
.face-library-filters button.active { border-color: var(--blue); color: #fff; background: var(--blue); }
.face-library-grid { padding: 18px 22px 22px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; overflow-y: auto; }
.face-library-card[hidden] { display: none; }
.face-library-card { min-width: 0; padding: 7px 7px 9px; border: 2px solid transparent; border-radius: 13px; color: #222b3b; background: #fff; box-shadow: 0 5px 16px rgba(41,56,85,.07); text-align: left; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.face-library-card:hover { transform: translateY(-2px); border-color: #aac0ff; box-shadow: 0 8px 20px rgba(41,56,85,.12); }
.face-library-card.selected { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(29,94,255,.12); }
.face-library-card.selected::after { content: "✓ 已选"; position: absolute; top: 12px; right: 11px; padding: 3px 6px; border-radius: 999px; color: #fff; background: var(--blue); font-size: 9px; font-weight: 800; }
.face-library-card { position: relative; }
.face-library-card img { width: 100%; aspect-ratio: 1; display: block; border-radius: 9px; object-fit: cover; background: #eef1f5; }
.face-library-card span, .face-library-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.face-library-card span { margin-top: 7px; font-size: 11px; font-weight: 800; }
.face-library-card small { margin-top: 2px; color: #8a94a5; font-size: 9px; }
.face-library-dialog > footer { width: auto; margin: 0; padding: 12px 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid #e4e9f1; color: #69758a; background: #fff; font-size: 11px; }
.face-library-dialog > footer button { min-height: 34px; padding: 0 17px; border: 1px solid #d7dfeb; border-radius: 8px; color: #536074; background: #f8f9fb; font-weight: 700; }
.skill-media-preview { display: block; width: 100%; height: 230px; margin-bottom: 12px; border-radius: 11px; background: #eef1f5; object-fit: contain; }
video.skill-media-preview { background: #111827; }
.skill-upload-grid.four-columns .skill-media-preview { height: 150px; }
.skill-media-gallery { width: 100%; height: 150px; margin-bottom: 12px; padding: 6px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; overflow: auto; border-radius: 11px; background: #eef1f5; }
.skill-media-gallery img { display: block; width: 100%; height: 64px; border-radius: 7px; background: #fff; object-fit: contain; }
.preset-video-settings { margin-top: 4px; padding-top: 18px; display: grid; gap: 12px; border-top: 1px solid #e3e8f0; }
.preset-video-settings .preset-model-setting { grid-template-columns: 1fr; margin: 0; }
.preset-video-settings .visual-parameters { background: #f8f9fb; }
.preset-video-settings .generation-mode-help { margin: 0; text-align: center; }
.skill-run-button { width: 100%; min-height: 48px; border: 0; border-radius: 11px; color: #fff; background: var(--blue); box-shadow: 0 8px 22px rgba(29,94,255,.18); font-weight: 800; }
.skill-run-button:hover:not(:disabled) { background: #154ed7; }
.skill-review-note { margin: 12px 0 0; color: #8490a3; font-size: 10px; line-height: 1.6; text-align: center; }
.skill-workspace .video-task-panel { margin-top: 16px; }
.page-heading { margin-bottom: 24px; display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.page-heading h1 { margin: 0; font-size: 36px; letter-spacing: -.04em; }
.page-heading p:last-child { margin: 9px 0 0; color: var(--muted); }
.field-label.first { margin-top: 0; }

.topbar {
  height: 72px; padding: 0 max(28px, calc((100vw - 1180px) / 2)); display: flex; align-items: center;
  justify-content: space-between; color: #fff; background: var(--navy); border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--blue); font-weight: 800; }
.brand div { display: flex; flex-direction: column; gap: 2px; }
.brand strong { font-size: 16px; letter-spacing: .03em; }
.brand small { color: #9da8bb; }
.system-status { display: flex; align-items: center; gap: 8px; color: #c9d0dc; font-size: 13px; }
.system-status span { width: 8px; height: 8px; border-radius: 50%; background: #8791a3; box-shadow: 0 0 0 4px rgba(135,145,163,.14); }
.system-status.ready span { background: #38d9a9; box-shadow: 0 0 0 4px rgba(56,217,169,.15); }
.system-status.warning span { background: #ffb454; box-shadow: 0 0 0 4px rgba(255,180,84,.15); }
.system-status.error span { background: #ff6b72; }

main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 58px 0 76px; }
.hero { display: grid; grid-template-columns: 1.08fr .92fr; gap: 48px; align-items: end; margin-bottom: 34px; }
.eyebrow { margin: 0 0 10px; color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.hero h1 { margin: 0; font-size: clamp(32px, 4.2vw, 54px); line-height: 1.12; letter-spacing: -.05em; }
.hero > div > p:last-child { max-width: 650px; margin: 18px 0 0; color: var(--muted); font-size: 16px; line-height: 1.8; }
.flow-map { display: flex; align-items: center; justify-content: space-between; padding: 22px; border-radius: 18px; color: #e8edf7; background: var(--navy); box-shadow: var(--shadow); }
.flow-map div { display: flex; flex-direction: column; gap: 3px; min-width: 82px; }
.flow-map span { color: #7295ff; font-size: 11px; font-weight: 800; }
.flow-map strong { font-size: 14px; }
.flow-map small { color: #8792a7; font-size: 11px; }
.flow-map i { color: #566176; font-style: normal; }

.workspace-card, .results { padding: 32px; border: 1px solid #e0e4eb; border-radius: 22px; background: var(--paper); box-shadow: var(--shadow); }
.section-title, .results-head { display: flex; align-items: start; justify-content: space-between; gap: 24px; }
h2 { margin: 0; font-size: 27px; letter-spacing: -.03em; }
.rule-badge { padding: 9px 12px; border: 1px solid #cdd9ff; border-radius: 99px; color: #365bb8; background: #f2f6ff; font-size: 12px; font-weight: 700; }
.field-label { display: block; margin: 28px 0 8px; color: #454f62; font-size: 13px; font-weight: 700; }
.text-input { width: 100%; padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); outline: none; }
.text-input:focus { border-color: #789aff; box-shadow: 0 0 0 3px rgba(29,94,255,.1); }

.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 20px; }
.upload-zone { position: relative; min-height: 220px; padding: 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1.5px dashed #c9d0db; border-radius: 16px; background: #fafbfc; text-align: center; transition: .2s ease; cursor: pointer; }
.upload-zone:hover { border-color: #8ea9f8; background: #f7f9ff; transform: translateY(-1px); }
.upload-zone.loaded { border-style: solid; border-color: #8db7aa; background: #f4fbf8; }
.upload-zone input { position: absolute; opacity: 0; pointer-events: none; }
.upload-icon { display: grid; place-items: center; width: 50px; height: 50px; margin-bottom: 14px; border-radius: 14px; color: #fff; font-weight: 800; box-shadow: 0 8px 18px rgba(29,94,255,.18); }
.image-icon { background: var(--blue); }
.video-icon { background: #6d48d8; }
.upload-zone strong { font-size: 17px; }
.upload-zone p { margin: 8px 0 5px; color: var(--muted); font-size: 13px; }
.upload-zone small { color: #929aab; }
.upload-state { margin-top: 17px; padding: 7px 12px; border-radius: 7px; color: #385ec2; background: #edf2ff; font-size: 12px; font-weight: 700; max-width: 92%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loaded .upload-state { color: #167464; background: #e2f5ee; }

.legacy-material-inputs[hidden] { display: none !important; }
.unified-material-upload { position: relative; min-height: 116px; padding: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border: 1.5px dashed #bfcbe0; border-radius: 15px; color: #24324a; background: linear-gradient(180deg, #fbfcff, #f7f9fd); text-align: center; cursor: pointer; transition: .18s ease; }
.unified-material-upload:hover { border-color: #6f91f5; background: #f3f6ff; box-shadow: 0 8px 22px rgba(40,71,145,.08); }
.unified-material-upload input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.unified-upload-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: #fff; background: var(--blue); font-size: 19px; font-weight: 500; }
.unified-material-upload strong { margin-top: 2px; font-size: 14px; }
.unified-material-upload small { color: #7b8799; font-size: 11px; }
.face-material-entry-grid, .fashion-material-entry-grid, .workflow-material-entry-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.face-material-entry-grid .unified-material-upload, .fashion-material-entry-grid .unified-material-upload, .workflow-material-entry-grid .unified-material-upload { min-height: 132px; }
.face-material-entry-grid .face-image-entry .unified-upload-icon { background: linear-gradient(135deg, #7c5cff, #5a43ee); }
.fashion-material-entry-grid .fashion-image-entry .unified-upload-icon { background: linear-gradient(135deg, #7c5cff, #5a43ee); }
.workflow-material-entry-grid .workflow-product-entry .unified-upload-icon { background: linear-gradient(135deg, #7c5cff, #5a43ee); }
.unified-material-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(142px, 1fr)); gap: 10px; }
.unified-material-preview[hidden] { display: none !important; }
.material-preview-card { position: relative; min-width: 0; padding: 7px; overflow: visible; border: 1px solid #dce3ed; border-radius: 13px; background: #fff; box-shadow: 0 5px 15px rgba(30,48,76,.055); }
.material-preview-card > img, .material-preview-card > video { width: 100%; height: 124px; display: block; border-radius: 9px; background: #eef1f5; object-fit: contain; }
.material-preview-card > video { background: #111827; }
.material-preview-card > audio { width: 100%; height: 124px; padding: 12px 6px; display: block; border-radius: 9px; background: linear-gradient(145deg, #f1f4fb, #e8edf8); }
.material-remove { position: absolute; z-index: 3; top: -7px; right: -7px; width: 24px; height: 24px; padding: 0; display: grid; place-items: center; border: 2px solid #fff; border-radius: 50%; color: #fff; background: #202735; box-shadow: 0 3px 9px rgba(15,23,42,.28); font-size: 17px; line-height: 1; opacity: 0; transform: scale(.85); transition: .15s ease; }
.material-preview-card:hover .material-remove, .material-remove:focus-visible { opacity: 1; transform: scale(1); }
.material-preview-meta { min-width: 0; margin-top: 7px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 5px; }
.material-preview-meta strong { min-width: 0; overflow: hidden; color: #303a4d; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.material-preview-meta > span { padding: 3px 6px; border-radius: 5px; color: #4464b6; background: #edf2ff; font-size: 9px; white-space: nowrap; }
.material-preview-meta select { min-width: 70px; height: 25px; padding: 0 5px; border: 1px solid #ccd6e6; border-radius: 6px; color: #43506a; background: #f8faff; font-size: 9px; }
.material-auto-status { grid-column: 1 / -1; display: block; min-width: 0; padding: 0 2px; overflow: hidden; color: #667085; font-size: 9px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.material-auto-status.pending { color: #7c5cff; }
.material-auto-status.done { color: #137a5c; }
.material-auto-status.failed { color: #a65b12; }
.face-candidate-button { grid-column: 1 / -1; min-height: 26px; padding: 0 8px; border: 1px solid #cad6ec; border-radius: 6px; color: #315fcb; background: #f4f7ff; font-size: 10px; font-weight: 800; }
.face-candidate-button:disabled { border-color: #a8d8c8; color: #14715f; background: #edf9f5; opacity: 1; }
.material-mention-button { grid-column: 1 / -1; min-height: 26px; padding: 0 8px; border: 1px solid #c9d8ff; border-radius: 6px; color: #2456d9; background: #f2f6ff; font-size: 10px; font-weight: 800; }
.material-mention-button:hover { border-color: #7395f8; background: #e9f0ff; }
.video-prompt-editor { position: relative; }
.video-prompt-editor > span em { margin-left: 7px; color: #6c7d99; font-size: 10px; font-style: normal; font-weight: 500; }
.material-mention-menu { position: absolute; z-index: 20; left: 14px; top: 36px; width: min(420px, calc(100% - 28px)); max-height: 240px; padding: 6px; overflow-y: auto; border: 1px solid #d4ddea; border-radius: 11px; background: #fff; box-shadow: 0 14px 36px rgba(24,38,65,.18); }
.material-mention-menu[hidden] { display: none !important; }
.material-mention-menu button { width: 100%; min-height: 42px; padding: 7px 9px; display: grid; grid-template-columns: 68px minmax(0,1fr) auto; align-items: center; gap: 8px; border: 0; border-radius: 7px; color: #344056; background: transparent; text-align: left; }
.material-mention-menu button:hover { background: #f1f5ff; }
.material-mention-menu b { color: var(--blue); font-size: 11px; }
.material-mention-menu span { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.material-mention-menu small { color: #8490a3; font-size: 9px; }
@media (hover: none) { .material-remove { opacity: 1; transform: scale(1); } }

.image-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; margin-top: 16px; }
.image-preview figure { margin: 0; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.image-preview img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 7px; background: #f5f6f8; }
.image-preview figcaption { margin-top: 7px; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice { margin-top: 18px; padding: 12px 14px; border-radius: 10px; font-size: 13px; line-height: 1.5; }
.notice.warning { color: #7c4b12; background: #fff7e8; border: 1px solid #f1d6a8; }
.notice.error { color: #8f2732; background: #fff0f1; border: 1px solid #f0bdc2; }
.run-row { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.run-row p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.primary-button, .secondary-button { border: 0; border-radius: 10px; font-weight: 800; }
.primary-button { padding: 13px 22px; color: #fff; background: var(--blue); box-shadow: 0 8px 22px rgba(29,94,255,.22); }
.primary-button:hover:not(:disabled) { background: #154ed7; }
.primary-button.small { padding: 10px 16px; }
.secondary-button { padding: 10px 15px; color: #314052; background: #edf0f4; }
.action-row { display: flex; gap: 9px; }
.import-button { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.import-button input { display: none; }

.progress-panel { position: relative; margin-top: 22px; padding: 25px 28px 32px 78px; border-radius: 16px; color: #fff; background: var(--navy); overflow: hidden; }
.spinner { position: absolute; left: 28px; top: 26px; width: 30px; height: 30px; border: 3px solid rgba(255,255,255,.18); border-top-color: #6e96ff; border-radius: 50%; animation: spin .9s linear infinite; }
.progress-panel strong { font-size: 16px; }
.progress-panel p { margin: 6px 0 0; color: #9da9bc; font-size: 13px; }
.progress-track { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(255,255,255,.09); }
.progress-track span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #2d69ff, #47d6c5); transition: width 1.2s ease; }
@keyframes spin { to { transform: rotate(360deg); } }

.results { margin-top: 26px; }
.script-result-panel { margin-top: 16px; }
.single-script-output { padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: #fafbfc; }
.single-script-output p { margin: 0; color: #4e596b; font-size: 12px; line-height: 1.75; white-space: pre-wrap; }
.unified-script-editor { display: block; width: 100%; min-height: 650px; padding: 18px 20px; resize: vertical; border: 1px solid #d5dce8; border-radius: 12px; outline: none; color: #354157; background: #fbfcfe; font-size: 12px; line-height: 1.8; white-space: pre-wrap; }
.unified-script-editor:focus { border-color: #7e9fff; background: #fff; box-shadow: 0 0 0 3px rgba(29,94,255,.08); }
.copy-script-button { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid #d8e0ef; border-radius: 9px; color: var(--blue); background: #f3f6ff; }
.copy-script-button:hover { color: #fff; background: var(--blue); }
.copy-script-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs { display: flex; gap: 4px; margin: 28px 0 24px; padding: 5px; border-radius: 11px; background: #f0f2f6; overflow-x: auto; }
.tab { padding: 10px 15px; border: 0; border-radius: 8px; color: #687184; background: transparent; font-size: 13px; font-weight: 700; white-space: nowrap; }
.tab.active { color: #14203a; background: #fff; box-shadow: 0 2px 8px rgba(20,32,58,.08); }
.tab span { margin-left: 4px; padding: 1px 6px; border-radius: 20px; background: #dde4f2; font-size: 11px; }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.summary-grid article { padding: 18px; border: 1px solid var(--line); border-radius: 12px; }
.summary-grid span { display: block; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.summary-grid strong { font-size: 16px; }
.fact-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.list-card { padding: 20px; border-radius: 13px; background: #f7f8fa; }
.list-card h3 { margin: 0 0 13px; font-size: 15px; }
.list-card ul { margin: 0; padding-left: 19px; }
.list-card li { margin: 8px 0; color: #4f586a; font-size: 13px; line-height: 1.55; }
.list-card.good { border-top: 3px solid var(--teal); }
.list-card.warn { border-top: 3px solid var(--orange); }
.list-card.danger { border-top: 3px solid var(--red); }

.shot-list, .segment-list { display: grid; gap: 12px; }
.shot-card { display: grid; grid-template-columns: 92px 1fr auto; gap: 20px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; }
.shot-number span { display: block; color: #315fd2; font-size: 24px; font-weight: 800; }
.shot-number small { color: var(--muted); }
.shot-head { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.shot-main p { margin: 6px 0; color: #596274; font-size: 13px; line-height: 1.6; }
.shot-main b { color: #303a4d; }
.compat { padding: 4px 8px; border-radius: 6px; font-size: 11px; font-weight: 800; }
.compat.full { color: #167464; background: #e2f5ee; }
.compat.conditional { color: #8a5217; background: #fff2dc; }
.compat.none { color: #9e2e3a; background: #ffe7e9; }
.adapted { margin-top: 10px; padding: 10px 12px; border-left: 3px solid var(--blue); color: #34405a; background: #f3f6ff; font-size: 13px; line-height: 1.6; }
.confidence { align-self: start; color: var(--muted); font-size: 11px; white-space: nowrap; }
.global-control { padding: 20px; border-radius: 14px; color: #e7ebf3; background: var(--navy); }
.global-control span { color: #7da0ff; font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.global-control p { margin: 9px 0 0; line-height: 1.7; white-space: pre-wrap; }
.segment-list { margin-top: 14px; }
.segment-card { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.segment-card header { display: flex; justify-content: space-between; padding: 13px 17px; background: #f4f6f9; font-size: 13px; }
.segment-card header span { color: #315fd2; font-weight: 800; }
.script-row { display: grid; grid-template-columns: 70px 1fr; padding: 12px 17px; border-top: 1px solid #edf0f4; }
.script-row b, .prompt-block b { font-size: 12px; }
.script-row p, .prompt-block p { margin: 0; color: #515b6e; font-size: 13px; line-height: 1.65; white-space: pre-wrap; }
.prompt-block { margin: 0 17px 17px; padding: 13px; border-radius: 9px; background: #f2f5ff; }
.prompt-block b { display: block; margin-bottom: 6px; color: #315fd2; }
.meta-line { display: flex; gap: 10px; flex-wrap: wrap; }
.meta-line span { padding: 7px 10px; border-radius: 7px; color: #556074; background: #eff2f6; font-size: 12px; }
.transcript-note { margin: 13px 0; padding: 11px 13px; border-radius: 9px; color: #526071; background: #f7f8fa; font-size: 13px; }
.empty { padding: 40px; color: var(--muted); text-align: center; }
.video-generation-card { margin-top: 28px; padding: 24px; border: 1px solid #dbe3f7; border-radius: 16px; background: linear-gradient(135deg, #f8faff, #f4fbfa); }
.standalone-generator { box-shadow: var(--shadow); }
.video-generation-head, .video-generation-action { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.video-generation-head h3 { margin: 0; font-size: 21px; }
.video-parameter-tags { display: flex; flex-wrap: wrap; justify-content: end; gap: 7px; }
.video-parameter-tags span { padding: 6px 9px; border-radius: 99px; color: #365bb8; background: #eaf0ff; font-size: 11px; font-weight: 800; }
.video-boundary { margin: 18px 0; color: #596579; font-size: 13px; line-height: 1.7; }
.video-prompt-editor { display: block; margin: 18px 0; }
.video-prompt-editor > span { display: block; margin-bottom: 8px; color: #354157; font-size: 13px; font-weight: 800; }
.video-prompt-editor textarea { display: block; width: 100%; min-height: 440px; resize: vertical; padding: 15px; border: 1px solid #cfd8e7; border-radius: 12px; color: var(--ink); background: #fff; outline: none; line-height: 1.65; }
.video-prompt-editor textarea:focus { border-color: #789aff; box-shadow: 0 0 0 3px rgba(29,94,255,.1); }
.video-prompt-editor small { display: flex; justify-content: space-between; align-items: center; margin-top: 7px; color: var(--muted); }
.video-prompt-editor small button { padding: 0; border: 0; color: var(--blue); background: transparent; font-weight: 700; }
.video-prompt-editor small i { font-style: normal; }
.video-settings-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 18px 0 12px; }
.video-settings-grid label { display: flex; flex-direction: column; gap: 7px; }
.video-settings-grid label > span { color: #465167; font-size: 12px; font-weight: 800; }
.video-settings-grid select, .duration-control { min-height: 42px; padding: 0 12px; border: 1px solid #d7deea; border-radius: 9px; color: var(--ink); background: #fff; outline: none; }
.video-settings-grid select:focus, .duration-control:focus-within { border-color: #789aff; box-shadow: 0 0 0 3px rgba(29,94,255,.1); }
.duration-control { display: flex; align-items: center; gap: 6px; }
.duration-control input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; }
.duration-control b { color: var(--muted); font-size: 12px; }
.generation-mode-help { margin: 0 0 18px; padding: 10px 12px; border-radius: 8px; color: #536179; background: #eef3ff; font-size: 12px; line-height: 1.6; }
.generator-assets { display: flex; gap: 12px; margin: 12px 0; }
.prompt-assets { margin: 16px 0 10px; }
.compact-upload { position: relative; flex: 1; min-height: 58px; display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 8px 10px; border: 1px dashed #bdc8da; border-radius: 9px; color: #354157; background: rgba(255,255,255,.72); cursor: pointer; }
.compact-upload:hover { border-color: #789aff; background: #fff; }
.compact-upload input { position: absolute; opacity: 0; pointer-events: none; }
.compact-upload b { font-size: 11px; }
.compact-upload span { color: var(--muted); font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-upload[hidden] { display: none; }
.basic-video-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.basic-video-settings.single-setting { grid-template-columns: 1fr; }
.basic-video-settings label { display: grid; gap: 6px; }
.basic-video-settings label > span, .parameter-group > span { color: #596579; font-size: 11px; font-weight: 700; }
.basic-video-settings select { width: 100%; min-height: 38px; padding: 0 10px; border: 1px solid #d7deea; border-radius: 9px; color: var(--ink); background: #fff; }
.visual-parameters { display: grid; gap: 13px; padding: 14px; border: 1px solid #e1e6ef; border-radius: 12px; background: rgba(255,255,255,.66); }
.parameter-group { display: grid; gap: 7px; }
.choice-row { display: grid; gap: 5px; padding: 3px; border-radius: 9px; background: #edf0f5; }
.choice-row button { min-height: 35px; border: 0; border-radius: 7px; color: #4f596b; background: transparent; font-size: 11px; }
.choice-row button.active { color: #172033; background: #fff; box-shadow: 0 2px 7px rgba(25,38,62,.10); font-weight: 800; }
.ratio-choices { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ratio-choices button { display: grid; place-items: center; gap: 3px; padding: 5px 2px; }
.ratio-choices b { font-size: 9px; }
.face-mode-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.background-mode-choices { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.background-mode-choices button:disabled { color: #a1a8b5; cursor: not-allowed; }
.background-mode-hint { color: #7a8496; font-size: 10px; line-height: 1.5; }
.ratio-icon { display: block; border: 1.5px solid currentColor; border-radius: 2px; }
.ratio-icon.wide { width: 18px; height: 7px; }.ratio-icon.landscape { width: 17px; height: 10px; }.ratio-icon.classic { width: 15px; height: 11px; }.ratio-icon.square { width: 12px; height: 12px; }.ratio-icon.portrait { width: 10px; height: 14px; }.ratio-icon.tall { width: 8px; height: 15px; }
.resolution-choices { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); }
.resolution-choices button[hidden] { display: none !important; }
.count-choices { grid-template-columns: repeat(4, 1fr); }
.duration-slider { display: grid; grid-template-columns: 1fr 66px; align-items: center; gap: 10px; }
.duration-slider input { width: 100%; accent-color: var(--blue); }
.duration-slider output { padding: 9px; border-radius: 8px; color: #263246; background: #edf0f5; font-size: 11px; text-align: center; }
.generate-video-bar { width: 100%; min-height: 48px; margin-top: 14px; padding: 10px 18px; display: flex; align-items: center; justify-content: center; gap: 14px; border: 0; border-radius: 10px; color: #fff; background: var(--blue); }
.generate-video-bar strong { font-size: 14px; }.generate-video-bar small { color: rgba(255,255,255,.78); font-size: 10px; }
.generate-video-bar:disabled { background: #999da5; }
.preset-generate-bar { margin-top: 0; }
.video-task-panel { margin-top: 18px; padding: 18px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.video-task-panel p { margin: 8px 0 0; color: #596579; font-size: 13px; line-height: 1.6; }
.video-task-panel video { display: block; width: min(100%, 420px); max-height: 640px; margin: 16px auto; border-radius: 12px; background: #111827; }
.video-result-grid { display: grid; gap: 14px; margin-top: 14px; }
.video-result-grid article { padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.video-result-error { color: #8f2732; background: #fff0f1; }
.video-status-line { display: flex; align-items: center; gap: 9px; }
.video-status-dot { width: 9px; height: 9px; border-radius: 50%; background: #ffb454; box-shadow: 0 0 0 4px rgba(255,180,84,.16); }
.video-status-line.success .video-status-dot { background: #38b99a; box-shadow: 0 0 0 4px rgba(56,185,154,.15); }
.video-download { display: table; margin: 12px auto 0; text-decoration: none; }

.header-account-button, .header-logout-button { min-height: 36px; padding: 0 12px; border: 1px solid #dce3f0; border-radius: 9px; color: #46546c; background: #fff; font-size: 11px; font-weight: 700; }
.header-account-button { color: #2357d4; background: #f3f6ff; }
.header-logout-button { color: #7d5660; }
.account-view { max-width: 1180px; margin: 0 auto; }
.account-heading { padding: 18px 0 24px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.account-heading h1 { margin: 0; font-size: 34px; letter-spacing: -.04em; }
.account-heading p { margin: 9px 0 0; color: var(--muted); }
.account-heading button, .admin-title button { min-height: 38px; padding: 0 14px; border: 1px solid #d9e0ea; border-radius: 9px; color: #445066; background: #fff; }
.account-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.account-summary article { padding: 19px; display: grid; gap: 5px; border: 1px solid #e1e6ee; border-radius: 14px; background: #fff; box-shadow: 0 8px 24px rgba(24,38,63,.04); }
.account-summary span { color: var(--muted); font-size: 11px; }
.account-summary strong { font-size: 24px; }
.account-summary small { color: #8b94a4; font-size: 10px; }
.account-panel { margin-bottom: 16px; padding: 20px; border: 1px solid #e1e6ee; border-radius: 14px; background: #fff; }
.account-panel h2, .account-panel h3 { margin: 0; }
.account-panel-head { margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.account-panel-head h2 { font-size: 19px; }
.account-panel-head span { color: var(--muted); font-size: 11px; }
.account-panel-head p { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.support-center .account-panel-head { align-items: start; }
.support-grid { display: grid; grid-template-columns: minmax(280px, .82fr) minmax(360px, 1.18fr); gap: 18px; }
.support-form { padding: 16px; display: grid; gap: 11px; align-content: start; border: 1px solid #e3e8f0; border-radius: 12px; background: #fafbfd; }
.support-form label, .admin-support-controls label { display: grid; gap: 6px; color: #5e6a80; font-size: 10px; font-weight: 700; }
.support-form input, .support-form select, .support-form textarea, .admin-support-controls select, .admin-support-controls textarea { width: 100%; padding: 0 11px; border: 1px solid #d6deeb; border-radius: 8px; color: #283347; background: #fff; outline: none; }
.support-form input, .support-form select, .admin-support-controls select { min-height: 40px; }
.support-form textarea { min-height: 128px; padding-top: 11px; resize: vertical; line-height: 1.6; }
.support-form input:focus, .support-form select:focus, .support-form textarea:focus, .admin-support-controls select:focus, .admin-support-controls textarea:focus { border-color: #789aff; box-shadow: 0 0 0 3px rgba(29,94,255,.08); }
.support-description { position: relative; }
.support-description small { color: #929bab; text-align: right; font-weight: 500; }
.support-form > button { min-height: 42px; border: 0; border-radius: 9px; color: #fff; background: var(--blue); font-weight: 800; }
.support-history { min-width: 0; }
.support-history h3 { margin: 2px 0 12px; font-size: 15px; }
.support-list, .admin-support-list { display: grid; gap: 10px; }
.support-list { max-height: 560px; overflow-y: auto; }
.support-card { padding: 15px; border: 1px solid #e2e7ef; border-radius: 11px; background: #fff; }
.support-card-head, .admin-support-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.support-card-head > div, .admin-support-head > div { display: grid; gap: 4px; }
.support-card-head strong, .admin-support-head strong { color: #273247; font-size: 13px; }
.support-card-head small, .admin-support-head small { color: #8993a4; font-size: 9px; }
.support-status { flex: 0 0 auto; padding: 4px 8px; border-radius: 999px; color: #8a5a15; background: #fff4dd; font-size: 9px; font-weight: 800; }
.support-status.processing { color: #2458b7; background: #eaf1ff; }
.support-status.resolved { color: #18745e; background: #e8f7f1; }
.support-status.closed { color: #657083; background: #edf0f4; }
.support-card > p, .admin-support-body > p { margin: 12px 0; color: #4a566a; font-size: 11px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.support-meta, .support-meta-row { margin-top: 10px; color: #7f8999; font-size: 9px; overflow-wrap: anywhere; }
.support-reply { margin-top: 12px; padding: 11px 12px; border-radius: 9px; color: #40516b; background: #f1f5ff; }
.support-reply b { color: #2c58bf; font-size: 10px; }
.support-reply p { margin: 5px 0; font-size: 11px; line-height: 1.7; white-space: pre-wrap; }
.support-reply small, .support-waiting { color: #8a94a5; font-size: 9px; }
.support-waiting { margin-top: 12px; padding: 10px; border-radius: 8px; background: #f6f7f9; }
.admin-support-card { padding: 16px; border: 1px solid #e1e6ee; border-radius: 12px; background: #fff; }
.support-meta-row { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.admin-support-controls { display: grid; grid-template-columns: 150px minmax(260px, 1fr) auto; align-items: end; gap: 10px; }
.admin-support-controls textarea { min-height: 66px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
.admin-support-controls button { min-height: 40px; padding: 0 14px; border: 0; border-radius: 8px; color: #fff; background: var(--blue); font-size: 10px; font-weight: 800; }
.ledger-list { display: grid; gap: 7px; }
.ledger-row { padding: 11px 12px; display: grid; grid-template-columns: minmax(120px, 1.5fr) 90px 105px 145px; align-items: center; gap: 12px; border-radius: 9px; background: #f7f8fb; font-size: 11px; }
.ledger-row strong { font-size: 12px; }
.ledger-row small { display: block; margin-top: 3px; color: #9099a9; }
.ledger-row .credit-positive { color: #07846e; font-weight: 800; }
.ledger-row .credit-negative { color: #b04450; font-weight: 800; }
.ledger-row .api-cost { color: #765114; }
.password-panel { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 24px; }
.password-panel p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.password-panel form { display: flex; gap: 8px; }
.password-panel input, .admin-form input { min-height: 39px; padding: 0 11px; border: 1px solid #d6deeb; border-radius: 8px; outline: none; }
.password-panel button, .admin-form button, .admin-user-actions button { min-height: 39px; padding: 0 14px; border: 0; border-radius: 8px; color: #fff; background: var(--blue); font-weight: 700; }
.admin-panel { margin-top: 28px; padding-top: 24px; border-top: 2px solid #dde5f5; }
.admin-title { margin-bottom: 15px; display: flex; align-items: end; justify-content: space-between; }
.admin-title span { color: var(--blue); font-size: 10px; font-weight: 900; }
.admin-title h2 { margin: 4px 0 0; font-size: 26px; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.admin-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: start; }
.admin-form h3 { grid-column: 1 / -1; margin-bottom: 4px; font-size: 16px; }
.admin-form label { display: grid; gap: 5px; color: #667188; font-size: 10px; }
.admin-form > button, .permission-checks { grid-column: 1 / -1; }
.permission-checks { display: flex; flex-wrap: wrap; gap: 13px; padding: 8px 2px; color: #4d596e; font-size: 11px; }
.permission-checks label { display: flex; align-items: center; gap: 5px; }
.admin-user-list { display: grid; gap: 8px; }
.admin-user-card { padding: 13px; display: grid; grid-template-columns: minmax(150px, 1fr) minmax(240px, 1.5fr) auto; align-items: center; gap: 16px; border: 1px solid #e4e8ef; border-radius: 10px; }
.admin-user-card h4 { margin: 0; font-size: 13px; }
.admin-user-card p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.admin-user-permissions { display: flex; flex-wrap: wrap; gap: 10px; font-size: 10px; }
.admin-user-permissions label { display: flex; align-items: center; gap: 4px; }
.admin-user-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 6px; }
.admin-user-actions button { min-height: 31px; padding: 0 9px; font-size: 9px; }
.admin-user-actions button.secondary { color: #4c5b72; background: #edf0f5; }
.admin-user-actions button.danger { color: #9d3f4a; background: #fff0f1; }
.login-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px; background: linear-gradient(145deg, #edf3ff, #f7fafc 60%, #eef8f6); }
.login-overlay[hidden] { display: none; }
.login-card { width: min(400px, 100%); padding: 34px; display: grid; gap: 15px; border: 1px solid #dfe6f1; border-radius: 22px; background: #fff; box-shadow: 0 24px 70px rgba(32,48,75,.14); }
.login-mark { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; color: #fff; background: var(--blue); font-size: 21px; font-weight: 900; }
.login-card h1 { margin: 4px 0 -7px; font-size: 28px; }
.login-card > p { margin: 0 0 4px; color: var(--muted); font-size: 12px; }
.login-card label { display: grid; gap: 6px; color: #536078; font-size: 11px; font-weight: 700; }
.login-card input { min-height: 44px; padding: 0 13px; border: 1px solid #d4ddea; border-radius: 9px; outline: none; font-size: 14px; }
.login-card input:focus { border-color: #789aff; box-shadow: 0 0 0 3px rgba(29,94,255,.1); }
.login-card button { min-height: 45px; border: 0; border-radius: 9px; color: #fff; background: var(--blue); font-weight: 800; }
.login-card small { color: #9099aa; text-align: center; }
.login-error { padding: 10px; border-radius: 8px; color: #982f3b; background: #fff0f1; font-size: 11px; }
.login-card .legal-consent { display: grid; grid-template-columns: 17px 1fr; align-items: start; gap: 8px; color: #6f7a8d; font-size: 11px; font-weight: 500; line-height: 1.6; }
.login-card .legal-consent input { width: 15px; min-height: 15px; margin: 3px 0 0; accent-color: var(--blue); }
.login-card .legal-consent label { display: inline; color: inherit; font: inherit; font-weight: inherit; }
.login-card .legal-consent button, .login-card .login-legal-links button { min-height: 0; padding: 0; border: 0; border-radius: 0; color: var(--blue); background: transparent; font: inherit; font-weight: 700; }
.login-card .legal-consent button:hover, .login-card .login-legal-links button:hover { text-decoration: underline; }
.login-legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px 12px; }
.login-card .login-legal-links button { color: #69758a; font-size: 10px; font-weight: 600; }

footer { width: min(1180px, calc(100% - 40px)); margin: -45px auto 0; padding-bottom: 28px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: #8991a0; font-size: 12px; }
.app-shell footer { width: min(1240px, calc(100% - 56px)); margin: -44px auto 0; }
.legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px 14px; }
.legal-links button { padding: 0; border: 0; color: #6f7a8d; background: none; font: inherit; }
.legal-links button:hover { color: var(--blue); text-decoration: underline; }
#legalEntitySummary { text-align: right; }
#legalEntitySummary.is-pending { color: #b06b22; }
.legal-open { overflow: hidden; }
.legal-modal { position: fixed; inset: 0; z-index: 1100; display: grid; place-items: center; padding: 24px; background: rgba(15, 23, 42, .56); backdrop-filter: blur(4px); }
.legal-modal[hidden] { display: none; }
.legal-dialog { width: min(780px, 100%); max-height: min(820px, calc(100vh - 48px)); display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; overflow: hidden; border: 1px solid #dfe6ef; border-radius: 18px; background: #fff; box-shadow: 0 28px 80px rgba(15,23,42,.24); }
.legal-dialog > header { padding: 22px 26px 18px; display: flex; align-items: start; justify-content: space-between; gap: 20px; border-bottom: 1px solid #e8edf4; }
.legal-dialog > header span { color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.legal-dialog > header h2 { margin: 4px 0 0; color: #182133; font-size: 24px; }
.legal-dialog > header button { width: 34px; height: 34px; border: 0; border-radius: 9px; color: #5d6879; background: #f1f4f8; font-size: 22px; line-height: 1; }
.legal-profile-warning { margin: 16px 26px 0; padding: 11px 13px; border: 1px solid #f1d5a4; border-radius: 9px; color: #885414; background: #fff8e9; font-size: 11px; line-height: 1.6; }
.legal-document { padding: 22px 26px 28px; overflow-y: auto; color: #4b5669; font-size: 13px; line-height: 1.85; }
.legal-document .legal-lead { margin: 0 0 22px; padding: 16px 18px; border-radius: 10px; color: #334158; background: #f5f7fb; }
.legal-document section + section { margin-top: 24px; }
.legal-document h3 { margin: 0 0 8px; color: #1f2a3d; font-size: 15px; }
.legal-document p { margin: 0; }
.legal-document p + p { margin-top: 8px; }
.legal-document ul { margin: 0; padding-left: 20px; }
.legal-contact-card { padding: 6px 18px; border: 1px solid #e1e7f0; border-radius: 12px; background: #fafbfd; }
.legal-contact-card dl { margin: 0; }
.legal-contact-card dl > div { padding: 11px 0; display: grid; grid-template-columns: 110px 1fr; gap: 16px; border-bottom: 1px solid #e9edf3; }
.legal-contact-card dl > div:last-child { border-bottom: 0; }
.legal-contact-card dt { color: #7a8496; }
.legal-contact-card dd { margin: 0; color: #273247; font-weight: 650; overflow-wrap: anywhere; }
.legal-dialog > footer { width: auto; margin: 0; padding: 14px 26px; display: flex; flex-direction: row; align-items: center; justify-content: space-between; border-top: 1px solid #e8edf4; color: #7d8797; background: #fafbfd; }
.legal-dialog > footer button { min-height: 36px; padding: 0 18px; border: 0; border-radius: 8px; color: #fff; background: var(--blue); font-weight: 750; }
.toast { position: fixed; right: 24px; bottom: 24px; padding: 11px 16px; border-radius: 9px; color: #fff; background: #1c2638; opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 880px) {
  .sidebar { width: 72px; }
  .app-shell { margin-left: 72px; }
  .app-header { padding: 0 20px; }
  .shell-main { width: min(100% - 30px, 1240px); padding-top: 30px; }
  .quick-tools { grid-template-columns: 1fr; }
  .account-summary { grid-template-columns: 1fr 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
  .support-grid { grid-template-columns: 1fr; }
  .admin-support-controls { grid-template-columns: 1fr 1fr; }
  .admin-support-controls button { grid-column: 1 / -1; }
  .admin-user-card { grid-template-columns: 1fr; }
  .admin-user-actions { justify-content: start; }
  .password-panel { grid-template-columns: 1fr; }
  .history-card { grid-template-columns: 44px minmax(0, 1fr); }
  .history-actions { grid-column: 2; }
  .skill-card-grid { grid-template-columns: 1fr; }
  .skill-upload-grid.four-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .face-library-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1fr; }
  .flow-map { overflow-x: auto; gap: 18px; }
  .upload-grid { grid-template-columns: 1fr; }
  .shot-card { grid-template-columns: 66px 1fr; }
  .confidence { grid-column: 2; }
  .shell-main.studio-mode { width: min(100% - 24px, 1040px); display: flex; flex-direction: column; gap: 8px; }
  .studio-mode #videoView, .studio-mode #workflowView { width: 100%; }
  .studio-mode #videoView { position: static; max-height: none; overflow: visible; }
  .studio-mode #workflowView { order: 1; }
  .studio-mode #videoView { order: 2; }
}
@media (max-width: 600px) {
  .sidebar { position: fixed; inset: auto 0 0 0; width: auto; height: 66px; padding: 6px 14px; flex-direction: row; border-top: 1px solid #e8ebf0; border-right: 0; }
  .sidebar-logo, .sidebar .system-status { display: none; }
  .sidebar-nav { margin: 0; display: grid; grid-template-columns: repeat(7, minmax(50px, 1fr)); gap: 2px; overflow-x: auto; }
  .sidebar-link { min-height: 54px; flex-direction: column; gap: 3px; }
  .sidebar-link span { font-size: 16px; }
  .sidebar-link b { font-size: 8px; }
  .app-shell { margin-left: 0; padding-bottom: 66px; }
  .app-header { height: 62px; }
  .app-header .brand small { display: none; }
  .header-history-button { padding: 9px 11px; }
  .header-video-button { padding: 9px 11px; }
  .header-account-button { padding: 8px; }
  .header-logout-button { display: none; }
  .account-summary { grid-template-columns: 1fr 1fr; }
  .password-panel form { flex-direction: column; }
  .ledger-row { grid-template-columns: 1fr 80px; }
  .ledger-row > :nth-child(3), .ledger-row > :nth-child(4) { text-align: left; }
  .admin-form { grid-template-columns: 1fr; }
  .support-center .account-panel-head { flex-direction: column; }
  .admin-support-controls { grid-template-columns: 1fr; }
  .admin-support-controls button { grid-column: 1; }
  .admin-form > *, .permission-checks { grid-column: 1; }
  .home-intro { padding-top: 14px; }
  .home-command-card { grid-template-columns: 44px 1fr; padding: 15px; }
  .home-add-button { width: 42px; height: 42px; }
  .quick-tool-card { grid-template-columns: 48px 1fr; }
  .quick-tool-card i { display: none; }
  .quick-icon { width: 46px; height: 46px; }
  .home-steps { grid-template-columns: 1fr; }
  .history-heading { align-items: start; flex-direction: column; }
  .history-toolbar { align-items: stretch; flex-direction: column; gap: 10px; }
  .history-filters { display: grid; grid-template-columns: repeat(3, 1fr); }
  .history-card { grid-template-columns: 38px minmax(0, 1fr); padding: 13px; }
  .history-type { width: 38px; height: 38px; }
  .history-actions { grid-column: 1 / 3; }
  .skills-heading h1 { font-size: 29px; }
  .skill-workspace { padding: 17px; }
  .skill-workspace-head { align-items: start; flex-direction: column; gap: 12px; }
  .skill-upload-grid.two-columns, .skill-upload-grid.four-columns { grid-template-columns: 1fr; }
  .skill-upload { min-height: 112px; }
  .face-library-modal { padding: 10px; }
  .face-library-head { padding: 16px; }
  .face-library-toolbar { padding: 10px 16px; align-items: start; flex-direction: column; }
  .face-library-grid { padding: 14px 16px 18px; }
  .face-library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .face-library-folder { grid-template-columns: 44px minmax(0, 1fr); }
  .face-library-folder > b { display: none; }
  .page-heading { align-items: start; flex-direction: column; }
  .topbar { padding: 0 18px; }
  .system-status { max-width: 150px; text-align: right; }
  main { width: min(100% - 24px, 1180px); padding-top: 36px; }
  .workspace-card, .results { padding: 20px; border-radius: 16px; }
  .hero h1 { font-size: 34px; }
  .section-title, .results-head, .run-row { align-items: stretch; flex-direction: column; }
  .video-generation-head, .video-generation-action { align-items: stretch; flex-direction: column; }
  .video-settings-grid { grid-template-columns: 1fr 1fr; }
  .summary-grid { grid-template-columns: 1fr; }
  .action-row { flex-wrap: wrap; }
  .shot-card { grid-template-columns: 1fr; }
  .confidence { grid-column: 1; }
  .script-row { grid-template-columns: 1fr; gap: 6px; }
  .video-settings-grid { grid-template-columns: 1fr; }
  .generator-assets { flex-direction: column; }
  .studio-mode .generator-assets { grid-template-columns: 1fr; }
  footer { width: calc(100% - 24px); flex-direction: column; gap: 8px; text-align: center; }
  #legalEntitySummary { text-align: center; }
  .legal-modal { padding: 10px; }
  .legal-dialog { max-height: calc(100vh - 20px); border-radius: 14px; }
  .legal-dialog > header { padding: 18px; }
  .legal-profile-warning { margin: 12px 18px 0; }
  .legal-document { padding: 18px; }
  .legal-contact-card dl > div { grid-template-columns: 1fr; gap: 3px; }
  .legal-dialog > footer { padding: 12px 18px; }
}

/* ========================================================================== */
/* 2.9 visual system — AI creation studio                                    */
/* ========================================================================== */
:root {
  --ink: #15182b;
  --muted: #727b91;
  --line: rgba(113, 124, 159, .16);
  --paper: rgba(255, 255, 255, .88);
  --wash: #f6f7fb;
  --navy: #0b1020;
  --blue: #5b5cf6;
  --teal: #00a9bc;
  --orange: #f07c3d;
  --red: #d94d67;
  --violet: #8b5cf6;
  --cyan: #14b8ff;
  --glow: 0 24px 70px rgba(63, 72, 130, .12);
  --shadow: 0 20px 60px rgba(44, 52, 97, .10);
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 22% 4%, rgba(101, 91, 255, .09), transparent 27rem),
    radial-gradient(circle at 92% 26%, rgba(20, 184, 255, .08), transparent 25rem),
    linear-gradient(180deg, #f8f9fd 0%, #f3f5fa 100%);
  background-attachment: fixed;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: .24;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(66, 76, 119, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(66, 76, 119, .045) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom, #000, transparent 76%);
}

button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease, color .2s ease; }
button:active:not(:disabled) { transform: scale(.98); }
input, select, textarea { color: var(--ink); }
::selection { color: #fff; background: rgba(91, 92, 246, .84); }

.sidebar {
  inset: 12px auto 12px 12px;
  width: 94px;
  padding: 15px 9px 12px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 25px;
  color: #fff;
  background:
    radial-gradient(circle at 50% 0, rgba(104, 97, 255, .28), transparent 15rem),
    linear-gradient(180deg, #10152a 0%, #090d1a 100%);
  box-shadow: 0 24px 60px rgba(9, 13, 30, .28), inset 0 1px rgba(255, 255, 255, .07);
}
.sidebar::before {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  content: "";
  pointer-events: none;
  background: linear-gradient(140deg, rgba(255,255,255,.07), transparent 22%, transparent 78%, rgba(80,180,255,.05));
}
.sidebar-logo {
  position: relative;
  isolation: isolate;
  width: 50px;
  height: 50px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 17px;
  background: linear-gradient(135deg, #8a60ff 0%, #5364ff 48%, #16b9ff 100%);
  box-shadow: 0 13px 30px rgba(85, 83, 255, .38), inset 0 1px rgba(255,255,255,.35);
}
.sidebar-logo span { font-size: 20px; line-height: 1; }
.sidebar-logo small {
  position: absolute;
  right: -5px;
  bottom: -4px;
  padding: 2px 4px;
  border: 2px solid #10152a;
  border-radius: 6px;
  color: #dff8ff;
  background: #046fca;
  font-size: 7px;
  letter-spacing: .05em;
}
.sidebar-nav { position: relative; z-index: 1; margin-top: 28px; gap: 7px; }
.sidebar-link {
  min-height: 62px;
  border: 1px solid transparent;
  border-radius: 16px;
  color: #8f99b6;
}
.sidebar-link span { font-size: 20px; filter: grayscale(.2); }
.sidebar-link b { font-size: 10px; letter-spacing: .02em; }
.sidebar-link:hover {
  color: #e4e8ff;
  border-color: rgba(255,255,255,.08);
  background: rgba(255,255,255,.055);
}
.sidebar-link.active {
  color: #fff;
  border-color: rgba(156, 158, 255, .25);
  background: linear-gradient(135deg, rgba(111, 91, 255, .38), rgba(35, 127, 244, .24));
  box-shadow: 0 12px 28px rgba(38, 38, 110, .28), inset 0 1px rgba(255,255,255,.10);
}
.sidebar .system-status {
  position: relative;
  z-index: 1;
  color: #8e98b5;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 13px;
  background: rgba(255,255,255,.035);
}
.sidebar .status-dot { box-shadow: 0 0 0 5px rgba(31, 210, 164, .08), 0 0 14px rgba(31, 210, 164, .55); }

.app-shell { margin-left: 118px; }
.app-header {
  position: sticky;
  top: 0;
  z-index: 18;
  height: 76px;
  padding: 0 38px 0 28px;
  border-bottom: 1px solid rgba(108, 119, 159, .12);
  background: rgba(248, 249, 253, .74);
  box-shadow: 0 12px 34px rgba(43, 51, 91, .035);
  backdrop-filter: blur(22px) saturate(150%);
}
.app-header .brand { display: grid; gap: 3px; }
.app-header .brand strong { font-size: 17px; letter-spacing: -.02em; }
.app-header .brand small { color: #9299ab; font-size: 10px; letter-spacing: .08em; }
.header-actions { gap: 8px; }
.header-history-button, .header-account-button, .header-logout-button {
  border-color: rgba(107, 119, 157, .15);
  border-radius: 12px;
  color: #535d76;
  background: rgba(255,255,255,.72);
  box-shadow: 0 4px 14px rgba(54,64,106,.04);
}
.header-history-button:hover, .header-account-button:hover, .header-logout-button:hover {
  color: var(--blue);
  border-color: rgba(91,92,246,.28);
  background: #fff;
}
.header-video-button {
  min-height: 42px;
  padding-inline: 19px;
  border-radius: 13px;
  background: linear-gradient(100deg, #6c54f6, #445dff 56%, #188ff2);
  box-shadow: 0 11px 26px rgba(79, 84, 239, .25), inset 0 1px rgba(255,255,255,.25);
}
.header-video-button:hover { transform: translateY(-1px); box-shadow: 0 14px 32px rgba(79,84,239,.34); }
.shell-main { width: min(1340px, calc(100% - 60px)); padding-top: 38px; }

.home-view { position: relative; }
.home-view::before, .home-view::after {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  content: "";
  filter: blur(10px);
}
.home-view::before { top: -70px; left: 15%; width: 330px; height: 220px; background: rgba(115,91,255,.10); }
.home-view::after { top: 100px; right: 8%; width: 260px; height: 260px; background: rgba(30,178,255,.08); }
.home-intro { padding: 34px 0 8px; }
.home-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 13px;
  color: #6d68c7;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .18em;
}
.home-kicker i { width: 7px; height: 7px; border-radius: 50%; background: #7367ff; box-shadow: 0 0 0 5px rgba(115,103,255,.10), 0 0 16px #7367ff; }
.home-intro h1 { font-size: clamp(39px, 4.5vw, 64px); font-weight: 800; letter-spacing: -.065em; line-height: 1.08; }
.home-intro h1 span {
  color: transparent;
  background: linear-gradient(100deg, #7958ef 5%, #4c62fc 52%, #128edb 96%);
  background-clip: text;
  -webkit-background-clip: text;
}
.home-intro > p { margin: 15px auto 0 !important; color: #7e8598 !important; font-size: 14px; }
.home-capabilities { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 17px; }
.home-capabilities span {
  padding: 6px 10px;
  border: 1px solid rgba(102,103,197,.13);
  border-radius: 999px;
  color: #686f86;
  background: rgba(255,255,255,.6);
  box-shadow: inset 0 1px rgba(255,255,255,.8);
  font-size: 10px;
  font-weight: 700;
}
.home-capabilities span::before { margin-right: 6px; color: #6860f6; content: "✦"; }
.home-command-card {
  position: relative;
  isolation: isolate;
  width: min(900px, 100%);
  min-height: 168px;
  margin: 25px auto 46px;
  padding: 22px 24px;
  border: 1px solid rgba(108, 99, 229, .18);
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(255,255,255,.94), rgba(248,248,255,.84));
  box-shadow: 0 30px 85px rgba(55, 59, 126, .14), inset 0 1px rgba(255,255,255,.92);
  backdrop-filter: blur(20px);
}
.home-command-card::before {
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  padding: 1px;
  content: "";
  background: linear-gradient(115deg, rgba(123,88,255,.6), rgba(255,255,255,0) 34%, rgba(30,177,255,.48));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
.home-command-card::after { position: absolute; right: 70px; bottom: -28px; z-index: -2; width: 70%; height: 55px; border-radius: 50%; content: ""; background: rgba(79,75,231,.18); filter: blur(30px); }
.home-add-button {
  width: 56px;
  height: 56px;
  border: 1px solid rgba(112,99,243,.15);
  border-radius: 18px;
  color: #5e5bea;
  background: linear-gradient(145deg, #f0ecff, #e6f4ff);
  box-shadow: inset 0 1px #fff, 0 9px 22px rgba(83,81,205,.12);
}
.home-command-card textarea { background: transparent; font-size: 16px; line-height: 1.65; }
.home-command-card > div { color: #737b91; }
.home-command-card > div button {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #7657f4, #3a68f6);
  box-shadow: 0 10px 22px rgba(78,78,229,.26);
}
.home-section-heading {
  width: min(1100px, 100%);
  margin: 0 auto 17px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}
.home-section-heading span { color: #7772cc; font-size: 9px; font-weight: 900; letter-spacing: .17em; }
.home-section-heading h2 { margin: 5px 0 0; font-size: 25px; letter-spacing: -.035em; }
.home-section-heading p { margin: 0; color: #9299aa; font-size: 11px; }
.quick-tools { width: min(1100px, 100%); grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.quick-tool-card {
  position: relative;
  min-height: 148px;
  overflow: hidden;
  padding: 25px;
  border: 1px solid rgba(108,120,160,.14);
  border-radius: 22px;
  background: rgba(255,255,255,.76);
  box-shadow: 0 14px 40px rgba(41,49,91,.07), inset 0 1px rgba(255,255,255,.9);
  backdrop-filter: blur(14px);
}
.quick-tool-card::after {
  position: absolute;
  right: -35px;
  bottom: -55px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  content: "";
  background: radial-gradient(circle, rgba(102,91,246,.12), transparent 70%);
}
.quick-tool-card:nth-child(2n)::after { background: radial-gradient(circle, rgba(20,184,255,.12), transparent 70%); }
.quick-tool-card:hover {
  transform: translateY(-5px);
  border-color: rgba(101,96,240,.30);
  background: rgba(255,255,255,.94);
  box-shadow: 0 24px 55px rgba(45,54,104,.13);
}
.quick-tool-card strong { font-size: 20px; letter-spacing: -.025em; }
.quick-tool-card small { color: #7e879a; }
.quick-tool-card i { z-index: 1; display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid rgba(96,102,159,.13); border-radius: 50%; color: #6564dc; background: #fff; font-size: 0; }
.quick-tool-card i::before { content: "→"; font-size: 15px; }
.quick-icon { width: 58px; height: 58px; border-radius: 18px; box-shadow: 0 12px 26px rgba(46,64,137,.17), inset 0 1px rgba(255,255,255,.25); }
.quick-icon.blue { background: linear-gradient(135deg, #5162fa, #2e8cf5); }
.quick-icon.purple { background: linear-gradient(135deg, #8a55e9, #5b5cf6); }
.quick-icon.cyan { background: linear-gradient(135deg, #05a6bf, #27c7df); }
.quick-icon.orange { background: linear-gradient(135deg, #ee7144, #f3ae43); }
.quick-icon.green { background: linear-gradient(135deg, #10a986, #39c9a6); }
.home-steps { width: min(1100px, 100%); margin-top: 28px; gap: 14px; }
.home-steps article { position: relative; padding: 18px 20px 18px 54px; border: 1px solid rgba(109,119,155,.10); border-radius: 15px; background: rgba(255,255,255,.45); }
.home-steps article::before { position: absolute; left: 20px; top: 23px; width: 20px; height: 1px; content: ""; background: linear-gradient(90deg, #7366f4, #1ab7ef); }

.skills-heading, .page-heading { margin-bottom: 26px; }
.skills-heading h1, .page-heading h1 { color: #171a2d; font-weight: 800; letter-spacing: -.055em; }
.skills-heading > div > p:first-child, .page-heading > div > p:first-child { color: #706dd0; letter-spacing: .13em; }
.skill-workspace, .workspace-card, .results {
  border: 1px solid rgba(105,117,155,.14);
  border-radius: 24px;
  background: rgba(255,255,255,.80);
  box-shadow: var(--glow), inset 0 1px rgba(255,255,255,.92);
  backdrop-filter: blur(18px);
}
.skill-workspace { padding: 30px; }
.skill-workspace-head > button, .secondary-button {
  border-color: rgba(105,117,155,.17);
  border-radius: 11px;
  color: #5f6880;
  background: rgba(247,248,252,.88);
}
.skill-workspace-head > button:hover, .secondary-button:hover { color: #5657df; border-color: rgba(91,92,246,.28); background: #fff; }
.skill-upload, .upload-zone, .unified-material-upload {
  border-color: rgba(103,111,231,.28);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(106,91,246,.08), transparent 65%),
    linear-gradient(180deg, rgba(252,252,255,.96), rgba(246,248,253,.90));
}
.skill-upload:hover, .upload-zone:hover, .unified-material-upload:hover {
  transform: translateY(-2px);
  border-color: rgba(91,92,246,.55);
  background: linear-gradient(180deg, #fbfaff, #f1f5ff);
  box-shadow: 0 14px 34px rgba(67,73,149,.10);
}
.upload-icon, .unified-upload-icon {
  color: #fff;
  border: 0;
  background: linear-gradient(135deg, #7d5bf4, #3b75f2);
  box-shadow: 0 9px 20px rgba(82,79,222,.23), inset 0 1px rgba(255,255,255,.28);
}
.unified-material-preview { gap: 12px; }
.material-card { border-color: rgba(103,114,151,.14); border-radius: 15px; background: rgba(255,255,255,.9); box-shadow: 0 9px 24px rgba(46,54,94,.07); }
.video-generation-card {
  border-color: rgba(93,101,213,.17);
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0%, rgba(52,177,255,.08), transparent 30rem),
    linear-gradient(145deg, rgba(249,249,255,.96), rgba(245,250,252,.90));
  box-shadow: 0 18px 50px rgba(46,54,104,.08), inset 0 1px #fff;
}
.video-generation-head span, .field-label, .parameter-group > span { color: #727c93; font-weight: 800; }
.video-prompt-editor, .basic-video-settings, .visual-parameters {
  border-color: rgba(103,114,151,.14);
  border-radius: 15px;
  background: rgba(255,255,255,.67);
  box-shadow: inset 0 1px rgba(255,255,255,.9);
}
.choice-row { padding: 4px; border-radius: 11px; background: rgba(229,232,241,.72); }
.choice-row button { min-height: 38px; border-radius: 9px; }
.choice-row button:hover { color: #5557df; }
.choice-row button.active { color: #4f4bd4; background: #fff; box-shadow: 0 5px 15px rgba(45,51,93,.10), inset 0 0 0 1px rgba(91,92,246,.08); }
.primary-button, .generate-video-bar {
  border-radius: 13px;
  background: linear-gradient(100deg, #7655f4, #4d5ff7 54%, #2186ec);
  box-shadow: 0 13px 30px rgba(80,80,225,.25), inset 0 1px rgba(255,255,255,.28);
}
.primary-button:hover:not(:disabled), .generate-video-bar:hover:not(:disabled) {
  transform: translateY(-2px);
  background: linear-gradient(100deg, #6849ed, #4055ee 54%, #147ee4);
  box-shadow: 0 17px 38px rgba(80,80,225,.34), inset 0 1px rgba(255,255,255,.28);
}
.generate-video-bar { min-height: 54px; border-radius: 14px; }
.generate-video-bar strong { font-size: 15px; }
.video-task-panel {
  border-color: rgba(105,116,155,.14);
  border-radius: 17px;
  background: rgba(255,255,255,.80);
  box-shadow: 0 12px 30px rgba(43,52,93,.06);
}
.notice, .upload-state { border-radius: 12px; }
.history-card, .account-panel, .support-ticket-card, .admin-panel {
  border-color: rgba(105,117,155,.14);
  border-radius: 18px;
  background: rgba(255,255,255,.78);
  box-shadow: 0 12px 34px rgba(44,52,97,.06), inset 0 1px rgba(255,255,255,.9);
}

.login-overlay {
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 18%, rgba(111,85,246,.31), transparent 24rem),
    radial-gradient(circle at 87% 78%, rgba(18,177,245,.20), transparent 28rem),
    linear-gradient(145deg, #080d1c 0%, #11152c 48%, #0a1730 100%);
}
.login-overlay::before {
  position: absolute;
  inset: 0;
  content: "";
  opacity: .35;
  background-image:
    linear-gradient(rgba(151,162,222,.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(151,162,222,.09) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at center, #000, transparent 72%);
}
.login-overlay::after {
  position: absolute;
  top: 14%;
  left: 50%;
  width: 470px;
  height: 470px;
  border: 1px solid rgba(124,130,255,.16);
  border-radius: 50%;
  content: "";
  transform: translateX(-50%);
  box-shadow: 0 0 0 70px rgba(104,95,255,.025), 0 0 0 140px rgba(104,95,255,.018);
}
.login-card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  padding: 38px;
  gap: 16px;
  border: 1px solid rgba(180,186,255,.18);
  border-radius: 27px;
  color: #f5f6ff;
  background: linear-gradient(145deg, rgba(29,34,65,.90), rgba(15,23,48,.88));
  box-shadow: 0 38px 110px rgba(0,0,0,.42), inset 0 1px rgba(255,255,255,.10);
  backdrop-filter: blur(24px) saturate(130%);
}
.login-card::before {
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  padding: 1px;
  content: "";
  background: linear-gradient(135deg, rgba(151,112,255,.75), transparent 34%, transparent 64%, rgba(38,185,255,.55));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
.login-mark {
  width: 54px;
  height: 54px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 18px;
  background: linear-gradient(135deg, #8b5cf6, #5263ff 55%, #16b9ff);
  box-shadow: 0 14px 34px rgba(84,84,237,.38), inset 0 1px rgba(255,255,255,.35);
}
.login-kicker { margin-bottom: -9px; color: #9f9cff; font-size: 9px; font-weight: 900; letter-spacing: .18em; }
.login-card h1 { color: #fff; font-size: 30px; letter-spacing: -.045em; }
.login-card > p { color: #9ca5bf; }
.login-card label { color: #aab2ca; }
.login-card input {
  min-height: 48px;
  border: 1px solid rgba(164,174,215,.18);
  border-radius: 12px;
  color: #fff;
  background: rgba(6,10,26,.38);
  box-shadow: inset 0 1px 4px rgba(0,0,0,.15);
}
.login-card input::placeholder { color: #6f7894; }
.login-card input:focus { border-color: rgba(119,111,255,.72); box-shadow: 0 0 0 4px rgba(105,92,255,.12), 0 0 24px rgba(91,92,246,.10); }
.login-card > button[type="submit"] {
  min-height: 49px;
  border-radius: 12px;
  background: linear-gradient(100deg, #8159f4, #5260f6 55%, #258eea);
  box-shadow: 0 14px 32px rgba(71,74,218,.30), inset 0 1px rgba(255,255,255,.24);
}
.login-card > button[type="submit"]:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(71,74,218,.42); }
.login-card .legal-consent { color: #929bb6; }
.login-card .legal-consent button, .login-card .login-legal-links button { color: #a7a7ff; }
.login-card .login-legal-links button { color: #808aa5; }

* { scrollbar-color: rgba(91,92,246,.32) transparent; scrollbar-width: thin; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 999px; background: rgba(91,92,246,.28); background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }

@keyframes studio-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.home-intro, .home-command-card, .home-section-heading, .quick-tool-card { animation: studio-rise .55s both; }
.home-command-card { animation-delay: .07s; }
.home-section-heading { animation-delay: .12s; }
.quick-tool-card:nth-child(1) { animation-delay: .16s; }
.quick-tool-card:nth-child(2) { animation-delay: .20s; }
.quick-tool-card:nth-child(3) { animation-delay: .24s; }
.quick-tool-card:nth-child(4) { animation-delay: .28s; }

@media (max-width: 900px) {
  .sidebar { inset: 0 auto 0 0; width: 82px; border-radius: 0 22px 22px 0; }
  .app-shell { margin-left: 82px; }
  .app-header { padding-inline: 20px; }
  .shell-main { width: min(100% - 34px, 1340px); }
  .home-intro h1 { font-size: clamp(36px, 7vw, 52px); }
  .home-section-heading { align-items: start; flex-direction: column; gap: 5px; }
}

@media (max-width: 600px) {
  .sidebar { inset: auto 8px 8px; width: auto; height: 68px; padding: 6px 8px; border: 1px solid rgba(255,255,255,.1); border-radius: 20px; }
  .sidebar-nav { margin: 0; grid-template-columns: repeat(7, minmax(52px, 1fr)); }
  .sidebar-link { min-height: 54px; border-radius: 13px; }
  .app-shell { margin-left: 0; padding-bottom: 78px; }
  .app-header { height: 64px; padding-inline: 14px; }
  .app-header .brand small { display: none; }
  .header-actions { gap: 5px; }
  .header-history-button, .header-video-button { padding: 9px 10px; }
  .shell-main { width: calc(100% - 24px); padding-top: 24px; }
  .home-intro { padding-top: 16px; }
  .home-intro h1 { font-size: 38px; }
  .home-command-card { grid-template-columns: 44px 1fr; padding: 16px; border-radius: 20px; }
  .home-add-button { width: 42px; height: 42px; border-radius: 14px; }
  .home-section-heading p { display: none; }
  .quick-tools { grid-template-columns: 1fr; }
  .quick-tool-card { min-height: 120px; padding: 19px; }
  .skill-workspace, .workspace-card, .results { padding: 18px; border-radius: 19px; }
  .login-card { padding: 28px 23px; border-radius: 23px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition-duration: .01ms !important; }
}

/* 2.9.1 compact creation navigation */
.face-library-folder {
  min-height: 48px;
  padding: 7px 10px;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 10px;
  border-radius: 12px;
}
.face-folder-icon {
  width: 29px;
  height: 22px;
  border-radius: 4px 5px 5px 5px;
}
.face-folder-icon::before {
  left: 2px;
  top: -4px;
  width: 13px;
  height: 6px;
  border-radius: 3px 3px 0 0;
}
.face-library-folder strong { font-size: 14px; }
.face-library-folder small { margin-top: 3px; color: #56627a; font-size: 12px; font-weight: 650; }
.face-library-folder b {
  padding: 6px 10px;
  border: 1px solid rgba(91, 92, 246, .14);
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  font-size: 11px;
}

.quick-tools {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.quick-tool-card {
  min-height: 112px;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 18px;
  text-align: center;
}
.quick-tool-card div { gap: 2px; }
.quick-tool-card strong { font-size: 14px; letter-spacing: -.02em; }
.quick-tool-card small, .quick-tool-card i { display: none; }
.quick-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 14px;
  font-size: 20px;
}

@media (max-width: 1050px) {
  .quick-tools {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(138px, 1fr);
    overflow-x: auto;
    padding: 2px 2px 12px;
    scroll-snap-type: x proximity;
  }
  .quick-tool-card { scroll-snap-align: start; }
}

@media (max-width: 600px) {
  .face-library-folder { grid-template-columns: 29px minmax(0, 1fr) auto; }
  .face-library-folder > b { display: block; padding-inline: 8px; }
  .quick-tools { grid-template-columns: none; }
  .quick-tool-card { min-height: 104px; padding: 14px 8px; }
}

.super-resolution-view { max-width: 940px; margin: 0 auto; }
.super-resolution-heading {
  margin-bottom: 14px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}
.super-resolution-heading span { color: #625cf3; font-size: 10px; font-weight: 900; letter-spacing: .15em; }
.super-resolution-heading h1 { margin: 4px 0 0; font-size: 31px; letter-spacing: -.04em; }
.super-resolution-heading p { margin: 7px 0 0; color: #788399; font-size: 13px; }
.super-resolution-heading > button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #dce3f0;
  border-radius: 10px;
  color: #4c5870;
  background: #fff;
}
.super-resolution-card {
  padding: 18px;
  display: grid;
  gap: 12px;
  border: 1px solid rgba(108, 116, 168, .16);
  border-radius: 20px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 18px 44px rgba(44, 52, 91, .08);
}
.super-resolution-upload {
  position: relative;
  min-height: 120px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1.5px dashed #bcc9e6;
  border-radius: 15px;
  color: #25314a;
  background: linear-gradient(135deg, #f9fbff, #f7f5ff);
  text-align: center;
  cursor: pointer;
}
.super-resolution-upload:hover { border-color: #716cff; background: #f6f5ff; }
.super-resolution-upload input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.super-resolution-upload-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #fff; background: linear-gradient(135deg, #7357ff, #2f8dff); font-size: 22px; }
.super-resolution-upload strong { margin-top: 4px; font-size: 15px; }
.super-resolution-upload small { color: #7b879a; font-size: 11px; }
.super-resolution-card > video { width: min(100%, 440px); max-height: 420px; margin: 0 auto; border-radius: 13px; background: #0e1424; }
.super-resolution-card > video[hidden] { display: none; }
.super-resolution-settings { padding: 13px; border: 1px solid #e1e6f0; border-radius: 13px; background: #fafbfe; }
.super-resolution-settings > div:first-child { margin-bottom: 9px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.super-resolution-settings > div:first-child span { color: #35415a; font-size: 12px; font-weight: 800; }
.super-resolution-settings > div:first-child small { color: #8a94a6; font-size: 10px; }
.super-resolution-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.super-resolution-options button { min-height: 58px; padding: 8px; display: grid; gap: 3px; border: 1px solid #dce2ed; border-radius: 10px; color: #3c4860; background: #fff; }
.super-resolution-options button.active { border-color: #7e80ff; color: #514fe3; background: linear-gradient(135deg, #f2f1ff, #edf6ff); box-shadow: 0 4px 14px rgba(83, 77, 219, .10); }
.super-resolution-options strong { font-size: 14px; }
.super-resolution-options small { color: #8992a4; font-size: 9px; }
.super-resolution-note { padding: 10px 12px; display: flex; align-items: center; gap: 10px; border-radius: 10px; color: #68748a; background: #f1f4f9; font-size: 11px; line-height: 1.5; }
.super-resolution-note strong { flex: 0 0 auto; color: #3b4860; }
.super-resolution-card .generate-video-bar { margin-top: 0; }
.super-resolution-card .video-task-panel { margin-top: 0; }

@media (max-width: 600px) {
  .sidebar-nav { grid-template-columns: repeat(8, minmax(52px, 1fr)); }
  .super-resolution-heading { align-items: start; }
  .super-resolution-heading h1 { font-size: 27px; }
  .super-resolution-heading p { max-width: 240px; }
  .super-resolution-card { padding: 12px; }
  .super-resolution-options { grid-template-columns: 1fr; }
  .super-resolution-note { align-items: start; flex-direction: column; gap: 3px; }
}

.workflow-options-grid {
  margin-top: 6px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
.workflow-option-card {
  min-width: 0;
  margin: 0;
  padding: 6px;
  border: 1px solid rgba(105, 117, 155, .14);
  border-radius: 15px;
  background: rgba(248, 249, 253, .78);
}
.workflow-option-card legend {
  padding: 0 5px;
  color: #69728a;
  font-size: 10px;
  font-weight: 900;
}
.workflow-option-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.workflow-option-choices label { position: relative; min-width: 0; cursor: pointer; }
.workflow-option-choices input { position: absolute; opacity: 0; pointer-events: none; }
.workflow-option-choices span {
  min-height: 42px;
  padding: 5px 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  border: 1px solid rgba(105, 117, 155, .13);
  border-radius: 11px;
  color: #596278;
  background: rgba(255,255,255,.74);
  transition: .18s ease;
}
.workflow-option-choices b { font-size: 11px; }
.workflow-option-choices small { overflow: hidden; color: #8a92a5; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.workflow-option-choices label:hover span { border-color: rgba(91,92,246,.30); background: #fff; }
.workflow-option-choices input:checked + span {
  color: #5150d5;
  border-color: rgba(91,92,246,.38);
  background: linear-gradient(135deg, rgba(239,236,255,.94), rgba(235,247,255,.9));
  box-shadow: inset 0 0 0 1px rgba(91,92,246,.06), 0 6px 16px rgba(75,79,173,.08);
}
.workflow-option-choices input:checked + span::before { margin-right: 4px; color: #625cf2; content: "✓ 已选择"; font-size: 8px; font-weight: 900; }
.workflow-notes-card textarea { width: 100%; min-height: 86px; padding: 10px 12px; resize: vertical; border: 1px solid rgba(105,117,155,.18); border-radius: 10px; color: var(--ink); background: #fff; outline: none; line-height: 1.55; }
.workflow-notes-card textarea:focus { border-color: #789aff; box-shadow: 0 0 0 3px rgba(29,94,255,.08); }
.workflow-notes-card > small { display: block; margin: 5px 3px 0; color: #8a92a5; font-size: 9px; }

@media (max-width: 760px) {
  .face-material-entry-grid, .fashion-material-entry-grid, .workflow-material-entry-grid { grid-template-columns: 1fr; }
  .workflow-options-grid { grid-template-columns: 1fr; }
}

