:root {
  --bg: #f2f5f4;
  --surface: #fff;
  --ink: #16201f;
  --ink-2: #354543;
  --muted: #65736f;
  --hair: #dce5e3;
  --hair-2: #eff3f2;
  --accent: #1d6a8c;
  --accent-soft: #e8f2f6;
  --success: #137f43;
  --danger: #b93831;
  --warning: #9a6508;
  --warning-soft: #fff5d7;
  --shadow: 0 10px 30px rgba(22, 32, 31, .08);
  --paper-shadow: 0 18px 52px rgba(22, 32, 31, .13);
  --radius: 13px;
  --workflow-height: 88px;
  --role-height: 0px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
@media (min-width: 840px) { html { scroll-padding-top: 104px; } } /* 批6修:sticky .site-header 補 scroll-padding，防 scrollIntoView 元素躲表頭後 */
body {
  margin: 0;
  padding-bottom: calc(var(--workflow-height) + 30px + env(safe-area-inset-bottom));
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-size: 18px;
  line-height: 1.65;
}
.mobile-top-shell,
.mobile-bottom-shell { display: contents; }
button, textarea, input { font: inherit; }
button { color: inherit; }
button:disabled { cursor: not-allowed; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 8px 14px;
  transform: translateY(-150%);
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  display: flex;
  position: sticky;
  z-index: 40;
  top: 0;
  align-items: center;
  gap: 13px;
  max-width: 1440px;
  min-height: 92px;
  margin: 0 auto;
  padding: 21px 32px 17px;
  background: rgba(242, 245, 244, .96);
  box-shadow: 0 5px 16px rgba(22, 32, 31, .06);
  backdrop-filter: blur(12px);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  border-radius: 14px;
  background: var(--accent);
  box-shadow: 0 7px 18px rgba(29, 106, 140, .22);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
}
.eyebrow,
.item-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .1em;
  line-height: 1.25;
  text-transform: uppercase;
}
.item-kicker { color: #155b79; }
.site-header h1 {
  margin: 2px 0 0;
  font-size: 26px;
  letter-spacing: .02em;
  line-height: 1.25;
}
.queue-summary {
  margin: 0 0 0 auto;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--hair-2);
  color: var(--muted);
  font-size: 17px;
  white-space: nowrap;
}
.role-panel {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
}
.role-buttons { display: flex; align-items: center; justify-content: center; gap: 8px; }
.role-button,
.access-identity {
  --role-color: var(--accent);
  display: inline-grid;
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  place-items: center;
  padding: 0;
  overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--role-color) 62%, #fff);
  border-radius: 50%;
  background: color-mix(in srgb, var(--role-color) 12%, #fff);
  color: transparent;
  cursor: pointer;
  font-size: 0;
  line-height: 1;
}
.role-button::after,
.access-identity::after {
  color: var(--role-color);
  content: attr(data-short);
  font-size: 15px;
  font-weight: 900;
}
.role-button:hover { background: color-mix(in srgb, var(--role-color) 20%, #fff); }
.role-button.on {
  border-color: #fff;
  background: var(--role-color);
  box-shadow: 0 0 0 3px var(--role-color);
}
.role-button.on::after { color: #fff; }
.role-button:focus-visible,
.access-identity:focus-visible { outline: 3px solid color-mix(in srgb, var(--role-color) 28%, transparent); outline-offset: 3px; }
.access-identity { cursor: default; }
.access-identity.is-verified { --role-color: var(--success); }
.access-identity.is-error { --role-color: var(--danger); }
.role-buttons.is-identity-prompt .role-button {
  transform-origin: center;
  animation: identity-prompt-pulse 1.8s ease-in-out infinite;
  will-change: opacity, transform;
}
.role-buttons.is-identity-prompt .role-button:nth-child(2) { animation-delay: .12s; }
.role-buttons.is-identity-prompt .role-button:nth-child(3) { animation-delay: .24s; }
@keyframes identity-prompt-pulse {
  0%, 100% { opacity: .72; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.07); }
}

.review-tabs-wrap {
  /* relative（非 sticky）：仍隨內容捲走（批6 §5），但讓 z-index 生效——
     static 時 z-index 無效，桌機分頁列會被 rewrite-veil(z-25) 蓋住（2026-07-26 Ming 抓到） */
  position: relative;
  z-index: 30;
  border-block: 1px solid var(--hair);
  background: rgba(242, 245, 244, .96);
  backdrop-filter: blur(12px);
}
.review-tabs-toolbar {
  display: flex;
  align-items: stretch;
  max-width: 1440px;
  margin: 0 auto;
}
.review-tabs {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  gap: 8px;
  padding: 10px 16px 10px 32px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.review-tab {
  --owner-color: var(--accent);
  position: relative;
  flex: 0 0 auto;
  width: min(320px, 64vw);
  min-width: 240px;
  padding: 11px 58px 11px 19px;
  overflow: hidden;
  border: 1px solid var(--hair);
  border-radius: 11px;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.review-tab::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--owner-color);
  content: "";
}
.review-tab:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.review-tab[aria-selected="true"] {
  border-color: var(--owner-color);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--owner-color) 15%, transparent);
}
.review-tab:focus-visible { outline: 3px solid color-mix(in srgb, var(--owner-color) 32%, transparent); outline-offset: 2px; }
.tab-type {
  display: block;
  overflow: hidden;
  color: var(--owner-color);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .045em;
  line-height: 1.35;
  text-overflow: clip;
  white-space: nowrap;
  -webkit-mask-image: linear-gradient(to right, #000 82%, transparent 100%);
  mask-image: linear-gradient(to right, #000 82%, transparent 100%);
}
.tab-title {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--ink);
  font-size: 18px;
  font-weight: 750;
  line-height: 1.45;
  text-overflow: clip;
  white-space: nowrap;
  -webkit-mask-image: linear-gradient(to right, #000 84%, transparent 100%);
  mask-image: linear-gradient(to right, #000 84%, transparent 100%);
}
.tab-state {
  position: absolute;
  top: 50%;
  right: 10px;
  padding: 2px 7px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: var(--hair-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
/* 待審是需立即動作的狀態：以品牌色亮燈，文字加深以兼顧淺色企業色的可讀性（2026-08-15 Ming） */
.review-tab.is-pending .tab-state {
  border: 1px solid color-mix(in srgb, var(--owner-color) 42%, white);
  background: color-mix(in srgb, var(--owner-color) 14%, white);
  color: color-mix(in srgb, var(--owner-color) 72%, #13201d);
}
.review-tab.is-in_review .tab-state { background: #e7f3f7; color: var(--accent); }
.review-tab.is-returned { --owner-color: #89928f !important; background: #f0f3f2; }
.review-tab.is-returned .tab-state { background: #e3e6e5; color: #5d6865; }
.review-tab.is-approved,
.review-tab.is-submitted { --owner-color: #92a09c !important; background: #f0f3f2; opacity: .8; }
.completed-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 10px 24px 10px 10px;
  color: var(--muted);
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}
.desktop-completed-toggle {
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid #b9c9c6;
  border-radius: 999px;
  background: rgba(255,255,255,.96);
}
.desktop-completed-toggle[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.mobile-completed-toggle { display: none; }
.completed-toggle input { width: 18px; height: 18px; accent-color: var(--accent); }

.filter-banner {
  display: flex;
  position: static;
  z-index: 29;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: 1376px;
  margin: 10px auto 0;
  padding: 8px 14px;
  border: 1px solid #d7ad3d;
  border-left: 5px solid #e8b727;
  border-radius: 9px;
  background: #fff8dc;
  color: #5b4610;
  box-shadow: 0 5px 18px rgba(91, 70, 16, .08);
  font-size: 16px;
  font-weight: 750;
}
.text-button {
  padding: 2px 8px;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

main { max-width: 1440px; margin: 0 auto; padding: 28px 32px; }
.status-view {
  display: grid;
  place-content: center;
  justify-items: center;
  min-height: 400px;
  gap: 12px;
  color: var(--muted);
  text-align: center;
}
.status-view p { max-width: 460px; margin: 0; }
.status-view h2 { margin: 0 0 5px; color: var(--ink); font-size: 26px; }
.loader,
.button-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid var(--hair);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.item-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}
.item-heading h2 {
  margin: 5px 0 2px;
  font-size: clamp(27px, calc(2.4vw + 2px), 38px);
  letter-spacing: -.025em;
  line-height: 1.35;
}
.item-meta { margin: 6px 0 0; color: var(--muted); font-size: 17px; }
.readonly-badge {
  flex: 0 0 auto;
  padding: 7px 12px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: var(--hair-2);
  color: var(--muted);
  font-size: 16px;
  font-weight: 750;
}
.return-notice {
  margin: 0 0 14px;
  padding: 13px 16px;
  border: 1px solid #c8cecc;
  border-left: 5px solid #7b8582;
  border-radius: 10px;
  background: #ecefee;
  color: #45504d;
}
.return-notice p { margin: 2px 0 0; }
.review-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 12px 15px;
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: rgba(255,255,255,.72);
}
.review-progress-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 6px; margin: 0; font-size: 16px; font-weight: 850; }
.review-progress-title small { color: var(--muted); font-size: 13px; font-weight: 500; }
.review-progress-copy { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.reviewer-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.reviewer-chip {
  --role-color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  padding: 5px 11px;
  border: 1px solid #cdd5d3;
  border-left: 4px solid var(--role-color);
  /* 加了「做了什麼」的描述後不再是單行標籤，圓角收斂成小卡片 */
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}
.reviewer-chip-detail { color: var(--muted); font-size: 13px; font-weight: 600; opacity: .92; }
.reviewer-chip.is-saved .reviewer-chip-detail,
.reviewer-chip.is-approved .reviewer-chip-detail { color: inherit; }
.reviewer-chip.is-saved { background: #fff8e8; color: #775407; }
.reviewer-chip.is-approved { background: #e9f6ee; color: var(--success); }
.retypeset-notice {
  margin-bottom: 14px;
  padding: 9px 14px;
  border: 1px solid #e1bd54;
  border-radius: 9px;
  background: #fff5cf;
  color: #795707;
  font-size: 16px;
  font-weight: 800;
  text-align: center;
}

.review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(360px, .82fr);
  align-items: start;
  gap: 24px;
}
.review-layout.is-fb-layout { align-items: stretch; }
.review-layout.is-fb-layout > .preview-column,
.review-layout.is-fb-layout > .editor-column {
  display: flex;
  min-height: 0;
  flex-direction: column;
}
.review-layout.is-fb-layout .preview-segments,
.review-layout.is-fb-layout .segment-editors { flex: 1 1 auto; }
.review-layout.is-fb-layout .segment-editors {
  position: static;
  max-height: none;
  overflow-y: auto;
}
.preview-column {
  overflow: hidden;
  border: 1px solid #cfd9d7;
  border-radius: 3px;
  background: #fff;
  box-shadow: var(--paper-shadow);
}
.editor-column,
.settings-panel {
  overflow: hidden;
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.review-layout > .editor-column { align-self: stretch; overflow: visible; }
.column-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--hair);
}
.preview-column > .column-heading { background: #f8faf9; }
.editor-column > .column-heading { background: #eaf3f7; border-bottom-color: #cddfe7; }
.column-heading > div,
.section-heading { display: flex; align-items: center; gap: 10px; }
.column-heading h3,
.section-heading h3 { margin: 0; font-size: 21px; }
.column-heading p,
.section-heading p,
.component-help { margin: 0; color: var(--muted); font-size: 16px; }
.component-help { color: var(--accent); font-weight: 800; text-align: right; text-underline-offset: 3px; }
.step-number {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 15px;
  font-weight: 850;
}
.mobile-instruction { display: none; }

.preview-segments {
  position: relative;
  min-height: 540px;
  padding: clamp(33px, 5vw, 71px) clamp(27px, 6vw, 85px) 80px;
  background: #fff;
}
/* 好室 blog 排版預覽收窄左右留白，讓可用寬度貼近真站（Ming 2026-09-11 裁「預覽＝真站」）：
   上面那條左右 padding 在 1440 寬時吃到 85px×2＝170px，量出真稿 b01（4 張條列卡）被擠成
   146px／張，真站同款只有 202px／張。只收窄 .hs-paper，不動 .kn-paper／.content-paper，
   也不動 .review-layout 兩欄比例——單純把「紙頁留白」讓給內容。 */
.preview-segments.hs-paper {
  padding-left: 24px;
  padding-right: 24px;
}
.paper-title-wrap {
  margin: 0 auto 34px;
  padding-bottom: 27px;
  border-bottom: 1px solid rgba(48,72,84,.14);
  text-align: center;
}
.paper-title-wrap h2 {
  max-width: 820px;
  margin: 0 auto;
  color: #304854;
  font-size: clamp(32px, calc(3.4vw + 2px), 49px);
  font-weight: 850;
  letter-spacing: -.025em;
  line-height: 1.35;
}
.segment-preview {
  position: relative;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  border-radius: 5px;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.segment-preview + .segment-preview { margin-top: 8px; }
.segment-preview:hover,
.segment-preview.is-active { border-left-color: var(--accent); background: rgba(232, 242, 246, .48); }
.segment-preview.has-comment { box-shadow: inset 0 0 0 1px rgba(29, 106, 140, .18); }
.plain-text-content { white-space: pre-wrap; }
.plain-text-content p { margin: 0 0 1em; }
.plain-text-content p:last-child { margin-bottom: 0; }
.segment-editor.mobile-segment-editor { display: none; }
.preview-segments.is-retypesetting { pointer-events: none; }
.preview-segments.is-retypesetting::before {
  position: absolute;
  z-index: 20;
  inset: 0;
  background: rgba(255,255,255,.82);
  content: "";
}
.preview-segments.is-retypesetting::after {
  position: absolute;
  z-index: 21;
  top: 180px;
  left: 50%;
  padding: 42px 18px 10px;
  transform: translateX(-50%);
  background: radial-gradient(circle at 50% 18px, transparent 10px, var(--accent) 11px 13px, transparent 14px);
  color: var(--accent);
  content: "重排中…";
  font-weight: 850;
}

.segment-editors {
  display: flex;
  position: sticky;
  top: 92px;
  flex-direction: column;
  max-height: calc(100vh - 120px - var(--role-height) - var(--workflow-height));
  padding: 14px;
  overflow-y: auto;
}
.segment-editor {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  margin-bottom: 0;
  padding: 12px;
  border: 1px solid var(--hair);
  border-radius: 11px;
  background: #fbfcfc;
  transition: border-color .15s, box-shadow .15s;
}
.segment-editor:last-child { margin-bottom: 0; }
.segment-editor.is-active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.segment-editor-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--ink-2);
  font-size: 17px;
  font-weight: 800;
}
.segment-editor-body { display: flex; flex: 1 1 auto; flex-direction: column; }
.segment-editor-body > label { margin: 6px 0 5px; color: var(--ink-2); font-size: 15px; font-weight: 800; }
.pure-view-note { color: var(--warning); font-size: 14px; }
.edited-text-input { min-height: 150px; }
textarea {
  display: block;
  width: 100%;
  min-height: 80px;
  padding: 11px 12px;
  resize: vertical;
  border: 1px solid #c5d2d0;
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.65;
}
textarea::placeholder { color: #8a9693; opacity: 1; }
textarea:focus { border-color: var(--accent); outline: 3px solid var(--accent-soft); }
textarea:disabled { background: var(--hair-2); color: var(--muted); cursor: not-allowed; }
.comment-history { display: grid; gap: 7px; margin-top: 10px; }
.saved-comment {
  margin: 0;
  padding: 9px 10px;
  border-left: 3px solid #d9b43d;
  border-radius: 4px;
  background: #fff8d9;
  color: #493f25;
  font-size: 15px;
  line-height: 1.55;
}
.saved-comment span { white-space: pre-wrap; }
.saved-comment strong { display: block; margin-top: 3px; color: #725b16; text-align: right; }

.fb-preview-surface { padding: 28px; background: #edf0f4; }
.fb-card {
  max-width: 700px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid #d8dce1;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 18px rgba(20, 35, 55, .11);
  color: #1c1e21;
  font-family: Arial, "PingFang TC", sans-serif;
}
.fb-brand-row { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; }
.fb-brand-avatar,
.fb-comment-avatar {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #304854;
  color: #fff;
  font-weight: 850;
}
.fb-brand-avatar { width: 46px; height: 46px; font-size: 15px; }
.fb-brand-avatar.is-teal,
.fb-comment-avatar.is-teal { background: #00928a; }
.fb-brand-row div { display: flex; flex-direction: column; line-height: 1.35; }
.fb-brand-row strong { font-size: 17px; }
.fb-brand-row span:not(.fb-brand-avatar) { color: #65676b; font-size: 15px; }
.fb-scroll-window { height: 480px; overflow-y: auto; overscroll-behavior: contain; border-block: 1px solid #e5e7eb; }
.fb-message { padding: 14px 16px; border: 0; border-radius: 0; font-size: 17px; line-height: 1.5; }
.fb-message:hover,
.fb-message.is-active { border-left: 3px solid var(--accent); background: #f7fafb; }
.fb-message .plain-text-content p { margin-bottom: .85em; }
.fb-inline-editor {
  width: 100%;
  min-height: 0;
  padding: 3px 4px;
  overflow: hidden;
  resize: none;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}
.fb-inline-editor:hover:not(:disabled) { border-color: #ccd0d5; background: rgba(255,255,255,.72); }
.fb-inline-editor:focus {
  border-color: #1877f2;
  outline: 2px solid rgba(24,119,242,.18);
  background: #fff;
}
.fb-inline-editor:disabled { border-color: transparent; background: transparent; color: inherit; }
.fb-inline-message { min-height: 72px; }
.fb-image-area { padding: 12px 16px 16px; border-top: 1px solid #e5e7eb; background: #f9fafb; }
.fb-image-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.fb-image-heading strong { font-size: 16px; }
.image-gen-status { color: var(--muted); font-size: 14px; font-weight: 750; }
.fb-post-image,
.fb-image-current { display: block; width: 100%; max-height: 430px; border-radius: 8px; object-fit: contain; background: #e8eaed; }
.fb-preview-image { border-radius: 0; }
.fb-image-placeholder { display: grid; place-items: center; min-height: 150px; border: 1px dashed #c3c8ce; border-radius: 8px; background: #eef0f3; color: #747b84; font-size: 16px; }
.image-gen-controls { display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 8px; margin-top: 10px; }
.image-gen-controls label { grid-column: 1 / -1; color: var(--ink-2); font-size: 15px; font-weight: 800; }
.image-gen-controls textarea { grid-column: 1 / 3; min-height: 74px; font-size: 15px; }
.fb-image-area.is-generating { position: relative; }
.fb-image-area.is-generating::after {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.78);
  color: var(--accent);
  content: "生成中…";
  font-weight: 850;
}
.fb-interactions { display: flex; justify-content: space-around; padding: 9px 14px; border-bottom: 1px solid #e5e7eb; color: #65676b; }
.fb-interactions span { display: inline-flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 750; }
.fb-interactions svg { width: 20px; height: 20px; }
.fb-comment-row { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 12px 16px 16px; border: 0; border-radius: 0; }
.fb-comment-row:hover,
.fb-comment-row.is-active { border-left: 3px solid var(--accent); background: #f7fafb; }
.fb-comment-avatar { width: 34px; height: 34px; font-size: 11px; }
.fb-comment-bubble { flex: 1 1 auto; padding: 8px 11px; border-radius: 16px; background: #f0f2f5; font-size: 15px; line-height: 1.45; }
.fb-comment-bubble.is-not-publishing { border: 1px dashed #9aa0a6; opacity: .68; }
.fb-comment-bubble > strong { display: block; margin-bottom: 2px; font-size: 14px; }
.fb-comment-status { display: block; margin-bottom: 4px; color: #65676b; font-size: 12px; line-height: 1.35; }
.fb-comment-bubble .plain-text-content p { margin: 0; }
.fb-inline-comment { min-height: 38px; padding: 0; }

.hashtag-panel {
  flex: 0 0 auto;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--hair);
  border-radius: 11px;
  background: #fbfcfc;
}
.mobile-hashtag-panel { display: none; }
.hashtag-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hashtag-heading strong { font-size: 17px; }
.hashtag-heading span { color: var(--muted); font-size: 14px; font-weight: 800; }
.hashtag-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.hashtag-chip {
  min-height: 38px;
  padding: 6px 11px;
  border: 1px solid #cbd7d5;
  border-radius: 999px;
  background: #fff;
  color: var(--ink-2);
  cursor: pointer;
  font-size: 15px;
  font-weight: 750;
}
.hashtag-chip.is-selected { border-color: var(--accent); background: var(--accent); color: #fff; }
.hashtag-chip:disabled { opacity: .58; cursor: not-allowed; }
.hashtag-custom { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; margin-top: 11px; }
.hashtag-custom input,
.publish-custom-wrap input {
  min-width: 0;
  min-height: 44px;
  padding: 8px 11px;
  border: 1px solid #c5d2d0;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
}
.hashtag-message { min-height: 21px; margin: 6px 0 0; color: var(--danger); font-size: 14px; font-weight: 800; }

.settings-panel { margin-top: 24px; }
.section-heading { padding: 18px 20px; border-bottom: 1px solid var(--hair); background: linear-gradient(90deg, #edf5f8, #fff); }
.basic-settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 18px; }
.basic-settings > .fb-image-area,
.basic-settings > .hashtag-panel {
  grid-column: 1 / -1;
  margin: 0;
  border: 1px solid var(--hair);
  border-radius: 11px;
}
.setting-card {
  min-width: 0;
  margin: 0;
  padding: 15px;
  border: 1px solid #cedad8;
  border-radius: 12px;
  background: #fbfcfc;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.setting-card:hover,
.setting-card:focus-within { transform: translateY(-1px); border-color: #8bb5c7; box-shadow: 0 8px 22px rgba(29,106,140,.1); }
.setting-card legend { display: flex; align-items: center; justify-content: space-between; width: calc(100% - 4px); padding: 0 4px; color: var(--ink-2); font-size: 18px; font-weight: 850; }
.setting-note { margin: 5px 0 0; padding: 0 4px; color: var(--muted); font-size: 15px; }
.setting-text-wrap { display: flex; align-items: stretch; margin-top: 10px; border: 1px solid #cbd7d5; border-radius: 9px; background: var(--surface); overflow: hidden; }
.setting-text-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.setting-text-prefix { display: flex; align-items: center; padding: 0 10px; background: var(--hair-2); color: var(--muted); font-size: 15px; white-space: nowrap; }
.setting-text { flex: 1; min-width: 0; min-height: 42px; padding: 9px 12px; border: 0; background: transparent; color: var(--ink-2); font: inherit; font-size: 17px; }
.setting-text:focus { outline: none; }
.setting-text:disabled { opacity: .58; cursor: not-allowed; }
.setting-card > .setting-text { margin-top: 10px; border: 1px solid #cbd7d5; border-radius: 9px; background: var(--surface); }
.hero-upload { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 11px; }
.hero-upload-status { color: var(--muted); font-size: 15px; }
.hero-generate { display: grid; gap: 7px; width: min(100%, 720px); margin-top: 10px; }
.hero-generate-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.hero-generate-input {
  min-width: 0;
  min-height: 44px;
  padding: 8px 11px;
  border: 1px solid #c5d2d0;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
.hero-generate-input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.hero-generate-input:disabled { opacity: .58; cursor: not-allowed; }
.system-auto { display: inline-flex; align-items: center; gap: 7px; color: var(--accent); cursor: pointer; font-size: 16px; font-weight: 750; }
.system-auto input,
.confirm-check input { width: 19px; height: 19px; accent-color: var(--accent); cursor: pointer; }
.setting-card.is-system-auto .setting-options { opacity: .48; filter: grayscale(.25); }
.setting-card.is-system-auto .setting-text,
.setting-card.is-system-auto .setting-text-wrap { opacity: .48; filter: grayscale(.25); }
.setting-options { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 10px; }
.choice-pill { position: relative; display: inline-flex; }
.choice-pill input { position: absolute; opacity: 0; pointer-events: none; }
.choice-pill span { display: inline-flex; align-items: center; min-height: 40px; padding: 7px 13px; border: 1px solid #cbd7d5; border-radius: 999px; background: var(--surface); color: var(--ink-2); cursor: pointer; font-size: 17px; }
.choice-pill input:checked + span { border-color: var(--accent); background: var(--accent); box-shadow: 0 4px 12px rgba(29,106,140,.18); color: #fff; font-weight: 750; }
.choice-pill input:focus-visible + span { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
.choice-pill input:disabled + span { opacity: .58; cursor: not-allowed; }
.confirm-value { margin: 9px 0 11px; padding: 10px 12px; border-radius: 9px; background: var(--hair-2); color: var(--ink-2); font-size: 17px; }
.confirm-check { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); cursor: pointer; font-size: 17px; font-weight: 750; }
.image-options { display: grid; grid-template-columns: repeat(4, minmax(92px, 1fr)); gap: 10px; margin-top: 11px; }
.image-choice { position: relative; min-width: 0; }
.image-choice input { position: absolute; opacity: 0; }
.image-choice-card { display: block; height: 100%; overflow: hidden; border: 2px solid var(--hair); border-radius: 10px; background: var(--surface); cursor: pointer; }
.image-choice-card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: linear-gradient(135deg,var(--hair-2),var(--hair)); }
.image-choice-card span { display: block; padding: 8px; overflow: hidden; font-size: 16px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.image-choice input:checked + .image-choice-card { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.image-choice input:disabled + .image-choice-card { opacity: .58; cursor: not-allowed; }
.image-placeholder { display: grid !important; place-items: center; aspect-ratio: 16 / 9; background: var(--hair-2); color: var(--muted); font-size: 16px; }
.setting-message { min-height: 22px; margin: 8px 0 0; color: var(--danger); font-size: 16px; font-weight: 850; }
.settings-empty { grid-column: 1 / -1; margin: 0; padding: 14px; border-radius: 9px; background: var(--hair-2); color: var(--muted); }

.workflow-bar {
  position: fixed;
  z-index: 43;
  inset: auto 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--workflow-height);
  gap: 20px;
  padding: 12px max(32px, calc((100vw - 1376px) / 2 + 32px)) calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--hair);
  background: rgba(255,255,255,.98);
  box-shadow: 0 -10px 28px rgba(22,32,31,.08);
  backdrop-filter: blur(12px);
}
.workflow-copy { display: flex; flex-direction: column; }
.workflow-copy strong { font-size: 18px; }
.workflow-copy span { color: var(--muted); font-size: 15px; }
.mobile-workflow-hint { display: none; }
.workflow-actions { display: flex; align-items: center; gap: 8px; }
.primary-button,
.secondary-button,
.danger-button,
.return-button {
  min-height: 44px;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 850;
}
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--accent); box-shadow: 0 5px 15px rgba(29,106,140,.2); color: #fff; }
.primary-button:hover:not(:disabled) { background: #155b79; }
.secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-color: #bac8c5; background: #fff; color: var(--ink-2); }
.secondary-button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.save-button { border-color: #7caf91; color: var(--success); }
.danger-button { background: var(--danger); color: #fff; }
.return-button { min-height: 38px; padding: 6px 9px; background: transparent; color: var(--danger); text-decoration: underline; text-underline-offset: 3px; }
/* 退回重寫狀態與「退回重寫」鈕同色，讓兩處紅字一致（2026-07-27 Ming） */
.readonly-badge.is-returned { border-color: rgba(185, 56, 49, .35); background: #fdf1f0; color: var(--danger); }
.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled,
.return-button:disabled { border-color: #c3cac8; background: #aeb8b6; box-shadow: none; color: #f3f5f4; cursor: not-allowed; opacity: .72; text-decoration: none; }
.primary-button.compact,
.secondary-button.compact { min-height: 38px; padding: 6px 12px; font-size: 15px; }
.button-spinner { display: none; width: 17px; height: 17px; border-color: rgba(101,115,111,.3); border-top-color: currentColor; }
.is-loading .button-spinner { display: inline-block; }

.comment-note {
  position: fixed;
  z-index: 120;
  top: 50%;
  left: 50%;
  width: min(330px, calc(100vw - 34px));
  max-height: min(62vh, 520px);
  padding: 24px 20px 20px;
  overflow-y: auto;
  transform: translate(-50%, -50%) rotate(-1deg);
  border: 1px solid #dec55b;
  border-radius: 3px;
  background: #fff4a9;
  box-shadow: 0 18px 50px rgba(58,47,4,.28);
  color: #493f25;
}
.comment-note::before { position: absolute; top: 0; left: 50%; width: 70px; height: 15px; transform: translate(-50%,-5px); background: rgba(255,255,255,.55); content: ""; }
.note-close { position: absolute; top: 5px; right: 7px; width: 30px; height: 30px; border: 0; background: transparent; cursor: pointer; font-size: 26px; }
.comment-note-title { margin: 0 0 12px; font-weight: 900; }
.comment-note-body { display: grid; gap: 12px; }
.comment-note-body p { margin: 0; padding-top: 10px; border-top: 1px dashed rgba(73,63,37,.25); white-space: pre-wrap; }
.comment-note-body p:first-child { padding-top: 0; border-top: 0; }
.comment-note-body strong { display: block; margin-top: 5px; text-align: right; }

.action-dialog {
  width: min(520px, calc(100vw - 30px));
  padding: 0;
  border: 1px solid var(--hair);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(22,32,31,.3);
}
.action-dialog::backdrop { background: rgba(18,28,27,.52); backdrop-filter: blur(3px); }
.action-dialog form { padding: 24px; }
.action-dialog h2 { margin: 0 0 8px; font-size: 25px; }
.action-dialog p { margin: 0 0 16px; color: var(--muted); }
.action-dialog label { display: block; margin-bottom: 6px; font-weight: 800; }
.publish-date-options { display: grid; gap: 8px; margin: 4px 0 0; padding: 0; border: 0; }
.publish-date-options legend { margin-bottom: 7px; color: var(--ink); font-weight: 850; }
.publish-date-option { position: relative; margin: 0 !important; }
.publish-date-option input { position: absolute; opacity: 0; pointer-events: none; }
.publish-date-option > span {
  display: flex;
  min-height: 52px;
  padding: 8px 12px;
  border: 1px solid #cbd7d5;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
}
.publish-date-option small { color: var(--muted); font-weight: 500; }
.publish-date-option input:checked + span { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px rgba(29,106,140,.12); }
.publish-date-option input:focus-visible + span { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
.publish-custom-wrap { margin-top: 12px; }
.publish-custom-wrap input { display: block; width: 100%; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }
.dialog-error { min-height: 22px; margin: 6px 0 0 !important; color: var(--danger) !important; font-size: 15px; font-weight: 800; }

.toast-region { position: fixed; z-index: 200; top: 16px; right: 16px; width: min(390px, calc(100vw - 32px)); pointer-events: none; }
.toast { margin-bottom: 8px; padding: 11px 13px; border: 1px solid var(--hair); border-left: 4px solid var(--accent); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); color: var(--ink-2); font-size: 17px; animation: toast-in .18s ease-out; }
.toast.is-error { border-left-color: var(--danger); }
.toast.is-warning { border-left-color: var(--warning); }
.toast.is-success { border-left-color: var(--success); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

@media (max-width: 839px) {
  :root { --workflow-height: 122px; --role-height: 0px; }  /* 08-17：提示列墊高按鈕，避免最底排點不到 */
  body { padding-bottom: calc(var(--workflow-height) + 18px + env(safe-area-inset-bottom)); }
  .mobile-top-shell {
    display: block;
    position: sticky;
    z-index: 50;
    top: 0;
    transform: translateY(0);
    background: rgba(242,245,244,.98);
    box-shadow: 0 5px 16px rgba(22,32,31,.06);
    transition: transform 210ms ease;
    will-change: transform;
  }
  .mobile-bottom-shell {
    display: flex;
    position: fixed;
    z-index: 60;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateY(0);
    flex-direction: column;
    transition: transform 210ms ease;
    will-change: transform;
  }
  .mobile-top-shell.is-scroll-hidden { transform: translateY(-101%); }
  .mobile-bottom-shell.is-scroll-hidden { transform: translateY(101%); }
  .site-header { position: static; z-index: auto; min-height: 76px; padding: 14px 15px 12px; background: rgba(242,245,244,.98); box-shadow: none; backdrop-filter: none; }
  .brand-mark { width: 40px; height: 40px; border-radius: 12px; }
  .site-header h1 { font-size: 21px; }
  .eyebrow, .item-kicker { font-size: 12px; }
  .queue-summary { display: none; }
  .role-buttons { gap: 6px; }
  .role-button,
  .access-identity { width: 34px; height: 34px; min-width: 34px; min-height: 34px; }
  .desktop-completed-toggle { display: none; }
  .review-tabs-wrap { position: static; }
  .review-tabs-toolbar { display: block; position: relative; }
  .review-tabs { padding: 8px 92px 8px 14px; }
  .review-tab { width: min(82vw, 310px); min-width: min(82vw, 310px); padding-block: 9px; }
  .tab-type { font-size: 14px; }
  .tab-title { font-size: 18px; }
  .mobile-completed-toggle {
    display: inline-flex;
    position: absolute;
    z-index: 2;
    top: 50%;
    right: 8px;
    width: auto;
    min-height: 44px;
    padding: 7px 11px;
    transform: translateY(-50%);
    justify-content: center;
    border: 1px solid #b9c9c6;
    border-radius: 999px;
    background: rgba(255,255,255,.98);
    color: var(--ink-2);
    box-shadow: 0 2px 8px rgba(22,32,31,.08);
  }
  .mobile-completed-toggle input { position: absolute; opacity: 0; pointer-events: none; }
  .mobile-completed-toggle span { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .mobile-completed-toggle:has(input:checked) { border-color: var(--accent); background: var(--accent); color: #fff; }
  .filter-banner { position: static; margin: 7px 9px 0; font-size: 14px; }
  main { padding: 19px 14px; }
  .item-heading { margin-bottom: 12px; }
  .item-heading h2 { font-size: 26px; }
  .item-meta { font-size: 15px; }
  .readonly-badge { padding: 4px 8px; font-size: 13px; }
  .readonly-badge.is-returned { padding: 4px 8px; }
  .readonly-badge.is-role-prompt { display: none; }
  .review-view.is-fb-review .item-heading.is-role-prompt-only { display: none; }
  .review-progress { display: block; padding: 10px 11px; }
  .reviewer-chips { justify-content: flex-start; margin-top: 8px; }
  /* 手機：三人各佔一行，描述才讀得完（原本三個 pill 橫排就已塞滿一行） */
  .reviewer-chip { width: 100%; font-size: 13px; }
  .reviewer-chip-detail { font-size: 12px; }
  .hero-generate { width: 100%; }
  .hero-generate-controls .compact { min-height: 44px; padding-inline: 12px; }
  .review-layout { display: block; }
  .editor-column { display: none; }
  .column-heading { min-height: 66px; padding: 12px 13px; }
  .column-heading .mobile-instruction { display: block; max-width: 165px; font-size: 14px; text-align: right; }
  .preview-segments { min-height: 0; padding: 12px 10px 22px; }
  .paper-title-wrap { margin: 0 8px 18px; padding: 18px 8px 20px; }
  .paper-title-wrap h2 { font-size: 32px; }
  .segment-preview { padding: 16px 12px; }
  /* FB 主文與留言列裡裝的是文字輸入框（2026-08-19 改 textarea），黃底黃框會被誤讀成
     「這個輸入框被標記了」——排除掉，兩者退回上面通用的淡藍細框（2026-08-19 Ming）。 */
  .segment-preview.has-comment:not(.fb-message):not(.fb-comment-row) { border-color: rgba(210,173,32,.4); background: #fff8cc; box-shadow: inset 0 -8px 0 rgba(255,224,70,.22); cursor: pointer; }
  .segment-editor.mobile-segment-editor { display: flex; min-height: 0 !important; margin: 6px 0 14px; padding: 10px; box-shadow: none; }
  .mobile-segment-editor .segment-editor-heading { margin: 0; }
  .mobile-segment-editor.is-mobile-layout-editor .segment-editor-heading { justify-content: flex-end; }
  .mobile-segment-editor .segment-editor-body:not([hidden]) { margin-top: 8px; }
  .mobile-editor-toggle { min-height: 44px; padding: 7px 12px; border: 1px solid var(--danger); border-radius: 999px; background: #fff; color: var(--danger); cursor: pointer; font-size: 14px; font-weight: 850; }
  .mobile-editor-toggle[aria-expanded="true"] { background: color-mix(in srgb, var(--danger) 8%, #fff); color: var(--danger); }
  .mobile-segment-editor .comment-history { display: none; }
  .content-paper .plain-text-content { font-size: 18px; line-height: 1.7; }
  .fb-preview-surface { padding: 10px 7px; background: #edf0f4; }
  .fb-card { border-radius: 9px; }
  .fb-scroll-window { height: 60vh; min-height: 390px; }
  .fb-message { padding: 12px; }
  .review-layout.is-fb-layout .editor-column { display: block; align-self: auto; margin-top: 12px; overflow: hidden; }
  .review-layout.is-fb-layout .segment-editors { display: flex; position: static; max-height: none; padding: 10px; overflow: visible; }
  .review-layout.is-fb-layout .segment-editor { margin-top: 10px !important; min-height: 0 !important; }
  .review-layout.is-fb-layout .segment-editor:first-child { margin-top: 0 !important; }
  .fb-image-area { padding: 10px 12px 13px; }
  .image-gen-controls { grid-template-columns: 1fr 1fr; }
  .image-gen-controls textarea { grid-column: 1 / -1; }
  .image-gen-controls .primary-button { width: 100%; }
  .hashtag-panel { margin-top: 10px; padding: 12px; }
  .mobile-hashtag-panel { display: block; margin: 12px 0; }
  .hashtag-custom { grid-template-columns: 1fr auto; }
  .settings-panel { margin-top: 12px; }
  .section-heading p { font-size: 14px; }
  .basic-settings { grid-template-columns: 1fr; padding: 11px; }
  .setting-card legend { font-size: 16px; }
  .choice-pill span, .confirm-value, .confirm-check { font-size: 15px; }
  .system-auto { font-size: 14px; }
  .image-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workflow-bar { position: static; flex-direction: column; width: 100%; min-height: var(--workflow-height); gap: 4px; padding: 6px 9px calc(8px + env(safe-area-inset-bottom)); }
  .workflow-copy { display: none; }
  .mobile-workflow-hint { display: block; width: 100%; color: var(--muted); font-size: 12px; line-height: 1.35; }
  .workflow-actions { width: 100%; justify-content: stretch; gap: 5px; }
  .workflow-actions > button { flex: 1 1 0; min-width: 0; min-height: 48px; padding: 7px 5px; font-size: 15px; }
  .workflow-actions .return-button { flex: 0 0 82px; }
  .workflow-actions .return-button:not(:disabled) { border-color: transparent; background: transparent; color: var(--danger); text-decoration: underline; }
  .toast-region { top: 9px; right: 9px; width: calc(100vw - 18px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ===== 批7：投稿工作區 + seo-struct 追蹤修訂 ===== */
.compose-entry {
  flex: 0 0 auto;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.compose-entry:hover { background: #155b79; }

.compose-view {
  max-width: 860px;
  margin: 20px auto;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.compose-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.compose-head h2 { font-size: 24px; margin: 4px 0 0; }
.compose-hint { color: var(--muted); font-size: 15px; margin: 10px 0 18px; line-height: 1.7; }
.compose-body { display: flex; flex-direction: column; gap: 14px; }
.compose-file {
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px dashed #b7c6c3; border-radius: 10px; padding: 14px 16px;
  cursor: pointer; color: var(--ink-2); background: #f8faf9; width: fit-content;
}
.compose-file input { display: none; }
.compose-file-cta { font-size: 15px; font-weight: 600; }
.compose-file-name { font-size: 14px; color: var(--muted); margin: 0; }
.compose-image-preview img { max-width: 280px; max-height: 200px; border-radius: 8px; border: 1px solid var(--hair); }
.compose-text {
  width: 100%; box-sizing: border-box; resize: vertical;
  border: 1px solid #c3d0cd; border-radius: 10px; padding: 14px;
  font: inherit; font-size: 16px; line-height: 1.75; color: var(--ink);
}
.compose-text:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.compose-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--hair);
}
.compose-actions-copy { display: flex; flex-direction: column; gap: 3px; }
.compose-actions-copy strong { font-size: 15px; }
.compose-actions-copy span { font-size: 13px; color: var(--muted); }
.compose-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.compose-buttons button { padding: 10px 18px; border-radius: 10px; font-size: 15px; cursor: pointer; }

/* 單欄追蹤修訂：藏掉 02 意見欄與 03 設定 */
.review-view.is-seo-struct .review-layout { grid-template-columns: minmax(0, 1fr); }
.review-view.is-seo-struct .editor-column,
.review-view.is-seo-struct .settings-panel { display: none; }
.seo-struct-surface { padding: 0; }

.tc-advice, .tc-research {
  margin: 0 0 16px; padding: 14px 18px; border-radius: 10px;
  border: 1px solid var(--hair); background: #f8faf9;
}
.tc-advice h4, .tc-research h4 { margin: 0 0 10px; font-size: 16px; color: var(--accent); }
.tc-advice ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tc-advice li { display: flex; gap: 10px; font-size: 15px; line-height: 1.7; color: var(--ink-2); }
.tc-symbol { flex: 0 0 auto; font-weight: 700; }
.tc-symbol.is-check { color: var(--danger); }
.tc-symbol.is-diamond { color: var(--accent); }
.tc-symbol.is-arrow, .tc-symbol.is-pen { color: var(--ink-2); }
.tc-research p { margin: 0; font-size: 14px; line-height: 1.7; color: var(--muted); }

/* 審稿更新記錄（2026-07-26）：沿「依意見重寫」鏈累積，最舊在上、最新在下 */
.tc-review-log {
  margin: 0 0 18px; padding: 14px 18px; border-radius: 10px;
  border: 1px solid var(--hair); background: #f8faf9;
}
.tc-review-log h4 { margin: 0 0 10px; font-size: 16px; color: var(--accent); }
.tc-review-log ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.tc-review-log > ol > li { padding-left: 12px; border-left: 3px solid var(--hair); }
.tc-review-log > ol > li:last-child { border-left-color: var(--accent); }
.tc-log-head { margin: 0 0 4px; display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.tc-log-head strong { font-size: 14px; color: var(--ink-2); }
.tc-log-head span { font-size: 13px; color: var(--muted); }
.tc-review-log ul { list-style: disc; margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.tc-review-log ul li { font-size: 14px; line-height: 1.7; color: var(--ink-2); }
.tc-review-log.is-collapsed > ol > li:first-child > ul,
.tc-review-log.is-collapsed > ol > li:first-child > .tc-log-snapshot,
.tc-review-log.is-collapsed > ol > li:nth-child(n+2) { display: none; }
.tc-log-toggle {
  margin: 9px 0 0 12px; padding: 0; border: 0; background: transparent;
  color: var(--accent); font: inherit; font-size: 14px; font-weight: 700;
  text-decoration: underline; cursor: pointer;
}

/* 每輪「當時主文（第 N 版）」——原生 <details>，預設收合（2026-09-12 Ming 裁 (乙)）：
   三輪紀錄若三份全文都攤開會把畫面撐得很長，這一層收合獨立於外層「查看完整修改紀錄」。 */
.tc-log-snapshot { margin: 6px 0 0; }
.tc-log-snapshot > summary {
  font-size: 13px; color: var(--accent); cursor: pointer; user-select: none;
}
.tc-log-snapshot-body {
  margin-top: 6px; padding: 10px 12px; border-radius: 8px;
  border: 1px dashed var(--hair); background: #fff;
  font-size: 14px; color: var(--ink-2);
}
.tc-log-snapshot-note { margin: 6px 0 0; font-size: 12px; color: var(--muted); }

/* 已核可稿改走定稿純文字顯示（2026-09-12 Ming 裁）：不再顯示紅刪綠增痕跡，
   layout_started 存在時多一行凍結時間提示。 */
.tc-frozen-notice {
  margin: 0 20px 16px; padding: 10px 18px; border-radius: 10px;
  border: 1px solid var(--hair); background: #f8faf9;
  font-size: 14px; color: var(--muted);
}

.tc-body { padding: 6px 20px 18px; }
/* Markdown 表格：只要黑色線條的格子（2026-08-17 Ming），不要底色圓角陰影 */
.tc-table-wrap { max-width: 100%; margin: 0 0 18px; overflow-x: auto; }
.tc-table {
  width: max-content; min-width: 100%; border-collapse: collapse;
  border-radius: 0; background: transparent; box-shadow: none;
  color: var(--ink); font-size: 17px; line-height: 1.6;
}
.tc-table th, .tc-table td {
  padding: 7px 10px; border: 1px solid #000; border-radius: 0; background: transparent;
  text-align: left; vertical-align: top;
}
.tc-para { font-size: 17px; line-height: 2; color: var(--ink); margin: 0 0 18px; }
.tc-para.is-para-ins { background: #eafaf1; border-left: 4px solid var(--success); padding: 6px 12px; border-radius: 6px; }
.tc-para.is-para-del { background: #fdecea; border-left: 4px solid var(--danger); padding: 6px 12px; border-radius: 6px; }
.tc-link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.tc-text mark.tc-selecting { background: #fff3b0; color: inherit; border-radius: 3px; padding: 0 1px; }
.tc-ins { color: var(--success); text-decoration: none; background: #eafaf1; border-radius: 3px; padding: 0 2px; }
.tc-del { color: var(--danger); text-decoration: line-through; background: #fdecea; border-radius: 3px; padding: 0 2px; }
.tc-ctl { display: inline-flex; gap: 4px; margin: 0 5px; vertical-align: middle; white-space: nowrap; }
.tc-btn {
  border: 1px solid #c3d0cd; background: #fff; color: var(--ink-2);
  box-sizing: border-box; flex: 0 0 32px; width: 32px; min-width: 32px;
  height: 32px; min-height: 32px; line-height: 1; border-radius: 8px; font-size: 15px; font-weight: 800;
  cursor: pointer; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  touch-action: manipulation;
}
.tc-btn:hover { border-color: var(--accent); color: var(--accent); }
.tc-btn:focus-visible {
  outline: 3px solid var(--accent-soft); outline-offset: 2px; border-color: var(--accent);
}
.tc-comment-flag {
  display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px;
  background: var(--warning-soft); color: var(--warning); font-size: 13px; vertical-align: middle;
}
.tc-start-actions { display: flex; justify-content: flex-end; padding: 8px 20px 4px; }
.tc-start-actions button { padding: 11px 26px; border-radius: 10px; font-size: 16px; cursor: pointer; }

.seo-waiting {
  max-width: 620px; margin: 0 auto; padding: 26px 24px; text-align: left;
  background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); box-shadow: var(--shadow);
}
.seo-waiting h3 { font-size: 21px; margin: 0 0 6px; color: var(--accent); }
.seo-waiting-eta { font-size: 27px; font-weight: 700; color: var(--ink); margin: 0 0 14px; }
.seo-waiting p { font-size: 16px; line-height: 1.8; color: var(--ink-2); margin: 0 0 12px; }
.seo-waiting-note { font-size: 14px !important; color: var(--muted) !important; }
.seo-waiting button { margin-top: 8px; padding: 10px 20px; border-radius: 10px; cursor: pointer; }

.tc-layout-choice { padding: 16px 22px 22px; }
.tc-layout-choice h4 { font-size: 18px; color: var(--accent); margin: 0 0 10px; }
.tc-layout-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0 14px; }
.tc-layout-buttons button { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 13px 20px; border-radius: 10px; cursor: pointer; text-align: left; }
.tc-layout-buttons button strong { font-size: 16px; }
.tc-layout-buttons button span { font-size: 13px; opacity: .85; }
.tc-layout-preview { padding: 12px 22px 20px; }
.tc-layout-preview h4 { font-size: 17px; color: var(--accent); margin: 0 0 14px; }
.tc-layout-preview p { font-size: 17px; line-height: 2; color: var(--ink); margin: 0 0 16px; }
.tc-layout-note { font-size: 13px !important; color: var(--muted) !important; line-height: 1.7 !important; }
.tc-layout-preview button { margin-top: 6px; padding: 9px 18px; border-radius: 10px; cursor: pointer; }

.tc-popup {
  position: fixed; z-index: 60; width: 300px; max-width: calc(100vw - 24px);
  background: var(--surface); border: 1px solid var(--hair); border-radius: 12px;
  box-shadow: var(--paper-shadow); padding: 12px;
}

/* 置中告知 modal（依意見重寫送出／失敗）——半透明遮罩＋置中卡片，取代右上 toast（2026-07-26 Ming） */
/* 送出重寫後的常駐淺灰遮罩：整頁變灰＋等待卡浮正中央；z-25 讓表頭/分頁列仍可點（切去審其他稿） */
.rewrite-veil {
  position: fixed;
  z-index: 25;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(226, 231, 230, .78);
  backdrop-filter: blur(1.5px);
}

.center-modal-overlay {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(22,32,31,.5);
}
.center-modal-card {
  width: 100%; max-width: 380px; box-sizing: border-box;
  background: var(--surface); border-radius: 16px; padding: 28px 26px;
  text-align: center; box-shadow: var(--paper-shadow);
}
.center-modal-title { font-size: 20px; margin: 0 0 12px; color: var(--accent); }
.center-modal-big { font-size: 27px; font-weight: 700; color: var(--ink); margin: 0 0 14px; }
.center-modal-detail { font-size: 15px; line-height: 1.8; color: var(--ink-2); margin: 0 0 18px; }
.center-modal-countdown { margin: -8px 0 18px; color: var(--muted); font-size: 14px; }
.center-modal-card button { padding: 10px 24px; border-radius: 10px; cursor: pointer; }
.tc-popup-modes { display: inline-flex; gap: 4px; margin-bottom: 10px; background: #eef3f2; border-radius: 8px; padding: 3px; }
.tc-mode { border: none; background: transparent; color: var(--muted); font-size: 13px; padding: 6px 12px; border-radius: 6px; cursor: pointer; }
.tc-mode.is-active { background: #fff; color: var(--accent); font-weight: 600; box-shadow: 0 1px 3px rgba(22,32,31,.12); }
.tc-popup-input {
  width: 100%; box-sizing: border-box; resize: vertical; font: inherit; font-size: 15px;
  border: 1px solid #c3d0cd; border-radius: 8px; padding: 9px 10px; line-height: 1.6;
}
.tc-popup-input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.tc-popup-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }
/* 追蹤修訂文字：加大點擊區與行距，降低手機選字誤點（2026-07-25 Ming 反映主管常點錯字） */
.tc-text { -webkit-user-select: text; user-select: text; }
.tc-body .tc-para { padding: 2px 0; }
.tc-document-meta {
  margin: 0 0 30px; padding: 18px 20px; border: 1px solid var(--hair);
  border-left: 4px solid var(--accent); border-radius: 10px; background: #f8faf9;
}
.tc-body .tc-doc-title {
  margin: 0 0 10px; color: var(--ink); font-size: clamp(21px, 2vw, 26px);
  font-weight: 800; line-height: 1.45; letter-spacing: .01em;
}
.tc-body .tc-meta {
  margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.65;
}
.tc-body .tc-heading {
  color: var(--ink); font-weight: 800; letter-spacing: .01em;
  text-wrap: balance;
}
.tc-body .tc-heading--1 {
  margin: 38px 0 14px; font-size: clamp(25px, 2.2vw, 31px); line-height: 1.4;
}
.tc-body .tc-heading--2 {
  margin: 36px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--hair);
  font-size: clamp(21px, 1.6vw, 24px); line-height: 1.5;
}
.tc-body .tc-heading--3,
.tc-body .tc-heading--4 {
  margin: 26px 0 10px; color: var(--accent); font-size: 19px; line-height: 1.55;
}
.tc-list {
  display: grid; gap: 7px; margin: 0 0 22px; padding: 0; list-style: none;
}
.tc-body .tc-list-item {
  margin: 0; padding: 1px 0 1px 1.65em; text-indent: -1.65em;
  line-height: 1.85;
}
.tc-popup-actions .compact { padding: 7px 16px; border-radius: 8px; font-size: 14px; cursor: pointer; }

/* FB/IG 主文追蹤修訂（批7 第6項） */

@media (max-width: 839px) {
  #tc-popup-cancel { display: none; }   /* 手機點框外即取消，不需要按鈕 */
  .tc-body .tc-para { line-height: 2.1; }
  .compose-entry { padding: 7px 12px; font-size: 19px; line-height: 1; }
  .compose-entry-label { display: none; }
  .compose-view { margin: 12px; padding: 16px; }
  /* 投稿頁在手機＝獨立全螢幕工作區（2026-07-30 Ming 裁）。
     為什麼不是「加 padding」或「藏頂列」：投稿與審稿是兩件事，讓投稿自成一層就
     不必跟 sticky 頂列（z-50）爭空間——鍵盤彈出時瀏覽器捲的是這一層而非整頁，
     頂列因此蓋不到草稿上緣（原症狀：捲動後重疊 118px、草稿前兩行被吃掉）。
     z-index 70＝在底列(60)之上，但仍低於置中彈窗(80)與 toast(200)，兩者照樣蓋得上來。 */
  #compose-view:not([hidden]) {
    /* 表頭高度＝唯一旋鈕：min-height 把它釘死，scroll-padding-top 才對得上，
       不必去抓一個量出來的魔術數字（量到的值會隨字級／安全區改變）。 */
    --compose-head-h: calc(104px + env(safe-area-inset-top));
    position: fixed;
    inset: 0;
    z-index: 70;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 0 16px calc(16px + env(safe-area-inset-bottom));
    /* 鍵盤彈出時瀏覽器會把焦點欄位捲到容器頂端；沒有這行，草稿前幾行會鑽到
       sticky 表頭底下——實測矮視埠時被蓋掉 101px，等於把原 bug 縮小重現一次。
       scroll-padding-top 是專為 sticky 表頭設計的，一次涵蓋層內所有可聚焦子元素。 */
    scroll-padding-top: var(--compose-head-h);
  }
  /* 「關閉」釘在面板頂端：這一層自己會捲，不釘住的話捲下去就點不到
     ——捲動後點不到「關閉」是改版前就存在的既有瑕疵，一併治掉。 */
  #compose-view:not([hidden]) .compose-head {
    position: sticky;
    top: 0;
    z-index: 1;
    box-sizing: border-box;
    min-height: var(--compose-head-h);
    padding: calc(14px + env(safe-area-inset-top)) 0 10px;
    background: var(--surface);
  }
  /* 輸入框收進可視範圍：rows="12" 在鍵盤彈出後（可視高剩 ~380px）比整個畫面還高，
     瀏覽器就只能顯示游標處、顯示不了草稿頂端。用 dvh 才會跟著鍵盤縮放；
     190px 留給提示文字、選檔鈕與底部動作列。這條是「全螢幕工作區」的一部分：
     版面該讓輸入框合身，而不是讓它撐破容器再靠捲動補救。 */
  #compose-view:not([hidden]) #compose-text {
    max-height: calc(100dvh - var(--compose-head-h) - 190px);
    min-height: 140px;
  }
  /* 投稿層開著時底層不要跟著捲，避免兩層同時捲動 */
  body:has(#compose-view:not([hidden])) { overflow: hidden; }
  .tc-body, .tc-advice, .tc-research, .tc-start-actions, .tc-layout-preview { padding-left: 14px; padding-right: 14px; }
  .tc-review-log { margin-left: 14px; margin-right: 14px; padding-left: 14px; padding-right: 14px; }
  .tc-para, .tc-layout-preview p { font-size: 16px; }
  .tc-document-meta { margin-bottom: 24px; padding: 15px 16px; }
  .tc-body .tc-doc-title { font-size: 21px; line-height: 1.5; }
  .tc-body .tc-heading--1 { margin-top: 32px; font-size: 24px; }
  .tc-body .tc-heading--2 { margin-top: 30px; font-size: 21px; }
  .tc-body .tc-heading--3,
  .tc-body .tc-heading--4 { margin-top: 24px; font-size: 18px; }
  .tc-body .tc-list-item { line-height: 1.85; }
  .tc-btn {
    flex-basis: 44px; width: 44px; min-width: 44px;
    height: 44px; min-height: 44px; border-radius: 10px; font-size: 18px;
  }
}

/* 鍵盤彈出＝可視高度變矮。此時 104px 的固定表頭會吃掉三分之一畫面，
   且瀏覽器的 focus 捲動不吃 scroll-padding-top（只有 scrollIntoView 吃），
   草稿前幾行仍會鑽到表頭底下。改成表頭隨內容捲走：使用者這時在打字、
   不是在找「關閉」；關閉路徑另有底部「取消」，且收鍵盤後 sticky 表頭立刻回來。 */
@media (max-width: 839px) and (max-height: 700px) {
  #compose-view:not([hidden]) { scroll-padding-top: 0; }
  #compose-view:not([hidden]) .compose-head {
    position: static;
    min-height: 0;
    padding-top: calc(10px + env(safe-area-inset-top));
  }
}
