:root {
  --bg: #f3f2ee;
  --panel: #ffffff;
  --panel-soft: #faf9f6;
  --ink: #1d2528;
  --muted: #6e777a;
  --line: #e5e4df;
  --line-strong: #d3d2cc;
  --accent: #155d73;
  --accent-strong: #0f4d60;
  --accent-soft: #e7f1f3;
  --accent-pale: #f1f7f8;
  --warm: #b68442;
  --danger: #b63e35;
  --success: #267456;
  --shadow: 0 18px 60px rgba(32, 42, 45, .09);
  --shadow-soft: 0 8px 28px rgba(32, 42, 45, .06);
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --header-height: 68px;
  --module-nav-height: 54px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; min-height: 100%; font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; color: var(--ink); background: var(--bg); }
body { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(21,93,115,.16); outline-offset: 1px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; background: #eef1f2; border-radius: 5px; padding: 1px 5px; }

.app-header {
  height: var(--header-height);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 0 24px;
  background: rgba(252, 252, 250, .93);
  border-bottom: 1px solid rgba(40, 49, 52, .08);
  backdrop-filter: blur(18px);
  position: relative;
  z-index: 80;
}
.brand-block { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 13px; background: linear-gradient(145deg, #1b6c83, #0f5063); color: white; box-shadow: 0 8px 20px rgba(21,93,115,.22); }
.brand-mark span { font-family: Georgia, serif; font-size: 21px; font-weight: 700; transform: translateY(-1px); }
.brand-copy { min-width: 0; }
.brand-copy strong, .brand-copy span { display: block; white-space: nowrap; }
.brand-copy strong { font-size: 14px; letter-spacing: .01em; }
.brand-copy span { color: var(--muted); font-size: 10px; margin-top: 3px; letter-spacing: .08em; }
.document-state { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.save-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(38,116,86,.08); }
.header-actions { display: flex; justify-content: flex-end; gap: 8px; }
.button { min-height: 40px; border: 0; border-radius: 12px; padding: 0 15px; font-weight: 730; font-size: 12px; transition: .16s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: #fff; background: var(--accent); box-shadow: 0 7px 18px rgba(21,93,115,.18); }
.button.primary:hover { background: var(--accent-strong); }
.button.primary.soft { color: var(--accent-strong); background: var(--accent-soft); box-shadow: none; }
.button.quiet { color: #3b4548; background: #fff; border: 1px solid var(--line); }
.button.quiet:hover { border-color: #c7d4d7; background: var(--accent-pale); }
.button.text-button { background: transparent; color: var(--muted); padding: 0 6px; }
.button.compact { min-height: 33px; padding: 0 11px; font-size: 11px; }

.module-nav {
  height: var(--module-nav-height);
  background: rgba(250, 249, 246, .96);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 70;
  overflow: hidden;
}
.module-nav-inner { height: 100%; display: flex; align-items: center; gap: 5px; padding: 7px 18px; overflow-x: auto; scrollbar-width: none; }
.module-nav-inner::-webkit-scrollbar { display: none; }
.module-link { flex: 0 0 auto; min-height: 38px; display: inline-flex; align-items: center; gap: 7px; padding: 0 13px; border: 1px solid transparent; border-radius: 11px; background: transparent; color: #667074; font-size: 11px; font-weight: 700; white-space: nowrap; transition: .15s ease; }
.module-link:hover { background: #fff; border-color: var(--line); color: var(--ink); }
.module-link.active { color: var(--accent-strong); background: #fff; border-color: #cddcde; box-shadow: 0 5px 15px rgba(25,51,57,.06); }
.module-link em { min-width: 20px; height: 20px; display: grid; place-items: center; border-radius: 999px; background: #eef0ef; font-style: normal; font-size: 9px; color: var(--muted); }
.module-link.active em { background: var(--accent-soft); color: var(--accent); }
.mobile-view-tabs { display: none; }

.workspace { height: calc(100vh - var(--header-height) - var(--module-nav-height)); display: grid; grid-template-columns: minmax(430px, 45%) minmax(520px, 55%); }
.editor-pane { min-width: 0; background: #f5f4f0; border-right: 1px solid var(--line); }
.editor-scroll { height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: 22px 22px 110px; scroll-padding-top: 18px; }
.editor-section { background: var(--panel); border: 1px solid rgba(37,49,53,.08); border-radius: var(--radius-xl); margin-bottom: 15px; overflow: hidden; box-shadow: var(--shadow-soft); scroll-margin-top: 16px; }
.editor-section.accent-section { border-color: rgba(21,93,115,.18); box-shadow: 0 10px 34px rgba(21,93,115,.08); }
.hero-card { padding: 22px; background: radial-gradient(circle at 90% 0%, rgba(21,93,115,.10), transparent 35%), linear-gradient(135deg, #fff, #fbfcfb); }
.hero-copy .eyebrow { color: var(--accent); font-size: 10px; font-weight: 850; letter-spacing: .15em; text-transform: uppercase; }
.hero-copy h1 { margin: 8px 0 8px; font-size: 20px; line-height: 1.45; letter-spacing: -.02em; }
.hero-copy p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.summary-card { padding: 12px; border-radius: 13px; background: rgba(246,247,245,.94); border: 1px solid rgba(37,49,53,.05); min-width: 0; }
.summary-card span, .summary-card strong { display: block; }
.summary-card span { color: var(--muted); font-size: 9px; }
.summary-card strong { margin-top: 5px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summary-card.late strong { color: var(--danger); }
.summary-card.early strong { color: var(--success); }
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.section-header { min-height: 68px; padding: 13px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid transparent; }
.editor-section.open .section-header { border-bottom-color: #efefeb; }
.section-title { min-width: 0; display: flex; align-items: center; gap: 11px; }
.section-number { width: 31px; height: 31px; flex: 0 0 31px; display: grid; place-items: center; border-radius: 10px; color: var(--accent); background: var(--accent-soft); font-size: 10px; font-weight: 850; }
.section-title h2 { margin: 0; font-size: 14px; line-height: 1.3; }
.section-title p { margin: 3px 0 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.section-tools { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.ai-fill-button, .lock-button, .collapse-button, .scope-pill, .count-pill { min-height: 30px; border-radius: 9px; font-size: 10px; }
.ai-fill-button { padding: 0 10px; border: 1px solid #cde0e3; color: var(--accent); background: var(--accent-pale); font-weight: 760; }
.ai-fill-button:hover { background: var(--accent-soft); }
.lock-button { padding: 0 9px; border: 1px solid var(--line); color: var(--muted); background: #fff; }
.lock-button.locked { color: #76511f; background: #faf2e5; border-color: #ead7b9; }
.collapse-button { width: 31px; border: 0; background: #f1f2ef; color: var(--muted); font-size: 15px; }
.scope-pill, .count-pill { display: inline-flex; align-items: center; padding: 0 9px; background: #f2f3f0; color: var(--muted); font-style: normal; }
.section-content { padding: 16px; }
.editor-section:not(.open) .section-content { display: none; }
.editor-section:not(.open) .collapse-button { transform: rotate(180deg); }
.editor-section.module-locked .section-content { opacity: .58; }
.editor-section.module-locked [data-module-fields] { pointer-events: none; }

.form-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.form-grid.two-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { display: block; min-width: 0; }
.field > span { display: block; margin: 0 0 6px 2px; color: var(--muted); font-size: 10px; font-weight: 700; }
.field input, .field textarea, .field select { width: 100%; display: block; border: 1px solid #dedfdb; border-radius: 11px; color: #253034; background: #fbfbf9; padding: 10px 11px; font-size: 12px; outline: none; transition: .15s ease; }
.field textarea { resize: vertical; line-height: 1.55; }
.field input:focus, .field textarea:focus, .field select:focus { background: #fff; border-color: #7ca6b1; box-shadow: 0 0 0 3px rgba(21,93,115,.08); }
.span-2 { grid-column: span 2; }
.helper-text { margin: 10px 0 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.inline-actions { display: flex; gap: 8px; margin-top: 12px; }
.inline-actions.end { justify-content: flex-end; }

.ai-scope-panel { margin-bottom: 16px; padding: 14px; border: 1px solid #d9e5e7; border-radius: 16px; background: linear-gradient(180deg,#fbfefe 0%,#f4f9f9 100%); }
.ai-scope-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 11px; }
.ai-scope-head strong, .ai-scope-head span { display: block; }
.ai-scope-head strong { font-size: 13px; color: #243033; }
.ai-scope-head span { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.ai-scope-actions { display: flex; flex: 0 0 auto; gap: 7px; }
.ai-scope-actions button { min-height: 30px; padding: 0 10px; border: 1px solid #d6e2e4; border-radius: 9px; background: #fff; color: #37616a; font-size: 10px; font-weight: 730; }
.ai-scope-actions button:hover { background: #eaf4f5; }
.scope-checklist { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.scope-option { min-width: 0; display: grid; grid-template-columns: 18px minmax(0,1fr); gap: 8px; align-items: start; padding: 10px; border: 1px solid #dfe6e5; border-radius: 12px; background: rgba(255,255,255,.86); cursor: pointer; transition: .15s ease; }
.scope-option:hover { border-color: #a9c8ce; transform: translateY(-1px); }
.scope-option:has(input:checked) { border-color: #8bb7c0; background: #edf7f8; box-shadow: inset 0 0 0 1px rgba(25,104,123,.08); }
.scope-option input { width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--accent); }
.scope-option b, .scope-option small { display: block; }
.scope-option b { color: #263337; font-size: 11px; }
.scope-option small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.import-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(280px, .95fr); gap: 14px; align-items: stretch; }
.import-source { min-width: 0; }
.dropzone { margin-top: 11px; min-height: 112px; display: grid; place-items: center; align-content: center; gap: 4px; border: 1px dashed #9fb4b9; border-radius: 14px; background: #f7fbfb; color: var(--accent); text-align: center; transition: .16s ease; }
.dropzone:hover, .dropzone.dragging { border-color: var(--accent); background: #eef7f8; }
.dropzone input { display: none; }
.dropzone .drop-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; background: #fff; border: 1px solid #d4e2e5; font-size: 18px; }
.dropzone strong { font-size: 12px; }
.dropzone small { color: var(--muted); font-size: 9px; }
.selected-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 28px; padding: 0 9px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 9px; color: #566064; }
.file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip button { border: 0; background: transparent; color: var(--muted); padding: 0; font-size: 13px; }
.import-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.import-review { min-width: 0; border: 1px solid #e1e3df; border-radius: 15px; background: #fafbf9; padding: 13px; }
.review-empty { height: 100%; min-height: 260px; display: grid; place-items: center; align-content: center; text-align: center; color: var(--muted); padding: 20px; }
.review-empty > span { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; color: var(--accent); background: var(--accent-soft); font-size: 17px; }
.review-empty strong { margin-top: 10px; color: #4b5659; font-size: 12px; }
.review-empty p { margin: 5px 0 0; max-width: 220px; font-size: 10px; line-height: 1.55; }
.review-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 11px; }
.review-head strong, .review-head span { display: block; }
.review-head strong { font-size: 12px; }
.review-head span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.candidate-media { display: grid; gap: 8px; margin-top: 11px; }
.media-candidate { display: grid; grid-template-columns: 62px 1fr; gap: 9px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.media-candidate img { width: 62px; height: 62px; object-fit: contain; border-radius: 8px; background: #f4f4f1; }
.media-candidate select { width: 100%; margin-top: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 6px; font-size: 10px; background: #fff; }
.media-candidate strong, .media-candidate small { display: block; }
.media-candidate strong { font-size: 10px; }
.media-candidate small { margin-top: 3px; color: var(--muted); font-size: 8px; }

.agenda-list { display: grid; gap: 10px; }
.agenda-card { border: 1px solid #e2e3df; border-radius: 15px; background: #fcfcfa; overflow: hidden; transition: .15s ease; }
.agenda-card:hover { border-color: #cedadd; box-shadow: 0 7px 20px rgba(30,50,55,.05); }
.agenda-card-head { min-height: 52px; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-bottom: 1px solid #ecece8; background: #fff; }
.agenda-index { min-width: 59px; color: var(--accent); font-size: 9px; font-weight: 800; }
.agenda-index b { display: block; color: #263033; font-size: 14px; }
.agenda-title-preview { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 750; }
.agenda-card-actions { display: flex; gap: 3px; }
.icon-button { width: 29px; height: 29px; display: grid; place-items: center; border: 0; border-radius: 8px; color: #5e686b; background: #f1f2ef; }
.icon-button:hover { background: var(--accent-soft); color: var(--accent); }
.icon-button.danger:hover { color: var(--danger); background: #fff0ee; }
.agenda-card-body { display: grid; grid-template-columns: 82px minmax(0, 1.5fr) minmax(0, 1fr) 95px; gap: 8px; padding: 11px; }
.mini-field span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 8px; }
.mini-field input, .mini-field select, .mini-field textarea { width: 100%; border: 1px solid #e0e1dd; border-radius: 9px; background: #fff; color: #273236; padding: 8px; font-size: 11px; outline: 0; }
.speech-fields { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr; gap: 8px; padding-top: 2px; }
.buffer-control { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; border-top: 1px dashed #e1e2de; padding-top: 8px; color: var(--muted); font-size: 10px; }
.buffer-control input { width: 60px; border: 1px solid #dfdfdc; border-radius: 8px; padding: 6px; }
.add-agenda { width: 100%; min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 11px; border: 1px dashed #a9b9bc; border-radius: 13px; background: #f8fbfb; color: var(--accent); font-weight: 760; font-size: 11px; }
.add-agenda:hover { border-color: var(--accent); background: var(--accent-pale); }

.segmented-control { display: inline-grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 11px; background: #f0f1ee; margin-bottom: 12px; }
.segmented-control button { min-height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 700; padding: 0 12px; }
.segmented-control button.active { background: #fff; color: var(--accent); box-shadow: 0 3px 10px rgba(20,35,40,.06); }
.officer-list { display: grid; gap: 8px; }
.officer-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fafaf8; }
.officer-row input { min-width: 0; width: 100%; border: 1px solid #dedfdb; border-radius: 9px; padding: 8px; background: #fff; font-size: 11px; }
.officer-row button { width: 30px; height: 30px; border: 0; border-radius: 8px; background: #f0f1ee; color: var(--danger); }
.add-inline { min-height: 36px; margin-top: 9px; padding: 0 12px; border: 1px dashed #b8c0c0; border-radius: 10px; color: var(--accent); background: transparent; font-size: 10px; font-weight: 720; }

.asset-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.asset-uploader { min-height: 105px; display: grid; grid-template-columns: 76px 1fr; gap: 11px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #fafaf8; transition: .15s ease; }
.asset-uploader:hover { border-color: #b7cdd1; background: #f6faf9; }
.asset-uploader input { display: none; }
.asset-uploader.wide { max-width: 520px; }
.asset-preview { width: 76px; height: 76px; display: grid; place-items: center; overflow: hidden; border-radius: 10px; background: #eef0ed; border: 1px solid #e1e2df; }
.asset-preview.landscape { height: 58px; }
.asset-preview img { width: 100%; height: 100%; object-fit: contain; }
.asset-uploader strong, .asset-uploader small { display: block; }
.asset-uploader strong { font-size: 11px; }
.asset-uploader small { margin-top: 5px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.asset-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 11px; color: var(--muted); font-size: 9px; }

.fixed-module-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.fixed-module { padding: 13px; border: 1px solid #eadfcf; border-radius: 13px; background: #fcf8f1; }
.fixed-module span { display: inline-flex; align-items: center; min-height: 20px; padding: 0 7px; border-radius: 999px; color: #805a25; background: #f4e7d3; font-size: 8px; font-weight: 800; }
.fixed-module strong { display: block; margin-top: 8px; font-size: 11px; }
.fixed-module p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.output-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 12px; }
.export-choice { min-height: 72px; text-align: left; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: #fafaf8; }
.export-choice:hover { border-color: #bad0d4; background: var(--accent-pale); }
.export-choice b, .export-choice span { display: block; }
.export-choice b { font-size: 15px; }
.export-choice span { margin-top: 5px; color: var(--muted); font-size: 9px; }

.preview-pane { min-width: 0; display: grid; grid-template-rows: 54px 1fr; background: #e8e8e5; }
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 0 17px; border-bottom: 1px solid rgba(40,49,52,.08); background: rgba(248,248,246,.96); }
.preview-toolbar strong, .preview-toolbar span { display: block; }
.preview-toolbar strong { font-size: 12px; }
.preview-toolbar span { margin-top: 2px; color: var(--muted); font-size: 9px; }
.preview-actions { display: flex; align-items: center; gap: 7px; }
.preview-actions > span { min-width: 42px; text-align: center; font-size: 10px; }
.preview-tool { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: #465154; }
.preview-tool.text { width: auto; padding: 0 9px; font-size: 9px; }
.canvas-stage { --paper-height: 808px; min-width: 0; overflow: auto; padding: 25px 28px 80px; display: flex; justify-content: center; align-items: flex-start; }
.paper-scale { width: 793.7px; height: var(--paper-height); transform-origin: top center; transition: transform .18s ease; }
.agenda-paper { width: 210mm; height: 297mm; background: #fff; color: #111; border: .3mm solid #111; box-shadow: var(--shadow); overflow: hidden; display: grid; grid-template-rows: 50mm 9mm 7mm minmax(0, 1fr) 42mm 4mm; font-family: Arial, "Microsoft YaHei", sans-serif; }
.paper-brand-header { position: relative; overflow: hidden; border-bottom: .3mm solid #111; background: #fff; }
.brand-header-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center center; }
.hero-title { position: absolute; z-index: 2; right: 7mm; top: 4mm; color: white; text-align: right; text-shadow: 0 1px 3px rgba(0,0,0,.25); max-width: 132mm; }
.hero-title strong, .hero-title span { display: block; }
.hero-title strong { font-size: 14.5pt; line-height: 1.12; }
.hero-title span { font-size: 12.5pt; font-weight: 760; margin-top: 1.2mm; line-height: 1.1; }
.org-strip { position: absolute; z-index: 2; left: 57mm; right: 1.4mm; top: 31.2mm; bottom: 1.2mm; display: grid; grid-template-columns: minmax(0, 1fr) 19mm; gap: 2mm; align-items: center; padding: 0; border: 0; font-size: 6.1pt; line-height: 1.28; }
.org-copy { align-self: center; }
.org-strip img { width: 17mm; height: 17mm; object-fit: contain; justify-self: end; }
.meeting-ribbon { display: flex; align-items: center; justify-content: space-between; padding: 0 3mm; background: #225d86; color: white; font-size: 10.6pt; }
.meeting-ribbon strong { font-size: 13pt; }
.meeting-meta { display: grid; grid-template-columns: 1.2fr 1.35fr .8fr; align-items: center; gap: 2mm; padding: 0 1mm; font-size: 6.5pt; font-weight: 600; border-bottom: .3mm solid #111; }
.meeting-meta span:nth-child(2) { text-align: center; font-weight: 500; }
.meeting-meta span:last-child { text-align: right; }
.paper-main { min-height: 0; display: grid; grid-template-columns: 34% 66%; }
.paper-sidebar { min-height: 0; display: flex; flex-direction: column; border-right: .3mm solid #111; }
.side-box { border-bottom: .3mm solid #111; min-height: 0; }
.side-box h3, .footer-box h3 { height: 6.5mm; display: grid; place-items: center; margin: 0; background: #225d86; color: white; font-size: 8pt; letter-spacing: .12em; }
.keyword-box { flex: 0 0 40mm; }
.side-copy { padding: 1.5mm 1.1mm; font-size: 6.25pt; line-height: 1.42; }
.side-copy p { margin: 0 0 1.5mm; }
.image-box { flex: 0 0 auto; }
.image-box img { display: block; width: 100%; object-fit: contain; }
.image-box:not(.pathways-box) img { height: 20mm; }
.pathways-box { flex: 1 1 auto; min-height: 46mm; }
.pathways-box img { height: calc(100% - 6.5mm); }
.rules-box { flex: 0 0 29mm; }
.rules-box ol { margin: 1.5mm 0 0 5mm; padding: 0 2mm; font-size: 6.5pt; line-height: 1.58; }
.timeline-wrap { min-height: 0; display: grid; grid-template-rows: 9mm 1fr; }
.timeline-head, .timeline-row { display: grid; grid-template-columns: 14% 54% 10% 22%; }
.timeline-head { background: #225d86; color: white; font-weight: 760; font-size: 8pt; text-align: center; align-items: center; }
.timeline-head > span { height: 100%; display: grid; place-items: center; border-right: .3mm solid #111; }
.timeline-head > span:last-child { border-right: 0; }
.timeline-body { min-height: 0; display: flex; flex-direction: column; }
.timeline-row { flex: 1 1 auto; min-height: 4.1mm; border-bottom: .25mm solid #111; font-size: 6.7pt; }
.timeline-row > div { min-width: 0; display: flex; align-items: center; padding: .42mm .68mm; border-right: .25mm solid #111; overflow: hidden; }
.timeline-row > div:first-child, .timeline-row > div:nth-child(3) { justify-content: center; text-align: center; }
.timeline-row > div:last-child { border-right: 0; }
.timeline-row.speech { flex: 2.5 1 auto; min-height: 12.6mm; }
.timeline-row.speech .agenda-content { display: block; padding: 0; }
.speech-title { padding: .55mm .8mm; font-weight: 760; background: #f5e77a; border-bottom: .25mm solid #111; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.speech-subtitle { padding: .35mm .8mm; text-align: right; font-weight: 700; }
.speech-objective { padding: .3mm .8mm .45mm; line-height: 1.32; }
.timeline-row.break { background: #f1f3f4; }
.timeline-row.end { background: #b7c1c2; }
.timeline-row.end .agenda-content { justify-content: center; }
.agenda-paper.density-compact .timeline-row { font-size: 6.1pt; min-height: 3.7mm; }
.agenda-paper.density-compact .timeline-row.speech { min-height: 10.9mm; }
.agenda-paper.density-ultra .timeline-row { font-size: 5.55pt; min-height: 3.3mm; }
.agenda-paper.density-ultra .timeline-row.speech { min-height: 9.7mm; }
.agenda-paper.density-ultra .speech-title, .agenda-paper.density-ultra .speech-subtitle, .agenda-paper.density-ultra .speech-objective { padding-top: .22mm; padding-bottom: .22mm; }
.paper-footer { display: grid; grid-template-columns: 34% 42% 24%; border-top: .3mm solid #111; }
.production-credit { display: flex; align-items: center; justify-content: flex-end; padding: 0 2.2mm; border-top: .2mm solid #9a9a9a; background: #fff; color: #4c4c4c; font-size: 5.5pt; font-weight: 650; letter-spacing: .03em; white-space: nowrap; }
.footer-box { min-width: 0; border-right: .3mm solid #111; overflow: hidden; }
.footer-box:last-child { border-right: 0; }
.officers-table { height: calc(100% - 6.5mm); display: flex; flex-direction: column; }
.officer-preview-row { flex: 1; min-height: 0; display: grid; grid-template-columns: 27% 43% 30%; border-bottom: .2mm solid #777; font-size: 6.1pt; }
.officer-preview-row span { display: flex; align-items: center; padding: .25mm .55mm; border-right: .2mm solid #777; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.officer-preview-row span:last-child { border-right: 0; }
.officers-box > img { width: 100%; height: calc(100% - 6.5mm); object-fit: fill; }
.word-box > div { padding: 1.4mm; font-size: 6.35pt; line-height: 1.48; height: calc(100% - 6.5mm); display: grid; grid-template-rows: auto auto 1fr; }
.word-box p { margin: 0 0 1mm; }
.next-info { align-self: end; text-align: center; border-top: .25mm solid #111; padding-top: 1.1mm; font-weight: 650; }
.interaction-layout { height: calc(100% - 6.5mm); display: grid; grid-template-columns: 1fr .42fr 1fr; place-items: center; padding: 1.2mm; }
.qr-column { display: grid; place-items: center; gap: 1mm; font-size: 8pt; }
.qr-column img { width: 21mm; height: 21mm; object-fit: contain; }
.arrow-column { text-align: center; line-height: 2.2; font-size: 11pt; }

.modal { width: min(540px, calc(100vw - 28px)); border: 0; border-radius: 20px; padding: 0; box-shadow: 0 30px 90px rgba(0,0,0,.23); }
.modal::backdrop { background: rgba(20,29,31,.44); backdrop-filter: blur(5px); }
.modal form { padding: 20px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 13px; }
.modal-head strong, .modal-head span { display: block; }
.modal-head strong { font-size: 17px; }
.modal-head span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.modal-head > button { width: 34px; height: 34px; border: 0; border-radius: 10px; background: #f0f1ee; font-size: 20px; }
.export-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.export-card { min-height: 92px; text-align: left; border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: #fafaf8; }
.export-card:hover { border-color: #aac5ca; background: var(--accent-pale); }
.export-card b, .export-card span { display: block; }
.export-card b { font-size: 18px; }
.export-card span { margin-top: 7px; color: var(--muted); font-size: 10px; }
.export-progress { min-height: 20px; padding-top: 12px; color: var(--accent); font-size: 11px; }
.wide-modal { width: min(780px, calc(100vw - 28px)); }
.wide-modal textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 18px); opacity: 0; pointer-events: none; z-index: 150; padding: 10px 14px; border-radius: 11px; background: #1c2629; color: #fff; font-size: 11px; transition: .18s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.mobile-actionbar { display: none; }
[hidden] { display: none !important; }

@media (max-width: 1180px) {
  .scope-checklist { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .workspace { grid-template-columns: minmax(400px, 48%) minmax(470px, 52%); }
  .editor-scroll { padding-left: 15px; padding-right: 15px; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .import-grid { grid-template-columns: 1fr; }
  .review-empty { min-height: 170px; }
  .agenda-card-body { grid-template-columns: 74px 1fr 1fr; }
  .agenda-card-body > .mini-field:last-of-type { grid-column: 1 / 2; }
}

@media (max-width: 1024px) {
  .ai-scope-panel { padding: 11px; }
  .ai-scope-head { align-items: flex-start; }
  .scope-checklist { grid-template-columns: 1fr; }
  :root { --header-height: 58px; --module-nav-height: 48px; }
  body { overflow: auto; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .app-header { grid-template-columns: 1fr auto; padding: 0 13px; }
  .brand-copy span, .document-state, .desktop-only { display: none; }
  .brand-mark { width: 34px; height: 34px; border-radius: 11px; }
  .header-actions { grid-column: 2; }
  .header-actions .button { min-height: 36px; padding: 0 12px; }
  .module-nav-inner { padding: 5px 9px; }
  .module-link { min-height: 36px; padding: 0 11px; }
  .mobile-view-tabs { height: 44px; display: grid; grid-template-columns: 1fr 1fr; padding: 5px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 60; }
  .mobile-view-tab { border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 750; }
  .mobile-view-tab.active { color: var(--accent); background: var(--accent-soft); }
  .workspace { display: block; height: auto; }
  .editor-pane, .preview-pane { min-height: calc(100vh - var(--header-height) - var(--module-nav-height) - 44px - 64px); border: 0; }
  .editor-scroll { height: auto; overflow: visible; padding: 11px 9px 34px; }
  .editor-section { border-radius: 17px; scroll-margin-top: calc(var(--module-nav-height) + 54px); }
  .hero-card { padding: 17px; }
  .hero-copy h1 { font-size: 17px; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .section-header { min-height: 64px; padding: 11px 12px; }
  .section-title p { display: none; }
  .section-tools { gap: 4px; }
  .scope-pill { display: none; }
  .section-content { padding: 13px; }
  .form-grid.two-cols { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .import-grid { grid-template-columns: 1fr; }
  .agenda-card-body { grid-template-columns: 70px 1fr; }
  .agenda-card-body .participant-field, .agenda-card-body > .mini-field:nth-of-type(4) { grid-column: 1 / -1; }
  .officer-row { grid-template-columns: 1fr 1fr auto; }
  .officer-row input:first-child { grid-column: 1 / -1; }
  .asset-grid { grid-template-columns: 1fr; }
  .fixed-module-grid { grid-template-columns: 1fr; }
  .preview-pane { display: none; grid-template-rows: 46px 1fr; }
  body.mobile-preview .editor-pane { display: none; }
  body.mobile-preview .preview-pane { display: grid; }
  .canvas-stage { padding: 14px 10px 86px; justify-content: flex-start; }
  .paper-scale { transform-origin: top left; }
  .preview-actions .preview-tool:not(.text), .preview-actions > span { display: none; }
  .mobile-actionbar { display: grid; grid-template-columns: 1fr 1fr 1.15fr; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; padding: 9px 10px calc(9px + env(safe-area-inset-bottom)); background: rgba(252,252,250,.95); border-top: 1px solid var(--line); backdrop-filter: blur(18px); }
  .mobile-actionbar button { min-height: 43px; border: 0; border-radius: 11px; background: #eef0ed; color: #455053; font-size: 11px; font-weight: 760; }
  .mobile-actionbar .primary { color: #fff; background: var(--accent); }
}

@media (max-width: 430px) {
  .brand-copy strong { font-size: 13px; }
  .module-link { padding: 0 10px; }
  .hero-copy p { font-size: 11px; }
  .quick-actions .button { flex: 1 1 auto; }
  .section-tools .ai-fill-button { font-size: 0; width: 31px; padding: 0; }
  .section-tools .ai-fill-button::before { content: "✦"; font-size: 12px; }
  .lock-button { font-size: 0; width: 31px; padding: 0; }
  .lock-button::before { content: "锁"; font-size: 9px; }
  .lock-button.locked::before { content: "已锁"; }
  .agenda-card-head { grid-template-columns: auto 1fr; }
  .agenda-card-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .asset-actions { align-items: flex-start; flex-direction: column; }
  .output-actions, .export-options { grid-template-columns: 1fr; }
}

@media print {
  body { background: white; overflow: visible; padding: 0; }
  .app-header, .module-nav, .mobile-view-tabs, .editor-pane, .preview-toolbar, .mobile-actionbar { display: none !important; }
  .workspace, .preview-pane, .canvas-stage { display: block !important; height: auto; padding: 0; overflow: visible; background: white; }
  .paper-scale { transform: none !important; height: auto !important; }
  .agenda-paper { box-shadow: none; border: 0; }
}

/* V0.2.1: scrolling and navigation reliability */
html, body { width: 100%; }
.workspace, .editor-pane, .preview-pane { min-width: 0; min-height: 0; }
.workspace { height: calc(100vh - var(--header-height) - var(--module-nav-height)); height: calc(100dvh - var(--header-height) - var(--module-nav-height)); overflow: hidden; }
.editor-pane { overflow: hidden; }
.editor-scroll {
  min-height: 0;
  max-height: 100%;
  overflow-y: scroll;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-gutter: stable;
  padding-bottom: max(140px, calc(100dvh - var(--header-height) - var(--module-nav-height) - 150px));
}
.canvas-stage { min-height: 0; -webkit-overflow-scrolling: touch; }
.reset-module-button {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid #e2dfd7;
  border-radius: 9px;
  color: #716a60;
  background: #fbfaf7;
  font-size: 10px;
  font-weight: 700;
}
.reset-module-button:hover { background: #f3f0e8; border-color: #d5cec0; }

@media (max-width: 1024px) {
  body { overflow-y: auto; overflow-x: hidden; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .app-header { position: sticky; top: 0; z-index: 90; }
  .module-nav { position: sticky; top: var(--header-height); z-index: 85; }
  .mobile-view-tabs { position: sticky; top: calc(var(--header-height) + var(--module-nav-height)); z-index: 80; }
  .workspace { display: block; height: auto; overflow: visible; }
  .editor-pane, .preview-pane { min-height: calc(100dvh - var(--header-height) - var(--module-nav-height) - 44px - 64px); overflow: visible; }
  .editor-scroll { height: auto; max-height: none; overflow: visible; touch-action: auto; padding-bottom: 34px; }
  .editor-section { scroll-margin-top: calc(var(--header-height) + var(--module-nav-height) + 54px); }
}

@media (max-width: 430px) {
  .section-tools .reset-module-button { font-size: 0; width: 31px; padding: 0; }
  .section-tools .reset-module-button::before { content: "↺"; font-size: 13px; }
}

@media (max-width: 430px) {
  #btnReset { width: 36px; min-width: 36px; padding: 0; font-size: 0; }
  #btnReset::before { content: "↺"; font-size: 16px; }
}


/* V0.3.4 · embedded image assets, stable export and single-source versioning */
.app-header { grid-template-columns: minmax(220px, 1fr) auto auto minmax(220px, 1fr); }
.language-switch {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f0f1ee;
}
.language-switch button {
  min-width: 72px;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 780;
}
.language-switch button.active {
  color: var(--accent-strong);
  background: #fff;
  box-shadow: 0 3px 10px rgba(20,35,40,.08);
}
.language-edit-pill {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 9px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 9px;
  font-weight: 780;
}
.agenda-card-head { grid-template-columns: auto auto minmax(0, 1fr) auto; }
.drag-handle {
  width: 29px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #8a9395;
  font-size: 18px;
  cursor: grab;
  touch-action: none;
}
.drag-handle:active { cursor: grabbing; }
.agenda-ghost { opacity: .36; background: var(--accent-soft); }
.agenda-chosen { border-color: #8bb2bc; box-shadow: 0 13px 32px rgba(21,93,115,.15); }

.officer-column-head {
  display: grid;
  grid-template-columns: 110px minmax(0,1fr) minmax(0,1fr) 30px;
  gap: 8px;
  padding: 0 9px 6px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}
.officer-column-head span:last-child { text-align: center; }
.officer-row label { min-width: 0; display: block; }
.officer-row label > span { display: none; }
.officer-row label input {
  min-width: 0;
  width: 100%;
  border: 1px solid #dedfdb;
  border-radius: 9px;
  padding: 8px;
  background: #fff;
  font-size: 11px;
}

.meeting-ribbon i, .meeting-meta i, .next-info i { font-style: normal; }
.time-rules-box { flex: 0 0 29mm; }
.time-rules-table { height: calc(100% - 6.5mm); display: flex; flex-direction: column; }
.time-rule-row { flex: 1; display: grid; grid-template-columns: 20% 26.5% 26.5% 27%; border-bottom: .18mm solid #777; font-size: 4.55pt; line-height: 1.12; }
.time-rule-row span { display: flex; align-items: center; padding: .15mm .35mm; border-right: .18mm solid #777; overflow: hidden; }
.time-rule-row span:last-child { border-right: 0; }
.time-rule-row.row-1 .col-0 { background: #00a34a; color: #071; font-weight: 800; }
.time-rule-row.row-2 .col-0 { background: #e4df00; color: #6b6500; font-weight: 800; }
.time-rule-row.row-3 .col-0 { background: #e60000; color: white; font-weight: 800; }
.time-rule-row.row-4 .col-0 { background: #cbd3d2; font-weight: 800; }

@media (max-width: 1024px) {
  .app-header { grid-template-columns: minmax(0,1fr) auto auto; gap: 7px; }
  .document-state { display: none; }
  .language-switch button { min-width: 58px; min-height: 32px; padding: 0 8px; }
  .header-actions { grid-column: auto; }
  .header-actions #btnReset { display: none; }
  .officer-column-head { display: none; }
  .officer-row { grid-template-columns: 1fr 1fr auto; align-items: end; }
  .officer-row label:first-child { grid-column: 1 / -1; }
  .officer-row label > span { display: block; margin: 0 0 4px 2px; color: var(--muted); font-size: 8px; font-weight: 750; }
}
@media (max-width: 560px) {
  .brand-copy { display: none; }
  .app-header { grid-template-columns: auto 1fr auto; }
  .language-switch { justify-self: center; }
  .language-switch button { min-width: 50px; padding: 0 6px; font-size: 9px; }
  .header-actions .button.primary { padding: 0 10px; font-size: 10px; }
  .agenda-card-head { grid-template-columns: auto auto 1fr; }
  .agenda-card-actions { grid-column: 1 / -1; }
  .language-edit-pill { display: none; }
}

/* Export staging: render at exact A4 size without preview transforms. */
.export-safe-clone { box-shadow: none !important; transform: none !important; }
.brand-copy #appVersion { font: inherit; font-weight: 650; }
