:root {
  --bg: #090b0f;
  --panel: rgba(18, 21, 28, 0.88);
  --panel-strong: #151922;
  --line: rgba(255, 255, 255, 0.1);
  --line-gold: rgba(226, 184, 100, 0.35);
  --text: #f5f2ea;
  --muted: #9ca3af;
  --gold: #e2b864;
  --gold-light: #f4d996;
  --green: #79d7aa;
  --red: #ff9c8c;
  --radius: 22px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 5%, rgba(183, 125, 38, 0.13), transparent 27rem),
    radial-gradient(circle at 95% 35%, rgba(76, 92, 136, 0.12), transparent 32rem),
    var(--bg);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  line-height: 1.65;
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.ambient { position: fixed; border-radius: 999px; filter: blur(90px); opacity: .18; pointer-events: none; z-index: -1; }
.ambient-one { width: 300px; height: 300px; background: #b87322; left: -160px; top: 32%; }
.ambient-two { width: 350px; height: 350px; background: #405b9a; right: -220px; top: 60%; }

.topbar {
  height: 76px;
  padding: 0 max(24px, calc((100vw - 1440px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 11, 15, 0.78);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand-mark {
  width: 40px; height: 40px; display: block; flex: none;
  filter: drop-shadow(0 8px 18px rgba(226, 184, 100, 0.16));
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: .12em; white-space: nowrap; }
.brand small { color: var(--muted); font-size: 10px; letter-spacing: .08em; }
.manuscript-entry { color: #c8c0b2; text-decoration: none; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 11px; transition: .2s ease; }
.manuscript-entry:hover, .manuscript-entry.active { color: var(--gold-light); border-color: var(--line-gold); background: rgba(226,184,100,.055); }
.manuscript-entry span:empty { display: none; }
.manuscript-entry span:not(:empty)::before { content: "· "; color: #777f8a; }
.health {
  display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px;
}
.health span { width: 7px; height: 7px; border-radius: 50%; background: #777; box-shadow: 0 0 12px currentColor; }
.health.online span { background: var(--green); }
.health.demo span { background: var(--gold); }

main { width: min(1440px, calc(100% - 48px)); margin: 0 auto; }
.manuscript-library-page { width: min(1080px, calc(100% - 48px)); margin: 0 auto; padding: 42px 0 72px; }
.manuscript-library-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.manuscript-library-head h1 { margin: 5px 0 7px; font: 500 42px/1.15 "STSong", serif; }
.manuscript-library-head > div > p:last-child { margin: 0; color: var(--muted); font-size: 12px; }
.manuscript-library-status { min-height: 18px; margin: 0 0 14px; color: #858d98; font-size: 11px; }
.manuscript-library-status.error { color: var(--red); }
.manuscript-library-list { display: grid; gap: 18px; }
.manuscript-load-more { display: block; margin: 20px auto 0; }
.manuscript-date-group { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: rgba(18,21,28,.82); box-shadow: var(--shadow); }
.manuscript-date-group h2 { margin: 0; padding: 15px 20px; color: var(--gold-light); border-bottom: 1px solid var(--line); font-size: 12px; letter-spacing: .06em; }
.manuscript-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 18px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.manuscript-row:last-child { border-bottom: 0; }
.manuscript-row-main { min-width: 0; }
.manuscript-row-title { margin: 0; color: #eee9df; font-size: 14px; font-weight: 700; line-height: 1.55; }
.manuscript-row-topic { margin: 4px 0 0; color: #747c87; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.manuscript-state { min-width: 48px; color: var(--green); font-size: 10px; text-align: center; }
.manuscript-state.failed { color: var(--red); }
.manuscript-state.pending { color: var(--gold-light); }
.manuscript-row-actions { display: flex; gap: 7px; }
.manuscript-row-actions button { margin: 0; white-space: nowrap; }
.manuscript-empty { padding: 70px 24px; text-align: center; border: 1px solid var(--line); border-radius: 18px; color: #7d8590; background: rgba(18,21,28,.7); }
.manuscript-empty h2 { margin: 0 0 8px; color: #e9e4da; font: 500 26px/1.3 "STSong", serif; }
.manuscript-empty p { margin: 0; font-size: 11px; }
.hero { text-align: center; padding: 82px 16px 66px; max-width: 900px; margin: 0 auto; }
.eyebrow { margin: 0 0 14px; color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; }
.hero h1 { margin: 0; font-family: "STSong", "SimSun", serif; font-weight: 500; font-size: clamp(42px, 6vw, 76px); line-height: 1.16; letter-spacing: -.04em; }
.hero h1 em { color: var(--gold-light); font-style: normal; }
.hero-flow { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 36px auto 0; }
.hero-flow span { min-width: 104px; padding: 12px 14px; color: #e5e0d5; font-size: 13px; font-weight: 650; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); }
.hero-flow i { color: #74664a; font-style: normal; }
.tutorial-intro { width: min(100%, 640px); margin: 32px auto 0; }
.tutorial-intro > p { margin: 0 0 2px; color: #e5e0d5; font-size: 15px; font-weight: 700; letter-spacing: .02em; }
.tutorial-arrows { display: flex; align-items: center; justify-content: center; gap: 22px; height: 38px; margin-bottom: 4px; color: var(--gold-light); }
.tutorial-arrows span { font-size: 30px; font-weight: 900; line-height: 1; text-shadow: 0 5px 18px rgba(226,184,100,.38); animation: tutorial-guide 1.25s ease-in-out infinite; }
.tutorial-arrows span:nth-child(2) { animation-delay: .12s; }
.tutorial-arrows span:nth-child(3) { animation-delay: .24s; }
.tutorial-player {
  position: relative; width: 100%; aspect-ratio: 633 / 304; overflow: hidden;
  border: 1px solid var(--line-gold); border-radius: 18px;
  background: #05070a;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.025), 0 20px 55px rgba(0,0,0,.2);
}
.tutorial-player video { display: block; width: 100%; height: 100%; object-fit: contain; background: #05070a; }
.tutorial-play { position: absolute; top: 50%; left: 50%; display: inline-flex; align-items: center; gap: 10px; min-width: 178px; padding: 10px 17px 10px 10px; border: 1px solid rgba(255,255,255,.55); border-radius: 999px; color: #17130b; background: linear-gradient(135deg, #f7dc96, var(--gold)); box-shadow: 0 14px 40px rgba(0,0,0,.45), 0 0 0 5px rgba(226,184,100,.14); cursor: pointer; transform: translate(-50%, -50%); transition: transform .2s ease, filter .2s ease; }
.tutorial-play:hover { filter: brightness(1.05); transform: translate(-50%, -53%); }
.tutorial-play:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
.tutorial-play[hidden] { display: none; }
.tutorial-play-icon { display: grid; place-items: center; width: 38px; height: 38px; padding-left: 3px; border-radius: 50%; color: var(--gold-light); background: #17130b; font-size: 16px; }
.tutorial-play strong { font-size: 14px; letter-spacing: .03em; white-space: nowrap; }
@keyframes tutorial-guide {
  0%, 100% { opacity: .58; transform: translateY(-2px); }
  50% { opacity: 1; transform: translateY(5px); }
}
@media (prefers-reduced-motion: reduce) {
  .tutorial-arrows span { animation: none; opacity: 1; }
}
.hero-start { display: inline-flex; align-items: center; justify-content: center; gap: 12px; margin-top: 26px; padding: 14px 24px; color: #17130b; font-size: 14px; font-weight: 800; text-decoration: none; border-radius: 12px; background: linear-gradient(135deg, var(--gold-light), var(--gold)); box-shadow: 0 14px 34px rgba(226,184,100,.18); transition: transform .2s ease, filter .2s ease; }
.hero-start:hover { transform: translateY(-2px); filter: brightness(1.05); }
.hero-start span { font-size: 18px; }

.home-main { min-height: calc(100vh - 144px); }
.app-page main { width: min(1080px, calc(100% - 48px)); }
.guided-app { padding: 46px 0 80px; }
.guided-intro { max-width: 900px; margin: 0 auto 28px; text-align: center; }
.back-home { display: inline-flex; margin-bottom: 18px; color: var(--muted); font-size: 12px; text-decoration: none; }
.back-home:hover { color: var(--gold-light); }
.guided-intro h1 { margin: 0; font: 500 clamp(34px, 5vw, 54px)/1.22 "STSong", "SimSun", serif; }
.guided-intro > p:not(.eyebrow) { max-width: 620px; margin: 12px auto 0; color: var(--muted); font-size: 13px; }
.guided-progress { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 28px; }
.guided-progress button { display: grid; justify-items: center; gap: 5px; min-width: 0; padding: 11px 6px; border: 1px solid var(--line); border-radius: 12px; color: #737b87; background: rgba(255,255,255,.02); }
.guided-progress button b { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid currentColor; border-radius: 999px; font-size: 10px; }
.guided-progress button span { overflow: hidden; max-width: 100%; font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.guided-progress button.active { color: var(--gold-light); border-color: var(--line-gold); background: rgba(226,184,100,.08); }
.guided-progress button.done { color: #b9aa87; }
.guided-progress button:disabled { cursor: not-allowed; opacity: .38; }

.guided-app .guided-workspace { display: block; }
.guided-app .input-panel { display: block; width: 100%; max-width: 880px; margin: 0 auto; }
.guided-app .result-panel { position: static; max-width: 940px; min-height: 0; max-height: none; margin: 0 auto; }
.guided-app .loop-dashboard { max-width: 1080px; margin: 0 auto; }
.guided-app .guided-stage-panel { display: none; }
.guided-app[data-active-step="profile"] [data-stage-panel~="profile"],
.guided-app[data-active-step="topic"] [data-stage-panel~="topic"],
.guided-app[data-active-step="script"] [data-stage-panel~="script"],
.guided-app[data-active-step="shoot"] [data-stage-panel~="shoot"],
.guided-app[data-active-step="review"] [data-stage-panel~="review"] { display: block; }
.guided-app[data-active-step="shoot"] #generatorForm,
.guided-app[data-active-step="review"] .guided-workspace { display: none; }
.guided-stage-panel > :last-child { margin-bottom: 0; }
.guided-stage-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 20px; }
.guided-stage-actions .primary-small { margin-left: auto; }
.result-stage-actions { padding: 16px 20px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.015); }
.review-stage-actions { justify-content: flex-end; }

.topic-path-choice { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.topic-path-choice button { padding: 22px; border: 1px solid var(--line); border-radius: 15px; color: var(--text); background: rgba(255,255,255,.025); text-align: left; }
.topic-path-choice button b, .topic-path-choice button small { display: block; }
.topic-path-choice button b { font-size: 16px; }
.topic-path-choice button small { margin-top: 6px; color: var(--muted); font-size: 10px; }
.topic-path-choice button.active { border-color: var(--line-gold); background: rgba(226,184,100,.08); box-shadow: 0 12px 32px rgba(0,0,0,.18); }
.topic-stage .topic-lab, .topic-stage .topic-results, .topic-stage .topic-history, .topic-stage .topic-entry, .topic-stage .topic-consent, .topic-stage .topic-generate-actions, .topic-stage .topic-next-actions, .topic-stage #topicStatus, .topic-stage #topicStepMessage { display: none; }
.topic-stage[data-topic-path="system"][data-topic-view="setup"] .topic-lab,
.topic-stage[data-topic-path="system"][data-topic-view="setup"] .topic-consent,
.topic-stage[data-topic-path="system"][data-topic-view="setup"] .topic-generate-actions,
.topic-stage[data-topic-path="system"][data-topic-view="setup"] #topicStatus,
.topic-stage[data-topic-path="system"][data-topic-view="loading"] .topic-results,
.topic-stage[data-topic-path="system"][data-topic-view="loading"] #topicStatus,
.topic-stage[data-topic-path="system"][data-topic-view="results"] .topic-results,
.topic-stage[data-topic-path="system"][data-topic-view="results"] .topic-next-actions,
.topic-stage[data-topic-path="system"][data-topic-view="results"] #topicStatus,
.topic-stage[data-topic-path="system"][data-topic-view="results"] #topicStepMessage,
.topic-stage[data-topic-path="system"][data-topic-view="history"] .topic-history,
.topic-stage[data-topic-path="own"] .topic-entry,
.topic-stage[data-topic-path="own"] .topic-consent,
.topic-stage[data-topic-path="own"] .topic-next-actions,
.topic-stage[data-topic-path="own"] #topicStepMessage { display: flex; }
.topic-stage[data-topic-path="system"][data-topic-view="setup"] .topic-lab,
.topic-stage[data-topic-path="system"][data-topic-view="loading"] .topic-results,
.topic-stage[data-topic-path="system"][data-topic-view="results"] .topic-results,
.topic-stage[data-topic-path="system"][data-topic-view="history"] .topic-history { display: block; }
.topic-stage[data-topic-path="system"][data-topic-view="setup"] #topicStatus,
.topic-stage[data-topic-path="system"][data-topic-view="loading"] #topicStatus,
.topic-stage[data-topic-path="system"][data-topic-view="results"] #topicStatus,
.topic-stage[data-topic-path="system"][data-topic-view="results"] #topicStepMessage,
.topic-stage[data-topic-path="own"] .topic-entry,
.topic-stage[data-topic-path="own"] #topicStepMessage { display: block; }
.topic-stage[data-topic-path="system"][data-topic-view="loading"] .topic-path-choice,
.topic-stage[data-topic-path="system"][data-topic-view="results"] .topic-path-choice { display: none; }
.topic-stage .topic-entry { margin-top: 18px; }
.topic-stage #topicStepMessage { min-height: 22px; }

.workspace { display: grid; grid-template-columns: minmax(420px, .93fr) minmax(520px, 1.07fr); gap: 18px; align-items: start; }
.input-panel, .result-panel {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); backdrop-filter: blur(20px);
}
.input-panel { padding: 30px; }
.result-panel { min-height: 860px; overflow: hidden; position: sticky; top: 94px; max-height: calc(100vh - 112px); overflow-y: auto; }
.panel-heading, .result-topline, .card-title { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.panel-heading { margin-bottom: 24px; }
.step { color: var(--gold); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; }
h2, h3, h4, p { margin-top: 0; }
.panel-heading h2, .result-topline h2 { margin: 3px 0 0; font-size: 24px; }
.text-button { border: 0; background: transparent; color: var(--gold-light); font-size: 13px; padding: 8px; }
.text-button:hover { color: white; }

.mode-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 18px; padding: 5px; border: 1px solid var(--line); border-radius: 15px; background: rgba(0,0,0,.22); }
.mode-switch button { border: 1px solid transparent; border-radius: 10px; padding: 11px 12px; color: #7e8590; background: transparent; text-align: left; }
.mode-switch button b, .mode-switch button small { display: block; }
.mode-switch button b { font-size: 13px; }
.mode-switch button small { margin-top: 2px; font-size: 9px; }
.mode-switch button.active { color: var(--gold-light); border-color: var(--line-gold); background: rgba(226,184,100,.08); }
.library-box { margin-bottom: 22px; padding: 17px; border: 1px solid var(--line-gold); border-radius: 15px; background: rgba(226,184,100,.035); }
.library-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.library-summary h3 { margin: 2px 0 0; font-size: 17px; }
.library-summary strong { color: var(--gold-light); font-size: 20px; }
.library-box > p { margin: 10px 0 13px; color: #8d949f; font-size: 10px; }
.library-box > p.ready { color: var(--green); }
.library-unready { display: grid; gap: 4px; margin: 0 0 13px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; color: #777f8a; font-size: 9px; }
.library-unready b { color: #b9a77e; font-size: 10px; }
.library-unready span { line-height: 1.5; }
.library-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.add-sample { display: grid; gap: 8px; margin-top: 12px; }
.add-sample > p { margin: 0; color: #8d949f; font-size: 10px; line-height: 1.6; }
.add-sample > p.library-message { min-height: 1.6em; color: #ff8d7a; }
.add-sample > p.library-message.success { color: var(--success); }
.add-sample input, .add-sample textarea, .add-sample select { width: 100%; color: var(--text); background: rgba(5,7,10,.8); border: 1px solid var(--line); border-radius: 9px; padding: 10px; outline: none; resize: vertical; }
.add-sample .primary-small { margin-left: 0; }
.library-list { display: grid; gap: 5px; margin-top: 12px; max-height: 240px; overflow-y: auto; }
.library-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 9px; border-top: 1px solid var(--line); }
.library-item b, .library-item small { display: block; }
.library-item b { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #c9cdd4; font-size: 10px; }
.library-item small, .library-more { color: #686f7a; font-size: 8px; }
.library-item .text-button { font-size: 9px; }

.field { display: block; margin-bottom: 18px; }
.field > span { display: flex; gap: 7px; align-items: center; margin-bottom: 8px; color: #d9dce2; font-size: 13px; font-weight: 650; }
.field b, .field i { font-size: 10px; font-style: normal; font-weight: 600; }
.field b { color: var(--gold); }
.field i { color: #858c98; }
.field input, .field textarea, .field select {
  width: 100%; color: var(--text); background: rgba(5, 7, 10, .75); border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; outline: none; transition: .2s ease;
}
.field input[readonly] { color: #9ba1ab; background: rgba(17, 20, 26, .62); cursor: default; }
.field textarea { resize: vertical; min-height: 88px; line-height: 1.65; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(226,184,100,.1); }
.field input::placeholder, .field textarea::placeholder { color: #5e6470; }
.field select { appearance: none; background-image: linear-gradient(45deg,transparent 50%,#848b96 50%),linear-gradient(135deg,#848b96 50%,transparent 50%); background-position: calc(100% - 17px) 19px,calc(100% - 12px) 19px; background-size: 5px 5px; background-repeat: no-repeat; }
.field small { display: block; text-align: right; color: #69707b; margin-top: 5px; font-size: 10px; }
.profile-actions { display: flex; align-items: center; gap: 12px; margin: -5px 0 18px; }
.profile-actions p { margin: 0; color: #6f7782; font-size: 9px; }
.profile-actions p.success { color: var(--green); }
.topic-lab { margin: 4px 0 20px; padding: 18px; border: 1px solid var(--line-gold); border-radius: 16px; background: linear-gradient(145deg, rgba(226,184,100,.07), rgba(65,85,130,.035)); }
.topic-inputs .field { margin-bottom: 8px; }
.topic-inputs textarea { min-height: 50px; }
.topic-options { margin: 5px 0 12px; }
.topic-options .compact-field { width: 220px; margin: 0; }
.topic-status { min-height: 17px; margin: 9px 0 0; color: #7f8793; font-size: 10px; }
.topic-status.error { color: var(--red); }
.topic-results { min-height: 120px; }
.topic-batch-summary, .topic-history-heading, .batch-script-plan-head, .batch-result-switcher > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.topic-batch-summary { padding: 12px 2px 4px; }
.topic-batch-summary b, .topic-batch-summary small, .topic-history-heading b, .topic-history-heading small, .batch-result-switcher b, .batch-result-switcher small { display: block; }
.topic-batch-summary b, .topic-history-heading b { color: #e3e0d8; font-size: 13px; }
.topic-batch-summary small, .topic-history-heading small, .batch-result-switcher small { margin-top: 4px; color: #737b87; font-size: 9px; }
.topic-list { display: grid; gap: 8px; margin-top: 13px; max-height: 520px; overflow-y: auto; padding-right: 3px; }
.topic-card { width: 100%; display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: start; padding: 12px; color: inherit; border: 1px solid var(--line); border-radius: 12px; background: rgba(0,0,0,.17); text-align: left; position: relative; }
.topic-card:hover { border-color: var(--line-gold); transform: translateY(-1px); }
.topic-score { width: 38px; height: 38px; display: grid; place-items: center; color: var(--gold-light); border: 1px solid var(--line-gold); border-radius: 50%; font-size: 11px; font-weight: 750; }
.topic-copy b, .topic-copy small { display: block; }
.topic-copy b { color: #e3e0d8; font-size: 12px; line-height: 1.55; }
.topic-copy p { margin: 5px 0; color: #949ba6; font-size: 10px; line-height: 1.55; }
.topic-copy small { color: #69717d; font-size: 9px; }
.topic-source { padding: 4px 6px; color: var(--green); border: 1px solid rgba(121,215,170,.22); border-radius: 999px; font-size: 8px; white-space: nowrap; }
.topic-source.evergreen { color: #9ea5b0; border-color: var(--line); }
.topic-card.selected { border-color: var(--gold); background: rgba(226,184,100,.09); }
.topic-card.generated { border-color: rgba(121,215,170,.22); }
.topic-card-status { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.topic-state { color: #7f8793; font-size: 8px; white-space: nowrap; }
.topic-state.done { color: var(--green); }
.topic-select-indicator { width: 18px; height: 18px; display: grid; place-items: center; border: 1px solid #505866; border-radius: 5px; color: transparent; font-size: 11px; }
.topic-card.selected .topic-select-indicator { color: #17130b; border-color: var(--gold); background: var(--gold); }
.topic-history { margin-top: 18px; }
.topic-history-heading { align-items: flex-end; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.topic-batch-list { display: grid; gap: 9px; margin-top: 12px; }
.topic-batch-item { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 14px; color: inherit; border: 1px solid var(--line); border-radius: 12px; background: rgba(0,0,0,.16); text-align: left; }
.topic-batch-item:hover { border-color: var(--line-gold); }
.topic-batch-item b, .topic-batch-item small { display: block; }
.topic-batch-item b { color: #e3e0d8; font-size: 12px; }
.topic-batch-item small { margin-top: 5px; color: #727a86; font-size: 9px; line-height: 1.5; }
.topic-batch-item span { align-self: center; color: var(--gold-light); font-size: 10px; white-space: nowrap; }
.topic-history-empty { padding: 34px 12px; color: #747c88; text-align: center; }
.batch-script-plan { margin-bottom: 20px; padding: 17px; border: 1px solid var(--line-gold); border-radius: 14px; background: rgba(226,184,100,.055); }
.batch-script-plan-head h3 { margin: 4px 0 0; font-size: 17px; }
.batch-script-topics { display: flex; flex-wrap: wrap; gap: 7px; margin: 13px 0 10px; }
.batch-script-topics span { padding: 7px 9px; color: #d5d2ca; border: 1px solid var(--line); border-radius: 8px; background: rgba(0,0,0,.16); font-size: 9px; line-height: 1.4; }
.batch-script-plan > p { margin: 0; color: #7d8591; font-size: 9px; }
.batch-result-switcher { padding: 16px 20px; border-bottom: 1px solid var(--line); background: rgba(226,184,100,.04); }
.batch-result-switcher > div:first-child { align-items: flex-start; }
.batch-result-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.batch-result-tabs button { max-width: 240px; padding: 8px 10px; overflow: hidden; color: #9ba2ad; border: 1px solid var(--line); border-radius: 8px; background: rgba(0,0,0,.17); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.batch-result-tabs button.active { color: #1a150b; border-color: var(--gold); background: var(--gold); }
.batch-result-tabs button.failed { color: #e89b8d; border-color: rgba(232,155,141,.28); }
.grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-three { display: grid; grid-template-columns: .75fr .72fr 1.3fr; gap: 12px; }
.profile-grid { grid-template-columns: 1fr 1fr .55fr; }
.divider { display: flex; align-items: center; gap: 12px; color: #6f7580; font-size: 10px; letter-spacing: .12em; margin: 28px 0 20px; }
.divider::before, .divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.consent { display: flex; align-items: flex-start; gap: 10px; padding: 13px; color: #8f96a1; background: rgba(255,255,255,.025); border-radius: 12px; font-size: 11px; line-height: 1.55; }
.consent input { margin-top: 3px; accent-color: var(--gold); }
.generate-button {
  width: 100%; margin-top: 18px; border: 0; border-radius: 14px; color: #1b150a; background: linear-gradient(135deg, #f0d38e, #c8933d); padding: 15px 18px; display: flex; align-items: center; gap: 13px; box-shadow: 0 14px 40px rgba(193, 137, 52, .18); transition: .2s ease;
}
.generate-button:hover { transform: translateY(-2px); filter: brightness(1.06); }
.generate-button:disabled { opacity: .55; cursor: wait; transform: none; }
.button-icon { font-size: 25px; }
.button-copy { display: flex; flex-direction: column; text-align: left; line-height: 1.3; }
.button-copy strong { font-size: 15px; }
.button-copy small { opacity: .65; font-size: 10px; }
.button-arrow { margin-left: auto; font-size: 22px; }
.form-message { min-height: 20px; margin: 8px 0 0; color: var(--red); text-align: center; font-size: 12px; }
.form-message.success { color: var(--green); }

.loading-state { min-height: 850px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 50px; }
.loading-state h2 { margin: 7px 0 8px; font: 500 34px/1.2 "STSong", serif; }
.loading-state > p:not(.step) { color: var(--muted); max-width: 450px; }

.loader { display: flex; gap: 10px; margin-bottom: 32px; }
.loader span { width: 12px; height: 12px; border-radius: 50%; background: var(--gold); animation: pulse 1.2s infinite ease-in-out; }
.loader span:nth-child(2) { animation-delay: .18s; }
.loader span:nth-child(3) { animation-delay: .36s; }
@keyframes pulse { 0%,80%,100% { transform: scale(.65); opacity: .35; } 40% { transform: scale(1); opacity: 1; } }
.loading-steps { list-style: none; padding: 0; margin: 28px 0 0; text-align: left; color: #606671; font-size: 12px; }
.loading-steps li { padding: 7px 0 7px 24px; position: relative; }
.loading-steps li::before { content: ""; position: absolute; left: 2px; top: 14px; width: 6px; height: 6px; border-radius: 50%; background: #414650; }
.loading-steps li.active { color: var(--gold-light); }
.loading-steps li.active::before { background: var(--gold); box-shadow: 0 0 10px var(--gold); }

.results { padding-bottom: 28px; }
.result-topline { padding: 28px 30px 20px; border-bottom: 1px solid var(--line); }
.result-card { margin: 18px 24px 0; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.024); scroll-margin-top: 62px; }
.card-title { justify-content: flex-start; margin-bottom: 17px; }
.card-title > span { color: var(--gold); font-size: 10px; font-weight: 700; }
.card-title h3 { margin: 0; font-size: 18px; }
.result-card h4 { color: #aab0ba; margin: 20px 0 10px; font-size: 12px; letter-spacing: .05em; }
.copy-button { border: 1px solid var(--line); background: transparent; color: #aeb4bd; border-radius: 8px; padding: 6px 9px; font-size: 9px; }
.copy-button:hover { border-color: var(--gold); color: var(--gold-light); }
.copy-button { margin-left: auto; }
.script-title { color: var(--gold-light) !important; font: 500 20px/1.5 "STSong", serif; }
.script-title-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.script-title-row .script-title { margin: 0; }
.script-body { white-space: pre-wrap; color: #d7d9dd; font-size: 14px; line-height: 1.95; }
.script-meta { display: flex; gap: 14px; margin-top: 17px; color: #707783; font-size: 10px; }
.action-required-list { margin: 0; padding-left: 20px; color: var(--red); font-size: 12px; line-height: 1.8; }
.action-required-list li + li { margin-top: 7px; }
.professional-summary { color: var(--green); font-size: 12px; }
.sample-chip-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }
.sample-chip { padding: 5px 8px; color: #9da4af; border: 1px solid var(--line); border-radius: 999px; font-size: 9px; }
.feedback-status { min-height: 18px; margin: 10px 0 0; color: var(--green); font-size: 11px; }
.feedback-status.error { color: var(--red); }
.result-actions { display: flex; flex-wrap: wrap; gap: 9px; padding: 18px 24px 0; }
.copy-status { flex: 1 1 100%; min-height: 18px; margin: 0; color: var(--green); font-size: 11px; }
.copy-status.error { color: var(--red); }
.secondary-button, .primary-small { padding: 10px 13px; border-radius: 9px; font-size: 11px; }
.secondary-button { color: #b1b7c0; border: 1px solid var(--line); background: transparent; }
.primary-small { margin-left: auto; border: 1px solid var(--gold); color: #17120a; background: var(--gold); }
.shoot-button { flex: 1 1 100%; padding: 14px 16px; border: 1px solid var(--gold); border-radius: 11px; color: #17120a; background: linear-gradient(135deg, #f0d38e, #c8933d); font-size: 14px; font-weight: 800; }

.loop-dashboard { margin: 36px 0 0; padding: 30px; border: 1px solid var(--line-gold); border-radius: var(--radius); background: linear-gradient(145deg, rgba(226,184,100,.055), rgba(18,21,28,.94)); box-shadow: var(--shadow); }
.loop-grid { display: grid; grid-template-columns: minmax(520px, 1.1fr) minmax(360px, .9fr); gap: 18px; }
.performance-form, .publication-history { padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: rgba(5,7,10,.38); }
.review-data-section h3 { margin: 0; font-size: 17px; }
.review-data-section { margin-top: 20px; }
.review-data-section h3 { margin-bottom: 12px; }
.metric-instruction { margin: -3px 0 18px; color: #7f8792; font-size: 10px; line-height: 1.7; }
.metric-group-title { margin: 18px 0 9px; color: #d9dce2; font-size: 12px; }
.metric-group-title i { margin-left: 5px; color: #858c98; font-size: 9px; font-style: normal; font-weight: 500; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.metric-grid-three { grid-template-columns: repeat(3, 1fr); }
.metric-grid .field { margin-bottom: 4px; }
.metric-grid .field > span { font-size: 10px; }
.metric-grid input { padding: 10px; }
.metric-field-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 24px; margin-bottom: 8px; }
.metric-field-head label { color: #d9dce2; font-size: 10px; font-weight: 650; }
.metric-field-head b { color: var(--gold); font-size: 9px; }
.metric-unavailable-toggle { flex: 0 0 auto; padding: 2px 5px; color: #737b87; background: transparent; border: 0; font-size: 8px; cursor: pointer; }
.metric-unavailable-toggle:hover, .metric-unavailable-toggle:focus-visible { color: var(--gold-light); }
.metric-field.is-unavailable input { color: #747b86; background: rgba(17,20,26,.58); border-style: dashed; }
.metric-field.is-unavailable .metric-unavailable-toggle { color: var(--gold-light); }
.calculated-metric { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 12px; align-items: baseline; margin-top: 10px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; background: rgba(17,20,26,.48); }
.calculated-metric span { color: #bfc4cc; font-size: 10px; font-weight: 650; }
.calculated-metric strong { color: var(--gold-light); font-size: 11px; }
.calculated-metric small { grid-column: 2; color: #6f7782; font-size: 8px; }
.calculated-metric-compact { margin-top: 0; min-height: 64px; align-content: center; }
.compact-generate { margin-top: 16px; }
.history-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.history-head h3 { margin: 0; font-size: 17px; }
.history-head span { color: var(--gold); font-size: 10px; }
.publication-list { display: grid; gap: 9px; max-height: 620px; overflow-y: auto; }
.publication-card { padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.02); }
.publication-card b, .publication-card small { display: block; }
.publication-card b { color: #dedbd3; font-size: 12px; line-height: 1.5; }
.publication-card small { margin-top: 4px; color: #707884; font-size: 9px; }
.publication-card p { margin: 9px 0 0; color: #9aa1ab; font-size: 10px; line-height: 1.6; }
.publication-card ul { margin: 7px 0 0; padding-left: 16px; color: var(--gold-light); font-size: 9px; line-height: 1.65; }
.publication-card-actions { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.publication-card-actions .muted-action { color: #777f8a; }
.publication-card-actions .muted-action:hover { color: #c5cad2; }
.empty-history { color: #717985; font-size: 10px; line-height: 1.7; }

.principles { padding: 110px 0 90px; text-align: center; }
.principles > h2 { font: 500 clamp(30px,4vw,48px)/1.3 "STSong", serif; }
.principle-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 34px; text-align: left; }
.principle-grid article { padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.02); }
.principle-grid span { color: var(--gold); font-size: 10px; }
.principle-grid h3 { margin: 12px 0 6px; }
.principle-grid p { color: var(--muted); font-size: 12px; }
footer { width: min(1440px, calc(100% - 48px)); margin: 0 auto; padding: 24px 0 40px; display: flex; justify-content: space-between; border-top: 1px solid var(--line); color: #5f6570; font-size: 10px; }

.account-tools { display: flex; align-items: center; gap: 8px; }
.points-badge, .account-admin, .account-logout { padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; color: #aeb4bf; background: rgba(255,255,255,.02); font: inherit; font-size: 10px; text-decoration: none; }
.points-badge { color: var(--gold-light); }
.account-logout { cursor: pointer; }
.account-admin:hover, .account-logout:hover { color: var(--gold-light); border-color: rgba(230,185,91,.42); }

.auth-page, .admin-page { min-height: 100vh; background: #090b0f; }
.auth-shell { width: min(100% - 32px, 520px); margin: 0 auto; padding: 72px 0; }
.auth-brand { display: inline-flex; margin-bottom: 34px; }
.auth-card, .admin-card { padding: 34px; border: 1px solid var(--line); border-radius: 22px; background: rgba(18,20,26,.96); box-shadow: 0 28px 80px rgba(0,0,0,.28); }
.auth-card h1 { margin: 8px 0 10px; font-size: 32px; }
.auth-card > p:not(.eyebrow), .admin-heading p { color: var(--muted); line-height: 1.7; }
.auth-form { display: grid; gap: 16px; margin-top: 26px; }
.auth-form label { display: grid; gap: 7px; color: #d5d8de; font-size: 12px; }
.auth-form label small { color: var(--muted); font-size: 11px; line-height: 1.6; }
.auth-form input, .admin-create-form input { width: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; color: #fff; background: #090b0f; }
.auth-form .hero-start { width: 100%; margin-top: 4px; border: 0; }
.auth-message { min-height: 22px; margin-top: 14px; color: #ff9b88; font-size: 11px; }
.admin-shell { width: min(100% - 40px, 1080px); margin: 0 auto; padding: 56px 0 90px; }
.admin-heading { margin-bottom: 28px; }
.admin-heading h1 { margin: 8px 0; font-size: 42px; }
.admin-card { margin-top: 18px; }
.admin-card h2 { margin-bottom: 18px; }
.admin-create-form { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 10px; }
.admin-create-form .primary-small { margin: 0; white-space: nowrap; }
.admin-user-list { display: grid; }
.admin-user-row { display: grid; grid-template-columns: minmax(220px,1fr) auto auto; align-items: center; gap: 18px; padding: 18px 0; border-top: 1px solid var(--line); }
.admin-user-row:first-child { border-top: 0; }
.admin-user-row div:first-child { display: grid; gap: 5px; }
.admin-user-row small { color: var(--muted); }
.admin-user-row > b { color: var(--gold-light); }
.admin-user-actions { display: flex; gap: 6px; }
.admin-user-actions .secondary-button { padding: 8px 10px; }

@media (max-width: 1050px) {
  .workspace { grid-template-columns: 1fr; }
  .result-panel { position: static; max-height: none; min-height: 650px; }
  .loading-state { min-height: 650px; }
  .loop-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  main { width: min(100% - 24px, 1440px); }
  .app-page main { width: min(100% - 24px, 1080px); }
  .topbar { height: 66px; padding: 0 14px; }
  .brand small { display: none; }
  .manuscript-entry { padding: 7px 10px; font-size: 10px; }
  .account-tools { gap: 4px; }
  .points-badge, .account-admin, .account-logout { padding: 6px 7px; font-size: 8px; }
  .account-admin { display: none; }
  .manuscript-library-page { width: min(100% - 24px, 1080px); padding: 28px 0 54px; }
  .manuscript-library-head { align-items: stretch; flex-direction: column; gap: 16px; }
  .manuscript-library-head h1 { font-size: 34px; }
  .manuscript-library-head .secondary-button { width: 100%; }
  .manuscript-row { grid-template-columns: 1fr auto; gap: 10px 12px; padding: 16px 14px; }
  .manuscript-row-actions { grid-column: 1 / -1; }
  .manuscript-row-actions button { flex: 1; }
  .health { padding: 7px 9px; }
  .hero { padding: 54px 4px 40px; }
  .hero h1 { font-size: 40px; }
  .hero h1 em { display: inline-block; font-size: 34px; letter-spacing: -.06em; white-space: nowrap; }
  .hero-flow { flex-direction: column; max-width: 250px; gap: 4px; }
  .hero-flow span { width: 100%; min-width: 0; padding: 9px 8px; font-size: 11px; }
  .hero-flow i { line-height: 1; transform: rotate(90deg); }
  .tutorial-intro { margin-top: 26px; }
  .tutorial-intro > p { font-size: 13px; }
  .tutorial-arrows { gap: 16px; height: 34px; margin-bottom: 2px; }
  .tutorial-arrows span { font-size: 26px; }
  .tutorial-player { border-radius: 14px; }
  .tutorial-play { min-width: 164px; padding: 8px 14px 8px 8px; }
  .tutorial-play-icon { width: 34px; height: 34px; font-size: 14px; }
  .tutorial-play strong { font-size: 13px; }
  .hero-start { margin-top: 20px; }
  .guided-app { padding: 28px 0 54px; }
  .guided-intro { margin-bottom: 18px; }
  .guided-intro h1 { font-size: 34px; }
  .guided-progress { gap: 4px; margin-top: 20px; }
  .guided-progress button { gap: 4px; padding: 8px 2px; border-radius: 9px; }
  .guided-progress button b { width: 21px; height: 21px; }
  .guided-progress button span { font-size: 9px; }
  .topic-path-choice { grid-template-columns: 1fr; }
  .topic-path-choice button { padding: 17px; }
  .profile-actions { align-items: stretch; flex-direction: column; }
  .guided-stage-actions { align-items: stretch; flex-direction: column; }
  .guided-stage-actions .primary-small { width: 100%; margin-left: 0; }
  .guided-stage-actions .secondary-button { width: 100%; }
  .result-stage-actions { padding: 13px 12px; }
  .input-panel { padding: 20px 16px; }
  .mode-switch { grid-template-columns: 1fr; }
  .grid-two, .grid-three, .check-columns, .principle-grid { grid-template-columns: 1fr; }
  .topic-card { grid-template-columns: 34px 1fr; }
  .topic-card-status { grid-column: 2; justify-self: stretch; flex-direction: row; align-items: center; justify-content: space-between; }
  .topic-source { justify-self: start; }
  .topic-batch-summary, .topic-history-heading, .batch-script-plan-head, .batch-result-switcher > div:first-child { align-items: flex-start; flex-direction: column; }
  .topic-batch-item { grid-template-columns: 1fr; }
  .topic-batch-item span { justify-self: start; }
  .topic-options .compact-field { width: 100%; }
  .result-topline { padding: 22px 18px 17px; }
  .result-card { margin: 13px 12px 0; padding: 18px 15px; }
  .result-actions { padding: 15px 12px 0; }
  .primary-small { margin-left: 0; }
  .principles { padding: 75px 0 65px; }
  .loop-dashboard { padding: 20px 14px; }
  .performance-form, .publication-history { padding: 16px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-grid-three { grid-template-columns: 1fr; }
  .calculated-metric { grid-template-columns: 1fr; }
  .calculated-metric small { grid-column: 1; }
  footer { width: calc(100% - 24px); flex-direction: column; gap: 5px; }
  .auth-shell { padding: 34px 0; }
  .auth-card { padding: 24px 18px; }
  .admin-shell { width: min(100% - 24px, 1080px); padding-top: 34px; }
  .admin-card { padding: 20px 16px; }
  .admin-create-form, .admin-user-row { grid-template-columns: 1fr; }
  .admin-user-actions { flex-wrap: wrap; }
}
