/* 貼文 page and 待審核 (mockups 1–3, docs/draft-review.md). Only colours this page adds are defined here; the tokens
   (--blue, --ink, --line…) and their dark values come from app.css and theme.css. */
:root { --posts-surface: rgba(255, 255, 255, .92); --posts-soft: #f4f9ff; --posts-neutral: #e6eefb; --posts-neutral-ink: #274877; --posts-old: #fdecef; --posts-old-ink: #8f2438; --posts-new: #e4f7ee; --posts-new-ink: #0f5c41; }
:root[data-theme="dark"] { --posts-surface: #19283d; --posts-soft: #23364e; --posts-neutral: #263f66; --posts-neutral-ink: #d5e3ff; --posts-old: #4c1f2a; --posts-old-ink: #ffb3c0; --posts-new: #173f30; --posts-new-ink: #a8ecc8; }

/* ---------- ＋ 新增 ---------- */
.new-menu { position: relative; }
.new-menu-button { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.new-menu-caret { width: 8px; height: 8px; margin: -4px 2px 0 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
.new-menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; display: grid; min-width: 190px; padding: 6px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--posts-surface); box-shadow: var(--lift); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
:root[data-theme="dark"] .new-menu-list { background: #23364e; }
.new-menu-item { display: flex; align-items: center; min-height: 44px; width: 100%; padding: 0 12px; border-radius: 9px; background: none; color: var(--ink); font-weight: 600; text-align: left; text-decoration: none; white-space: nowrap; }
a.new-menu-item, :root[data-theme="dark"] a.new-menu-item { color: var(--ink); }
.new-menu-item:hover, .new-menu-item:focus-visible { background: var(--posts-soft); color: var(--ink); }

/* ---------- tabs and search ---------- */
.posts-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.posts-tabs { display: flex; gap: 8px; }
.posts-tab { border-radius: 12px; padding: 0 16px; white-space: nowrap; }
.posts-search { position: relative; flex: 0 1 330px; min-width: 200px; }
.posts-search input { padding-left: 40px; }
/* The magnifier is drawn here: a strict CSP page has no inline SVG to hand, and it is decoration. */
.posts-search::before { content: ""; position: absolute; left: 14px; top: 13px; width: 13px; height: 13px; border: 2px solid var(--muted); border-radius: 50%; pointer-events: none; }
.posts-search::after { content: ""; position: absolute; left: 26px; top: 26px; width: 7px; height: 2px; background: var(--muted); border-radius: 1px; transform: rotate(45deg); transform-origin: left center; pointer-events: none; }

/* ---------- 開始審核 ---------- */
.review-start { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 12px 10px 18px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--posts-surface); }
:root[data-theme="dark"] .review-start { background: #23364e; }
.review-start-count { font-weight: 600; }
.review-start-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* Desk: a secondary button after the sentence. Phone: the sentence goes into the button, which fills the row (mockup 2). */
.review-start-button { gap: 0; background: #fff; color: var(--ink); border: 1px solid var(--line-strong); }
:root[data-theme="dark"] .review-start-button { background: var(--theme-soft); color: var(--ink); }
.review-start-button:hover:not(:disabled) { border-color: var(--blue); }
.review-start-button-count { display: none; }
.review-batch { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.review-batch-button.is-armed { background: var(--amber-bg); color: var(--amber); border-color: var(--amber); }
.review-batch-note:empty { display: none; }
.review-done { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.posts-bar { justify-content: flex-end; }

/* ---------- the list ---------- */
.post-list { display: grid; margin: 0; padding: 0 16px; list-style: none; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--posts-surface); }
.post-list > li + li { border-top: 1px solid var(--line); }
.posts-list-wrap { display: grid; gap: 10px; }
/* Two lines (about 62px): the title and its status, then the platforms and one line of text. */
.post-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "title tags" "line tags"; align-items: center; gap: 2px 14px; min-height: 60px; padding: 8px 4px; color: var(--ink); text-decoration: none; }
:root[data-theme="dark"] .post-row { color: var(--ink); }
@media (hover: hover) {
  .post-row:hover .post-row-title { color: var(--blue); }
  :root[data-theme="dark"] .post-row:hover .post-row-title { color: var(--blue-dark); }
}
.post-row-title { grid-area: title; font-size: 15px; font-weight: 700; line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-row-tags { grid-area: tags; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 46ch; }
.post-row-line { grid-area: line; display: flex; align-items: center; gap: 6px; min-width: 0; }
.post-row-excerpt { flex: 1 1 0; min-width: 0; color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-platform { flex: none; background: var(--posts-neutral); color: var(--posts-neutral-ink); font-weight: 600; font-size: 12px; padding: 1px 8px; }
.post-tag-neutral { background: var(--posts-neutral); color: var(--posts-neutral-ink); }
:root[data-theme="dark"] :is(.post-platform, .post-tag-neutral) { background: var(--posts-neutral); color: var(--posts-neutral-ink); }
.posts-foot { display: flex; }
.button.link.posts-deleted-link { color: var(--muted); text-decoration: underline; text-underline-offset: 4px; font-weight: 500; }
:root[data-theme="dark"] .button.link.posts-deleted-link { color: var(--muted); }
.posts-deleted-heading { margin-top: 2px; }

/* ---------- 首頁的待審核 ---------- */
.home-review { padding: 6px; }
.home-review > .hint { padding: 12px 14px; }
.home-review > .button { margin: 0 14px 12px; }
.home-review-open { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 0 16px; border-radius: 14px; background: none; color: var(--ink); text-align: left; }
.home-review-open:hover { background: var(--posts-soft); }
.home-review-label { font-size: 17px; font-weight: 700; }
.home-review-count { font-size: 22px; color: var(--blue); }
:root[data-theme="dark"] .home-review-count { color: var(--blue-dark); }
.home-review-hint { margin-left: auto; color: var(--muted); font-size: 14px; }
.home-review-hint::after { content: " ›"; }

/* ---------- the open draft ---------- */
.review-top { display: grid; gap: 10px; margin: 12px 24px 4px; }
.review-top:not(:has(> :not([hidden]))) { display: none; }
.review-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.review-line-text { min-width: 0; }
.review-line .review-approve { margin-left: auto; }
.review-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.review-chips:empty { display: none; }
.review-chips .tag { font-size: 13px; padding: 2px 10px; }
.review-error { margin: 0; }
.review-hint { margin: 0; }
.review-diff { display: grid; gap: 8px; padding: 14px 16px; }
.review-diff h2 { font-size: 15px; }
.review-diff-body { display: grid; gap: 10px; }
.review-diff-part { display: grid; gap: 6px; }
.review-diff-label { font-size: 13px; }
.review-diff-old, .review-diff-new { display: block; padding: 6px 10px; border-radius: 8px; line-height: 1.6; overflow-wrap: anywhere; white-space: pre-wrap; }
.review-diff-old { background: var(--posts-old); color: var(--posts-old-ink); text-decoration: line-through; }
.review-diff-new { background: var(--posts-new); color: var(--posts-new-ink); text-decoration: none; }
/* 開始審核: the counter and the bar replace the way back and 儲存並回貼文; the tabs and fields are the editor's own. */
.review-counter { color: var(--muted); font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.review-progress { order: 9; flex: 1 1 100%; display: block; width: 100%; height: 6px; border: 0; border-radius: 3px; overflow: hidden; background: var(--line); appearance: none; -webkit-appearance: none; }
.review-progress::-webkit-progress-bar { background: var(--line); border-radius: 3px; }
.review-progress::-webkit-progress-value { background: var(--blue); border-radius: 3px; }
.review-progress::-moz-progress-bar { background: var(--blue); }
.in-review > .publish-summary { display: none; }
.in-review { padding-bottom: 72px; }
.review-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 10px 24px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-strong); background: #fff; }
:root[data-theme="dark"] .review-bar { background: #19283d; }
.review-next { min-width: 240px; }
.button.link.review-skip { color: var(--muted); font-weight: 600; }
:root[data-theme="dark"] .button.link.review-skip { color: var(--muted); }

@media (max-width: 760px) {
  .new-menu-caret { display: none; }
  .posts-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; gap: 6px; }
  .posts-tab { padding: 0 2px; font-size: 14px; }
  .posts-search { flex: 1 1 100%; }
  .review-start { padding: 0; border: 0; background: none; }
  :root[data-theme="dark"] .review-start { background: none; }
  .review-start-count { display: none; }
  .review-start-actions { flex-direction: column-reverse; align-items: stretch; width: 100%; }
  .review-start-button { width: 100%; background: var(--blue); color: #fff; border: 0; box-shadow: 0 12px 24px -14px var(--blue); }
  :root[data-theme="dark"] .review-start-button { background: var(--blue); color: #fff; }
  .review-start-button-count { display: inline; }
  .review-batch { justify-content: center; }
  /* 全部通過 stays quiet under the one main button, as in mockup 2's order. */
  .button.ghost.review-batch-button:not(.is-armed) { border: 0; background: none; color: var(--muted); font-weight: 600; box-shadow: none; }
  :root[data-theme="dark"] .button.ghost.review-batch-button:not(.is-armed) { background: none; color: var(--muted); }
  .post-list { padding: 0 12px; }
  /* Three short lines on a phone (mockup 2). */
  .post-row { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "tags" "line"; gap: 6px; padding: 12px 2px; }
  .post-row-title { font-size: 16px; }
  .post-row-tags { justify-content: flex-start; max-width: none; }
  .review-top { margin: 10px 12px 4px; }
  .review-bar { flex-direction: column; gap: 2px; padding: 8px 12px calc(6px + env(safe-area-inset-bottom)); }
  .review-next { width: 100%; }
  .review-skip { min-height: 40px; }
  .in-review { padding-bottom: 130px; }
  /* Mockup 3: ← 待處理 and 第 1 篇，共 6 篇 on the first line, the title large under them. */
  .in-review .fullpage-editor-head { flex-wrap: wrap; }
  .in-review .review-counter { margin-left: auto; order: 2; }
  .in-review .fullpage-editor-head > .save-status { order: 3; }
  .in-review .review-progress { order: 4; }
  .in-review .fullpage-editor-title { order: 5; flex: 1 1 100%; }
  .in-review .fullpage-editor-title h1 { font-size: 22px; white-space: normal; overflow-wrap: anywhere; }
}
@media (min-width: 761px) {
  .in-review .fullpage-editor-head { gap: 12px; }
}
