.creative-home { display: grid; gap: 20px; }
.creative-hero { min-height: 180px; padding: 30px 34px; display: flex; align-items: center; justify-content: space-between; gap: 28px; overflow: hidden; position: relative; background: linear-gradient(120deg, #f8fbff 0%, #fff 55%, #edf6ff 100%); }
.creative-hero::after { content: ""; position: absolute; width: 240px; height: 240px; border-radius: 50%; right: 120px; top: -150px; border: 38px solid rgba(5, 109, 232, .06); }
.creative-hero h1 { margin: 5px 0 8px; font-size: 30px; letter-spacing: -.03em; }
.creative-hero p { color: var(--muted); margin: 0; font-size: 15px; }
.creative-eyebrow { color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .14em; }
.creative-new-button { min-width: 150px; min-height: 44px; position: relative; z-index: 1; }
.creative-quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.creative-quick { border: 1px solid var(--line); display: grid; grid-template-columns: 42px 1fr; text-align: left; gap: 2px 12px; align-items: center; padding: 18px; cursor: pointer; color: var(--ink); }
.creative-quick:hover, .creative-tool:hover, .creative-draft-card:hover { border-color: #b7d4f6; box-shadow: 0 8px 24px rgba(50, 91, 140, .09); transform: translateY(-1px); }
.creative-quick small, .creative-tool small { color: var(--muted); }
.creative-quick b { font-size: 15px; }
.quick-icon { grid-row: 1/3; width: 40px; height: 40px; display: grid; place-items: center; color: var(--blue); background: #eef6ff; border-radius: 10px; font-weight: 800; }
.creative-section-head, .creative-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.creative-section-head h2, .creative-page-head h1 { margin: 0; }
.creative-section-head h2 { font-size: 18px; }
.creative-section-head p, .creative-page-head p { margin: 5px 0 0; color: var(--muted); }
.creative-page-head { margin-bottom: 20px; align-items: center; }
.creative-page-head h1 { margin-top: 8px; font-size: 26px; }
.creative-page-head > div:last-child { display: flex; gap: 8px; flex-wrap: wrap; }
.creative-draft-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.creative-draft-card { padding: 18px; cursor: pointer; transition: .18s ease; min-height: 170px; }
.draft-card-top, .draft-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.creative-status { font-size: 12px; color: #627087; }
.creative-draft-card h3 { font-size: 16px; margin: 16px 0 7px; line-height: 1.45; }
.creative-draft-card > p { color: var(--muted); font-size: 13px; line-height: 1.5; height: 40px; overflow: hidden; }
.draft-card-meta { color: var(--muted); font-size: 11px; margin-top: 14px; flex-wrap: wrap; }
.draft-warning { color: #b76808; }
.creative-tool-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.creative-tool { border: 1px solid var(--line); padding: 17px; color: var(--ink); display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer; }
.creative-tool > span { font-size: 22px; color: var(--blue); width: 32px; text-align: center; }
.creative-tool div { display: grid; gap: 4px; }
.creative-knowledge-strip { padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; }
.creative-knowledge-strip p { margin: 5px 0 0; color: var(--muted); }
.creative-consent { padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-color: #a9cef7; background: #f3f8ff; }
.creative-consent p { color: var(--muted); margin: 5px 0 0; }
.creative-empty-icon { font-size: 28px; color: #84b5ee; margin-bottom: 8px; }

.creative-new-form { width: min(620px, calc(100vw - 32px)); }
.creative-new-form > p { color: var(--muted); }
.new-flow-initial-form { display: flex; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); flex-direction: column; overflow: hidden; }
.new-flow-initial-form > h3 { flex: 0 0 auto; }
.new-flow-initial-scroll { min-height: 0; margin-top: 8px; padding: 0 7px 4px 1px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.new-flow-initial-form > .modal-actions { flex: 0 0 auto; margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--line); background: #fff; }
.creative-type-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0; }
.creative-type-picker input { position: absolute; opacity: 0; }
.creative-type-picker span { border: 1px solid var(--line); border-radius: 8px; padding: 11px; display: block; text-align: center; cursor: pointer; }
.creative-type-picker input:checked + span { color: var(--blue); background: #eff6ff; border-color: #8dbcf2; font-weight: 700; }
.field-label { display: grid; gap: 7px; margin: 14px 0; font-size: 13px; font-weight: 600; }
.field-label[hidden] { display: none; }
.field-label input, .field-label textarea, .field-label select, .knowledge-path-form input, .creative-filterbar input, .creative-filterbar select { width: 100%; border: 1px solid #cad3df; background: #fff; color: var(--ink); border-radius: 7px; padding: 10px 11px; font: inherit; }
.field-label textarea { min-height: 90px; resize: vertical; line-height: 1.55; }
.field-label .large-textarea { min-height: 260px; }
.check-label { display: flex; align-items: center; gap: 8px; color: var(--muted); }

.material-research-progress { position: fixed; top: 76px; right: 24px; z-index: 19; width: min(680px, calc(100vw - 48px)); padding: 17px; border: 1px solid #dce6f3; border-radius: 12px; background: rgba(255,255,255,.98); box-shadow: 0 16px 42px rgba(30,53,83,.19); backdrop-filter: blur(10px); }
.material-research-progress[hidden] { display: none; }
.material-research-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.material-research-head > div { display: flex; align-items: center; gap: 10px; }
.material-research-head strong { font-size: 15px; }
.material-research-head span { padding: 3px 8px; border-radius: 999px; background: #edf5ff; color: var(--blue); font-size: 11px; }
.material-research-progress.success .material-research-head span { background: #eaf8f2; color: #12815b; }
.material-research-progress.error .material-research-head span { background: #fff1f1; color: #b13b3b; }
.material-research-head button { border: 0; background: transparent; color: #8c97a7; cursor: pointer; font-size: 20px; line-height: 1; }
.material-research-progress > p { margin: 8px 0 13px; color: #647084; font-size: 12px; }
.material-research-stage-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.material-research-stage { min-height: 40px; display: flex; align-items: center; gap: 7px; padding: 9px 10px; border-radius: 8px; background: #f4f6f9; color: #8a95a6; font-size: 11px; line-height: 1.35; }
.material-research-stage i { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #c7ced8; }
.material-research-stage.active { background: #eaf3ff; color: #1269db; font-weight: 600; }
.material-research-stage.active i { background: var(--blue); box-shadow: 0 0 0 4px rgba(22,119,255,.12); animation: material-research-pulse 1.2s ease infinite; }
.material-research-stage.complete { background: #edf8f3; color: #14805b; }
.material-research-stage.complete i { background: #20a474; }
.material-research-stage.error { background: #fff1f1; color: #b13b3b; }
.material-research-stage.error i { background: var(--danger); }
@keyframes material-research-pulse { 50% { box-shadow: 0 0 0 7px rgba(22,119,255,.04); } }

.author-create-progress { width: min(620px, calc(100vw - 32px)); }
.author-create-progress > header { display: flex; align-items: center; gap: 14px; }
.author-create-progress .creative-loading-orb { width: 38px; height: 38px; flex: 0 0 auto; border: 3px solid #dceaff; border-top-color: var(--blue); border-radius: 50%; animation: author-create-spin .9s linear infinite; }
@keyframes author-create-spin { to { transform: rotate(360deg); } }
.author-create-progress > header span { display: block; margin-bottom: 4px; color: var(--blue); font-size: 11px; font-weight: 700; }
.author-create-progress > header h3 { margin: 0; }
.author-create-progress > p { margin: 18px 0 14px; }
.author-create-stage-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.author-create-stage { min-height: 46px; display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: 8px; background: #f4f6f9; color: #8a95a6; font-size: 12px; }
.author-create-stage i { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #c7ced8; }
.author-create-stage.active { background: #eaf3ff; color: #1269db; font-weight: 600; }
.author-create-stage.active i { background: var(--blue); box-shadow: 0 0 0 4px rgba(22,119,255,.12); animation: material-research-pulse 1.2s ease infinite; }
.author-create-stage.complete { background: #edf8f3; color: #14805b; font-weight: 600; }
.author-create-stage.complete i { background: #20a474; }
.author-create-stage.error { background: #fff1f1; color: #b13b3b; }
.author-create-stage.error i { background: var(--danger); }
.author-create-progress > small { display: block; margin-top: 14px; color: var(--muted); line-height: 1.55; }
.author-create-progress.success .creative-loading-orb { border: 0; animation: none; background: #20a474; box-shadow: 0 0 0 7px rgba(32,164,116,.12); }
.author-create-error { margin: 12px 0; padding: 10px 12px; border: 1px solid #f0c4c4; border-radius: 8px; background: #fff4f4; color: #a83c3c; font-size: 12px; line-height: 1.55; }

.creative-filterbar { padding: 14px; display: grid; grid-template-columns: minmax(200px, 1fr) 220px 150px 130px; gap: 10px; margin-bottom: 14px; }
.creative-draft-list { display: grid; gap: 10px; }
.creative-draft-row { padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.draft-row-main { min-width: 0; flex: 1; display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; cursor: pointer; }
.draft-row-main h3 { margin: 0 0 5px; font-size: 15px; }
.draft-row-main p { margin: 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.draft-row-side { text-align: right; display: grid; gap: 5px; justify-items: end; color: var(--muted); }
.draft-row-side > div { display: flex; gap: 5px; }
.compact { padding: 6px 9px !important; min-height: 30px; font-size: 12px; }

body:has(#creative.page.active .creative-workspace) .page-shell { max-width: none; padding-left: 18px; padding-right: 18px; }
@media (min-width: 1201px) {
  html:has(#creative.page.active .creative-workspace),
  body:has(#creative.page.active .creative-workspace) { overflow: hidden; }
}
.creative-workspace { display: grid; grid-template-columns: 220px minmax(440px, 1fr) 330px; height: calc(100vh - 108px); height: calc(100dvh - 108px); min-height: 560px; border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; }
.workspace-rail, .workspace-assets { background: #f8fafc; min-width: 0; }
.workspace-rail { padding: 18px; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.workspace-task { padding: 18px 0; border-bottom: 1px solid var(--line); }
.workspace-task h2 { margin: 10px 0 7px; font-size: 16px; line-height: 1.45; }
.workspace-task p { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 0; max-height: 55px; overflow: hidden; }
.stage-rail { display: grid; gap: 2px; padding: 18px 0; }
.creative-stage { display: grid; grid-template-columns: 25px 1fr; align-items: center; gap: 8px; padding: 9px 7px; color: #8390a3; font-size: 12px; }
.creative-stage span { border: 1px solid #cbd4df; border-radius: 50%; width: 22px; height: 22px; display: grid; place-items: center; font-size: 10px; }
.creative-stage.active { color: var(--blue); background: #eaf4ff; border-radius: 7px; }
.creative-stage.active span { color: #fff; background: var(--blue); border-color: var(--blue); }
.creative-stage.done { color: #4c7a69; }
.creative-stage.done span { color: #fff; background: #4ca47d; border-color: #4ca47d; }
.rail-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--muted); }
.workspace-main { min-width: 0; min-height: 0; background: #fff; display: flex; flex-direction: column; overflow: hidden; }
.workspace-main-head { min-height: 83px; border-bottom: 1px solid var(--line); padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.workspace-main-head span { color: var(--blue); font-size: 11px; font-weight: 700; }
.workspace-main-head h1 { font-size: 18px; margin: 4px 0 0; }
.workspace-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.workspace-error { background: #fff5e9; color: #9d5b08; padding: 10px 18px; font-size: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.workspace-error button { flex: 0 0 auto; }
.workspace-canvas { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.conversation-list { padding: 28px max(24px, 8%); flex: 1; min-height: 0; display: grid; align-content: start; gap: 20px; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-gutter: stable; }
.conversation-message { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; align-items: flex-start; }
.conversation-message > span { width: 30px; height: 30px; border-radius: 8px; background: #eaf4ff; color: var(--blue); display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.conversation-message.user > span { background: #eff1f4; color: #5e6878; }
.conversation-message > div { background: #f7f9fb; padding: 12px 14px; border-radius: 4px 12px 12px; line-height: 1.75; color: #344054; white-space: pre-wrap; overflow-wrap: anywhere; }
.conversation-message.user > div { background: #edf5ff; }
.conversation-message.waiting .conversation-message-content:empty::before { content: "AI 正在思考…"; color: var(--muted); }
.conversation-message.streaming:not(.waiting) .conversation-message-content::after { content: ""; display: inline-block; width: 2px; height: 1em; margin-left: 3px; background: var(--blue); vertical-align: -2px; animation: creative-caret .75s steps(1) infinite; }
.conversation-message.turn-error > div { background: #fff5e9; color: #8a4b08; border: 1px solid #f2d3aa; }
.conversation-message.turn-error button { margin-top: 10px; }
@keyframes creative-caret { 50% { opacity: 0; } }
.conversation-composer { flex: 0 0 auto; margin: 0 24px 22px; border: 1px solid #bfcbd9; border-radius: 10px; overflow: hidden; box-shadow: 0 5px 20px rgba(53, 76, 105, .08); }
.conversation-composer textarea { width: 100%; min-height: 90px; border: 0; padding: 14px; resize: vertical; font: inherit; color: var(--ink); outline: none; }
.conversation-composer > div { background: #f8fafc; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; padding: 8px 10px 8px 14px; }
.conversation-composer span { color: var(--muted); font-size: 11px; }
.template-recommendations { display: grid; gap: 12px; min-height: 0; }
.template-recommendations h3 { font-size: 14px; }
.template-recommendations-head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 7px; background: #fff; }
.template-recommendations-head h3 { margin: 0 0 3px; }
.template-recommendations-head span { color: var(--muted); font-size: 11px; }
.template-recommendations article { min-height: 138px; border: 1px solid var(--line); border-radius: 10px; padding: 15px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; background: #fff; }
.template-recommendations article.selected { border-color: #78b7f1; background: #f3f8ff; box-shadow: inset 4px 0 #2582df; }
.template-recommendations article > div { min-width: 0; }
.template-recommendations article b { display: block; margin-top: 3px; }
.template-recommendation-rank { color: var(--blue); font-size: 10px; font-weight: 700; }
.template-recommendations p { margin: 5px 0; color: #4f5d70; }
.template-recommendations small, .template-recommendations em { display: block; color: var(--muted); font-style: normal; font-size: 11px; line-height: 1.5; }
.template-recommendations em { color: #a0631c; }
.template-recommendation-pager { position: sticky; bottom: -22px; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px 0 2px; background: linear-gradient(to bottom, rgba(255,255,255,.9), #fff 35%); }
.template-recommendation-pager span { color: var(--muted); font-size: 11px; }
.template-recommendation-pager button:disabled { opacity: .45; cursor: not-allowed; }
.structure-recommendation-modal { position: relative; display: flex; flex-direction: column; width: min(920px, calc(100vw - 40px)); height: min(820px, calc(100dvh - 40px)); max-height: 92dvh; padding: 0; overflow: hidden; box-shadow: 0 28px 80px rgba(15, 31, 52, .25); }
.structure-recommendation-modal > header { flex: 0 0 auto; display: flex; justify-content: space-between; gap: 22px; padding: 24px 28px 18px; border-bottom: 1px solid var(--line); background: #fff; }
.structure-recommendation-modal > header span { color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.structure-recommendation-modal > header h3 { margin: 5px 0 0; font-size: 22px; }
.structure-recommendation-modal > header p { margin: 7px 0 0; }
.structure-modal-close { flex: 0 0 auto; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 8px; color: #68768a; background: #fff; cursor: pointer; font-size: 22px; }
.structure-recommendation-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 20px 28px 24px; background: #f8fafc; }
.structure-recommendation-loading { min-height: 100%; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; }
.structure-recommendation-loading > span { width: 34px; height: 34px; border: 3px solid #d7e7f8; border-top-color: var(--blue); border-radius: 50%; animation: structure-loading-spin .8s linear infinite; }
.structure-recommendation-loading p { margin: 0; }
@keyframes structure-loading-spin { to { transform: rotate(360deg); } }
.structure-recommendation-modal > footer { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 28px; border-top: 1px solid var(--line); background: #fff; }
.structure-recommendation-modal > footer span { color: var(--muted); font-size: 11px; }
.template-interview-progress { flex: 0 0 auto; margin: 0 24px 12px; padding: 10px 13px; border: 1px solid #d7e7f8; border-radius: 8px; background: #f6faff; }
.template-interview-progress > div { display: flex; justify-content: space-between; align-items: center; color: #355b82; font-size: 12px; }
.template-interview-progress ul { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 11px; }
.template-interview-progress li { color: #7a8797; }
.template-interview-progress li.complete { color: #377b5d; }
.template-interview-progress li > span { display: inline-block; width: 15px; font-weight: 800; }
.interview-subtask-progress { flex: 0 0 auto; margin: 0 24px 12px; padding: 11px 13px; border: 1px solid #e2d2f4; border-radius: 8px; background: #faf7fe; color: #594273; }
.interview-subtask-progress > div { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.interview-subtask-progress p { margin: 6px 0 4px; color: #463459; font-size: 12px; line-height: 1.5; }
.interview-subtask-progress small, .interview-subtask-progress em { display: block; color: #776689; font-size: 10px; font-style: normal; line-height: 1.5; }
.conversation-next-step { flex: 0 0 auto; margin: 0 24px 22px; padding: 12px 14px; border-radius: 8px; background: #f5f7fa; color: #596779; font-size: 12px; }
.editor-toolbar { min-height: 56px; padding: 10px 14px; background: #f8fafc; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.editor-toolbar > div { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.editor-toolbar span { color: var(--muted); font-size: 11px; margin-left: 8px; }
.editor-font-size-control {
  display: inline-flex !important;
  align-items: center;
  gap: 2px !important;
  padding: 2px;
  border: 1px solid #dbe2ea;
  border-radius: 7px;
  background: #fff;
}
.editor-font-size-control > span { margin: 0 4px 0 5px; font-size: 10px; }
.editor-font-size-control > button {
  min-width: 25px;
  border: 0;
  border-radius: 5px;
  padding: 4px 6px;
  color: #617086;
  background: transparent;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}
.editor-font-size-control > button:hover { color: var(--blue); background: #f0f6ff; }
.editor-font-size-control > button.active {
  color: #fff;
  background: var(--blue);
  font-weight: 800;
}
.selection-actions { display: inline-flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.selection-actions .text-button { font-size: 11px; padding: 2px 4px; }
.ai-edit-trigger { font-weight: 700; }
.editor-toolbar button:disabled, .check-card button:disabled { opacity: .45; cursor: not-allowed; }
.ai-edit-dialog { flex: 0 0 auto; margin: 12px 18px 0; padding: 13px 14px; border: 1px solid #b9d5f2; border-radius: 9px; background: #f7fbff; box-shadow: 0 7px 22px rgba(42, 84, 128, .09); }
.ai-edit-dialog[hidden] { display: none; }
.ai-edit-dialog-head, .ai-edit-dialog-head > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ai-edit-dialog-head > div { justify-content: flex-start; }
.ai-edit-dialog-head span { color: var(--muted); font-size: 10px; }
.ai-edit-dialog blockquote { max-height: 92px; overflow: auto; margin: 10px 0; padding: 8px 10px; border-left: 3px solid #86b7e8; background: #fff; color: #46556a; font-size: 11px; line-height: 1.6; white-space: pre-wrap; }
.ai-edit-dialog label { display: grid; gap: 5px; color: #40506a; font-size: 11px; }
.ai-edit-dialog textarea { width: 100%; min-height: 66px; resize: vertical; border: 1px solid #c7d4e2; border-radius: 6px; padding: 8px 9px; background: #fff; color: var(--ink); font: 12px/1.55 inherit; outline: 0; }
.ai-edit-dialog textarea:focus { border-color: #72aee9; box-shadow: 0 0 0 2px rgba(22, 119, 255, .1); }
.ai-edit-dialog-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 8px; }
.markdown-editor { flex: 1; min-height: calc(100vh - 248px); resize: none; border: 0; outline: 0; padding: 32px max(28px, 9%); font: 15px/1.9 ui-monospace, SFMono-Regular, Consolas, "Microsoft YaHei", monospace; color: #2d3746; tab-size: 2; }
.markdown-editor.editor-font-large { font-size: 15px; line-height: 1.9; }
.markdown-editor.editor-font-medium { font-size: 13px; line-height: 1.8; }
.markdown-editor.editor-font-small { font-size: 12px; line-height: 1.7; }
.outline-editor { font-family: inherit; }
.workspace-assets { border-left: 1px solid var(--line); overflow: auto; max-height: calc(100vh - 108px); }
.asset-section { padding: 17px; border-bottom: 1px solid var(--line); }
.asset-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 0; }
.asset-section.open .asset-title { margin-bottom: 12px; }
.asset-title h3 { font-size: 13px; margin: 0; }
.asset-title span { color: var(--muted); font-size: 10px; }
.asset-toggle { min-width: 0; flex: 1; display: grid; grid-template-columns: 15px minmax(0, 1fr) auto; align-items: center; gap: 5px; border: 0; padding: 0; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.asset-toggle h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-chevron { display: inline-block; margin: 0 !important; color: #738197 !important; font-size: 15px !important; line-height: 1; transform: rotate(-90deg); transition: transform .15s ease; }
.asset-section.open .asset-chevron { transform: rotate(0); }
.asset-body[hidden] { display: none; }
.text-button { border: 0; background: none; color: var(--blue); cursor: pointer; }
.asset-section label { display: grid; gap: 4px; margin-top: 9px; }
.asset-section label > span { color: var(--muted); font-size: 10px; }
.asset-section label textarea { border: 1px solid transparent; background: #fff; border-radius: 5px; min-height: 42px; resize: vertical; padding: 7px; font: 12px/1.5 inherit; color: #3c4758; }
.idea-candidate, .research-request { margin-top: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: 11px; }
.idea-candidate b { display: block; color: #344054; line-height: 1.55; }
.idea-candidate p { margin: 6px 0; color: #596779; line-height: 1.5; }
.idea-candidate small, .research-request small { color: var(--muted); line-height: 1.45; }
.idea-candidate-actions { display: flex; gap: 6px; margin-top: 9px; }
.idea-candidate-actions button { border: 0; border-radius: 5px; padding: 5px 7px; color: #426b91; background: #eef5fc; cursor: pointer; font-size: 10px; }
.idea-candidate-actions button:last-child { color: #8b5960; background: #faf0f1; }
.research-request > div { display: flex; gap: 8px; justify-content: space-between; align-items: flex-start; }
.research-request b { color: #344054; overflow-wrap: anywhere; }
.research-request em { flex: 0 0 auto; color: #6b7788; font-style: normal; }
.research-request em.completed { color: #377b5d; }
.research-request em.failed { color: #a24d4d; }
.depth-dimensions { display: flex; flex-wrap: wrap; gap: 6px; }
.depth-dimensions span { padding: 4px 7px; border-radius: 999px; background: #f0f2f5; color: #7a8797; font-size: 10px; }
.depth-dimensions span.complete { background: #eaf6f0; color: #377b5d; }
.asset-section label textarea:focus { border-color: #8dbcf2; outline: 0; }
.asset-empty { font-size: 12px; color: var(--muted); line-height: 1.6; }
.gap-list, .asset-warning { background: #fff8ed; color: #925f19; padding: 9px; border-radius: 6px; margin-top: 10px; font-size: 11px; }
.gap-list p { margin: 4px 0; }
.reference-card, .check-card { border: 1px solid var(--line); border-radius: 7px; background: #fff; padding: 10px; margin-top: 9px; }
.reference-card { cursor: pointer; transition: border-color .16s ease, box-shadow .16s ease; }
.reference-card:hover, .reference-card:focus-visible { border-color: #91bde9; box-shadow: 0 5px 16px rgba(44, 88, 132, .09); outline: 0; }
.reference-card > div:first-child, .check-card > div:first-child { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }
.reference-card em { font-style: normal; }
.reference-card > b { font-size: 12px; display: block; margin-top: 7px; }
.reference-card p, .check-card p { color: #596579; font-size: 11px; line-height: 1.55; margin: 7px 0; }
.reference-card a { font-size: 10px; color: var(--blue); }
.reference-open-hint { display: block; margin: -1px 0 5px; color: var(--blue); font-size: 10px; }
.reference-actions, .check-card > div:last-child { display: flex; gap: 4px; margin-top: 8px; }
.reference-actions button, .check-card > div:last-child button { flex: 1; border: 0; background: #eff3f7; color: #566274; padding: 5px 3px; border-radius: 4px; font-size: 10px; cursor: pointer; }
.workspace-blocks { display: grid; gap: 6px; }
.workspace-blocks button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 8px; display: flex; justify-content: space-between; gap: 8px; text-align: left; cursor: pointer; color: #40506a; }
.workspace-blocks small { color: var(--muted); }
.asset-helper { margin: -4px 0 10px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.asset-focus { animation: creative-asset-focus 1.2s ease; }
@keyframes creative-asset-focus { 0%, 100% { background: transparent; } 35% { background: #eaf4ff; } }
.related-work-card { display: grid; gap: 7px; margin-top: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.related-work-card > div { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 7px; }
.related-work-card b { color: #344054; font-size: 11px; line-height: 1.5; }
.related-work-card p { margin: 0; color: #48617c; font-size: 10px; line-height: 1.45; }
.related-work-card small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.related-work-card button { justify-self: stretch; }
.related-inserted { display: grid; gap: 5px; margin-bottom: 9px; }
.related-inserted span { overflow: hidden; padding: 5px 7px; border-radius: 5px; background: #eaf6f0; color: #377b5d; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.decision-list { display: grid; grid-template-columns: 72px 1fr; gap: 7px; margin: 0; font-size: 11px; }
.decision-list dt { color: var(--muted); }
.decision-list dd { margin: 0; color: #40506a; word-break: break-all; }
.reference-card.adopted { border-color: #88c9ad; }
.reference-card.rejected { border-color: #e5e8ed; background: #f7f8fa; opacity: .72; }
.check-card.high { border-left: 3px solid #d65d5d; }
.check-card.medium { border-left: 3px solid #e0a04a; }
.check-card.outdated { opacity: .72; }
.check-comparison { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 6px 7px; margin: 9px 0 0; font-size: 10px; line-height: 1.55; }
.check-comparison dt { color: var(--muted); font-weight: 700; }
.check-comparison dd { margin: 0; padding: 6px 7px; border-radius: 5px; background: #f5f6f8; color: #4a5668; white-space: pre-wrap; overflow-wrap: anywhere; }
.check-comparison dd.suggested { background: #eef8f3; color: #35644f; }
.check-outdated { color: #9a6420 !important; }
.asset-structure-version { display: block; margin-top: 7px; color: var(--muted); }

.template-library, .style-profile-grid, .content-block-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.template-library-card, .style-profile-card, .content-block-card { padding: 20px; }
.template-library-card.disabled { opacity: .62; }
.template-library-card > div:first-child > span, .style-profile-card > div:first-child > span, .content-block-card > div:first-child { color: var(--muted); font-size: 11px; }
.template-library-card h2, .style-profile-card h2, .content-block-card h2 { font-size: 16px; margin: 9px 0; }
.template-library-card p { color: var(--muted); line-height: 1.55; min-height: 42px; }
.template-library-card ol { padding-left: 22px; line-height: 1.8; color: #435064; font-size: 12px; }
.template-card-risk { background: #fff7eb; color: #96601a; border-radius: 6px; padding: 8px; font-size: 11px; min-height: 44px; }
.template-card-actions { display: flex; gap: 6px; margin-top: 14px; }
.template-card-actions { flex-wrap: wrap; }
.template-type-pills { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.template-pin-note { color: #8a5d16; background: #fff7e6; border-radius: 999px; padding: 3px 8px; font-size: 10px; }
.template-assistant-modal { width: min(980px, calc(100vw - 32px)); max-width: 980px; max-height: calc(100dvh - 40px); overflow: auto; }
.template-assistant-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-right: 28px; }
.template-assistant-head > div > span { color: var(--primary); font-size: 12px; font-weight: 700; }
.template-assistant-head h2 { margin: 5px 0 7px; font-size: 23px; }
.template-assistant-head p { margin: 0; color: var(--muted); line-height: 1.55; }
.template-source-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 22px 0; }
.template-source-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.template-source-card { display: grid; gap: 9px; min-height: 142px; padding: 20px; text-align: left; border: 1px solid #d8e0ea; border-radius: 12px; background: #fff; color: var(--ink); cursor: pointer; transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.template-source-card:hover { transform: translateY(-2px); border-color: var(--primary); box-shadow: 0 10px 25px rgba(31, 67, 115, .1); }
.template-source-card b { font-size: 16px; }
.template-source-card span { color: var(--muted); line-height: 1.6; }
.template-type-checks { display: flex; flex-wrap: wrap; gap: 16px; margin: 18px 0 8px; }
.template-type-checks .check-label { color: var(--ink); }
.template-type-checks small { color: var(--muted); font-weight: 400; }
.template-link-modal { width: min(720px, calc(100vw - 32px)); }
.template-link-list { display: grid; gap: 9px; margin-top: 8px; }
.template-link-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.template-link-row input { width: 100%; min-width: 0; }
.template-link-row input[aria-invalid="true"] { border-color: #dc4c4c; box-shadow: 0 0 0 3px rgba(220, 76, 76, .1); }
.template-link-remove { width: 38px; height: 38px; border: 1px solid #d8e0ea; border-radius: 8px; background: #fff; color: #7c8798; cursor: pointer; font-size: 20px; line-height: 1; }
.template-link-remove:hover { border-color: #dc4c4c; color: #b63c3c; }
.template-link-add { justify-self: start; margin-top: 10px; padding: 0; border: 0; background: transparent; color: var(--primary); cursor: pointer; font-weight: 700; }
.template-link-warning { margin: 9px 0 0; color: #b63c3c; font-size: 12px; line-height: 1.5; }
.template-link-warning[hidden] { display: none; }
.template-sample-modal { height: min(820px, calc(100dvh - 40px)); display: flex; flex-direction: column; overflow: hidden; }
.template-sample-list { display: grid; gap: 8px; min-height: 120px; overflow: auto; padding: 2px 5px 10px 2px; }
.template-sample-row { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid #e1e6ed; border-radius: 9px; background: #fff; cursor: pointer; }
.template-sample-row:has(input:checked) { border-color: #8fb4e6; background: #f5f9ff; }
.template-sample-row > span { display: grid; gap: 5px; }
.template-sample-row b { font-size: 13px; }
.template-sample-row small { color: var(--muted); }
.template-sample-row em { color: #386ba9; font-size: 11px; font-style: normal; }
.template-sample-row strong { color: #94631b; font-size: 11px; font-weight: 500; }
.template-pending { min-height: 300px; display: grid; place-content: center; justify-items: center; text-align: center; }
.template-pending h2 { margin: 18px 0 6px; }
.template-pending p, .template-pending small { color: var(--muted); }
.template-candidate-tabs { display: flex; gap: 7px; margin: 18px 0 12px; overflow-x: auto; }
.template-candidate-tabs button { border: 1px solid #d7dfe9; border-radius: 999px; background: #fff; color: var(--muted); padding: 7px 12px; white-space: nowrap; }
.template-candidate-tabs button.active { border-color: var(--primary); background: #edf5ff; color: var(--primary); }
.template-candidate-preview { display: grid; gap: 16px; padding: 18px; border: 1px solid #dce3ec; border-radius: 12px; background: #fbfcfe; }
.template-preview-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.template-preview-title h2 { margin: 5px 0; }
.template-preview-title p { margin: 0; color: var(--muted); }
.template-preview-title > div:first-child > span { color: #376fae; font-size: 11px; font-weight: 700; }
.template-preview-nodes { display: grid; gap: 8px; padding: 0; margin: 8px 0 0; list-style: none; }
.template-preview-nodes li { display: grid; grid-template-columns: minmax(120px, .4fr) 1fr auto; gap: 10px; padding: 10px 12px; border-radius: 8px; background: #fff; }
.template-preview-nodes li span { color: var(--muted); }
.template-preview-nodes li em { color: #7a5a12; font-size: 11px; font-style: normal; }
.template-preview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.template-preview-grid section { padding: 13px; border-radius: 9px; background: #fff; }
.template-preview-grid h3, .template-candidate-preview > section h3 { margin: 0 0 8px; font-size: 13px; }
.template-preview-grid ul { margin: 0; padding-left: 19px; color: #4b586b; line-height: 1.65; }
.template-preview-grid p { margin: 0; color: #4b586b; line-height: 1.65; }
.template-similarity { padding: 12px 14px; border-radius: 9px; background: #eef7f1; color: #315f43; }
.template-similarity.warning { background: #fff5e6; color: #805719; }
.template-similarity p { margin: 5px 0; }
.template-similarity span { font-size: 11px; }
.template-refine-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; margin-top: 16px; }
.template-refine-form .field-label { margin: 0; }
.template-refine-form textarea { min-height: 72px; }
.template-diagnosis { display: grid; gap: 8px; margin: 18px 0; }
.template-diagnosis > h3 { margin: 0; }
.template-diagnosis article { display: grid; gap: 4px; padding: 12px; border-left: 3px solid #77a4dc; background: #f5f8fc; }
.template-diagnosis article p { margin: 0; }
.template-diagnosis article small { color: var(--muted); }
.template-diagnosis article em { color: #315f43; font-style: normal; }
.version-row p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.style-profile-card > div:first-child, .content-block-card > div:first-child { display: flex; align-items: center; justify-content: space-between; }
.confidence { font-size: 11px; color: #287d5e; }
.confidence.low { color: #a46a16; }
.style-profile-card dl { display: grid; grid-template-columns: 80px 1fr; gap: 7px; font-size: 11px; }
.style-profile-card dt { color: var(--muted); }
.style-profile-card dd { margin: 0; line-height: 1.5; }
.style-profile-card > small { color: var(--muted); }
.sample-list { display: grid; gap: 8px; margin-top: 12px; }
.sample-card { padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; }
.sample-card > div { display: flex; align-items: center; gap: 10px; }
.sample-card p { color: var(--muted); margin: 0; }
.sample-card em { color: #ad554f; font-style: normal; font-size: 11px; }
.candidate-list { padding: 16px; }
.candidate-list p { border-bottom: 1px solid var(--line); padding: 9px 0; margin: 0; }
.content-block-card pre { background: #f7f8fa; padding: 12px; border-radius: 6px; white-space: pre-wrap; max-height: 180px; overflow: auto; color: #4a5567; line-height: 1.6; }
.content-block-card > div:last-child { display: flex; gap: 6px; }
.version-list { display: grid; gap: 8px; max-height: 55vh; overflow: auto; margin-top: 14px; }
.version-row { border: 1px solid var(--line); border-radius: 7px; padding: 10px; display: flex; justify-content: space-between; align-items: center; }
.version-row div { display: grid; gap: 4px; }
.version-row small { color: var(--muted); }
.reference-detail-modal { position: relative; display: flex; flex-direction: column; width: min(820px, calc(100vw - 40px)); max-height: min(800px, 90vh); padding: 0; overflow: hidden; border: 1px solid #dfe5ed; border-radius: 14px; box-shadow: 0 24px 70px rgba(15, 23, 42, .24); }
.reference-detail-modal header { padding: 26px 64px 20px 30px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #fbfdff, #fff); }
.reference-detail-modal header h2 { margin: 10px 0 0; color: var(--ink); font-size: 22px; line-height: 1.45; }
.reference-detail-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; color: #667387; font-size: 11px; }
.reference-detail-kicker > span { padding: 4px 8px; border-radius: 999px; background: #eef2f7; }
.reference-detail-kicker .reference-state-chip.adopted { color: #257558; background: #e8f7f0; }
.reference-detail-kicker .reference-state-chip.rejected { color: #8a5151; background: #f8eeee; }
.reference-byline { margin: 9px 0 0; color: var(--muted); font-size: 11px; }
.reference-modal-close { position: absolute; top: 14px; right: 14px; z-index: 1; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--muted); cursor: pointer; font-size: 22px; line-height: 1; }
.reference-modal-close:hover, .reference-modal-close:focus-visible { border-color: #91bde9; color: var(--blue); outline: 3px solid rgba(22,119,255,.12); }
.reference-modal-content { flex: 1; min-height: 200px; overflow: auto; padding: 22px 30px 26px; overscroll-behavior: contain; background: #fff; }
.reference-detail-section + .reference-detail-section, .reference-full-content { margin-top: 14px; }
.reference-detail-section { padding: 16px 18px; border: 1px solid #e5eaf0; border-radius: 10px; background: #fbfcfe; }
.reference-detail-section h3 { margin: 0 0 8px; color: #667387; font-size: 11px; font-weight: 700; }
.reference-detail-section p { margin: 0; color: #303a49; font-size: 13px; line-height: 1.8; }
.reference-detail-section.reference-claim { border-color: #cae6da; background: #f3faf7; }
.reference-full-content { border: 1px solid #e5eaf0; border-radius: 10px; overflow: hidden; }
.reference-full-content summary { padding: 12px 16px; color: #4b5c72; background: #f7f9fc; cursor: pointer; font-size: 12px; font-weight: 700; }
.reference-full-content pre { max-height: 300px; margin: 0; padding: 16px; overflow: auto; color: #3a4656; font: 12px/1.8 "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; white-space: pre-wrap; overflow-wrap: anywhere; background: #fff; }
.reference-detail-modal footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 30px; border-top: 1px solid var(--line); background: #f8fafc; color: var(--muted); font-size: 11px; }
.reference-detail-modal footer a { color: var(--blue); text-decoration: none; }
.reference-detail-modal footer a:hover { text-decoration: underline; }
.reference-modal-actions { display: flex; align-items: center; gap: 8px; }
.reference-modal-actions button { min-width: 72px; border: 1px solid #d3dbe6; border-radius: 6px; padding: 8px 12px; color: #435066; background: #fff; cursor: pointer; font: inherit; }
.reference-modal-actions button:hover, .reference-modal-actions button:focus-visible { border-color: #91bde9; color: var(--blue); outline: 2px solid rgba(22,119,255,.1); }
.reference-modal-actions .active { border-color: #3c9a77; color: #fff; background: #3c9a77; }
.reference-modal-actions .reference-reject-action { border-color: #eccaca; background: #fffafa; }
.reference-reject-action { color: #a34848 !important; }
.reference-rejected-action { color: #8b5d5d !important; cursor: default !important; }
.knowledge-path-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 12px; }
.creative-settings-card small { color: var(--muted); }
.knowledge-errors { background: #fff1f1; color: #9f3f3f; border-radius: 6px; padding: 8px 10px; margin-top: 10px; max-height: 120px; overflow: auto; }
.knowledge-errors p { margin: 3px 0; font-size: 11px; }
.recommendation-table .action-column { width: 94px; }

@media (max-width: 1200px) {
  .creative-draft-grid, .creative-tool-grid { grid-template-columns: repeat(2, 1fr); }
  .creative-workspace { grid-template-columns: 190px minmax(420px, 1fr); height: auto; }
  .workspace-main { height: calc(100vh - 108px); height: calc(100dvh - 108px); min-height: 560px; }
  .workspace-assets { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(2, 1fr); max-height: none; }
  .template-library, .style-profile-grid, .content-block-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .material-research-progress { top: 70px; right: 12px; width: calc(100vw - 24px); }
  .material-research-stage-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .structure-recommendation-modal { width: calc(100vw - 20px); height: calc(100dvh - 20px); max-height: none; }
  .structure-recommendation-modal > header, .structure-recommendation-body, .structure-recommendation-modal > footer { padding-left: 16px; padding-right: 16px; }
  .structure-recommendation-modal > footer { align-items: stretch; flex-direction: column; }
  .template-recommendations article { grid-template-columns: 1fr; }
  .template-recommendations article button { justify-self: start; }
  .creative-hero, .creative-page-head, .creative-section-head { align-items: flex-start; flex-direction: column; }
  .creative-quick-grid, .creative-draft-grid, .creative-tool-grid, .template-library, .style-profile-grid, .content-block-grid { grid-template-columns: 1fr; }
  .creative-filterbar { grid-template-columns: 1fr; }
  .creative-draft-row { align-items: flex-start; flex-direction: column; }
  .draft-row-side { width: 100%; text-align: left; justify-items: start; }
  .creative-workspace { grid-template-columns: 1fr; }
  .workspace-main { height: max(640px, calc(100dvh - 84px)); }
  .workspace-rail { border-right: 0; border-bottom: 1px solid var(--line); }
  .stage-rail { grid-template-columns: repeat(4, 1fr); }
  .creative-stage { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .workspace-main-head, .editor-toolbar { align-items: flex-start; flex-direction: column; }
  .markdown-editor { min-height: 65vh; padding: 20px; }
  .workspace-assets { grid-template-columns: 1fr; }
  .sample-card { align-items: flex-start; flex-direction: column; gap: 8px; }
  .reference-detail-modal { width: calc(100vw - 24px); max-height: 92vh; }
  .reference-detail-modal header { padding: 22px 54px 14px 20px; }
  .reference-detail-modal header h2 { font-size: 20px; }
  .reference-modal-content { padding: 18px 20px; }
  .reference-detail-modal footer { align-items: flex-start; flex-direction: column; padding: 12px 20px; }
  .reference-modal-actions { width: 100%; }
  .reference-modal-actions button { flex: 1; }
}

/* Parallel author-model-first creative workflow */
:root { --border: var(--line); --surface: var(--card); --surface-soft: var(--bg); --primary: var(--blue); --text: var(--ink); }
.new-flow-author-readonly { display: grid; gap: 5px; margin: 14px 0 18px; padding: 14px 16px; border-radius: 12px; background: var(--surface-soft); }
.new-flow-author-readonly span { line-height: 1.5; }
.new-flow-author-readonly small { color: var(--muted); }

.new-flow-workspace { min-height: calc(100vh - 84px); margin: -24px; background: var(--surface-soft); }
.new-flow-toolbar { position: sticky; z-index: 15; top: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 96%, transparent); backdrop-filter: blur(14px); }
.new-flow-toolbar .new-auto-create { min-width: 132px; min-height: 42px; font-size: 15px; box-shadow: 0 8px 22px color-mix(in srgb, var(--primary) 25%, transparent); }
.new-flow-toolbar .save-indicator { margin-left: auto; }
.new-flow-badge { padding: 5px 9px; border-radius: 999px; background: color-mix(in srgb, var(--primary) 11%, var(--surface)); color: var(--primary); font-size: 12px; font-weight: 800; }
.new-flow-split { display: grid; grid-template-columns: minmax(0, 7fr) minmax(320px, 3fr); min-height: calc(100vh - 146px); }
.new-flow-document-pane { display: flex; min-width: 0; flex-direction: column; padding: 22px; border-right: 1px solid var(--border); background: var(--surface); }
.new-flow-document-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.new-flow-document-head > div:last-child { display: flex; gap: 8px; color: var(--muted); font-size: 12px; }
.new-flow-document-head > div:last-child span { padding: 5px 8px; border-radius: 999px; background: var(--surface-soft); }
.new-flow-title-input { width: min(760px, 75%); padding: 7px 4px; border: 0; border-bottom: 1px solid transparent; background: transparent; color: var(--text); font: 700 26px/1.35 inherit; }
.new-flow-title-input:hover { border-bottom-color: color-mix(in srgb, var(--primary) 35%, var(--border)); background: color-mix(in srgb, var(--primary) 3%, transparent); }
.new-flow-title-input:focus { outline: none; border-bottom-color: var(--primary); background: color-mix(in srgb, var(--primary) 5%, transparent); }
.new-flow-title-edit { display: grid; min-width: 0; width: min(760px, 75%); gap: 2px; cursor: text; }
.new-flow-title-edit > span { color: var(--muted); font-size: 10px; font-weight: 600; }
.new-flow-title-edit .new-flow-title-input { width: 100%; }
.new-flow-markdown-editor { box-sizing: border-box; width: 100%; min-height: calc(100vh - 260px); flex: 1; resize: none; padding: 28px clamp(20px, 5vw, 68px); border: 1px solid var(--border); border-radius: 16px; outline: none; background: #fff; color: var(--text); font: 17px/1.85 "Microsoft YaHei", system-ui, sans-serif; transition: box-shadow .2s, border-color .2s, background .2s; }
.new-flow-markdown-editor:focus { border-color: color-mix(in srgb, var(--primary) 50%, var(--border)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 10%, transparent); }
.new-flow-markdown-editor.locked { background: var(--surface-soft); color: var(--muted); }
.new-flow-markdown-editor.change-highlight { animation: new-flow-highlight 6s ease-out; }
@keyframes new-flow-highlight { 0%, 18% { box-shadow: inset 0 0 0 9999px rgba(67, 185, 118, .12), 0 0 0 3px rgba(67, 185, 118, .25); } 100% { box-shadow: none; } }
.new-flow-change-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; padding: 8px 12px; border: 1px solid #bfe6cb; border-radius: 10px; background: #effbf3; color: #216b3c; font-size: 13px; }
.new-performance-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 10px; padding: 9px 12px; border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border)); border-radius: 10px; background: color-mix(in srgb, var(--primary) 5%, var(--surface)); color: var(--muted); font-size: 12px; }
.new-performance-strip b { max-width: min(360px, 45vw); overflow: hidden; color: var(--text); text-overflow: ellipsis; white-space: nowrap; }
.new-flow-conversation-pane { display: grid; min-width: 0; grid-template-rows: 1fr auto auto; background: var(--surface); }
.new-flow-conversation-list { overflow: auto; max-height: calc(100vh - 270px); padding: 20px 18px; }
.new-flow-message { display: grid; grid-template-columns: 28px 1fr; gap: 9px; margin-bottom: 15px; }
.new-flow-message > span { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 50%; background: var(--surface-soft); color: var(--muted); font-size: 11px; font-weight: 800; }
.new-flow-message > div { padding: 12px 14px; border-radius: 4px 14px 14px; background: var(--surface-soft); line-height: 1.7; }
.new-flow-message.user > span { background: var(--primary); color: #fff; }
.new-flow-message.user > div { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); }
.new-flow-research-actions { display: flex; gap: 8px; padding: 0 16px 10px; }
.new-flow-composer { display: grid; grid-template-columns: 1fr auto; gap: 9px; padding: 12px 16px 16px; border-top: 1px solid var(--border); }
.new-flow-composer textarea { min-height: 76px; resize: vertical; }
.new-flow-composer button { align-self: end; }
.new-flow-mobile-tabs { display: none; }

body:has(#modal.open) { overflow: hidden; }
#modal.modal { z-index: 30; padding: 16px; overflow-y: auto; }
.new-reference-modal, .new-history-modal, .new-check-modal, .new-diff-modal { position: relative; width: min(980px, calc(100vw - 32px)); max-height: min(880px, calc(100dvh - 32px)); overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.new-reference-modal > header, .new-history-modal > header, .new-check-modal > header, .new-diff-modal > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.new-reference-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0; }
.new-reference-add, .new-reference-tabs { display: flex; flex-wrap: wrap; gap: 7px; }
.new-reference-add { position: relative; }
.new-reference-add-popover {
  position: absolute;
  z-index: 4;
  top: calc(100% + 7px);
  left: 0;
  display: grid;
  width: 168px;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(26,39,55,.16);
}
.new-reference-add-popover[hidden] { display: none; }
.new-reference-add-popover button { border: 0; padding: 9px 10px; border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; text-align: left; }
.new-reference-add-popover button:hover { background: var(--surface-soft); color: var(--primary); }
.new-reference-tabs .active { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 9%, var(--surface)); color: var(--primary); font-weight: 700; }
.new-reference-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.new-reference-card { padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.new-reference-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.new-reference-card-head > span { color: var(--muted); font-size: 12px; }
.new-reference-card h3 { margin: 10px 0 6px; }
.new-reference-card p { min-height: 45px; color: var(--muted); line-height: 1.55; }
.new-reference-dimensions { display: flex; gap: 6px; }
.new-reference-dimensions button { flex: 1; padding: 6px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--muted); }
.new-reference-dimensions button.active { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--surface)); color: var(--primary); font-weight: 700; }
.new-own-work-list article, .author-version-history article { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.new-own-work-list article > div, .author-version-history article > div:first-child { display: grid; gap: 3px; }
.new-own-work-list article > div { min-width: 0; }
.new-own-work-list article small { max-width: 720px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.new-own-work-search { display: grid; gap: 7px; margin: 16px 0 6px; font-size: 13px; font-weight: 700; }
.new-own-work-search input { width: 100%; border: 1px solid #cad3df; border-radius: 9px; padding: 11px 13px; background: #fff; color: var(--ink); font: inherit; }
.new-own-work-search input:focus { border-color: var(--primary); outline: 3px solid color-mix(in srgb, var(--primary) 13%, transparent); }
.new-own-work-search small { color: var(--muted); font-size: 11px; font-weight: 400; }
.new-own-work-type-filter { display: flex; align-items: center; gap: 8px; margin: 10px 0 4px; padding: 0; border: 0; }
.new-own-work-type-filter legend { margin-right: 2px; color: var(--muted); font-size: 12px; font-weight: 700; }
.new-own-work-type-filter label { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 12px; cursor: pointer; }
.new-own-work-type-filter label:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 9%, var(--surface)); color: var(--primary); font-weight: 700; }
.new-own-work-type-filter input { width: 14px; height: 14px; margin: 0; accent-color: var(--primary); }
.new-title-candidates { display: grid; gap: 9px; margin: 18px 0; }
.new-title-candidates button { padding: 13px; text-align: left; }
.new-inline-diff { display: grid; gap: 10px; margin: 18px 0; }
.new-inline-diff article { display: grid; gap: 6px; padding: 12px; border-radius: 10px; background: var(--surface-soft); white-space: pre-wrap; }
.new-inline-diff del, .new-history-compare del { padding: 3px 5px; background: #fdeaea; color: #9f2e2e; text-decoration-thickness: 2px; }
.new-inline-diff ins, .new-history-compare ins { padding: 3px 5px; background: #e8f8ed; color: #176b38; text-decoration: none; }
.new-history-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-height: 360px; overflow: auto; white-space: pre-wrap; }

/* Dual-assistant outline/document workspace */
.creative-quick-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.new-dual-workspace { position: relative; display: flex; height: calc(100dvh - 84px); min-height: 620px; flex-direction: column; overflow: hidden; background: #f6f8fb; }
.new-dual-header { position: relative; z-index: 12; display: grid; grid-template-columns: minmax(280px, 1fr) auto minmax(84px, 1fr); align-items: center; gap: 16px; min-height: 74px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.98); }
.new-dual-title { display: flex; min-width: 0; align-items: center; gap: 10px; }
.new-dual-title .new-flow-title-edit { min-width: 0; width: 100%; }
.new-dual-title .new-flow-title-input { min-width: 0; width: 100%; font-size: 18px; text-overflow: ellipsis; }
.new-dual-tabs { display: flex; padding: 3px; border-radius: 10px; background: #eef1f5; }
.new-dual-tabs button { min-width: 88px; padding: 9px 18px; border: 0; border-radius: 8px; background: transparent; color: #66758a; cursor: pointer; }
.new-dual-tabs button.active { color: #173555; background: #fff; box-shadow: 0 1px 5px rgba(28,45,67,.13); font-weight: 800; }
.new-dual-status { display: flex; align-items: center; justify-content: flex-end; }
.new-dual-status .save-indicator { color: var(--muted); font-size: 11px; }
.new-nav-button { display: inline-flex; width: 112px; min-width: 112px; height: 34px; flex: 0 0 112px; align-items: center; justify-content: center; gap: 6px; padding-inline: 8px; white-space: nowrap; }
.new-nav-icon { flex: 0 0 auto; font-size: 14px; line-height: 1; }
.new-generate-button { white-space: nowrap; }
.new-generate-button:not(:disabled):active, .new-ai-action:not(:disabled):active { transform: translateY(1px); }
.new-generate-button.is-loading, .new-ai-action.is-loading, .modal-actions button.is-loading, .new-reference-confirmation button.is-loading { display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; opacity: 1; }
.new-button-spinner { width: 13px; height: 13px; flex: 0 0 13px; box-sizing: border-box; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: new-button-spin .7s linear infinite; }
@keyframes new-button-spin { to { transform: rotate(360deg); } }
.new-flow-change-banner { position: relative; z-index: 4; margin: 8px 20px 0; }
.new-dual-editor { height: auto; min-height: 0; flex: 1; padding: 18px; overflow: hidden; }
.new-outline-editor-panel { display: flex; width: min(1080px, 100%); height: 100%; min-height: 0; margin: 0 auto; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 8px 30px rgba(41,61,88,.06); }
.new-outline-editor-panel .markdown-editor { width: 100%; min-height: 0; flex: 1; box-sizing: border-box; resize: none; }
.new-dual-document-workbench { height: 100%; min-height: 0; }
.new-dual-document-workbench .document-editor-panel { height: 100%; }
.new-dual-document-workbench .markdown-editor { min-height: 0; }
.new-reference-rail-card { display: grid; gap: 4px; margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.new-reference-rail-card small { color: var(--muted); }

.new-assistant-layer { visibility: hidden; position: fixed; z-index: 28; inset: 0; pointer-events: none; }
.new-assistant-layer.open { visibility: visible; pointer-events: auto; }
.new-assistant-backdrop { position: absolute; inset: 0; border: 0; background: rgba(31,38,48,.15); cursor: default; }
.new-assistant-drawer { position: absolute; top: 0; right: 0; display: grid; width: 58vw; max-width: 70vw; height: 100%; grid-template-rows: auto auto minmax(0,1fr) auto auto; transform: translateX(100%); border-left: 1px solid #d7dde6; background: #fff; box-shadow: -18px 0 48px rgba(24,35,52,.18); transition: transform .22s ease; }
.new-assistant-layer.open .new-assistant-drawer { transform: translateX(0); }
.new-assistant-drawer > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.new-assistant-drawer > header span { color: var(--blue); font-size: 11px; font-weight: 700; }
.new-assistant-drawer > header h2 { margin: 3px 0 0; font-size: 20px; }
.new-assistant-drawer > header button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); cursor: pointer; font-size: 22px; }
.new-assistant-context-note { padding: 9px 22px; border-bottom: 1px solid var(--line); background: #f7f9fc; color: var(--muted); font-size: 11px; }
.new-assistant-drawer .new-flow-conversation-list { max-height: none; min-height: 0; padding: 18px 22px; }
.new-change-summary { margin: 0 22px 12px; padding: 15px; border: 1px solid #cbdff7; border-radius: 10px; background: #f6faff; }
.new-change-summary p { margin: 8px 0 12px; color: #334258; line-height: 1.75; }
.new-change-summary > div { display: flex; justify-content: flex-end; gap: 8px; }
.new-assistant-drawer .new-flow-composer { padding-inline: 22px; }
.new-assistant-drawer > footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 22px 18px; }
.new-assistant-drawer > footer span { color: var(--muted); font-size: 11px; }
.new-assistant-fab { position: fixed; z-index: 20; right: 104px; bottom: 28px; display: grid; grid-template-columns: 34px auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; min-width: 174px; padding: 11px 16px 11px 12px; border: 1px solid rgba(62,119,211,.3); border-radius: 999px; background: linear-gradient(135deg, #235fb8, #7357ca); color: #fff; box-shadow: 0 14px 34px rgba(42,74,142,.3); cursor: pointer; text-align: left; transition: transform .18s ease, box-shadow .18s ease, filter .18s ease; }
.new-assistant-fab:hover { transform: translateY(-3px); box-shadow: 0 18px 42px rgba(42,74,142,.38); filter: saturate(1.08); }
.new-assistant-fab:active { transform: translateY(-1px); }
.new-assistant-fab-orbit { grid-row: 1 / 3; display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: rgba(255,255,255,.18); box-shadow: inset 0 0 0 1px rgba(255,255,255,.28); animation: new-assistant-pulse 2.4s ease-in-out infinite; font-size: 18px; }
.new-assistant-fab b { font-size: 13px; line-height: 1.25; }
.new-assistant-fab small { color: rgba(255,255,255,.78); font-size: 10px; line-height: 1.25; }
.new-assistant-fab.busy .new-assistant-fab-orbit { animation: new-button-spin 1.15s linear infinite; }
@keyframes new-assistant-pulse { 0%, 100% { transform: scale(1); box-shadow: inset 0 0 0 1px rgba(255,255,255,.28), 0 0 0 0 rgba(110,174,255,.28); } 50% { transform: scale(1.08); box-shadow: inset 0 0 0 1px rgba(255,255,255,.4), 0 0 0 9px rgba(110,174,255,0); } }
.locked { background: #f2f4f7 !important; color: #748095 !important; cursor: not-allowed; }

.new-reference-confirmation { width: min(560px, calc(100vw - 32px)); padding: 34px; text-align: center; }
.new-reference-confirmation-icon { display: grid; width: 54px; height: 54px; margin: 0 auto 14px; place-items: center; border-radius: 17px; background: color-mix(in srgb, var(--primary) 12%, #fff); color: var(--primary); font-size: 25px; }
.new-reference-confirmation > span { color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.new-reference-confirmation h2 { margin: 7px 0 10px; }
.new-reference-confirmation p { margin: 0 auto; color: var(--muted); line-height: 1.7; }
.new-reference-confirmation-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin: 24px 0 13px; }
.new-reference-confirmation > small { color: #8a6518; line-height: 1.55; }

.author-model-empty { max-width: 700px; margin: 60px auto; padding: 46px; text-align: center; }
.author-model-empty > span { display: grid; width: 60px; height: 60px; margin: 0 auto 18px; place-items: center; border-radius: 20px; background: color-mix(in srgb, var(--primary) 12%, var(--surface)); color: var(--primary); font-size: 25px; font-weight: 800; }
.author-model-summary { margin-bottom: 18px; }
.author-model-summary > div { display: flex; align-items: center; gap: 10px; font-size: 22px; }
.author-model-summary > div span { padding: 4px 8px; border-radius: 999px; background: #fff3d6; color: #885f00; font-size: 12px; }
.author-model-summary dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0 0; }
.author-model-summary dl div { padding: 12px; border-radius: 10px; background: var(--surface-soft); }
.author-model-summary dt { color: var(--muted); font-size: 12px; }
.author-model-summary dd { margin: 5px 0 0; font-weight: 700; }
.author-document { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.author-document section { padding: 18px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); }
.author-document section h3 { margin-top: 0; }
.author-document ul { display: grid; gap: 9px; padding: 0; list-style: none; }
.author-rule { padding: 10px; border-left: 3px solid var(--border); border-radius: 7px; background: var(--surface-soft); }
.author-rule.user_locked { border-left-color: #d79d18; }
.author-rule.active { border-left-color: #38a166; }
.author-rule.candidate { border-left-color: #7994cb; }
.author-rule > div { display: flex; justify-content: space-between; gap: 8px; }
.author-rule > div span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.author-rule p, .author-rule small { color: var(--muted); font-size: 12px; }
.author-version-history, .author-conflicts { margin-top: 16px; }
.author-conflicts article { padding: 13px 0; border-bottom: 1px solid var(--border); }
.author-conflicts article > div { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

@media (max-width: 1480px) {
  .new-dual-header { grid-template-columns: minmax(0, 1fr) auto; }
  .new-dual-tabs { grid-column: 2; grid-row: 1; }
}

@media (max-width: 980px) {
  .new-flow-workspace { margin: -16px; }
  .new-flow-toolbar { position: relative; }
  .new-flow-mobile-tabs { display: flex; padding: 8px; border-bottom: 1px solid var(--border); background: var(--surface); }
  .new-flow-mobile-tabs button { flex: 1; padding: 9px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); }
  .new-flow-mobile-tabs button.active { background: var(--surface-soft); color: var(--primary); font-weight: 800; }
  .new-flow-split { display: block; }
  .new-flow-split[data-mobile-tab="document"] .new-flow-conversation-pane,
  .new-flow-split[data-mobile-tab="conversation"] .new-flow-document-pane { display: none; }
  .new-flow-document-pane { min-height: calc(100vh - 190px); border-right: 0; }
  .new-flow-conversation-pane { min-height: calc(100vh - 190px); }
  .new-flow-conversation-list { max-height: calc(100vh - 350px); }
  .author-document { grid-template-columns: 1fr; }
  .creative-quick-grid.three { grid-template-columns: 1fr; }
  .new-dual-workspace { height: calc(100dvh - 68px); margin: -16px; }
  .new-dual-header { grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
  .new-dual-tabs { grid-column: 2; grid-row: 1; }
  .new-assistant-drawer { width: 70vw; max-width: 70vw; }
  .new-assistant-fab { right: 18px; bottom: 82px; min-width: 158px; }
  .new-dual-editor { height: auto; padding: 10px; }
}

@media (max-width: 620px) {
  .new-flow-initial-form { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); padding: 18px; }
  .author-create-stage-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .new-reference-list, .author-model-summary dl, .new-history-compare { grid-template-columns: 1fr; }
  .new-flow-toolbar { align-items: stretch; }
  .new-flow-toolbar .new-auto-create { order: -1; flex: 1 1 calc(100% - 54px); }
  .new-flow-toolbar .save-indicator { width: 100%; margin-left: 0; text-align: right; }
  .new-flow-document-pane { padding: 12px; }
  .new-flow-title-input { width: 100%; font-size: 21px; }
  .new-flow-document-head { align-items: flex-start; flex-direction: column; }
  .new-flow-markdown-editor { min-height: 62vh; padding: 18px 14px; }
  .new-reference-topbar { align-items: stretch; flex-direction: column; }
  .new-dual-title .new-flow-badge { display: none; }
  .new-dual-tabs button { min-width: 64px; padding-inline: 10px; }
  .new-assistant-drawer { width: 70vw; max-width: 70vw; }
  .new-assistant-drawer > header,
  .new-assistant-drawer .new-flow-conversation-list,
  .new-assistant-drawer .new-flow-composer,
  .new-assistant-drawer > footer { padding-inline: 12px; }
  .new-assistant-fab { right: 12px; bottom: 78px; }
}

@media (prefers-reduced-motion: reduce) {
  .new-assistant-fab, .new-assistant-fab-orbit { animation: none; transition: none; }
}

/* Viewpoint-interview workflow (v2) */
.creative-quick-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.v2-home .creative-tool-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.v2-workspace { grid-template-columns: 218px minmax(540px, 1fr) 330px; }
.scene-rail { display: grid; gap: 10px; margin-top: 24px; }
.scene-step { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: center; padding: 11px; border: 1px solid transparent; border-radius: 10px; color: #7b879a; font: inherit; text-align: left; background: transparent; cursor: pointer; }
.scene-step:hover:not(:disabled) { color: var(--blue); background: #f7faff; }
.scene-step:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.scene-step:disabled { cursor: wait; opacity: .68; }
.scene-step > span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #eef1f5; font-size: 12px; font-weight: 800; }
.scene-step div { display: grid; gap: 2px; }
.scene-step small { font-size: 10px; line-height: 1.35; }
.scene-step.active { color: var(--blue); border-color: #cfe2fb; background: #f2f7ff; }
.scene-step.active > span { color: white; background: var(--blue); }
.scene-step.done { color: #417465; }
.scene-step.done > span { color: white; background: #4e9b82; }
.interview-main { min-width: 0; }
.interview-canvas { display: grid; grid-template-rows: minmax(260px, 1fr) auto auto; min-height: 0; padding: 0; }
.interview-canvas .conversation-list { padding: 24px 30px 16px; }
.conversation-decision { margin: 0 30px 16px; padding: 18px; border: 1px solid #cfe2fb; border-radius: 12px; background: #f7fbff; }
.conversation-decision.ready { border-color: #b9dfd0; background: #f5fbf8; }
.conversation-decision > div:first-child > span { color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.conversation-decision h3 { margin: 5px 0; font-size: 18px; }
.conversation-decision p { color: var(--muted); margin: 0 0 12px; }
.decision-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.composer-wrap { position: relative; border-top: 1px solid var(--line); background: white; }
.composer-wrap .conversation-composer { border: 0; }
.material-menu { position: absolute; left: 24px; bottom: calc(100% - 4px); z-index: 5; display: grid; grid-template-columns: repeat(2, minmax(128px, 1fr)); gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: 0 14px 36px rgba(38, 56, 82, .16); }
.material-menu[hidden] { display: none; }
.material-menu button { border: 0; border-radius: 7px; padding: 9px 12px; text-align: left; color: #314158; background: #f6f8fb; cursor: pointer; }
.material-menu button:hover { color: var(--blue); background: #eef6ff; }
.note-body { display: grid; gap: 15px; }
.note-body > div { padding-bottom: 12px; border-bottom: 1px solid #edf0f4; }
.note-body > div:last-child { border-bottom: 0; }
.note-body b { color: #344258; font-size: 12px; }
.note-body p { margin: 5px 0 0; color: #58677c; font-size: 12px; line-height: 1.55; }
.note-conflict { padding: 10px !important; border: 1px solid #f1d4ad !important; border-radius: 8px; background: #fffaf2; }
.stage-badge { margin-left: auto; padding: 3px 8px; border-radius: 999px; color: #526176; background: #eef1f5; font-size: 10px; font-weight: 800; }
.stage-badge.forming { color: #2860a0; background: #eaf3ff; }
.stage-badge.nearly_ready { color: #99621f; background: #fff2d9; }
.stage-badge.ready { color: #28735d; background: #e4f5ee; }
.structure-nodes { margin: 10px 0; padding-left: 20px; color: #526176; font-size: 12px; line-height: 1.7; }
.asset-actions { margin-top: 12px; }
.reference-card.ordinary { border-color: #e1e6ec; background: white; }
.reference-card.adopted { border-color: #8ac8b3; background: #f0faf6; box-shadow: inset 3px 0 #42a17d; }
.reference-card .reference-actions .active { color: white; border-color: #3c9a77; background: #3c9a77; }
.reference-card > small { display: block; margin: 7px 0; color: var(--muted); }
.reference-card .reference-review-badge { width: fit-content; margin-top: 7px; padding: 3px 7px; border-radius: 999px; color: #946010; background: #fff4d8; font-size: 10px; font-weight: 700; }
.creation-workspace { grid-template-columns: 218px minmax(680px, 1fr); }
.creation-main { min-width: 0; }
.creation-header { min-height: 78px; display: grid; grid-template-columns: auto minmax(260px, 1fr) auto; align-items: center; gap: 20px; padding: 14px 26px; border-bottom: 1px solid var(--line); background: white; }
.creation-tabs { display: flex; padding: 3px; border-radius: 9px; background: #eef1f5; }
.creation-tabs button { border: 0; border-radius: 7px; padding: 8px 18px; color: #67758a; background: transparent; cursor: pointer; }
.creation-tabs button.active { color: #183251; background: white; box-shadow: 0 1px 4px rgba(30, 45, 65, .12); font-weight: 800; }
.creation-tabs button:disabled { opacity: .45; cursor: not-allowed; }
.creation-title { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; }
.creation-title span, .creation-fixed-title span { color: var(--muted); font-size: 11px; }
.creation-title input { min-width: 0; border: 1px solid transparent; border-bottom-color: var(--line); padding: 7px 4px; color: #26364c; background: transparent; font-size: 15px; font-weight: 700; }
.creation-title input:focus { outline: 0; border-bottom-color: var(--blue); }
.creation-fixed-title { min-width: 0; display: grid; gap: 3px; }
.creation-fixed-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.creation-status { display: grid; justify-items: end; gap: 4px; color: var(--muted); font-size: 11px; }
.creation-status b { color: #40506a; font-size: 12px; }
.creation-canvas { min-height: 0; height: calc(100vh - 151px); height: calc(100dvh - 151px); overflow: auto; background: #f6f8fb; }
.creation-editor-panel { width: min(1040px, calc(100% - 40px)); min-height: calc(100% - 40px); margin: 20px auto; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 8px 30px rgba(41, 61, 88, .06); overflow: hidden; }
.creation-editor-panel .editor-toolbar { position: sticky; top: 0; z-index: 4; }
.creation-editor-panel .markdown-editor { display: block; width: 100%; box-sizing: border-box; min-height: 620px; border-width: 1px 0; border-radius: 0; padding: 34px 44px; resize: vertical; }
.outline-editor-panel {
  display: flex;
  flex-direction: column;
  height: calc(100% - 24px);
  min-height: 0;
  margin-block: 12px;
}
.outline-editor-panel .markdown-editor {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  overflow: auto;
  resize: none;
}
.outline-title-area { padding: 18px 28px 0; }
.outline-title-area > b { font-size: 12px; color: #43536a; }
.outline-title-area > p { margin: 7px 0; color: var(--muted); font-size: 11px; }
.title-candidates { display: flex; flex-wrap: wrap; gap: 7px; margin: 9px 0 12px; }
.title-candidates button, .title-modal section button { display: block; width: 100%; border: 1px solid #dbe4ef; border-radius: 8px; padding: 9px 12px; color: #30425a; background: #f8fbff; text-align: left; cursor: pointer; }
.title-candidates button:hover, .title-modal section button:hover { border-color: #9fc5f2; color: var(--blue); }
.creation-primary-action { display: flex; flex: 0 0 auto; align-items: center; justify-content: flex-end; gap: 12px; padding: 14px 28px; border-top: 1px solid var(--line); background: #fff; }
.creation-primary-action > span { color: #54806f; font-size: 12px; }
.creation-primary-action > span.stale { color: #a46820; }
.outline-stale-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; color: #8b5b20; background: #fff6e7; border-bottom: 1px solid #f0d6aa; font-size: 12px; }
.document-tool-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 18px 28px; border-top: 1px solid var(--line); }
.creation-assets-inline { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 0 28px 28px; }
.creation-side-card { padding: 15px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfe; }
.creation-side-card h3 { margin: 0 0 10px; font-size: 14px; }
.creation-side-card article { padding: 10px 0; border-top: 1px solid #edf0f4; }
.creation-side-card article p { margin: 4px 0 8px; color: var(--muted); font-size: 11px; }
.content-block-button { margin: 3px; border: 1px solid #dce3ec; border-radius: 7px; padding: 7px 9px; color: #40506a; background: white; cursor: pointer; }
.readonly-project { padding: 24px; }
.readonly-project pre { min-height: 420px; margin: 0 0 18px; padding: 24px; border-radius: 8px; white-space: pre-wrap; line-height: 1.8; background: #f7f9fc; }
.readonly-project > div { display: flex; gap: 8px; justify-content: flex-end; }
.title-modal section { display: grid; gap: 6px; margin: 16px 0; }
.account-profile-card { padding: 24px 28px; }
.profile-version { display: flex; justify-content: space-between; padding-bottom: 15px; border-bottom: 1px solid var(--line); color: var(--muted); }
.account-profile-card dl { display: grid; grid-template-columns: 170px 1fr; gap: 0; }
.account-profile-card dt, .account-profile-card dd { margin: 0; padding: 13px 4px; border-bottom: 1px solid #edf0f4; }
.account-profile-card dt { color: #526176; font-weight: 700; }
.account-profile-card dd { color: #293950; line-height: 1.6; }
.profile-suggestions { margin-top: 20px; padding: 18px; border: 1px solid #cfe2fb; border-radius: 9px; background: #f6faff; }
.profile-suggestions h3 { margin-top: 0; }
.profile-suggestions > div { display: flex; gap: 8px; }
.profile-history { margin-top: 14px; padding: 20px 28px; }
.profile-history p { color: var(--muted); }

@media (max-width: 1300px) {
  .v2-home .creative-tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .v2-workspace { grid-template-columns: 190px minmax(500px, 1fr); }
  .v2-workspace .workspace-assets { grid-column: 1 / -1; }
  .creation-workspace { grid-template-columns: 190px minmax(620px, 1fr); }
}

@media (max-width: 760px) {
  .creative-home, .creative-home > *, .creative-quick, .creative-draft-card, .creative-section-head { min-width: 0; width: 100%; }
  .creative-quick b, .creative-quick small, .creative-draft-card h3, .creative-draft-card p { min-width: 0; overflow-wrap: anywhere; }
  .creative-quick-grid.two, .v2-home .creative-tool-grid { grid-template-columns: 1fr; }
  .v2-workspace, .creation-workspace { grid-template-columns: 1fr; }
  .scene-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .creation-header { grid-template-columns: 1fr; align-items: stretch; }
  .creation-status { justify-items: start; }
  .creation-canvas { height: auto; min-height: 75vh; }
  .creation-editor-panel { width: calc(100% - 20px); margin: 10px; }
  .creation-editor-panel .markdown-editor { min-height: 60vh; padding: 20px; }
  .creation-assets-inline { grid-template-columns: 1fr; padding: 0 16px 16px; }
  .material-menu { right: 12px; left: 12px; }
  .account-profile-card dl { grid-template-columns: 1fr; }
  .account-profile-card dt { padding-bottom: 2px; border-bottom: 0; }
}

/* Top context bar and document-side tools */
.context-workspace {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  height: calc(100vh - 108px);
  height: calc(100dvh - 108px);
  min-height: 0;
}
.creative-context-header {
  z-index: 8;
  display: grid;
  grid-template-rows: auto auto;
  border-bottom: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 2px 8px rgba(31, 49, 74, .04);
}
.context-primary {
  display: grid;
  grid-template-columns: 36px auto minmax(260px, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 6px 14px;
}
.context-back {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #526176;
  background: #fff;
  cursor: pointer;
  font-size: 17px;
}
.context-back:hover { color: var(--blue); border-color: #9fc5f2; background: #f5f9ff; }
.context-title,
.context-title-edit { min-width: 0; }
.context-title { display: grid; gap: 2px; }
.context-title > span,
.context-title-edit > span { color: var(--muted); font-size: 10px; }
.context-title h1 {
  overflow: hidden;
  margin: 0;
  color: #26364c;
  font-size: 15px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.context-title-edit {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}
.context-title-edit input {
  min-width: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 4px 3px;
  color: #26364c;
  background: transparent;
  font-size: 15px;
  font-weight: 700;
}
.context-title-edit input:focus { outline: 0; border-bottom-color: var(--blue); }
.context-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.context-actions > b {
  padding: 5px 9px;
  border-radius: 999px;
  color: #37705d;
  background: #eaf6f0;
  font-size: 10px;
  white-space: nowrap;
}
.context-secondary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 38px;
  padding: 4px 14px;
  border-top: 1px solid #eef1f5;
  background: #fbfcfe;
}
.context-scene-track { display: flex; align-items: center; min-width: 310px; }
.context-scene-track .scene-step {
  grid-template-columns: 24px auto;
  min-width: 112px;
  margin: 0;
  padding: 3px 7px;
  border-radius: 8px;
}
.context-scene-track .scene-step > span { width: 22px; height: 22px; }
.context-scene-track .scene-step b { font-size: 11px; }
.context-scene-track .scene-step small { display: none; }
.scene-connector { width: clamp(24px, 4vw, 58px); height: 2px; background: #dfe5ec; }
.scene-connector.done { background: #74b69f; }
.context-tabs { flex: 0 0 auto; }
.context-tabs button { padding: 6px 15px; }
.context-hint { color: var(--muted); font-size: 11px; }
.workspace-body { min-width: 0; min-height: 0; overflow: hidden; }
.interview-workspace-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
}
.interview-workspace-body .workspace-assets {
  grid-column: auto;
  max-height: none;
}
.creation-workspace-body,
.creation-workspace-body .creation-main,
.creation-workspace-body .creation-canvas { min-height: 0; height: 100%; }
.creation-workspace-body .creation-canvas { overflow: hidden; }

.document-workbench {
  display: grid;
  grid-template-areas: "editor drawer rail";
  grid-template-columns: minmax(420px, 1fr) 0 92px;
  min-width: 0;
  height: 100%;
  background: #f4f6f9;
  transition: grid-template-columns .22s ease;
}
.document-workbench.tool-drawer-open { grid-template-columns: minmax(420px, 1fr) minmax(310px, 360px) 92px; }
.document-editor-column { position: relative; grid-area: editor; min-width: 0; overflow: hidden; }
.markdown-editor-shell {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
}
.markdown-editor-shell > .markdown-editor { flex: 1 1 auto; height: 100%; min-height: 0; }
.editor-loading-view {
  position: absolute;
  z-index: 6;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 9px;
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border));
  border-radius: 0 0 11px 11px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--text);
  text-align: center;
  backdrop-filter: blur(3px);
}
.editor-loading-view .new-button-spinner { width: 24px; height: 24px; border-width: 3px; color: var(--primary); }
.editor-loading-view small { color: var(--muted); }
.document-editor-panel {
  display: flex;
  flex-direction: column;
  height: calc(100% - 24px);
  min-height: 0;
  margin-block: 12px;
}
.document-editor-panel .markdown-editor {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  overflow: auto;
  resize: none;
}
.document-editor-meta > div { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.document-editor-actions { justify-content: flex-end; }
.document-editor-meta small { color: var(--muted); }
.document-tool-rail {
  grid-area: rail;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: hidden;
  border-left: 1px solid var(--line);
  background: #fff;
}
.document-tool-rail .tool-group { display: grid; gap: 3px; padding: 5px 6px; border-bottom: 1px solid #eef1f5; }
.tool-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 25px;
  border: 0;
  border-radius: 6px;
  padding: 4px 5px;
  color: #7d899b;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.tool-group-toggle:hover { color: #3f5e80; background: #f4f7fa; }
.tool-group-toggle b {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .1em;
}
.tool-group-toggle small { font-size: 8px; font-weight: 600; letter-spacing: 0; }
.tool-group-items { display: grid; gap: 3px; }
.tool-group-items[hidden] { display: none; }
.document-tool-button {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  min-width: 0;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 5px 6px;
  color: #526176;
  background: transparent;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.document-tool-button > span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 6px;
  color: #56708f;
  background: #eef2f6;
  font-size: 11px;
  font-weight: 800;
}
.document-tool-button > b {
  overflow: hidden;
  font-size: 10px;
  line-height: 1.25;
  text-overflow: ellipsis;
}
.document-tool-button:hover { border-color: #d5e4f5; color: var(--blue); background: #f4f8fd; }
.document-tool-button.active { border-color: #a8caf1; color: #1f65ad; background: #eaf3ff; }
.document-tool-button.active > span { color: #fff; background: var(--blue); }
.document-tool-button:disabled { border-color: transparent; background: transparent; color: #aeb7c3; cursor: not-allowed; opacity: .64; }
.document-tool-button:disabled > span { background: #f3f5f7; color: #aeb7c3; }
.document-tool-drawer {
  grid-area: drawer;
  min-width: 0;
  overflow: hidden;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: #fff;
  box-shadow: -8px 0 24px rgba(35, 53, 77, .05);
  opacity: 1;
  transform: translateX(0);
  transform-origin: right center;
  visibility: visible;
  transition: opacity .16s ease .05s, transform .22s ease, visibility 0s;
}
.document-tool-drawer[aria-hidden="true"] {
  border: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(16px);
  visibility: hidden;
  transition: opacity .12s ease, transform .2s ease, visibility 0s linear .22s;
}
.tool-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--line);
}
.tool-drawer-header h3 { margin: 0; color: #28384e; font-size: 16px; }
.tool-drawer-header p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.tool-drawer-header > button {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #66758a;
  background: #fff;
  cursor: pointer;
  font-size: 19px;
}
.tool-drawer-body {
  display: grid;
  align-content: start;
  gap: 12px;
  height: calc(100% - 86px);
  box-sizing: border-box;
  padding: 16px;
  overflow: auto;
}
.tool-drawer-body > p { margin: 0; color: #5d6b7e; font-size: 12px; line-height: 1.65; }
.tool-drawer-body label { display: grid; gap: 6px; color: #40506a; font-size: 11px; font-weight: 700; }
.tool-drawer-body input,
.tool-drawer-body textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d7dee7;
  border-radius: 8px;
  padding: 10px;
  color: #2d3c50;
  background: #fff;
  font: inherit;
  font-weight: 400;
}
.tool-drawer-body textarea { min-height: 118px; resize: vertical; line-height: 1.6; }
.tool-drawer-body input:focus,
.tool-drawer-body textarea:focus { outline: 2px solid #cfe2fb; border-color: #7fb0e6; }
.markdown-format-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.markdown-format-panel button {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 10px;
  text-align: left;
}
.markdown-format-panel button > :first-child { color: var(--blue); font-size: 13px; font-style: normal; text-align: center; }
.markdown-format-panel button:active { transform: translateY(1px); }
.ai-quick-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ai-tool-panel blockquote {
  max-height: 120px;
  margin: 0;
  overflow: auto;
  border-left: 3px solid #9dc4ee;
  padding: 9px 10px;
  color: #536176;
  background: #f5f8fc;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.55;
  white-space: pre-wrap;
}
.tool-primary-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.tool-warning,
.tool-success {
  display: grid;
  gap: 5px;
  border: 1px solid #efd1a3;
  border-radius: 9px;
  padding: 11px;
  color: #89591c;
  background: #fff8ec;
  font-size: 11px;
  line-height: 1.55;
}
.tool-success { border-color: #add9c9; color: #2e7058; background: #eef9f5; }
.save-summary { display: flex; justify-content: space-between; padding: 12px; border-radius: 8px; background: #f4f7fa; color: #526176; }
.tool-card-list { gap: 8px; }
.reference-tool-panel { padding: 0; }
.reference-tool-panel .asset-section { border-bottom: 0; }
.tool-content-card,
.tool-related-card {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px;
  color: #37465a;
  background: #fff;
  text-align: left;
}
button.tool-content-card { cursor: pointer; }
button.tool-content-card:hover { border-color: #9fc5f2; background: #f7fbff; }
.tool-content-card small,
.tool-content-card span,
.tool-related-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.related-tool-panel { grid-template-columns: minmax(0, 1fr); }
.related-search-button { width: 100%; }
.related-search-state {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px dashed #cdd8e6;
  border-radius: 9px;
  background: #f8fbff;
  color: #40506a;
}
.related-search-state b { font-size: 12px; }
.related-search-state p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.title-tool-panel section { display: grid; gap: 6px; padding-top: 10px; border-top: 1px solid #edf0f4; }
.title-tool-panel section > b { color: #526176; font-size: 10px; }
.title-tool-panel section > button {
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  padding: 9px;
  color: #30425a;
  background: #f8fbff;
  text-align: left;
  cursor: pointer;
}
.tool-empty { color: var(--muted) !important; font-size: 11px !important; }
.publish-tool-panel form { display: grid; gap: 12px; }
.form-feedback { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.form-feedback.pending { color: #356da8; }
.form-feedback.success { color: #28735d; font-weight: 700; }
.form-feedback.error { color: #b34444; font-weight: 700; }

@media (max-width: 1300px) {
  .context-workspace { grid-template-columns: minmax(0, 1fr); }
  .context-workspace .workspace-assets { grid-column: auto; }
  .interview-workspace-body { grid-template-columns: minmax(0, 1fr) 300px; }
  .document-workbench { grid-template-columns: minmax(360px, 1fr) 0 84px; }
  .document-workbench.tool-drawer-open { grid-template-columns: minmax(360px, 1fr) 320px 84px; }
  .document-tool-button { grid-template-columns: 20px minmax(0, 1fr); padding-inline: 4px; }
}

@media (max-width: 760px) {
  .template-source-grid, .template-source-grid.two, .template-preview-grid { grid-template-columns: 1fr; }
  .template-assistant-modal { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); }
  .template-preview-title, .template-refine-form { display: grid; grid-template-columns: 1fr; }
  .template-preview-nodes li { grid-template-columns: 1fr; }
  .template-sample-modal { height: calc(100dvh - 20px); }
  .context-workspace { height: auto; min-height: calc(100dvh - 84px); overflow: visible; }
  .creative-context-header { position: sticky; top: 0; }
  .context-primary { grid-template-columns: 34px auto minmax(0, 1fr); padding: 8px 10px; }
  .context-title,
  .context-title-edit { grid-column: 1 / -1; grid-row: 2; }
  .context-title-edit { grid-template-columns: auto minmax(0, 1fr); }
  .context-actions { grid-column: 3; grid-row: 1; }
  .context-actions .secondary,
  .context-actions .save-indicator { display: none; }
  .context-secondary { align-items: stretch; flex-direction: column; gap: 4px; padding: 5px 10px; }
  .context-scene-track { min-width: 0; width: 100%; }
  .context-scene-track .scene-step { min-width: 0; flex: 1 1 0; }
  .context-scene-track .scene-step small { display: none; }
  .scene-connector { width: 22px; flex: 0 0 22px; }
  .context-tabs { align-self: stretch; }
  .context-tabs button { flex: 1; }
  .context-hint { display: none; }
  .workspace-body { overflow: visible; }
  .interview-workspace-body { grid-template-columns: 1fr; }
  .interview-workspace-body .workspace-main { height: max(620px, calc(100dvh - 198px)); min-height: 620px; }
  .interview-workspace-body .workspace-assets { max-height: none; }
  .creation-workspace-body,
  .creation-workspace-body .creation-main,
  .creation-workspace-body .creation-canvas { height: auto; min-height: calc(100dvh - 198px); overflow: visible; }
  .outline-editor-panel { height: auto; min-height: calc(100dvh - 218px); }
  .outline-editor-panel .markdown-editor { height: auto; min-height: 60vh; }
  .document-workbench,
  .document-workbench.tool-drawer-open { display: flex; flex-direction: column; height: auto; min-height: calc(100dvh - 198px); }
  .document-editor-column { order: 1; overflow: visible; }
  .document-editor-panel .markdown-editor { min-height: 66vh; }
  .document-tool-rail {
    position: sticky;
    bottom: 0;
    z-index: 10;
    order: 2;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    border-top: 1px solid var(--line);
    border-left: 0;
    box-shadow: 0 -6px 18px rgba(35, 53, 77, .1);
  }
  .document-tool-rail .tool-group { display: flex; flex: 0 0 auto; align-items: center; padding: 5px; border-right: 1px solid #edf0f4; border-bottom: 0; }
  .tool-group-toggle { width: auto; min-width: max-content; }
  .tool-group-items { display: flex; gap: 3px; }
  .tool-group-items[hidden] { display: none; }
  .document-tool-button { grid-template-columns: 22px auto; min-width: max-content; padding: 5px 8px; }
  .document-tool-drawer {
    position: fixed;
    right: 10px;
    bottom: 10px;
    left: 10px;
    z-index: 20;
    order: 3;
    max-height: min(68vh, 600px);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 18px 60px rgba(19, 35, 57, .28);
  }
  .tool-drawer-body { max-height: calc(min(68vh, 600px) - 84px); height: auto; }
}

.viewpoint-modal { width: min(720px, calc(100vw - 32px)); max-height: 90vh; overflow-y: auto; }
.viewpoint-modal .viewpoint-topic { font-weight: 600; overflow-wrap: anywhere; }
.viewpoint-guidance { padding: 14px 16px; margin: 16px 0; border: 1px solid var(--border, #e4e7ec); border-radius: 12px; background: var(--bg, #f8fafc); }
.viewpoint-guidance p { line-height: 1.7; margin-top: 0; }
.viewpoint-guidance small { display: block; margin-top: 8px; color: var(--muted, #667085); }
.viewpoint-modal textarea { width: 100%; min-height: 220px; resize: vertical; line-height: 1.7; }
.viewpoint-modal [data-viewpoint-status] { font-size: 13px; overflow-wrap: anywhere; }

.creation-unlinked{color:var(--danger,#e5484d);font-size:10px;margin-right:7px;vertical-align:middle}.creation-table-wrap{overflow-x:auto}.creation-table-wrap td{max-width:420px;white-space:normal;overflow-wrap:anywhere}.creation-table-wrap th button,.creation-title{border:0;background:transparent;color:var(--blue);text-align:left;cursor:pointer}.creation-selection{font-size:12px;margin-top:8px;color:var(--muted)}.creation-selection summary{cursor:pointer}.creation-zhihu{display:inline-flex;align-items:center;justify-content:center;background:#1772f6;color:white;border-radius:5px;font-size:18px;font-weight:700;width:28px;height:28px}

/* Creation list shares the Works table and toolbar hierarchy. */
.creation-filter-toolbar{flex-wrap:wrap;gap:12px 24px;margin-bottom:16px}.creation-filter-toolbar label{display:flex;align-items:center;gap:6px;font-size:13px}.creation-filter-toolbar>span{margin-left:auto;color:var(--muted);font-size:12px}.creation-table-wrap .data-table th button{color:inherit;font:inherit;padding:0}.creation-table-wrap .data-table td{vertical-align:top}.creation-table-wrap .data-table td:first-child{width:48%;min-width:260px}.creation-table-wrap .data-table td:last-child{min-width:155px}.creation-table-wrap .data-table td:last-child button{margin:0 6px 6px 0}.creation-table-wrap .creation-title{font:inherit;line-height:1.6;display:inline;padding:0;white-space:normal;color:var(--blue)}.creation-table-wrap .creation-selection{margin-top:8px;line-height:1.8}.creation-table-wrap .data-table td:nth-child(3){font-variant-numeric:tabular-nums}.creation-table-wrap .data-table td:nth-child(4){white-space:nowrap}.creative-filterbar select,.creative-filterbar input[type=search]{min-height:36px}@media(max-width:760px){.creation-filter-toolbar>span{margin-left:0;width:100%}}

.creation-main-toolbar{grid-template-columns:minmax(220px,1fr) 170px 150px;margin-bottom:16px}@media(max-width:760px){.creation-main-toolbar{grid-template-columns:1fr}}
.article-topic-panel { display: grid; gap: 18px; }
.article-topic-panel section h3 { font-size: 13px; margin: 0 0 10px; }
.article-topic-panel .tool-related-card { margin-top: 10px; }
.article-topic-panel .zhihu-topic-tag { justify-self: start; }
.article-topic-panel .tool-related-card small { display: block; color: var(--muted, #64748b); margin-top: 8px; }
.article-topic-selection { display: flex; flex-wrap: wrap; gap: 8px; }
.article-topic-selected { display: inline-flex; align-items: center; gap: 3px; }
.topic-remove { border: 0; background: transparent; color: #64748b; cursor: pointer; padding: 5px; }
