:root {
  --bg0: #0e1419;
  --ink: #152028;
  --muted: #5c6b75;
  --line: #c8d3da;
  --accent: #1a7a6d;
  --accent-soft: #d8eee9;
  --primary: #1f4e79;
  --warn: #b45309;
  --danger: #9f2d3a;
  --chip: #e2eaf0;
  --surface: #f2f5f7;
  --menu-sidebar-w: 22rem;
  --font-ui: "Instrument Sans", "PingFang SC", "Noto Sans SC", sans-serif;
  --font-display: "Newsreader", "Songti SC", "Noto Serif SC", serif;
}

* { box-sizing: border-box; }

/* —— 顶栏：fixed 置顶，保证永远可点 —— */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  pointer-events: auto;
  isolation: isolate;
  backdrop-filter: blur(12px);
  background: rgba(14, 20, 25, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-nav .nav-link,
.site-nav .nav-sidebar-btn,
.site-nav .nav-brand,
.site-nav .btn-agent,
.site-nav .btn-more {
  pointer-events: auto;
  position: relative;
  z-index: 1;
}

body {
  margin: 0;
  min-height: 100vh;
  padding-top: 3.25rem; /* 给 fixed 顶栏留位 */
  color: var(--ink);
  font-family: var(--font-ui);
  background: var(--surface);
}

.noise {
  display: none;
}

.nav-progress {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 8px;
  margin: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  pointer-events: none;
  z-index: 21;
}

#progress-fill {
  height: 100%;
  width: 0%;
  background: #2ec4b6;
  will-change: width;
}

.nav-progress-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-nav-inner {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0.7rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 1;
  min-width: 0;
  max-width: min(42vw, 24rem);
}

.nav-sidebar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.06);
  color: #d5e0e6;
  cursor: pointer;
  box-sizing: border-box;
}

.nav-sidebar-btn:hover,
.nav-sidebar-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.nav-sidebar-btn svg {
  display: block;
}

.nav-sidebar-btn .nav-hamburger-icon path {
  transition: transform 0.2s ease, opacity 0.2s ease;
  transform-origin: center;
}

.nav-sidebar-btn[aria-expanded="true"] .nav-hamburger-top {
  transform: translateY(5px) rotate(45deg);
}

.nav-sidebar-btn[aria-expanded="true"] .nav-hamburger-mid {
  opacity: 0;
}

.nav-sidebar-btn[aria-expanded="true"] .nav-hamburger-bot {
  transform: translateY(-5px) rotate(-45deg);
}

.menu-sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10050;
  background: rgba(14, 20, 25, 0.42);
  opacity: 0;
  visibility: hidden;
  pointer-events: none !important;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

body.menu-sidebar-open .menu-sidebar-backdrop {
  opacity: 1;
  visibility: visible;
  pointer-events: auto !important;
}

.menu-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 10060;
  width: var(--menu-sidebar-w);
  padding-top: 2.85rem; /* 盖住顶栏；上方留给汉堡 */
  box-sizing: border-box;
  background: #121920;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 8px 0 28px rgba(0, 0, 0, 0.28);
  transform: translateX(0);
  transition: transform 0.2s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.menu-sidebar.is-collapsed {
  transform: translateX(-100%);
  pointer-events: none;
  visibility: hidden;
  box-shadow: none;
}

/*
 * 侧栏盖住顶栏时：把整个 site-nav 提到侧栏之上，
 * 但只露出汉堡（其余透明隐藏）。否则按钮在 isolation 栈里会被侧栏挡住。
 */
body.menu-sidebar-open .site-nav {
  z-index: 10070;
  background: transparent;
  border-bottom-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  pointer-events: none;
}

body.menu-sidebar-open .site-nav .nav-progress {
  opacity: 0;
}

body.menu-sidebar-open .site-nav .nav-brand,
body.menu-sidebar-open .site-nav .nav-links,
body.menu-sidebar-open .site-nav .nav-right {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

body.menu-sidebar-open .nav-sidebar-btn {
  position: relative;
  z-index: 1;
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.32);
  color: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.menu-sidebar-section {
  flex-shrink: 0;
  padding: 0.55rem 0.55rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  z-index: 1;
}

.menu-sidebar-section:has(#menu-mode-wrap) {
  z-index: 5;
  overflow: visible;
}

.menu-sidebar-project {
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}

.menu-project-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  min-width: 0;
}

.menu-project-row .menu-sidebar-section-label {
  flex-shrink: 0;
}

.menu-project-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.92rem;
  font-weight: 650;
  color: #f2f6f8;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}

.menu-project-edit {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #9eb0ba;
  cursor: pointer;
}

.menu-project-edit:hover:not(:disabled) {
  color: #e8eef2;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.menu-project-edit:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.menu-project-edit-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.menu-project-edit-row.hidden {
  display: none;
}

.menu-project-name-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 1.85rem;
  padding: 0.2rem 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.06);
  color: #f2f6f8;
  font: inherit;
  font-size: 0.86rem;
}

.menu-project-name-input:focus {
  outline: 1px solid rgba(126, 184, 201, 0.55);
  outline-offset: 0;
}

.menu-project-edit-row .btn-sm {
  flex-shrink: 0;
  padding: 0.22rem 0.45rem;
  font-size: 0.72rem;
}

.menu-sidebar-section-label {
  margin: 0;
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  color: #7d929c;
  text-transform: uppercase;
  white-space: nowrap;
}

.menu-mode-wrap {
  position: relative;
  z-index: 2;
}

.menu-mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
}

.menu-mode-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.28rem;
  width: auto;
  max-width: 9.5rem;
  min-height: 1.55rem;
  padding: 0.18rem 0.4rem 0.18rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.06);
  color: #e8eef2;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
}

.menu-mode-btn:hover,
.menu-mode-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
}

.menu-mode-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-mode-caret {
  flex-shrink: 0;
  opacity: 0.75;
  transition: transform 0.18s ease;
}

.menu-mode-btn[aria-expanded="true"] .menu-mode-caret {
  transform: rotate(180deg);
}

.menu-mode-menu {
  position: absolute;
  top: calc(100% + 0.28rem);
  right: 0;
  z-index: 30;
  min-width: 9.5rem;
  width: max-content;
  max-width: min(14rem, calc(100vw - 2rem));
  margin: 0;
  padding: 0.28rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #1a2228;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42);
}

.menu-mode-menu.hidden {
  display: none;
}

.menu-mode-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  min-height: 2rem;
  padding: 0.38rem 0.55rem;
  border: none;
  background: transparent;
  color: #9aafb9;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 550;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
}

.menu-mode-item:hover {
  color: #e8eef2;
  background: rgba(255, 255, 255, 0.06);
}

.menu-mode-item.active {
  color: #0e1419;
  background: #e8eef2;
}

.menu-mode-check {
  flex-shrink: 0;
  min-width: 0.85rem;
  font-size: 0.72rem;
  opacity: 0.85;
}

.menu-sidebar-work.overview-work {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 0.65rem 0.55rem 0.9rem;
  background: transparent;
  border: none;
  align-self: stretch;
  overflow: hidden;
}

.menu-sidebar-work .flat-title,
.menu-sidebar-work .archive-head .flat-title {
  color: #d6e0e6;
}

.menu-sidebar-work .project-list-empty {
  color: #8fa0aa;
}

.menu-sidebar-work .overview-archive {
  min-height: 0;
}

.menu-sidebar-work .project-list {
  max-height: none;
}

.menu-sidebar-work .new-project-row .btn {
  font-size: 0.78rem;
  padding: 0.42rem 0.55rem;
}

.menu-sidebar-work .new-project-name {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  color: #e8eef2;
}

.menu-sidebar-work .new-project-name::placeholder {
  color: #7f919c;
}

.menu-sidebar-work .btn-icon-only {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  color: #9eb0ba;
}

.menu-sidebar-work .btn-icon-only:hover {
  color: #e8eef2;
  border-color: rgba(255, 255, 255, 0.28);
}

.nav-mode-wrap {
  position: relative;
  flex-shrink: 0;
}

.nav-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  max-width: 8.5rem;
  height: 1.7rem;
  padding: 0 0.45rem 0 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.06);
  color: #d5e0e6;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
}

.nav-mode-btn:hover,
.nav-mode-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.nav-mode-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-mode-caret {
  flex-shrink: 0;
  opacity: 0.75;
}

.nav-mode-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 40;
  min-width: 9.5rem;
  padding: 0.28rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #1a2228;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.nav-mode-menu.hidden {
  display: none;
}

.nav-mode-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  width: 100%;
  padding: 0.42rem 0.5rem;
  border: none;
  background: transparent;
  color: #d5e0e6;
  font: inherit;
  font-size: 0.78rem;
  text-align: left;
  cursor: pointer;
}

.nav-mode-item:hover,
.nav-mode-item.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-mode-check {
  min-width: 0.85rem;
  color: #8fd4c7;
  font-size: 0.75rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  color: #e8eef2;
  flex-shrink: 1;
  min-width: 0;
  max-width: none;
}

.nav-brand-text {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  flex: 1;
  justify-content: center;
}

.nav-link {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  height: 1.7rem;
  padding: 0 0.7rem;
  border: 1px solid transparent;
  background: transparent;
  color: #9aafb9;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 0;
  cursor: pointer;
  box-sizing: border-box;
}

.nav-link:hover {
  color: #e8eef2;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
}

.nav-link.active {
  color: #0e1419;
  background: #e8eef2;
  border-color: #e8eef2;
}

.nav-link.done:not(.active) {
  color: #8fd4c7;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

@media (max-width: 820px) {
  .site-nav-inner { flex-wrap: wrap; }
  .nav-links { order: 3; width: 100%; justify-content: flex-start; }
}

/* —— 页面：全宽铺开，不再居中窄栏 —— */
.page {
  position: relative;
  z-index: 1;
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
}

.page-panel {
  background: var(--surface);
  border-radius: 0;
  min-height: calc(100vh - 3.25rem);
  padding: 1.5rem 1.75rem 3rem;
  border: none;
  box-shadow: none;
}

.workspace-panel {
  display: flex;
  flex-direction: column;
  padding: 0.85rem 1rem 0.75rem;
  height: calc(100vh - 3.25rem);
  min-height: calc(100vh - 3.25rem);
  overflow: hidden;
}

/* 工作区：禁止整页上下滚动，仅三栏内部滚动 */
html.workspace-noscroll,
html.workspace-noscroll body {
  height: 100%;
  overflow: hidden;
}

html.workspace-noscroll body {
  display: flex;
  flex-direction: column;
}

html.workspace-noscroll .page {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

html.workspace-noscroll .workspace-panel {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  max-height: none;
}

.type-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.85rem;
  position: sticky;
  top: 0;
  z-index: 4;
  padding: 0.1rem 0 0.55rem;
  background: #f4f7f8;
  /* 仅盖住滚动区内上边距，避免章节头再往上涂一大块 */
  box-shadow: 0 -0.9rem 0 0 #f4f7f8;
}

.type-chip {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  padding: 0.28rem 0.55rem;
  border-radius: 2px;
  cursor: pointer;
}

.type-chip:hover { color: var(--ink); border-color: #9aabb5; }
.type-chip.active {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(31, 78, 121, 0.06);
}

.unit-cards {
  grid-template-columns: 1fr;
}

.unit-chapter {
  margin: 0 0 1.1rem;
}

.unit-chapter:last-child {
  margin-bottom: 0;
}

.unit-chapter-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.45rem;
  padding: 0.35rem 0 0.4rem;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: var(--unit-filter-sticky-h, 0px);
  z-index: 3;
  background: #f4f7f8;
}

.unit-chapter-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--ink);
  line-height: 1.35;
  min-width: 0;
}

.unit-chapter-count {
  flex-shrink: 0;
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

.unit-text {
  margin: 0.25rem 0;
  font-size: 0.9rem;
  line-height: 1.55;
}

.unit-asset-caption {
  margin: 0.35rem 0 0.45rem;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

.unit-table-wrap {
  margin-top: 0.35rem;
  overflow-x: auto;
}

.unit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  line-height: 1.4;
}

.unit-table th,
.unit-table td {
  border: 1px solid var(--line);
  padding: 0.35rem 0.45rem;
  text-align: left;
  vertical-align: top;
}

.unit-table th {
  background: #f4f7f8;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.unit-table td {
  color: var(--ink);
}

.unit-figure-wrap {
  margin-top: 0.35rem;
}

.unit-figure {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  background: #f4f7f8;
}

.tri-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.35fr) minmax(200px, 260px);
  gap: 0;
  border: 1px solid var(--line);
  background: #fff;
}

.col {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
}

.col:last-child { border-right: none; }

.col-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  height: 2.375rem;
  min-height: 2.375rem;
  max-height: 2.375rem;
  padding: 0 0.85rem;
  box-sizing: border-box;
  border-bottom: 1px solid var(--line);
  background: #eef2f4;
}

.col-head-left,
.col-head-right {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.col-source .col-head {
  overflow: hidden;
}

.col-source .col-head-left {
  flex: 0 0 auto;
  white-space: nowrap;
}

.col-source .col-head-left h3 {
  white-space: nowrap;
  flex-shrink: 0;
}

.col-source .col-head-right {
  flex: 1 1 auto;
  min-width: 0;
  justify-content: flex-end;
  overflow: hidden;
}

.source-head-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  flex: 1 1 auto;
  max-width: 100%;
  flex-wrap: nowrap;
  justify-content: flex-end;
  overflow: hidden;
}

.source-head-meta .col-tag {
  min-width: 0;
  flex: 0 1 auto;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-head-meta .col-chars {
  flex: 0 0 auto;
  color: var(--muted);
}

.col-source .col-head .btn-icon {
  flex: 0 0 auto;
  white-space: nowrap;
  flex-wrap: nowrap;
}

.col-head-left h3 {
  margin: 0;
}

.col-chars {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

.col-sub {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.article-version,
.head-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.04em;
  padding: 0.08rem 0.32rem;
  border: 1px solid var(--line);
  background: #fff;
  line-height: 1.2;
  white-space: nowrap;
  border-radius: 0;
  box-sizing: border-box;
}

button.article-version,
button.head-chip {
  font: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  margin: 0;
}

button.article-version:hover:not(:disabled),
button.head-chip:hover:not(:disabled) {
  background: #f4f7f8;
}

button.head-chip-accent {
  color: #1f6b52;
  border-color: rgba(31, 107, 82, 0.4);
  background: rgba(31, 107, 82, 0.08);
}

button.head-chip-stop {
  color: #9f2d3a;
  border-color: rgba(159, 45, 58, 0.45);
  background: rgba(159, 45, 58, 0.08);
}

button.head-chip-stop:hover:not(:disabled) {
  background: rgba(159, 45, 58, 0.16);
}

button.head-chip-accent.is-wait {
  color: #6a7a74;
  border-color: rgba(31, 107, 82, 0.22);
  background: rgba(31, 107, 82, 0.04);
}

button.head-chip-on {
  color: #1f6b52;
  border-color: rgba(31, 107, 82, 0.45);
  background: rgba(31, 107, 82, 0.1);
}

button.head-chip-off {
  color: #8a969c;
  border-color: color-mix(in srgb, var(--line) 85%, #8a969c);
  background: #f7f8f9;
}

button.head-chip-off:hover:not(:disabled) {
  color: #5a6a72;
  background: #eef1f2;
}

button.head-chip-on:hover:not(:disabled) {
  background: rgba(31, 107, 82, 0.16);
}

button.head-chip-accent:hover:not(:disabled) {
  background: rgba(31, 107, 82, 0.14);
}

button.article-version:disabled,
button.head-chip:disabled,
.col-head-right .btn-sm:disabled,
.col-head-right .btn-rollback:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.head-chip-group {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  position: relative;
}

.head-chip-group .head-chip {
  border-radius: 0;
}

.head-chip-group .head-chip + .head-chip {
  border-left: none;
  margin-left: -1px;
}

.head-chip-more {
  width: 1.35rem;
  min-width: 1.35rem;
  padding-left: 0;
  padding-right: 0;
  letter-spacing: 0;
}

.head-chip-more svg {
  display: block;
  width: 12px;
  height: 12px;
}

.head-chip-more[aria-expanded="true"] {
  background: #f4f7f8;
}

.plan-version-menu {
  position: absolute;
  top: calc(100% + 0.28rem);
  right: 0;
  z-index: 30;
  min-width: 8.5rem;
  max-width: min(22rem, 70vw);
  max-height: min(50vh, 18rem);
  overflow: auto;
  padding: 0.25rem;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.plan-version-menu.hidden {
  display: none;
}

.plan-version-menu-label {
  display: block;
  padding: 0.3rem 0.55rem 0.2rem;
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.plan-version-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.25rem;
  padding: 0.15rem 0.2rem;
}

.plan-version-row + .plan-version-row {
  border-top: 1px solid rgba(21, 32, 40, 0.06);
}

.plan-version-item {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.08rem;
  width: auto;
  min-width: 2.4rem;
  max-width: 6.8rem;
  padding: 0.28rem 0.42rem;
  border: 1px solid transparent;
  border-radius: 0.2rem;
  background: transparent;
  text-align: left;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
  cursor: pointer;
}

.plan-version-id {
  white-space: nowrap;
  line-height: 1.15;
}

.plan-version-item.is-branch {
  font-weight: 500;
  color: #3d4d57;
}

.plan-version-item:hover {
  background: #f4f7f8;
  border-color: var(--line);
}

.plan-version-item small {
  display: block;
  max-width: 100%;
  margin: 0;
  font-size: 0.62rem;
  font-weight: 400;
  line-height: 1.25;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.col-head-right .btn-sm,
.col-head-right .btn-rollback,
.col-head-right .head-chip {
  max-width: 9.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}

.parse-search-input {
  flex: 0 1 9rem;
  min-width: 5.5rem;
  max-width: 11rem;
  height: 1.35rem;
  margin: 0;
  padding: 0 0.4rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.2;
  box-sizing: border-box;
}

.col-result .col-head-left .parse-search-input {
  flex: 0 1 8.5rem;
}

.parse-search-input::placeholder {
  color: var(--muted);
  font-weight: 400;
}

.parse-search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.parse-search-status {
  margin: 0 0 0.55rem;
}

mark.parse-search-hit {
  background: rgba(250, 204, 21, 0.55);
  color: inherit;
  padding: 0 0.05em;
  border-radius: 1px;
}

.col-head-right .btn-rollback {
  padding: 0.08rem 0.32rem;
  font-size: 0.68rem;
  line-height: 1.2;
  min-height: 0;
  height: auto;
}

.col-head .btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.2;
  padding: 0.08rem 0.32rem;
  border-radius: 0;
  cursor: pointer;
  box-sizing: border-box;
}

.col-head .btn-icon svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.col-head .btn-icon:hover {
  background: #f4f7f8;
  border-color: var(--line);
  color: var(--ink);
}

.settings-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(14, 20, 25, 0.35);
  z-index: 40;
}

.settings-unsaved-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(14, 20, 25, 0.4);
}

.settings-unsaved-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 61;
  width: min(22rem, calc(100vw - 2rem));
  padding: 1.1rem 1.15rem 1rem;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 12px 36px rgba(14, 20, 25, 0.18);
}

.settings-unsaved-dialog.hidden,
.settings-unsaved-backdrop.hidden {
  display: none;
}

.settings-unsaved-dialog h3 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.settings-unsaved-dialog p {
  margin: 0 0 0.95rem;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--muted);
}

.settings-unsaved-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.settings-unsaved-actions .btn {
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  min-height: 1.7rem;
}

.settings-drawer {
  position: fixed;
  /* 顶栏 fixed + z-index 更高，侧栏从顶栏下方起，避免头按钮被挡住 */
  top: 3.25rem;
  right: 0;
  width: min(360px, 92vw);
  height: calc(100vh - 3.25rem);
  background: #f7f9fa;
  border-left: 1px solid var(--line);
  z-index: 50;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.22s ease;
  box-shadow: -12px 0 40px rgba(14, 20, 25, 0.12);
}

.settings-drawer.open {
  transform: translateX(0);
}

.settings-drawer-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  background: #eef2f4;
}

.settings-head-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.settings-head-actions .btn {
  padding: 0.28rem 0.62rem;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
  min-height: 1.7rem;
  height: 1.7rem;
  box-sizing: border-box;
}

.settings-more-wrap {
  position: relative;
}

.settings-more-btn {
  width: 1.7rem;
  min-width: 1.7rem;
  height: 1.7rem;
  min-height: 1.7rem;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  box-sizing: border-box;
}

.settings-more-btn:hover,
.settings-more-btn[aria-expanded="true"] {
  color: var(--ink);
  background: #f4f7f8;
}

.settings-more-btn svg {
  display: block;
}

.settings-more-menu {
  position: absolute;
  top: calc(100% + 0.28rem);
  right: 0;
  z-index: 40;
  min-width: 6.5rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
}

.settings-more-menu.hidden {
  display: none;
}

.settings-more-item {
  display: block;
  width: 100%;
  padding: 0.4rem 0.55rem;
  border: none;
  background: transparent;
  text-align: left;
  font: inherit;
  font-size: 0.78rem;
  color: var(--ink);
  cursor: pointer;
}

.settings-more-item:hover {
  background: #f2f6f5;
}

#btn-save-step-settings.dirty {
  box-shadow: inset 0 0 0 1px #e0a060;
}

.settings-drawer-head h3 {
  margin: 0;
  font-size: 1rem;
  font-family: var(--font-display);
}

.settings-drawer-body {
  flex: 1;
  overflow: auto;
  padding: 1rem;
}

.settings-drawer-body .ops-block {
  background: #fff;
  border: 1px solid var(--line);
  padding: 0.85rem 0.95rem;
  margin-bottom: 0.85rem;
}

.fold-section {
  background: #fff;
  border: 1px solid var(--line);
  margin-bottom: 0.55rem;
}

.fold-head {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-bottom: 1px solid transparent;
}

.fold-section.open .fold-head {
  border-bottom-color: var(--line);
}

.fold-toggle {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  appearance: none;
  border: none;
  background: transparent;
  text-align: left;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
  padding: 0.7rem 0.75rem;
  cursor: pointer;
}

.fold-toggle:hover { background: #f0f4f6; }

.fold-chevron {
  display: inline-block;
  width: 0.7rem;
  transition: transform 0.15s ease;
  color: var(--muted);
}

.fold-chevron::before { content: "›"; }

.fold-section.open .fold-chevron {
  transform: rotate(90deg);
}

.fold-pin {
  appearance: none;
  border: none;
  border-left: 1px solid var(--line);
  background: transparent;
  width: 2.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  padding: 0;
}

.fold-pin svg {
  display: block;
}

.fold-pin:hover,
.fold-pin.pinned {
  color: var(--ink);
  background: #f4f7f8;
}

.fold-pin.pinned {
  color: var(--accent, #2a7a6a);
}

.fold-section.pinned {
  border-color: #b7ddd4;
}

.fold-body {
  display: none;
  padding: 0.75rem 0.85rem 0.9rem;
}

.fold-section.open .fold-body {
  display: block;
}

.parse-type {
  border-bottom: 1px solid var(--line);
  padding: 0.15rem 0 0.35rem;
}

.parse-type.parse-worker {
  margin-bottom: 0.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

.parse-type.parse-worker .parse-type-label {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.parse-type.parse-worker .parse-type-toggle {
  padding-left: 0;
}

/* Worker 展开区顶满左缘，不跟类型项一样缩进 */
.parse-type.parse-worker .parse-type-detail {
  padding-left: 0;
}

.parse-type.parse-worker .worker-hint {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  line-height: 1.45;
}

.parse-type.parse-worker .worker-field {
  display: grid;
  grid-template-columns: 5.2rem minmax(0, 1fr);
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-top: 0.35rem;
}

.parse-type.parse-worker .worker-field > span {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.3;
}

.parse-type.parse-worker .worker-field select,
.parse-type.parse-worker .worker-field textarea {
  width: 100%;
  min-width: 0;
}

.parse-type.parse-worker .worker-field-stack {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.parse-type.parse-worker .worker-field-stack > span {
  margin-bottom: -0.1rem;
}

.parse-type:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.parse-type-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.parse-type-check {
  margin: 0 !important;
  flex-shrink: 0;
}

.parse-type-toggle {
  appearance: none;
  border: none;
  background: transparent;
  flex: 1 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  padding: 0.35rem 0.2rem;
  font: inherit;
  font-size: 0.86rem;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.parse-type-toggle:hover {
  background: #f0f4f6;
}

.parse-type-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.parse-type-toggle .fold-chevron {
  flex-shrink: 0;
}

.parse-type.open .parse-type-toggle .fold-chevron {
  transform: rotate(90deg);
}

.parse-type-detail {
  display: none;
  padding: 0.15rem 0 0.45rem;
}

.parse-type.open .parse-type-detail {
  display: block;
}

.parse-type-def {
  margin: 0 0 0.45rem;
}

.parse-type-def .kv-line {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  align-items: start;
  gap: 0.35rem 0.5rem;
  margin: 0.2rem 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--ink);
}

.parse-type-def .kv-line > span:first-child {
  flex: unset;
  min-width: 0;
  color: var(--muted);
}

.parse-type-def .kv-line > span:last-child {
  flex: unset;
  min-width: 0;
}

.parse-type-detail .parse-type-field {
  display: grid;
  grid-template-columns: 5.2rem minmax(0, 1fr);
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-top: 0.35rem;
}

.parse-type-detail .parse-type-field > span {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.3;
}

.parse-type-detail .parse-type-field select,
.parse-type-detail .parse-type-field textarea {
  width: 100%;
  min-width: 0;
}

.parse-type-detail .parse-type-field-stack {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.sim-user-actions {
  margin: 0.35rem 0 0.75rem;
}

.persona-list {
  display: grid;
  gap: 0.75rem;
}

.persona-card {
  padding: 0.65rem 0.7rem 0.75rem;
  border: 1px solid var(--line);
  background: #fff;
}

.asset-block + .asset-block {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
  /* 顶部分割线拉满 step-view / col-scroll 宽度（抵消容器 padding） */
  margin-left: -0.85rem;
  margin-right: -0.85rem;
  padding-left: 0.85rem;
  padding-right: 0.85rem;
}

.asset-block + .asset-block.asset-block--no-rule {
  border-top: none;
  padding-top: 0;
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
}

.asset-block h3 {
  margin: 0 0 0.3rem;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
  color: #3d4d57;
}

.asset-block-head {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0 0 0.3rem;
  width: 100%;
}

.asset-block-head h3,
.asset-block-head .shared-chrome-title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
}

.asset-block-head .header-digest-title-row {
  flex: 0 1 auto;
  min-width: 0;
  width: auto;
  max-width: 100%;
}

.asset-block-head .header-digest-title-row .shared-chrome-title {
  flex: 0 0 auto;
  width: fit-content;
  max-width: 100%;
  margin: 0;
}

.asset-block-head .asset-block-action,
.asset-block-head .head-chip {
  flex: 0 0 auto;
  margin-left: auto;
  width: auto;
  max-width: none;
}

.asset-block-head .asset-block-actions,
.asset-block-head .head-chip-group.asset-block-actions {
  margin-left: auto;
  flex: 0 0 auto;
  position: relative;
}

.asset-block-head .asset-block-actions .head-chip {
  margin-left: 0;
}

.asset-block input[type="text"],
.asset-block textarea {
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.45rem 0.55rem;
  background: #fff;
  box-sizing: border-box;
}

.asset-block input[type="text"]:focus,
.asset-block textarea:focus {
  outline: none;
  border-color: var(--primary, #1a6b6b);
}

.asset-block textarea.textarea-autosize {
  resize: none;
  overflow: hidden;
  min-height: 2.2rem;
  line-height: 1.45;
  field-sizing: content;
  white-space: pre-wrap;
  word-break: break-word;
}

.asset-cover-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.45rem;
}

.asset-cover-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.asset-cover-row > .asset-cover-slot {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.asset-cover-row .asset-cover-label {
  flex: 0 0 auto;
  min-height: 1.25em;
  line-height: 1.25;
  margin-bottom: 0.15rem;
  align-self: flex-start;
}

.asset-cover-row .asset-cover-hint {
  flex: 0 0 auto;
  min-height: 2.2em;
  margin-bottom: 0.3rem;
  align-self: flex-start;
}

.asset-cover-slot {
  min-width: 0;
}

.asset-cover-slot--16x9 .asset-cover-preview,
.asset-cover-slot--16x9 .asset-cover-empty {
  aspect-ratio: 16 / 9;
  width: 100%;
  height: auto;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.asset-cover-slot--900x383 {
  flex: 1 1 auto;
  min-width: 0;
}

.asset-cover-slot--900x383 .asset-cover-preview,
.asset-cover-slot--900x383 .asset-cover-empty {
  aspect-ratio: 900 / 383;
  width: 100%;
  height: auto;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

/* 方图：宽度由 --square-cover-size 锁定为正方形（JS 按行宽公式写入） */
.asset-cover-slot--square {
  flex: 0 0 auto;
  width: var(--square-cover-size, 9rem);
  max-width: none;
}

.asset-cover-slot--square .asset-cover-preview,
.asset-cover-slot--square .asset-cover-empty {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  min-height: 0;
  overflow: hidden;
  position: relative;
  box-sizing: border-box;
}

.asset-cover-slot--16x9 .asset-cover-preview img,
.asset-cover-slot--900x383 .asset-cover-preview img,
.asset-cover-slot--square .asset-cover-preview img,
.asset-cover-slot--composite .asset-cover-preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  display: block;
}

.asset-cover-slot--composite .asset-cover-preview,
.asset-cover-slot--composite .asset-cover-empty {
  aspect-ratio: 1283 / 383;
  width: 100%;
  height: auto;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.asset-cover-slot--composite .asset-cover-preview img {
  object-fit: contain;
  background: #0f3d3d;
}

.asset-cover-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  color: #3d4d57;
  margin-bottom: 0.15rem;
}

.asset-cover-hint {
  display: block;
  font-size: 0.76rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
  line-height: 1.35;
}

.img-logo-field {
  margin: 0 0 0.75rem;
}

.img-logo-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #2d404a;
  margin: 0 0 0.35rem;
}

.img-logo-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.img-logo-preview {
  width: 148px;
  height: 52px;
  border: 1px dashed var(--line);
  border-radius: 2px;
  background: #0f1720;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 auto;
}

.img-logo-preview.has-logo {
  border-style: solid;
  background: #0b1220;
}

.img-logo-preview img {
  max-width: 92%;
  max-height: 88%;
  object-fit: contain;
  display: block;
}

.img-logo-preview .hint {
  margin: 0;
  font-size: 0.72rem;
  color: #9aa7b2;
}

.img-logo-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.reading-meta {
  margin: 0.55rem 0 0.75rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.reading-meta--preview {
  margin-top: 0.75rem;
  padding: 0.45rem 0.55rem;
  border: 1px dashed var(--line);
  background: #f7faf9;
}

.draft-display-title {
  margin: 0 0 0.35rem;
}

.draft-display-subtitle {
  margin: 0 0 0.45rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--muted);
  font-weight: 500;
}

.draft-display-digest {
  margin: 0 0 0.75rem;
  font-size: 0.86rem;
  line-height: 1.55;
  /* 单一蓝：亮/暗底都能辨认（贴近公众号「只设一种色」） */
  color: #4a7cc9;
}

.draft-header-zone {
  margin: 0 0 0.85rem;
  padding: 0.55rem 0 0.15rem;
  border-top: 1px solid rgba(45, 64, 74, 0.08);
}

.draft-header-zone .reading-meta {
  margin: 0 0 0.85rem;
}

.draft-header-zone .draft-display-digest {
  margin: 0;
}

.draft-header-zone .reading-meta + .draft-display-digest {
  margin-top: 0;
}

.header-digest-section {
  margin-top: 0.55rem;
  padding-top: 0;
  border-top: none;
}

.header-digest-head {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0 0 0.35rem;
  width: 100%;
}

.header-digest-title-row {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  min-width: 0;
}

.header-digest-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 650;
  color: #2d404a;
  line-height: 1.25;
}

.header-digest-head .asset-block-action {
  flex: 0 0 auto;
  margin-left: auto;
}

.digest-field-wrap {
  position: relative;
}

.digest-field-wrap .digest-field {
  margin: 0;
}

.digest-field-wrap #ex-digest {
  padding-bottom: 1.35rem;
  padding-left: 0.55rem;
  box-sizing: border-box;
}

.digest-count-badge {
  position: absolute;
  left: 0.55rem;
  bottom: 0.4rem;
  z-index: 1;
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.2;
  color: var(--muted);
  pointer-events: none;
  user-select: none;
}

.asset-block-header .reading-meta--preview,
#ex-block-header > .reading-meta--preview {
  margin: 0.35rem 0 0.65rem;
}

.asset-reading-chk {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  color: #3d4d57;
  font-weight: 500;
  cursor: pointer;
}

.asset-reading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  margin: 0.15rem 0 0.7rem;
}

.asset-reading-row .asset-reading-chk {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.asset-reading-row .head-chip {
  flex: 0 0 auto;
}

.shared-chrome-block .asset-reading-chk {
  margin: 0.15rem 0 0.7rem;
}

.shared-chrome-block .asset-reading-row .asset-reading-chk {
  margin: 0;
}

.asset-block--flash {
  animation: asset-block-flash 1.1s ease;
}

@keyframes asset-block-flash {
  0% {
    box-shadow: 0 0 0 0 rgba(26, 107, 107, 0.35);
  }
  35% {
    box-shadow: 0 0 0 3px rgba(26, 107, 107, 0.28);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(26, 107, 107, 0);
  }
}

.draft-cover-wrap {
  margin: 0.55rem 0 0;
  border: 1px solid var(--line);
  overflow: hidden;
  background: #fff;
}

.draft-cover-wrap--empty {
  aspect-ratio: 16 / 9;
  border-style: dashed;
  background: #f7faf9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.86rem;
}

.draft-cover-wrap img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.draft-display-title {
  margin: 0 0 0.55rem;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
}

.draft-display-title + .draft-cover-wrap {
  margin-top: 0;
}

.draft-cover-wrap + .reading-meta,
.draft-display-title + .reading-meta {
  margin-top: 0.55rem;
}

.asset-cover-preview,
.asset-cover-empty {
  margin-top: 0;
  border: 1px solid var(--line);
  background: #fff;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* 未指定比例的槽位（如微信拼图）保留基础高度 */
.asset-cover-slot:not([class*="asset-cover-slot--"]) .asset-cover-preview,
.asset-cover-slot:not([class*="asset-cover-slot--"]) .asset-cover-empty {
  min-height: 6.5rem;
}

.asset-cover-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asset-cover-empty {
  color: var(--muted);
  font-size: 0.86rem;
  text-align: center;
  padding: 0.75rem;
}

.asset-footer-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.45rem;
}

.asset-footer-image .asset-cover-empty {
  min-height: 6.5rem;
}

.asset-footer-image-frame {
  position: relative;
  border: 1px solid var(--line);
  background: #fff;
  overflow: hidden;
  width: 100%;
}

.asset-footer-image-frame .asset-cover-preview,
.asset-footer-image-frame .asset-cover-empty {
  border: none;
}

.asset-footer-image-frame .asset-cover-empty {
  min-height: 6.5rem;
}

.asset-footer-image-frame.has-image .asset-cover-preview {
  min-height: 0;
  display: block;
  line-height: 0;
}

.asset-footer-image-frame.has-image .asset-cover-preview img {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
}

.asset-footer-image-actions {
  position: absolute;
  inset: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin: 0;
  background: rgba(247, 250, 249, 0.82);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.asset-footer-image-frame:hover .asset-footer-image-actions,
.asset-footer-image-frame:focus-within .asset-footer-image-actions {
  opacity: 1;
  pointer-events: auto;
}

.asset-file-btn {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  margin: 0;
}

.asset-file-name {
  display: block;
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
}

.shared-chrome-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  margin: 0 0 0.35rem;
  flex-wrap: nowrap;
  width: 100%;
}

.shared-chrome-head > .shared-chrome-title,
.asset-block .shared-chrome-head > .shared-chrome-title,
.block .shared-chrome-head > .shared-chrome-title {
  display: block;
  flex: 0 0 auto;
  width: fit-content;
  max-width: 45%;
  margin: 0;
  line-height: 1.25;
}

.shared-chrome-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.35rem;
}

.shared-chrome-title .head-chip {
  letter-spacing: 0.02em;
  font-weight: 600;
}

.shared-chrome-head.asset-block-head {
  flex-wrap: nowrap;
  align-items: center;
}

.shared-chrome-head.asset-block-head .shared-chrome-title {
  flex: 1 1 auto;
  min-width: 0;
}

.shared-chrome-head.asset-block-head .header-digest-title-row .shared-chrome-title {
  flex: 0 0 auto;
  width: fit-content;
  margin: 0;
}

.shared-chrome-meta,
.shared-chrome-head .shared-chrome-meta.hint {
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--muted);
  text-align: right;
  flex: 1 1 auto;
  min-width: 0;
}

.shared-chrome-rule {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  user-select: none;
}

.shared-chrome-rule::before,
.shared-chrome-rule::after {
  content: "";
  flex: 1 1 auto;
  height: 0;
  border-top: 1px dashed var(--line);
}

.shared-chrome-rule span {
  flex: 0 0 auto;
  color: #5a7a78;
  font-weight: 500;
}

.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;
}

.footer-shared-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
  margin: 0 0 0.55rem;
}

.footer-shared-bar .hint {
  flex: 1 1 12rem;
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.4;
}

.footer-format-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.15rem 0 0;
}

.footer-format-bar .btn-sm {
  padding: 0.22rem 0.55rem;
  font-size: 0.8rem;
}

.reply-keyword-panel {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.reply-keyword-card {
  border: 1px dashed var(--line);
  background: #f7faf9;
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.reply-keyword-row {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  gap: 0.55rem;
  align-items: start;
}

.reply-keyword-k {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.55;
  padding-top: 0.05rem;
}

.reply-keyword-code {
  font-size: 0.86rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #1a5c5c;
  background: #e8f2f0;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  width: fit-content;
}

.reply-keyword-tip {
  font-size: 0.86rem;
  color: #3d4d57;
  line-height: 1.55;
}

.draft-footer {
  margin: 1.35rem 0 0.35rem;
  padding: 1.1rem 0 0.2rem;
  border-top: 1px solid var(--line);
  text-align: center;
  color: #5a6a72;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.7;
}

.draft-footer-line {
  margin: 0;
  padding: 0 0.35rem;
  text-align: center;
  font-weight: 700;
}

.draft-footer-line--blank {
  height: 0.85rem;
}

.draft-footer-line--center {
  text-align: center;
}

.draft-footer-hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0.75rem auto;
  width: 42%;
}

/* 模拟公众号正文通栏：页脚图与文章同宽 */
.draft-footer-image {
  margin: 0.9rem 0 0;
  width: 100%;
  max-width: none;
  overflow: hidden;
  border-radius: 6px;
  line-height: 0;
}

.draft-footer-image img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.draft-ad {
  margin: 1.25rem 0 0.25rem;
  padding: 1rem 0 0.15rem;
  border-top: 1px dashed rgba(0, 0, 0, 0.1);
}

.draft-ad-lead {
  margin: 0 0 0.55rem;
  font-size: 0.88rem;
  line-height: 1.65;
  color: #4a7cc9;
  font-weight: 700;
  text-align: center;
}

.draft-reply-tip {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  line-height: 1.65;
  color: #4a7cc9;
  font-weight: 700;
  text-align: center;
}

.draft-ad .draft-reply-tip {
  margin: 0 0 0.75rem;
}

.draft-reply-tip + .draft-footer {
  margin-top: 0.85rem;
}

.draft-ad-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.draft-ad-thumb {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: zoom-in;
  overflow: hidden;
}

.draft-ad-thumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  object-position: center top;
  background: transparent;
}

.draft-ad-thumb-label {
  display: none;
}

.ad-slot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-top: 0.55rem;
}

.ad-slot-frame {
  min-height: 5.5rem;
  border: 1px dashed var(--line);
  background: #f3f5f6;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
  overflow: hidden;
}

.ad-slot-frame.has-image {
  border-style: solid;
  background: #f3f5f6;
}

.ad-slot-frame img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 8rem;
  object-fit: contain;
  object-position: center top;
}

.ad-slot-empty {
  font-size: 0.75rem;
  color: var(--muted);
}

.ad-slot-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-top: 0.28rem;
}

.ad-slot-label {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}

.ad-slot-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.65rem;
  flex-wrap: wrap;
}

.media-lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10080;
  background: rgba(14, 20, 25, 0.72);
}

.media-lightbox-backdrop.hidden,
.media-lightbox.hidden,
.ad-image-picker.hidden {
  display: none;
}

.media-lightbox {
  position: fixed;
  z-index: 10090;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(920px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 1rem;
  background: #111;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
  overflow: auto;
}

.media-lightbox img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 6rem);
  object-fit: contain;
  margin: 0 auto;
}

.media-lightbox-cap {
  margin: 0.55rem 0 0;
  color: #d7e0e6;
  font-size: 0.82rem;
  text-align: center;
}

.media-lightbox-close {
  position: absolute;
  top: 0.35rem;
  right: 0.45rem;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.ad-image-picker {
  position: fixed;
  inset: 0;
  z-index: 10085;
  background: rgba(14, 20, 25, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.ad-image-picker-card {
  width: min(36rem, 100%);
  max-height: min(80vh, 40rem);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  padding: 0.85rem 0.95rem 1rem;
  box-shadow: 0 14px 40px rgba(14, 20, 25, 0.18);
}

.ad-image-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.ad-image-picker-head h4 {
  margin: 0;
  font-size: 0.95rem;
}

.ad-image-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.ad-image-pick-item {
  border: 1px solid var(--line);
  background: #fff;
  padding: 0;
  cursor: pointer;
  text-align: center;
}

.ad-image-pick-item img {
  display: block;
  width: 100%;
  height: 4.5rem;
  object-fit: cover;
}

.ad-image-pick-item span {
  display: block;
  padding: 0.2rem;
  font-size: 0.7rem;
  color: var(--muted);
}

@media (max-width: 720px) {
  .asset-cover-row {
    flex-direction: column;
  }

  .asset-cover-slot--square {
    width: 8rem;
    max-width: 100%;
  }
}

.asset-export-actions {
  opacity: 0.95;
}

.fold-body .field + .field {
  margin-top: 0.55rem;
}

.settings-drawer-body .field {
  margin-top: 0.55rem;
}

.settings-drawer-body .field span {
  font-size: 0.78rem;
}

.settings-drawer-body input[type="url"],
.settings-drawer-body input[type="password"],
.settings-drawer-body input[type="text"],
.settings-drawer-body input[type="number"],
.settings-drawer-body select,
.settings-drawer-body textarea {
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.45rem 0.55rem;
  background: #fff;
  box-sizing: border-box;
}

.settings-drawer-body textarea {
  min-height: 6.5rem;
  line-height: 1.45;
}

.settings-drawer-body input[type="url"]:focus,
.settings-drawer-body input[type="password"]:focus,
.settings-drawer-body input[type="text"]:focus,
.settings-drawer-body input[type="number"]:focus,
.settings-drawer-body select:focus,
.settings-drawer-body textarea:focus {
  outline: none;
  border-color: var(--primary, #1a6b6b);
}

.settings-drawer-body .field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-top: 0.55rem;
}

.settings-drawer-body .field-row.hidden {
  display: none;
}

.settings-drawer-body .field-row .field {
  margin-top: 0;
}

.char-range-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.char-range-row input[type="number"] {
  width: 5.5rem;
  flex: 0 0 auto;
}

.char-range-sep,
.char-range-unit {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.cover-size-spec {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  background: #f7faf9;
}

.cover-size-spec-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.82rem;
  line-height: 1.4;
}

.cover-size-name {
  color: #3d4d57;
  font-weight: 500;
  flex-shrink: 0;
}

.cover-size-meta {
  color: var(--muted);
  text-align: right;
}

.wx-ip-display {
  margin-top: 0.3rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #f7faf9;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9rem;
  color: var(--ink);
  word-break: break-all;
}

.wx-ip-display.ok {
  border-color: rgba(26, 107, 107, 0.35);
}

.wx-ip-display.err {
  color: #8a3b2a;
}

.wx-ip-whitelist-hint {
  margin: 0.45rem 0 0.75rem;
  line-height: 1.55;
}

.btn-link {
  display: inline;
  padding: 0;
  margin: 0 0.1rem;
  border: none;
  background: none;
  color: var(--primary, #1a6b6b);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}

.btn-link:hover {
  opacity: 0.85;
}

.secret-input-row {
  display: flex;
  align-items: stretch;
  gap: 0.4rem;
}

.secret-input-row input {
  flex: 1;
  min-width: 0;
}

.secret-input-row .btn {
  flex-shrink: 0;
  white-space: nowrap;
  padding-left: 0.7rem;
  padding-right: 0.7rem;
}

#parse-llm-status.ok,
#step-llm-status.ok,
#img-gen-status.ok {
  color: var(--accent);
}

.col-head h3 {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.col-tag {
  font-size: 0.72rem;
  color: var(--muted);
}

.col-scroll,
.ops-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.85rem;
  scrollbar-gutter: stable;
}

.ops-scroll {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.ops-scroll-main {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.85rem;
}

.ops-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.ops-actions.hidden {
  display: none;
}

.ops-package-hint {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.ops-char-range-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
}

.ops-char-range-field > span {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted, #66736e);
}

.ops-char-range-field .char-range-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: nowrap;
}

.ops-char-range-field .char-range-row input[type="number"] {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  padding: 0.4rem 0.45rem;
  font-size: 0.85rem;
}

.ops-char-range-field .char-range-sep,
.ops-char-range-field .char-range-unit {
  flex: 0 0 auto;
  font-size: 0.75rem;
  color: var(--muted, #66736e);
  white-space: nowrap;
}

.insight-results-panel {
  padding: 0 1.15rem 0.25rem;
}

.insight-results-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: min(42vh, 22rem);
  overflow: auto;
  padding-right: 0.15rem;
}

.insight-result-card {
  border: 1px solid color-mix(in srgb, var(--reader-border, #1a7a6d) 35%, #e6ebe8);
  background: var(--reader-soft, #f6f8f7);
  border-left: 3px solid var(--reader-border, #1a7a6d);
  padding: 0.7rem 0.8rem 0.8rem;
  cursor: pointer;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.insight-result-card:hover {
  border-color: color-mix(in srgb, var(--reader-border, #1a7a6d) 55%, #cfd8d4);
}

.insight-result-card.is-selected {
  box-shadow: 0 0 0 2px rgba(31, 122, 92, 0.28);
  background: color-mix(in srgb, var(--reader-soft, #f6f8f7) 70%, #fff);
}

.insight-result-pick-hint {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.insight-result-foot {
  margin-top: 0.55rem;
  display: flex;
  justify-content: flex-end;
}

.insight-once-feedback-wrap {
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  opacity: 0.72;
  transition: opacity 0.15s ease;
}

.insight-once-feedback-wrap.is-ready {
  opacity: 1;
}

.insight-once-feedback-wrap .panel-section-title {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
}

.insight-result-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.55rem;
}

.insight-result-avatar {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  background: var(--reader-accent, #1a7a6d);
}

.insight-result-who {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.insight-result-who strong {
  font-size: 0.88rem;
  color: var(--reader-accent, #1a7a6d);
}

.insight-result-who span {
  font-size: 0.72rem;
  color: #6a757c;
}

.insight-result-badge {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 650;
  color: #1f6b52;
  background: rgba(31, 107, 82, 0.12);
  padding: 0.15rem 0.4rem;
}

.insight-result-claim {
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.45;
  color: #1c2429;
  margin-bottom: 0.45rem;
}

.insight-result-row {
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  gap: 0.35rem 0.5rem;
  margin-top: 0.35rem;
}

.insight-result-row span {
  font-size: 0.7rem;
  font-weight: 650;
  color: #7a858c;
  padding-top: 0.12rem;
}

.insight-result-row p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #2a3338;
  white-space: pre-wrap;
}

.insight-feedback-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: min(58vh, 28rem);
  overflow: auto;
  padding-right: 0.15rem;
}

.insight-feedback-card {
  border: 1px solid #e2e7ea;
  background: #f7f9fa;
  padding: 0.65rem 0.75rem 0.75rem;
}

.insight-feedback-card--draft {
  border-style: dashed;
  background: #fffdf6;
}

.insight-feedback-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.4rem;
}

.insight-feedback-meta {
  flex: 1;
  min-width: 0;
}

.insight-feedback-del {
  margin-left: auto;
  flex-shrink: 0;
  width: 1.55rem;
  height: 1.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #8a9399;
  cursor: pointer;
  padding: 0;
}

.insight-feedback-del:hover {
  background: rgba(180, 50, 50, 0.1);
  color: #b42318;
}


.insight-results-feedback-block {
  margin-top: 1.15rem;
  padding-top: 0.85rem;
  border-top: 1px solid #e2e7ea;
}

.insight-results-feedback-block .panel-section-title {
  margin: 0 0 0.35rem;
}

.insight-feedback-mode {
  font-size: 0.68rem;
  font-weight: 650;
  padding: 0.12rem 0.4rem;
  background: rgba(70, 110, 150, 0.14);
  color: #355a78;
}

.insight-feedback-mode--feedback {
  background: rgba(40, 120, 95, 0.14);
  color: #1f6b52;
}

.insight-feedback-mode--instruct {
  background: rgba(180, 100, 40, 0.14);
  color: #9a4e1c;
}

.insight-feedback-mode--ask {
  background: rgba(70, 110, 150, 0.14);
  color: #355a78;
}

.insight-feedback-mode--adopt {
  background: rgba(40, 120, 95, 0.16);
  color: #1f6b52;
}

.insight-feedback-mode--note {
  background: rgba(160, 120, 40, 0.14);
  color: #7a5a18;
}

.insight-feedback-meta {
  font-size: 0.7rem;
  color: #8a9399;
}

.insight-feedback-text {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.5;
  color: #1c2429;
  white-space: pre-wrap;
}

.insight-feedback-note {
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #5a4a28;
  background: rgba(247, 243, 234, 0.9);
  padding: 0.35rem 0.45rem;
  white-space: pre-wrap;
}

.insight-global-feedback {
  margin: 0 0 0.25rem;
  padding: 0.7rem 0.75rem 0.8rem;
  background: #f4f7f5;
  border: 1px solid #d7e2dc;
}

.insight-global-feedback-title {
  margin: 0 0 0.35rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #1f6b52;
}

.insight-global-feedback-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #c5d4cc;
  background: #fff;
  color: #1c2429;
  font: inherit;
  font-size: 0.86rem;
  line-height: 1.5;
  padding: 0.55rem 0.65rem;
  resize: vertical;
  min-height: 5rem;
}

.insight-global-feedback-input:focus {
  outline: none;
  border-color: rgba(31, 107, 82, 0.55);
  box-shadow: 0 0 0 2px rgba(31, 107, 82, 0.12);
}

.plan-guidance-box {
  margin: 0.75rem 0 1rem;
  padding: 0.75rem 0.85rem;
  background: #f4f7f5;
  border: 1px solid #d7e2dc;
}

.plan-guidance-box--empty {
  background: #f7f8f9;
  border-style: dashed;
}

.plan-guidance-title {
  margin: 0 0 0.3rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #1f6b52;
}

.plan-guidance-text {
  margin: 0;
  white-space: pre-wrap;
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #2a3338;
  max-height: 14rem;
  overflow: auto;
}

.wx-msg-annotation {
  margin-top: 0.45rem;
  padding-top: 0.4rem;
  border-top: 1px dashed rgba(120, 130, 138, 0.35);
}

.wx-msg-annotation-label {
  font-size: 0.7rem;
  font-weight: 650;
  color: #7a5a18;
  margin-bottom: 0.2rem;
}

.wx-msg-annotation-text {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #5a4a28;
  white-space: pre-wrap;
}

.wx-msg-annotation-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(160, 130, 60, 0.35);
  background: #fffdf6;
  color: #2a3338;
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.45;
  padding: 0.4rem 0.5rem;
  resize: vertical;
  min-height: 3.2rem;
}

.wx-msg-annotation-input:focus {
  outline: none;
  border-color: rgba(160, 130, 60, 0.65);
  box-shadow: 0 0 0 2px rgba(184, 149, 42, 0.15);
}

.wx-msg.is-selected .wx-bubble--combo,
.wx-msg.is-selected .wx-bubble--speak {
  box-shadow: 0 0 0 2px rgba(31, 122, 92, 0.28);
}

.ops-action-row {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.ops-action-btn {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  padding: 0.7rem 0.85rem;
  line-height: 1.35;
}

.ops-action-row .ops-action-btn,
.ops-action-row .ops-action-more {
  border-radius: 0;
}

.ops-action-row .ops-action-btn {
  flex: 1;
  min-width: 0;
}

.ops-action-row .ops-action-btn + .ops-action-more {
  border-left: none;
  margin-left: -1px;
}

.ops-action-more {
  align-self: stretch;
  aspect-ratio: 1;
  width: auto;
  height: auto;
  min-width: 0;
  flex: 0 0 auto;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: #fff;
  box-sizing: border-box;
}

.ops-action-more svg {
  width: 14px;
  height: 14px;
  display: block;
}

.ops-action-more:hover {
  color: var(--ink);
  background: #f4f7f8;
}

.ops-scroll-footer {
  flex-shrink: 0;
  padding: 0.75rem 0.85rem 0.95rem;
  border-top: 1px solid var(--line);
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ops-scroll-footer.hidden {
  display: none;
}

.ops-transfer-btn {
  width: 100%;
  min-height: 2.6rem;
  justify-content: center;
}

.ops-transfer-btn.hidden {
  display: none;
}

.ops-confirm-btn {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  text-align: left;
  white-space: normal;
  line-height: 1.35;
  min-height: 3.25rem;
  padding: 0.7rem 0.9rem;
}

.ops-confirm-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  min-width: 0;
  flex: 1;
}

.ops-confirm-main {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
}

.ops-confirm-sub {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0.92;
}

.ops-confirm-arrow {
  flex-shrink: 0;
  opacity: 0.95;
}

.col-source .doc-text,
.col-result .doc-text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--ink);
}

.col-source .doc-text {
  color: #3d4d57;
}

.source-doc {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.source-doc-text {
  margin: 0;
}

.source-media {
  margin: 0.15rem 0;
}

.source-media.unit-figure-wrap {
  margin: 0.25rem 0;
  padding: 0.45rem;
  background: #f7fafb;
  border: 1px solid var(--line);
}

.source-media .unit-figure {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
}

.source-media-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
  padding: 0.75rem;
  border: 1px dashed #b7c4cc;
  background: #f4f7f8;
  color: var(--muted);
  font-size: 0.82rem;
}

.source-media-extra {
  margin-top: 0.35rem;
  padding-top: 0.55rem;
  border-top: 1px dashed var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.ops-block {
  padding-bottom: 1rem;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.ops-block:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.ops-help {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.5;
}

.ops-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
  align-items: center;
}

.llm-test-row {
  margin: 0.15rem 0 0.1rem;
}

.hint.ok {
  color: #1a7a6d;
}

.hint.bad {
  color: var(--danger, #b42318);
}

.ops-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.ops-block .chk { margin-top: 0.45rem; }

.chat-log {
  margin-top: 0.65rem;
  display: grid;
  gap: 0.4rem;
}

.chat-bubble {
  font-size: 0.82rem;
  line-height: 1.45;
  padding: 0.45rem 0.55rem;
  border-left: 2px solid var(--line);
  color: #3d4d57;
}

.chat-bubble.user { border-left-color: var(--primary); }
.chat-bubble.agent { border-left-color: var(--accent); }

/* 左栏底部：指令 / 工作日志（高度与右侧 ops-confirm-footer 同步） */
.source-worklog {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 5.375rem;
  border-top: 1px solid var(--line);
  background: #eef2f4;
  color: var(--ink);
  overflow: hidden;
}

.col-source.is-worklog-expanded #source-view {
  display: none;
}

.col-source.is-worklog-expanded .source-worklog {
  flex: 1 1 auto;
  min-height: 0;
  height: auto !important;
  border-top: none;
}

.source-worklog-toggle {
  position: absolute;
  top: 0.2rem;
  right: 0.25rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: none;
  border-radius: 0.25rem;
  background: transparent;
  color: #5a6a72;
  cursor: pointer;
}

.source-worklog-toggle:hover {
  background: rgba(45, 62, 70, 0.08);
  color: var(--ink);
}

.source-worklog-chevron {
  display: block;
  transition: transform 0.18s ease;
}

.source-worklog.is-expanded .source-worklog-chevron {
  transform: rotate(180deg);
}

.source-worklog-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0.45rem 1.9rem 0.55rem 0.7rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.68rem;
  line-height: 1.45;
  background: #eef2f4;
}

.work-log-empty {
  color: var(--muted);
  padding: 0.15rem 0;
}

.work-log-line {
  display: block;
  padding: 0.2rem 0;
  border-bottom: 1px solid rgba(21, 32, 40, 0.05);
  line-height: 1.45;
}

.work-log-time,
.work-log-lvl,
.work-log-who {
  display: inline;
  margin-right: 0.35em;
  white-space: nowrap;
}

.work-log-time {
  color: var(--muted);
}

.work-log-lvl {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.work-log-who {
  color: #6a7a82;
}

.work-log-text {
  display: inline;
  color: var(--ink);
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;
}

/* 默认折叠：整行单行省略 */
.source-worklog:not(.is-expanded) .work-log-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.source-worklog:not(.is-expanded) .work-log-text {
  white-space: nowrap;
}

/* 展开：连续段落，仅按宽度软换行（终端风） */
.source-worklog.is-expanded .work-log-line {
  white-space: normal;
}

.source-worklog.is-expanded .work-log-text {
  white-space: normal;
}

.work-log-line--info .work-log-lvl { color: #3d7a8c; }
.work-log-line--ok .work-log-lvl { color: #1a7a6d; }
.work-log-line--err .work-log-lvl { color: #b42318; }
.work-log-line--cmd .work-log-lvl { color: #9a6b12; }
.work-log-line--err .work-log-text { color: #8a2f28; }
.work-log-line--cmd .work-log-text { color: #6b5310; }

.work-log-line--live {
  background: rgba(26, 122, 109, 0.08);
  border-left: 2px solid rgba(26, 122, 109, 0.55);
  padding-left: 0.35rem;
}

.work-log-line--live .work-log-lvl {
  color: #1a7a6d;
  font-weight: 700;
}

.work-log-line--live .work-log-text {
  color: var(--ink);
}

@media (max-width: 1100px) {
  .workspace-panel {
    height: auto;
    min-height: calc(100vh - 58px);
    overflow: visible;
  }
  .tri-layout {
    grid-template-columns: 1fr;
    border: none;
  }
  .col {
    border: 1px solid var(--line);
    margin-bottom: 0.65rem;
    max-height: 420px;
  }
  .col-ops { max-height: none; }
}

.page-head {
  padding: 0 0 1rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.25rem;
}

.overview-panel {
  padding: 0;
  max-width: none;
  height: calc(100vh - 3.25rem);
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.overview-docs {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(12rem, 15.5rem) minmax(0, 1fr);
  border-top: 1px solid var(--line);
}

.overview-docs-nav {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #eef2f4;
}

.overview-docs-mode {
  position: relative;
  flex-shrink: 0;
  padding: 0.65rem 0.7rem;
  border-bottom: 1px solid var(--line);
}

.overview-docs-mode-btn {
  appearance: none;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.overview-docs-mode-btn:hover,
.overview-docs-mode-btn[aria-expanded="true"] {
  border-color: #9eb0bc;
  background: #f8fafb;
}

.overview-docs-mode-caret {
  flex-shrink: 0;
  opacity: 0.7;
}

.overview-docs-mode-menu {
  position: absolute;
  left: 0.7rem;
  right: 0.7rem;
  top: calc(100% - 0.15rem);
  z-index: 20;
  padding: 0.25rem;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.1);
}

.overview-docs-mode-menu.hidden {
  display: none;
}

.overview-docs-mode-item {
  appearance: none;
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.84rem;
  text-align: left;
  padding: 0.45rem 0.55rem;
  cursor: pointer;
}

.overview-docs-mode-item:hover {
  background: #f2f6f8;
}

.overview-docs-mode-item.active {
  color: var(--primary);
  font-weight: 600;
  background: var(--accent-soft);
}

.overview-docs-toc {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.45rem 0.4rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.overview-docs-toc-group {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}

.overview-docs-toc-item {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  text-align: left;
  padding: 0.48rem 0.65rem;
  cursor: pointer;
  border-left: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  width: 100%;
}

.overview-docs-toc-item.is-child {
  padding-left: 1.35rem;
  font-size: 0.82rem;
  font-weight: 450;
}

.overview-docs-toc-item:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
}

.overview-docs-toc-item.active {
  color: var(--primary);
  font-weight: 650;
  background: #fff;
  border-left-color: var(--primary);
}

.overview-docs-toc-group.has-active > .overview-docs-toc-item.is-group:not(.active) {
  color: var(--ink);
  font-weight: 600;
}

.overview-docs-toc-label {
  min-width: 0;
  flex: 1;
  text-align: left;
}

.overview-docs-toc-caret {
  flex-shrink: 0;
  opacity: 0.55;
  transition: transform 0.15s ease;
}

.overview-docs-toc-group.is-open > .overview-docs-toc-item.is-group .overview-docs-toc-caret {
  transform: rotate(180deg);
}

.overview-docs-toc-children {
  display: flex;
  flex-direction: column;
  gap: 0.06rem;
  padding: 0 0 0.2rem;
}

.overview-docs-toc-children.hidden {
  display: none;
}

.overview-docs-stub {
  margin: 0.75rem 0 0;
  display: inline-block;
  padding: 0.28rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #7a5c00;
  background: #fff6d6;
  border: 1px solid #ead7a0;
}

.overview-docs-main {
  min-height: 0;
  overflow: auto;
  padding: 1.35rem 1.75rem 2.5rem;
  background: #fff;
}

.overview-docs-main h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 600;
  color: var(--ink);
}

.overview-docs-head {
  max-width: 44rem;
  margin-bottom: 0.35rem;
}

.overview-docs-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: none;
}

.overview-docs-main .lead {
  margin: 0.55rem 0 0;
  max-width: 44rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.overview-docs-section {
  margin-top: 1.35rem;
  max-width: 44rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.overview-docs-section h3 {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--primary);
}

.overview-docs-section p {
  margin: 0 0 0.55rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ink);
}

.overview-docs-section p:last-child {
  margin-bottom: 0;
}

.overview-docs-list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.6;
}

.overview-docs-list.is-ol {
  padding-left: 1.25rem;
}

.overview-docs-callout {
  margin: 0.65rem 0 0;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  background: #f6f8fa;
}

.overview-docs-callout strong {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 0.25rem;
  color: var(--muted);
}

.overview-docs-callout p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--ink);
}

.overview-docs-callout.is-info {
  border-color: #c5d4e0;
  background: #f3f7fb;
}

.overview-docs-callout.is-tip {
  border-color: #c5ddd4;
  background: #f3faf6;
}

.overview-docs-callout.is-tip strong {
  color: var(--accent);
}

.overview-docs-callout.is-warn {
  border-color: #e6d2a8;
  background: #fff9ef;
}

.overview-docs-callout.is-warn strong {
  color: #8a5a00;
}

.overview-docs-table-wrap {
  margin-top: 0.45rem;
  overflow-x: auto;
  border: 1px solid var(--line);
}

.overview-docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.overview-docs-table th,
.overview-docs-table td {
  padding: 0.55rem 0.7rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  line-height: 1.45;
}

.overview-docs-table th {
  background: #f4f7f8;
  font-weight: 650;
  color: var(--ink);
  white-space: nowrap;
}

.overview-docs-table tr:last-child td {
  border-bottom: none;
}

.overview-docs-table td:first-child {
  font-weight: 600;
  white-space: nowrap;
  color: var(--primary);
}

.overview-docs-section.is-agent {
  background: #f4f8f7;
  border: 1px solid #d5e4df;
  border-top-color: #d5e4df;
  padding: 0.85rem 0.95rem 0.95rem;
  margin-top: 1.5rem;
}

.overview-docs-section.is-agent h3 {
  color: var(--accent);
}

.overview-docs-section.is-agent .overview-docs-list {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.55;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 26rem);
  gap: 1.75rem 2rem;
  align-items: stretch;
  min-height: calc(100vh - 5.5rem);
}

.overview-grid--solo {
  grid-template-columns: minmax(0, 1fr);
  max-width: 52rem;
}

.guide-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.85rem;
}

.guide-steps li {
  display: grid;
  gap: 0.2rem;
  padding: 0.75rem 0 0.75rem 0.9rem;
  border-left: 2px solid var(--line);
}

.guide-steps strong {
  font-size: 0.92rem;
  color: var(--ink);
  font-weight: 600;
}

.guide-steps span {
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.5;
}

.guide-rules {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.guide-rules ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.guide-rules li + li {
  margin-top: 0.35rem;
}

.overview-work {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 1rem 1.15rem 1.25rem;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  min-height: 0;
  align-self: stretch;
}

.overview-work .flat-section {
  margin-bottom: 0;
  border-bottom: none;
}

.overview-new {
  padding-bottom: 1rem;
  flex-shrink: 0;
}

.overview-archive {
  padding-top: 0.85rem;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.new-project-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.new-project-name {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.5rem 0.65rem;
  background: #fff;
  font: inherit;
  color: var(--ink);
}

.new-project-name:focus {
  outline: none;
  border-color: var(--primary, #1a6b6b);
}

.new-project-row .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.archive-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.archive-head .flat-title {
  margin: 0;
}

.btn-icon-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}

.btn-icon-only:hover {
  color: var(--primary, #1a6b6b);
  border-color: var(--primary, #1a6b6b);
}

.btn-sm {
  padding: 0.28rem 0.65rem;
  font-size: 0.78rem;
}

.project-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
  align-content: start;
}

.project-list-empty {
  color: var(--muted);
  font-size: 0.88rem;
  padding: 0.75rem 0;
}

.project-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem 0.75rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  background: #fff;
  align-items: center;
}

.project-card.active {
  border-color: var(--primary, #1a6b6b);
}

.project-card-main {
  min-width: 0;
}

.project-card-title-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.project-card-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1 1 auto;
}

.project-mode-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  max-width: 4.8rem;
  padding: 0.1rem 0.35rem;
  border: 1px solid rgba(120, 170, 210, 0.35);
  background: rgba(80, 140, 190, 0.18);
  color: #8ec3e8;
  font-size: 0.65rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-card-meta {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.project-card-progress {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.5rem;
  min-width: 0;
}

.project-progress-bar {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  flex: 1 1 auto;
  min-width: 0;
  height: 0.42rem;
}

.project-progress-seg {
  display: block;
  height: 100%;
  background: rgba(255, 255, 255, 0.12);
}

.project-progress-seg.is-done {
  background: linear-gradient(90deg, #3d8fd4, #5eb0ef);
}

.project-progress-count {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 600;
  color: #8fa3b0;
  font-variant-numeric: tabular-nums;
}

/* 侧栏项目卡：深蓝底，与侧栏统一 */
.menu-sidebar-work .project-card {
  background: #1a2834;
  border-color: rgba(110, 168, 210, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.menu-sidebar-work .project-card.active {
  background: #1e3344;
  border-color: rgba(110, 180, 230, 0.55);
  box-shadow: 0 0 0 1px rgba(94, 176, 239, 0.18);
}

.menu-sidebar-work .project-card-title {
  color: #e8eef2;
}

.menu-sidebar-work .project-card-meta {
  color: #8fa3b0;
}

.menu-sidebar-work .project-card-actions .btn.ghost,
.menu-sidebar-work .project-more-btn {
  color: #9eb0ba;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
}

.menu-sidebar-work .project-card-actions .btn.ghost:hover,
.menu-sidebar-work .project-more-btn:hover {
  color: #e8eef2;
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
}

.project-card-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.project-card-actions .btn-sm {
  height: 2rem;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.75rem;
  line-height: 1;
}

.project-more-wrap {
  position: relative;
}

.project-more-btn {
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.project-more-btn .project-more-icon {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
}

.menu-sidebar-work .project-more-btn .project-more-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.project-more-btn[aria-expanded="true"] {
  color: var(--ink);
  background: rgba(26, 107, 107, 0.08);
}

.project-more-menu {
  position: absolute;
  top: calc(100% + 0.25rem);
  right: 0;
  z-index: 20;
  min-width: 6.5rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.project-more-menu.hidden {
  display: none;
}

.project-more-item {
  display: block;
  width: 100%;
  padding: 0.45rem 0.65rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  font: inherit;
  font-size: 0.85rem;
  color: var(--ink);
  cursor: pointer;
}

.project-more-item:hover {
  background: rgba(15, 23, 42, 0.05);
}

.project-more-item.danger {
  color: #b42318;
}

.project-more-item.danger:hover {
  background: rgba(180, 35, 24, 0.08);
}

@media (max-width: 960px) {
  .overview-grid {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .overview-panel {
    height: auto;
    min-height: calc(100vh - 3.25rem);
    overflow: visible;
  }

  .overview-docs {
    grid-template-columns: 1fr;
    min-height: calc(100vh - 3.25rem);
  }

  .overview-docs-nav {
    border-right: none;
    border-bottom: 1px solid var(--line);
    max-height: none;
  }

  .overview-docs-toc {
    display: flex;
    flex-direction: column;
    max-height: min(42vh, 22rem);
    overflow: auto;
  }

  .project-list {
    max-height: none;
  }
}

.page-head h2 {
  margin: 0.2rem 0 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
}

.eyebrow {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.lead, .page-desc {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 44rem;
}

.flat-section {
  padding: 0 0 1.35rem;
  margin-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
}

.flat-section:last-child { border-bottom: none; }

.flat-title, .block h3 {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.flat-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-bottom: 0.5rem;
}

.block {
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
}

.block p.desc {
  margin: -0.35rem 0 0.85rem;
  color: var(--muted);
  font-size: 0.86rem;
}

/* 平铺网格：条目横铺，无卡片壳 */
.cards,
.profile-grid,
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.card-item,
.list-check label,
.score-cell {
  margin: 0;
  border: none;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 0.95rem 1rem;
  box-shadow: none;
}

.card-item.selected {
  background: rgba(31, 78, 121, 0.06);
  box-shadow: inset 3px 0 0 var(--primary);
}

.card-item h4 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  font-family: var(--font-display);
}

.section-plan {
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 0.85rem 0;
  margin: 0;
}

.section-plan:first-of-type { border-top: 1px solid var(--line); }
.section-plan h4 { margin: 0 0 0.45rem; font-size: 0.95rem; }

.plan-doc {
  padding: 0.15rem 0.1rem 1.2rem;
}

.plan-doc-head {
  margin: 0 0 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
}

.plan-doc-title {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
}

.plan-doc-lead {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
}

.plan-spine {
  display: grid;
  gap: 0.3rem;
  margin: 0 0 0.85rem;
}

.plan-spine-label,
.plan-field-label {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  color: var(--accent, #1a7a6d);
}

.plan-field {
  display: grid;
  gap: 0.22rem;
  margin: 0.35rem 0 0;
}

.plan-field-check .plan-field-label {
  color: #5a6a72;
}

.plan-field-check .plan-doc-retell,
.plan-field-check .plan-doc-trust {
  border: 1px dashed color-mix(in srgb, var(--line) 80%, #8a9aa3);
  background: color-mix(in srgb, #f4f7f8 70%, #fff);
}

.plan-doc-spine,
.plan-doc-label,
.plan-doc-say,
.plan-doc-retell,
.plan-doc-trust,
.plan-doc-intent {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  padding: 0.35rem 0.4rem;
  margin: 0;
  resize: none;
  overflow: hidden;
}

.plan-doc-spine {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.45;
  border: 1px solid var(--line);
  background: #fbfcfc;
  min-height: 2.6rem;
}

.plan-doc-label {
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--accent, #1a7a6d);
  padding-left: 0;
  letter-spacing: 0.02em;
}

.plan-doc-say {
  font-size: 0.9rem;
  line-height: 1.55;
  min-height: 3.6rem;
}

.plan-doc-retell,
.plan-doc-trust,
.plan-doc-intent {
  font-size: 0.82rem;
  line-height: 1.45;
  color: #3d4d57;
  min-height: 2.2rem;
}

.plan-doc-retell::placeholder,
.plan-doc-trust::placeholder,
.plan-doc-say::placeholder,
.plan-doc-spine::placeholder,
.plan-doc-label::placeholder {
  color: #9aa3a9;
}

.plan-doc-spine:focus,
.plan-doc-label:focus,
.plan-doc-say:focus,
.plan-doc-retell:focus,
.plan-doc-trust:focus,
.plan-doc-intent:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent, #1a7a6d) 45%, var(--line));
  background: #fff;
}

.plan-strategy-meta {
  margin: 0.55rem 0 0;
  padding: 0.45rem 0.55rem;
  border: 1px solid color-mix(in srgb, var(--accent, #1a7a6d) 22%, var(--line));
  background: color-mix(in srgb, var(--accent, #1a7a6d) 6%, #fff);
  font-size: 0.78rem;
  line-height: 1.45;
  color: #2f4a4a;
}

.plan-strategy-line {
  font-weight: 600;
  color: var(--accent, #1a7a6d);
}

.plan-strategy-why {
  margin-top: 0.2rem;
  color: #4a5c5c;
}

.wa-weights {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 0.55rem;
  margin: 0 0 0.75rem;
}

.wa-weight-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--ink);
}

.wa-weight-item select {
  width: 3.2rem;
  font: inherit;
  font-size: 0.8rem;
  padding: 0.2rem 0.25rem;
  border: 1px solid var(--line);
  background: #fff;
}

@media (max-width: 420px) {
  .wa-weights {
    grid-template-columns: 1fr;
  }
}

.plan-think-card {
  margin: 0 0 0.9rem;
  padding: 0.55rem 0.7rem 0.6rem;
  border: 1px solid var(--line);
  background: #f7f8f9;
}

.plan-think-card .wx-think-fold {
  border-bottom: none;
  padding-bottom: 0;
}

.plan-think-card .wx-think-body {
  max-height: 14rem;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.plan-think-card.is-pending .wx-think-body {
  color: #9aa3a9;
}

.plan-doc-body {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.plan-doc-section {
  padding: 0.85rem 0.35rem 0.95rem;
  margin: 0 -0.35rem;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
  border-radius: 0.2rem;
  transition: background 0.15s ease;
}

.plan-doc-section:last-child {
  border-bottom: none;
}

.plan-doc-section:focus-within {
  background: color-mix(in srgb, var(--accent, #1a7a6d) 5%, transparent);
}

.plan-doc-kicker {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  color: var(--accent, #1a7a6d);
  margin: 0 0 0.35rem;
}

.plan-doc-section .plan-doc-say {
  margin-top: 0.15rem;
}

.plan-doc-section .plan-doc-retell,
.plan-doc-section .plan-doc-trust {
  margin-top: 0.25rem;
  border-top: 1px dashed color-mix(in srgb, var(--line) 80%, transparent);
  padding-top: 0.35rem;
}

.arg-board .desc {
  margin-bottom: 0.65rem;
}

.arg-section {
  margin: 0 0 1rem;
  padding: 0 0 0.85rem;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.arg-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.arg-sec-title {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--ink);
}

.arg-text {
  margin: 0 0 0.2rem;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--ink);
}

.arg-k {
  display: inline-block;
  min-width: 2.2rem;
  margin-right: 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.arg-marks {
  margin: 0.3rem 0 0.45rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.arg-mark {
  display: inline-block;
  font-size: 0.68rem;
  line-height: 1.2;
  padding: 0.08rem 0.28rem;
  border: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  white-space: nowrap;
}

.arg-mark.is-ok {
  color: var(--accent);
  border-color: rgba(26, 122, 109, 0.35);
}

.arg-mark.is-warn {
  color: var(--warn);
  border-color: rgba(180, 110, 20, 0.35);
}

.arg-mark.is-bad {
  color: #b42318;
  border-color: rgba(180, 35, 24, 0.35);
}

.arg-verify-banner {
  margin: 0 0 0.75rem;
}

.arg-line.is-verify-fail {
  border-color: rgba(180, 35, 24, 0.28);
  background: rgba(180, 35, 24, 0.04);
}

.arg-line-verify-note {
  margin: 0.2rem 0 0;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--muted);
}

.preview-html .draft-figure,
.preview-html .draft-table-wrap {
  margin: 0.85rem 0 1rem;
}

.preview-html .draft-figure img,
.preview-html .unit-figure {
  max-width: 100%;
  height: auto;
  display: block;
}

.preview-html .draft-media-cap,
.preview-html .unit-asset-caption {
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

.preview-html .draft-media-title {
  color: var(--ink);
  font-weight: 600;
  font-size: 0.82rem;
  line-height: 1.45;
}

.preview-html .draft-media-source {
  margin-top: 0.12rem;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.45;
}

.preview-html .draft-cite {
  font-size: 0.72em;
  font-weight: 500;
  line-height: 1;
  color: #5f8f86;
  vertical-align: 0.08em;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.preview-html .draft-refs {
  margin: 1.1rem 0 0.35rem;
  padding-top: 0.55rem;
  border-top: 1px dashed rgba(0, 0, 0, 0.08);
}

.preview-html .draft-refs h1,
.preview-html .draft-refs h2,
.preview-html .draft-refs h3,
.preview-html .draft-refs h4 {
  margin: 0 0 0.35rem;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.35;
  color: #6a7a84;
}

.preview-html .draft-refs p,
.preview-html .draft-refs li {
  margin: 0 0 0.2rem;
  font-size: 0.74rem;
  font-weight: 400;
  line-height: 1.38;
  color: #6f808a;
}

.preview-html .draft-refs p:last-child,
.preview-html .draft-refs li:last-child {
  margin-bottom: 0;
}

.arg-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.arg-line {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 0.5rem 0;
  border-top: 1px dashed rgba(0, 0, 0, 0.06);
  font-size: 0.84rem;
  line-height: 1.45;
}

.arg-line:first-child {
  border-top: none;
}

.arg-line-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.arg-line-tags {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.28rem;
  min-width: 0;
}

.arg-line-text {
  margin: 0;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.arg-line-anchor {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
  word-break: break-word;
}

.arg-line-acts {
  flex: 0 0 auto;
  display: inline-flex;
  gap: 0.35rem;
}

.arg-act {
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: 0.72rem;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.arg-act:hover {
  color: var(--ink);
}

.arg-act.is-danger:hover {
  color: var(--danger);
}

.arg-empty {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.more-dialog.more-panel.is-ap-picker {
  width: min(52rem, calc(100vw - 1.5rem));
  max-height: min(92vh, 56rem);
}

.more-dialog.more-panel.is-insight-results {
  width: min(48rem, calc(100vw - 2rem));
  max-height: min(90vh, 52rem);
}

.more-dialog.more-panel.is-insight-results .insight-results-list {
  max-height: min(52vh, 28rem);
}

.more-dialog.more-panel.is-guidance-panel {
  width: min(48rem, calc(100vw - 2rem));
  max-height: min(90vh, 52rem);
}

.more-dialog.more-panel.is-verify-panel {
  width: min(48rem, calc(100vw - 2rem));
  max-height: min(90vh, 52rem);
}

.more-dialog.more-panel.is-agent-settings {
  width: min(40rem, calc(100vw - 2rem));
  max-height: min(92vh, 56rem);
}

.more-dialog.more-panel.is-manual-edit {
  width: min(56rem, calc(100vw - 1.5rem));
  max-height: min(92vh, 58rem);
}

.more-dialog.more-panel.is-manual-edit .more-panel-body {
  display: flex;
  flex-direction: column;
}

.more-dialog.more-panel.is-manual-edit .panel-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.more-dialog.more-panel.is-manual-edit #manual-draft-text {
  flex: 1;
  min-height: min(58vh, 32rem);
  resize: vertical;
  font-size: 0.95rem;
  line-height: 1.65;
}

.sys-settings-block {
  margin: 0 0 1.15rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(15, 61, 61, 0.08);
}

.sys-settings-block:last-of-type {
  border-bottom: 0;
}

.agent-cap-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.agent-cap-row {
  align-items: flex-start;
  gap: 0.55rem;
}

.agent-cap-row span {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  line-height: 1.35;
}

.agent-cap-row small {
  color: var(--muted, #64748b);
  font-size: 0.78rem;
  font-weight: 400;
}

.verify-card-list {
  max-height: min(52vh, 28rem);
}

.verify-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.guidance-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0 0 1rem;
  max-height: min(42vh, 22rem);
  overflow: auto;
  padding-right: 0.15rem;
}

.guidance-card {
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: var(--surface);
  padding: 0.7rem 0.85rem;
}

.guidance-card-head {
  margin: 0 0 0.4rem;
  font-size: 0.86rem;
  color: var(--ink);
}

.guidance-card-head strong {
  font-weight: 650;
}

.guidance-card-body {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--muted);
}

.guidance-extra-wrap {
  margin-top: 0.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.guidance-extra-wrap .panel-section-title {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
}

.guidance-extra-wrap textarea {
  width: 100%;
  min-height: 6.5rem;
  resize: vertical;
}

.more-dialog.more-panel.is-ap-picker .more-panel-body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 0;
}

.req-group {
  margin: 0 0 1rem;
}

.req-group-title {
  margin: 0 0 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #2a3a42;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.req-group-count {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 0.02rem 0.28rem;
}

.req-check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  flex: 1 1 auto;
  min-width: 0;
  cursor: pointer;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
}

.req-check-row input[type="checkbox"] {
  margin-top: 0.2rem;
  flex: 0 0 auto;
}

.req-card .req-note {
  margin: 0.25rem 0 0.35rem;
  padding-left: 1.45rem;
}

.req-card .req-prompt {
  margin: 0;
  padding: 0.45rem 0.55rem 0.45rem 1.45rem;
  white-space: pre-wrap;
  cursor: default;
  border: none;
  background: transparent;
  text-align: left;
  width: 100%;
  font: inherit;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.ap-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
}

.ap-panel-hint {
  margin: 0 0 0.55rem !important;
  flex-shrink: 0;
}

.ap-toolbar {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  margin: 0 0 0.65rem;
  flex-shrink: 0;
}

.ap-toolbar input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  font: inherit;
  font-size: 0.84rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--line);
  background: #fff;
}

.ap-skill-picker {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  background: #f7faf9;
  flex-shrink: 0;
}

.ap-skill-picker-field {
  margin: 0;
}

.ap-skill-picker-field > span {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.78rem;
  color: var(--muted, #5a6a72);
}

.ap-skill-picker-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.ap-skill-picker-row select {
  flex: 1 1 auto;
  min-width: 0;
  font: inherit;
  font-size: 0.84rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--line);
  background: #fff;
}

.ap-skill-picker-row .btn {
  flex: 0 0 auto;
}

.ap-list-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0.1rem 0.35rem 0.75rem 0;
  margin-right: -0.15rem;
  scrollbar-gutter: stable;
}

.ap-list-scroll::-webkit-scrollbar {
  width: 8px;
}

.ap-list-scroll::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.28);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.ap-list-scroll::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.04);
  border-radius: 4px;
}

.ap-panel-actions {
  flex-shrink: 0;
  margin-top: 0;
  padding: 0.75rem 0 1.1rem;
  background: #fff;
}

.ap-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  overflow: visible;
}

.ap-item,
.ap-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.75rem 0.8rem;
  border: 1px solid var(--line);
  background: #fafbfc;
  box-sizing: border-box;
  width: 100%;
  overflow: visible;
}

.ap-card.is-on {
  background: color-mix(in srgb, #1a7a6d 7%, #fff);
  border: 2px solid #1a7a6d;
  box-shadow: 0 0 0 1px color-mix(in srgb, #1a7a6d 35%, transparent);
}

.ap-card-top {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}

.ap-pick {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  text-align: left;
  flex: 1 1 auto;
  min-width: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ap-card-title-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.ap-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

.ap-current-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.05rem 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #1a7a6d;
  border: 1px solid color-mix(in srgb, #1a7a6d 45%, #fff);
  background: color-mix(in srgb, #1a7a6d 10%, #fff);
  line-height: 1.3;
}

.ap-note {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.ap-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.22rem;
  margin-top: 0.05rem;
}

.ap-prompt {
  appearance: none;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  text-align: left;
  font: inherit;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  cursor: pointer;
}

.ap-prompt:hover {
  border-color: rgba(31, 78, 121, 0.28);
}

.ap-item-acts {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding-top: 0.05rem;
  white-space: nowrap;
}

.ap-act-btn {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0.1rem 0;
  margin: 0;
  font: inherit;
  font-size: 0.78rem;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  line-height: 1.3;
}

.ap-act-btn:hover {
  color: var(--ink);
}

.ap-act-btn.is-danger {
  color: #b42318;
}

.ap-act-btn.is-danger:hover {
  color: #912018;
}

.ap-select-btn {
  appearance: none;
  border: 1px solid #1a7a6d !important;
  background: #1a7a6d !important;
  color: #fff !important;
  padding: 0.18rem 0.55rem !important;
  font-size: 0.78rem;
  font-weight: 650;
  text-decoration: none !important;
  line-height: 1.25;
  border-radius: 2px;
  letter-spacing: 0.02em;
}

.ap-select-btn:hover {
  background: #156657 !important;
  color: #fff !important;
}

.ap-select-btn.is-selected {
  background: color-mix(in srgb, #1a7a6d 12%, #fff) !important;
  color: #1a7a6d !important;
  border-color: #1a7a6d !important;
}

.ap-more-wrap {
  position: relative;
  display: inline-flex;
}

.ap-more-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 5;
  min-width: 5.5rem;
  padding: 0.25rem 0;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(14, 20, 25, 0.12);
}

.ap-more-menu.hidden {
  display: none !important;
}

.ap-more-item {
  appearance: none;
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 0.35rem 0.65rem;
  font: inherit;
  font-size: 0.78rem;
  color: var(--ink);
  cursor: pointer;
}

.ap-more-item:hover {
  background: #f4f7f8;
}

.ap-more-item.is-danger {
  color: var(--danger);
}

.status-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.status-list li {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.88rem;
  padding: 0.75rem 0.85rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
  border-radius: 0;
}

.status-list .st-label { color: #33434d; font-weight: 500; }
.status-list .st-val { color: var(--muted); font-size: 0.8rem; }
.status-list li.ok .st-val { color: var(--accent); }
.status-list li.wait .st-val { color: var(--warn); }

@media (max-width: 900px) {
  .status-list { grid-template-columns: repeat(2, 1fr); }
}

.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0 0 1.25rem;
  padding: 0;
  background: transparent;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
}

.col-source .subnav,
.col-result .subnav {
  flex-shrink: 0;
  margin: 0;
  background: #f7f9fa;
}

.col-result .col-head .draft-head-tabs {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: stretch;
  align-self: stretch;
  height: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-bottom: none;
  gap: 0;
}

.col-result .col-head .draft-head-tabs.hidden {
  display: none !important;
}

.col-result .col-head .draft-head-tabs .subnav-btn {
  height: 100%;
  padding: 0 0.75rem;
  font-size: 0.84rem;
  display: inline-flex;
  align-items: center;
  border-bottom-width: 2px;
  margin-bottom: 0;
}

.subnav-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.65rem 1rem;
  border-radius: 0;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.subnav-btn:hover { color: var(--ink); }
.subnav-btn.active {
  color: var(--primary);
  background: transparent;
  box-shadow: none;
  border-bottom-color: var(--primary);
}
.subnav-btn.done:not(.active) { color: var(--accent); }

/* 底栏工具条：平铺一行 */
.flat-toolbar {
  margin-top: 1.5rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 1rem;
  align-items: start;
}

@media (max-width: 900px) {
  .flat-toolbar { grid-template-columns: 1fr; }
}

.flat-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.flat-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  justify-content: flex-end;
}

.flat-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.85rem;
  align-items: end;
}

@media (max-width: 800px) {
  .flat-form { grid-template-columns: 1fr; }
}

.badge {
  font-size: 0.78rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(26, 122, 109, 0.2);
  color: #8fd4c7;
  border: 1px solid rgba(143, 212, 199, 0.35);
}

.badge.bad {
  background: rgba(159, 45, 58, 0.2);
  color: #f0a8b0;
  border-color: rgba(240, 168, 176, 0.35);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.nav-user-cluster {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  flex-shrink: 0;
}

.btn-agent {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.32rem;
  height: 1.7rem;
  padding: 0 0.42rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(20, 28, 24, 0.72);
  color: #fff;
  border-radius: 0;
  cursor: pointer;
}

.btn-agent:hover {
  background: rgba(36, 48, 40, 0.9);
  border-color: rgba(255, 255, 255, 0.32);
}

.btn-agent-status {
  width: 0.48rem;
  height: 0.48rem;
  flex-shrink: 0;
  background: #a2d98a;
  box-shadow: 0 0 0 1px rgba(162, 217, 138, 0.25);
}

.btn-agent-status.is-busy {
  background: #e0b35a;
  box-shadow: 0 0 0 1px rgba(224, 179, 90, 0.35);
}

.btn-agent-status.is-unread {
  background: #7ed957;
  box-shadow: 0 0 0 1px rgba(126, 217, 87, 0.45);
  animation: agent-status-blink 1.1s ease-in-out infinite;
}

@keyframes agent-status-blink {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.28;
    transform: scale(0.85);
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn-agent-status.is-unread {
    animation: none;
    opacity: 1;
    background: #5ecf3a;
    box-shadow: 0 0 0 2px rgba(94, 207, 58, 0.55);
  }
}

.btn-agent-icon {
  display: block;
  flex-shrink: 0;
}

.btn-agent-eye {
  fill: #1a2220;
}

.btn-more {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(20, 28, 24, 0.72);
  color: #fff;
  border-radius: 0;
  cursor: pointer;
}

.btn-more:hover,
.btn-more[aria-expanded="true"] {
  background: rgba(36, 48, 40, 0.9);
  border-color: rgba(255, 255, 255, 0.32);
  color: #fff;
}

.btn-more-name {
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
}

/* —— Agent 对话浮层 —— */
.agent-panel {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 55;
  width: min(22.5rem, calc(100vw - 1.5rem));
  height: min(30rem, calc(100vh - 4.5rem));
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 12px 36px rgba(14, 20, 25, 0.16);
  overflow: hidden;
}

.agent-panel.hidden {
  display: none;
}

.agent-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-shrink: 0;
  padding: 0.45rem 0.5rem 0.45rem 0.55rem;
  border-bottom: 1px solid var(--line);
  background: #f7f9fa;
}

.agent-panel-title-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.35rem;
  border: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.agent-panel-title-btn:hover {
  background: rgba(15, 23, 42, 0.05);
}

.agent-panel-caret {
  opacity: 0.55;
}

.agent-panel-close {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.agent-panel-close:hover {
  color: var(--ink);
  background: rgba(15, 23, 42, 0.06);
}

.agent-panel-messages {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.85rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: #f2f5f7;
}

.agent-msg {
  display: flex;
  max-width: 88%;
}

.agent-msg.agent {
  align-self: flex-start;
}

.agent-msg.user {
  align-self: flex-end;
}

.agent-msg-bubble {
  position: relative;
  padding: 0.55rem 0.7rem 1.15rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.agent-msg.agent .agent-msg-bubble {
  white-space: normal;
}

.agent-msg.user .agent-msg-bubble {
  background: #e8f3f1;
  border-color: #c5ddd8;
}

.agent-md {
  display: block;
}

.agent-md > :first-child {
  margin-top: 0;
}

.agent-md > :last-child {
  margin-bottom: 0;
}

.agent-md p {
  margin: 0 0 0.55rem;
}

.agent-md .agent-md-h {
  margin: 0.15rem 0 0.45rem;
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.35;
  color: var(--ink);
}

.agent-md h1.agent-md-h { font-size: 0.98rem; }
.agent-md h2.agent-md-h { font-size: 0.92rem; }
.agent-md h3.agent-md-h { font-size: 0.86rem; }

.agent-md strong {
  font-weight: 650;
}

.agent-md em {
  font-style: italic;
}

.agent-md code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78em;
  padding: 0.08em 0.28em;
  border-radius: 4px;
  background: color-mix(in srgb, var(--line, #d5ddd7) 55%, #fff);
}

.agent-md a {
  color: #1f6b5c;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.agent-md-list {
  margin: 0 0 0.55rem;
  padding-left: 1.15rem;
}

.agent-md-list li {
  margin: 0.18rem 0;
}

.agent-md-list li::marker {
  color: var(--muted, #6a756d);
}

.agent-md-pre {
  margin: 0 0 0.55rem;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  background: #f3f6f4;
  border: 1px solid var(--line, #d5ddd7);
  overflow: auto;
  max-width: 100%;
}

.agent-md-pre code {
  padding: 0;
  background: transparent;
  font-size: 0.76rem;
  white-space: pre;
}

.agent-msg-time {
  position: absolute;
  right: 0.55rem;
  bottom: 0.28rem;
  font-size: 0.66rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.agent-panel-foot {
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 0.55rem 0.65rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.agent-panel-input {
  width: 100%;
  min-height: 2.4rem;
  max-height: 7rem;
  resize: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.84rem;
  line-height: 1.45;
  padding: 0.45rem 0.55rem;
  outline: none;
  field-sizing: content;
}

.agent-panel-input:focus {
  border-color: #9aabb5;
}

.agent-panel-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.agent-panel-tools-left {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}

.agent-tool-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.agent-tool-btn:hover {
  color: var(--ink);
  background: rgba(15, 23, 42, 0.05);
}

.agent-send-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.agent-send-btn:hover:not(:disabled) {
  filter: brightness(1.05);
}

.agent-send-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.more-wrap {
  position: relative;
  flex-shrink: 0;
}

.more-popover {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 60;
  min-width: 8.5rem;
  padding: 0.3rem;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(14, 20, 25, 0.16);
  display: grid;
  gap: 0.15rem;
}

.more-popover-item {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
  text-align: left;
  padding: 0.5rem 0.65rem;
  cursor: pointer;
  border-radius: 2px;
}

.more-popover-item:hover {
  background: var(--chip, #e2eaf0);
  color: var(--primary, #1f4e79);
}

.more-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(14, 20, 25, 0.45);
  z-index: 50;
}

.article-preview-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(14, 20, 25, 0.5);
  z-index: 70;
}

.article-preview-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 71;
  /* 手机壳 375 + 边框/留白 */
  width: min(420px, calc(100vw - 1.5rem));
  max-height: min(92vh, 860px);
  display: flex;
  flex-direction: column;
  background: #e8ecef;
  border: 1px solid var(--line);
  box-shadow: 0 16px 48px rgba(14, 20, 25, 0.22);
  overflow: hidden;
  transition: width 0.18s ease;
}

.article-preview-dialog[data-device="pc"] {
  /* 677 版心 + 两侧页边 */
  width: min(760px, calc(100vw - 1.5rem));
}

.article-preview-dialog[data-theme="dark"] {
  background: #12181d;
  border-color: #2a343c;
}

.article-preview-dialog[data-theme="dark"] .article-preview-head {
  background: #1a2228;
  border-bottom-color: #2a343c;
  color: #e8eef2;
}

.article-preview-dialog[data-theme="dark"] .article-preview-head h3 {
  color: #e8eef2;
}

.article-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-shrink: 0;
  padding: 0.55rem 0.75rem;
  background: #f7f9fa;
  border-bottom: 1px solid var(--line);
}

.article-preview-head h3 {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
}

.article-preview-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.article-preview-seg {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--line);
  background: #fff;
  overflow: hidden;
}

.article-preview-dialog[data-theme="dark"] .article-preview-seg {
  border-color: #3a4650;
  background: #12181d;
}

.article-preview-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  color: #6b757c;
  cursor: pointer;
}

.article-preview-tool + .article-preview-tool {
  border-left: 1px solid var(--line);
}

.article-preview-dialog[data-theme="dark"] .article-preview-tool + .article-preview-tool {
  border-left-color: #3a4650;
}

.article-preview-tool:hover {
  background: rgba(14, 20, 25, 0.05);
  color: var(--ink);
}

.article-preview-dialog[data-theme="dark"] .article-preview-tool {
  color: #9aa7b0;
}

.article-preview-dialog[data-theme="dark"] .article-preview-tool:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #e8eef2;
}

.article-preview-tool.active {
  background: rgba(26, 122, 109, 0.12);
  color: var(--accent);
}

.article-preview-dialog[data-theme="dark"] .article-preview-tool.active {
  background: rgba(26, 122, 109, 0.22);
  color: #7dcec0;
}

.article-preview-dialog[data-theme="dark"] .more-panel-close {
  color: #c5d0d7;
}

.article-preview-frame {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.85rem 0.75rem 0.55rem;
  background: #ededed;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.article-preview-dialog[data-theme="dark"] .article-preview-frame {
  background: #0e1419;
}

/* 微信阅读页容器：手机 375 / 网页 677 */
.wx-preview-device {
  width: 375px;
  max-width: 100%;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #cfcfcf;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  max-height: min(78vh, 760px);
}

.article-preview-dialog[data-device="pc"] .wx-preview-device {
  width: 677px;
  max-width: 100%;
  border-radius: 2px;
  border-color: #d9d9d9;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  max-height: min(78vh, 760px);
}

.article-preview-dialog[data-theme="dark"] .wx-preview-device {
  background: #111;
  border-color: #2a343c;
}

.wx-preview-chrome {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f7f7f7;
  color: #111;
}

.article-preview-dialog[data-theme="dark"] .wx-preview-chrome {
  background: #1a1a1a;
  color: #e8eef2;
}

.wx-preview-chrome--top {
  height: 44px;
  padding: 0 16px;
  font-size: 12px;
  font-weight: 600;
  position: relative;
}

.wx-preview-time {
  width: 42px;
}

.wx-preview-notch {
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translateX(-50%);
  width: 92px;
  height: 22px;
  border-radius: 12px;
  background: #111;
}

.article-preview-dialog[data-theme="dark"] .wx-preview-notch {
  background: #000;
}

.wx-preview-sys {
  display: inline-flex;
  gap: 3px;
  align-items: flex-end;
  width: 42px;
  justify-content: flex-end;
}

.wx-preview-sys i {
  display: block;
  width: 3px;
  background: currentColor;
  border-radius: 1px;
  opacity: 0.85;
}

.wx-preview-sys i:nth-child(1) { height: 6px; }
.wx-preview-sys i:nth-child(2) { height: 9px; }
.wx-preview-sys i:nth-child(3) { height: 12px; }

.wx-preview-nav {
  flex-shrink: 0;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-bottom: 1px solid #ececec;
  background: #f7f7f7;
  color: #181818;
  font-size: 15px;
}

.article-preview-dialog[data-theme="dark"] .wx-preview-nav {
  background: #1a1a1a;
  border-bottom-color: #2a343c;
  color: #e8eef2;
}

.wx-preview-nav-back {
  width: 10px;
  height: 10px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-left: 4px;
}

.wx-preview-nav-title {
  font-weight: 500;
}

.wx-preview-nav-more {
  letter-spacing: 1px;
  font-weight: 700;
  width: 28px;
  text-align: right;
}

.wx-preview-chrome--bottom {
  height: 28px;
  justify-content: center;
  border-top: 1px solid #ececec;
}

.article-preview-dialog[data-theme="dark"] .wx-preview-chrome--bottom {
  border-top-color: #2a343c;
}

.wx-preview-home {
  width: 108px;
  height: 4px;
  border-radius: 999px;
  background: #111;
  opacity: 0.85;
}

.article-preview-dialog[data-theme="dark"] .wx-preview-home {
  background: #e8eef2;
}

/* 网页端不展示手机壳顶栏/底栏 */
.article-preview-dialog[data-device="pc"] .wx-preview-chrome,
.article-preview-dialog[data-device="pc"] .wx-preview-nav {
  display: none;
}

.article-preview-body {
  width: 100%;
  max-width: none;
  margin: 0;
  background: #fff;
  border: none;
  /* 微信正文常见左右约 15px 内边距 */
  padding: 20px 15px 28px;
  box-shadow: none;
  color: #3f3f3f;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.article-preview-dialog[data-theme="dark"] .article-preview-body {
  background: #111;
  color: #cfcfcf;
  box-shadow: none;
}

/* 贴近微信阅读页排版 */
.article-preview-body .draft-display-title {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.4;
  color: #000;
  letter-spacing: 0.02em;
}

.article-preview-body .draft-cover-wrap {
  margin: 0 0 12px;
}

.article-preview-body .draft-cover-wrap img {
  width: 100%;
  display: block;
}

.article-preview-body .reading-meta {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.5;
  color: #8c8c8c;
}

.article-preview-body .draft-display-digest {
  margin: 0 0 18px;
  padding: 0 0 14px;
  border-bottom: 1px solid rgba(74, 124, 201, 0.35);
  font-size: 15px;
  line-height: 1.65;
  color: #4a7cc9;
  letter-spacing: 0.02em;
}

.article-preview-body .preview-html {
  border: none;
  padding: 0;
  font-size: 17px;
  line-height: 1.6;
  color: #3f3f3f;
  letter-spacing: 0.034em;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.article-preview-body .preview-html p {
  margin: 0 0 1em;
}

.article-preview-body .preview-html p:last-child {
  margin-bottom: 0;
}

.article-preview-body .preview-html a {
  color: #576b95;
  text-decoration: none;
}

.article-preview-body .draft-footer {
  margin-top: 24px;
  font-size: 15px;
  color: #3f3f3f;
}

.article-preview-dialog[data-theme="dark"] .article-preview-body .draft-display-title {
  color: #f2f2f2;
}

.article-preview-dialog[data-theme="dark"] .article-preview-body .preview-html,
.article-preview-dialog[data-theme="dark"] .article-preview-body .draft-footer {
  color: #cfcfcf;
}

.article-preview-dialog[data-theme="dark"] .article-preview-body .reading-meta {
  color: #8a8a8a;
}

.article-preview-dialog[data-theme="dark"] .article-preview-body .draft-ad {
  border-top-color: rgba(255, 255, 255, 0.14);
}

.wx-preview-hint {
  margin: 0.55rem 0 0;
  font-size: 0.72rem;
  color: #6b7780;
  text-align: center;
  line-height: 1.35;
}

.article-preview-dialog[data-theme="dark"] .wx-preview-hint {
  color: #7a8790;
}

.more-dialog.more-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 51;
  width: min(36rem, calc(100vw - 2rem));
  max-height: min(82vh, 42rem);
  padding: 1.15rem 0 0;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 12px 40px rgba(14, 20, 25, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.more-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0;
  padding: 0 1.25rem 0.85rem;
  flex-shrink: 0;
}

.more-dialog-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.more-panel-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 2px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
}

.more-panel-close:hover {
  color: var(--ink);
  background: rgba(15, 61, 61, 0.06);
}

.more-panel-body {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 1.15rem 1.25rem;
  scrollbar-gutter: stable;
  font-size: 0.9rem;
  color: var(--ink);
  line-height: 1.55;
}

.more-panel-body::-webkit-scrollbar {
  width: 8px;
}

.more-panel-body::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.22);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.more-panel-body::-webkit-scrollbar-track {
  background: transparent;
}

.more-panel-body .hint {
  margin-top: 0.5rem;
}

.more-panel-body .kv-line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.86rem;
}

.more-panel-body .field {
  display: grid;
  gap: 0.3rem;
  margin-top: 0.65rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.more-panel-body .field span {
  font-weight: 500;
  color: #3d4d57;
}

.more-panel-body .field input,
.more-panel-body .field select,
.more-panel-body .field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.45rem 0.55rem;
  background: #fff;
  font: inherit;
  color: var(--ink);
}

.more-panel-body .field textarea {
  min-height: 7rem;
  line-height: 1.45;
  resize: vertical;
}

.more-panel-body .chk {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin-top: 0.65rem;
  font-size: 0.86rem;
  color: var(--ink);
}

.cover-regen-targets {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.cover-regen-targets .chk {
  margin-top: 0.35rem;
}

.more-panel-body .field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-top: 0.55rem;
}

.more-panel-body .field-row.hidden {
  display: none;
}

.more-panel-body .field-row .field {
  margin-top: 0;
}

.panel-section {
  padding-bottom: 0.95rem;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.panel-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.panel-section-title {
  margin: 0 0 0.45rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
}

.panel-bullet-list {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--ink);
}

.panel-bullet-list .hint {
  list-style: none;
  margin-left: -1.15rem;
}

.panel-prompt-preview {
  margin-top: 0.55rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  background: #fafbfc;
}

.panel-prompt-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: #3d4d57;
  margin-bottom: 0.3rem;
}

.panel-prompt-preview p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
}

.more-panel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.settings-inline-action {
  margin: 0.55rem 0 0.75rem;
  padding: 0 0.15rem;
}

.settings-inline-action .ops-action-btn {
  width: 100%;
}

.parse-flow-list {
  margin: 0.35rem 0 0;
  padding-left: 1.2rem;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--ink);
}

.parse-flow-list li + li {
  margin-top: 0.25rem;
}

.settings-drawer-body .kv-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.78rem;
  line-height: 1.45;
}

.settings-drawer-body .kv-line > span:first-child {
  flex: 0 0 4.8rem;
  color: var(--muted);
  font-weight: 550;
}

.settings-drawer-body .kv-line > span:last-child {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--ink);
  text-align: right;
  word-break: break-word;
}

.settings-drawer-body .fold-subhead {
  margin: 0.75rem 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* 大纲生成设置：说明文字缩小并改蓝青，与表单正文区分 */
.settings-drawer-body .fold-section[data-fold-id="plan"] .hint,
.settings-drawer-body .fold-section[data-fold-id="plan"] .parse-flow-list {
  font-size: 0.7rem;
  line-height: 1.4;
  color: #1f8a8a;
}

.settings-drawer-body .fold-section[data-fold-id="plan"] .parse-flow-list {
  margin-top: 0.2rem;
}

.settings-drawer-body .fold-section[data-fold-id="plan"] .parse-flow-list li + li {
  margin-top: 0.15rem;
}

.settings-drawer-body .fold-section[data-fold-id="global_prompt"] textarea,
.settings-drawer-body .fold-section[data-fold-id="about"] .kv-line > span:last-child {
  text-align: left;
}

.parse-sys-preview p {
  white-space: pre-wrap;
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #3d4d57;
}

.more-panel-actions.parse-feedback-actions {
  flex-wrap: wrap;
  justify-content: stretch;
}

.more-panel-actions.parse-feedback-actions .btn {
  flex: 1 1 auto;
  min-width: 7.5rem;
}

.review-refs-upload {
  margin: 0 0 0.75rem;
}

.review-refs-upload #btn-upload-review-refs {
  margin-bottom: 0.45rem;
}

.review-refs-files {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  background: #fafbfc;
}

.review-refs-files.empty {
  padding: 0.55rem 0.65rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.review-refs-file {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.55rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.8rem;
}

.review-refs-file:last-child {
  border-bottom: none;
}

.review-refs-file-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
}

.review-refs-file-meta {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.review-refs-file-remove {
  flex-shrink: 0;
  padding: 0.15rem 0.4rem !important;
  font-size: 0.72rem !important;
  min-height: 0;
}

.health-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.25rem;
  max-width: min(42vw, 28rem);
}

.health-chip {
  font-size: 0.65rem;
  line-height: 1.2;
  padding: 0.2rem 0.4rem;
  border-radius: 2px;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #9aafb9;
}

.health-chip.ok {
  color: #8fd4c7;
  border-color: rgba(143, 212, 199, 0.35);
  background: rgba(26, 122, 109, 0.18);
}

.health-chip.bad {
  color: #f0a8b0;
  border-color: rgba(240, 168, 176, 0.35);
  background: rgba(159, 45, 58, 0.18);
}

@media (max-width: 1100px) {
  .health-strip {
    max-width: 36vw;
  }
}

.field { display: grid; gap: 0.3rem; font-size: 0.88rem; color: var(--muted); }
.field span { font-weight: 500; color: #3d4d57; }

.field-label-with-info {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}

.field-label-with-info > label {
  margin: 0;
  font-weight: 500;
  color: #3d4d57;
  cursor: default;
}

.field-info-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(45, 64, 74, 0.28);
  border-radius: 999px;
  background: transparent;
  color: #6a7b86;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  font-style: normal;
  cursor: help;
  flex-shrink: 0;
  z-index: 2;
}

.field-info-btn:hover,
.field-info-btn:focus-visible,
.field-info-btn.is-tip-open {
  color: #2d404a;
  border-color: rgba(45, 64, 74, 0.5);
  outline: none;
  z-index: 30;
}

.field-info-btn::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 0.4rem);
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
  width: max-content;
  max-width: min(15.5rem, calc(100vw - 2rem));
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: #2d404a;
  color: #fff;
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0;
  text-align: left;
  white-space: normal;
  box-shadow: 0 6px 18px rgba(20, 32, 40, 0.18);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.12s ease;
  z-index: 40;
}

/* 仅按钮自身悬停 / 聚焦时显示，避免 label 包裹输入框时误触发 */
.field-info-btn.is-tip-open::after {
  opacity: 1;
  visibility: visible;
}

input[type="text"],
input[type="file"],
input[type="url"],
textarea,
select {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 0.55rem 0;
  background: transparent;
  font: inherit;
  color: var(--ink);
}

input[type="text"]:focus,
textarea:focus {
  outline: none;
  border-bottom-color: var(--primary);
}

textarea { resize: vertical; min-height: 2.8rem; }

.row-actions { display: flex; flex-wrap: wrap; gap: 0.55rem; }

.hint, .side-hint {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
  margin: 0.75rem 0 0;
}

.btn {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 2px;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  font: inherit;
  font-weight: 500;
}

.btn:hover { border-color: #9aabb5; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.warn { background: var(--warn); color: #fff; border-color: var(--warn); }
.btn.ghost { background: transparent; }
.btn.danger-outline { color: var(--danger); border-color: #e4b4ba; }

.hidden { display: none !important; }

.alert {
  background: transparent;
  border: none;
  border-left: 3px solid var(--warn);
  color: var(--warn);
  border-radius: 0;
  padding: 0.5rem 0 0.5rem 0.75rem;
  margin: 0.5rem 0 1rem;
  font-size: 0.9rem;
}
.alert:empty { display: none; }

.chk {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  font-size: 0.88rem;
  line-height: 1.4;
  cursor: pointer;
}

.thinking-switch-field {
  margin-top: 0.15rem;
}

.thinking-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border, #d8dee3);
  border-radius: 8px;
  background: var(--surface-2, #f6f8f9);
}

.thinking-switch-copy {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.thinking-switch-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text, #1c2429);
}

.thinking-switch-hint {
  font-size: 0.75rem;
  color: var(--muted, #6b7780);
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  cursor: pointer;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-track {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #c5ced4;
  transition: background 0.18s ease;
  display: block;
  position: relative;
}

.switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  transition: transform 0.18s ease;
}

.switch input:checked + .switch-track {
  background: var(--accent, #1f7a5c);
}

.switch input:checked + .switch-track .switch-knob {
  transform: translateX(18px);
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--accent, #1f7a5c);
  outline-offset: 2px;
}

.stale-box {
  margin-top: 0.5rem;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--warn);
  font-size: 0.84rem;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.35rem 0.55rem;
  margin: 0.4rem 0;
}

.meta-main {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
  flex: 1 1 auto;
}

.unit-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  flex: 0 0 auto;
  margin-left: auto;
}

.unit-act {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 0;
  cursor: pointer;
  border-radius: 0;
  flex-shrink: 0;
}

.unit-act svg {
  display: block;
  pointer-events: none;
}

.unit-act:hover {
  color: var(--ink);
  background: rgba(31, 78, 121, 0.06);
}

.unit-act.is-active {
  color: var(--primary);
  background: rgba(31, 78, 121, 0.08);
}

.unit-act-danger:hover {
  color: var(--danger);
  background: rgba(196, 64, 80, 0.08);
}

.unit-remark-preview {
  display: flex;
  gap: 0.45rem;
  align-items: flex-start;
  margin: 0.45rem 0 0;
  padding: 0.4rem 0 0;
  border-top: 1px dashed var(--line);
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--ink);
}

.unit-remark-label {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-top: 0.12rem;
}

.unit-remark-text {
  min-width: 0;
  white-space: pre-wrap;
}

.unit-remark-editor {
  margin: 0.5rem 0 0;
  padding: 0.5rem 0 0;
  border-top: 1px solid var(--line);
}

.unit-remark-editor .unit-remark-label {
  display: block;
  margin: 0 0 0.25rem;
}

.unit-remark-input {
  width: 100%;
  min-height: 4.2rem;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  padding: 0.45rem 0.5rem;
  font: inherit;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--ink);
  box-sizing: border-box;
}

.unit-remark-input:focus {
  outline: none;
  border-color: var(--accent);
}

.unit-remark-hint {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
}

@keyframes source-locate-fade {
  0% { background: rgba(46, 196, 182, 0.62); }
  55% { background: rgba(46, 196, 182, 0.38); }
  100% { background: rgba(46, 196, 182, 0); }
}

mark.source-locate-hit {
  color: inherit;
  padding: 0 0.05em;
  border-radius: 1px;
  animation: source-locate-fade 1.5s ease forwards;
}

.pill {
  font-size: 0.72rem;
  padding: 0.12rem 0.4rem;
  border-radius: 2px;
  background: var(--chip);
  color: #3d4d57;
}

.pill.ok { background: var(--accent-soft); color: var(--accent); }
.pill.wait { background: #fff1df; color: var(--warn); }
.pill.no { background: #f8e6e9; color: var(--danger); }

.score-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  margin-top: 0.5rem;
}

@media (max-width: 700px) {
  .score-grid { grid-template-columns: repeat(2, 1fr); }
}

.score-cell strong {
  display: block;
  font-size: 1.15rem;
  font-family: var(--font-display);
}

.score-cell span {
  font-size: 0.75rem;
  color: var(--muted);
}

/* —— 定稿中栏：微信群聊式审读（平铺填满 step-view） —— */
#step-view:has(.wx-chat),
#step-view:has(.result-fill) {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.result-fill {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  border: none;
  background:
    linear-gradient(180deg, #e8eef0 0%, #e3eaed 48%, #dde6e9 100%);
  overflow: hidden;
}

.result-fill-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0.85rem 0.75rem 1rem;
}

.result-fill .block {
  background: #fff;
  border: 1px solid rgba(180, 195, 202, 0.55);
  padding: 0.85rem 0.9rem;
  margin: 0 0 0.75rem;
}

.result-fill .block:last-child {
  margin-bottom: 0;
}

.result-fill .block > h3:first-child {
  margin-top: 0;
}

.wx-chat {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  border: none;
  background:
    linear-gradient(180deg, #e8eef0 0%, #e3eaed 48%, #dde6e9 100%);
  overflow: hidden;
}

.wx-chat-head {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.7rem 0.9rem;
  background: rgba(247, 250, 249, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}

.wx-chat-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
}

.wx-chat-sub {
  font-size: 0.76rem;
  color: var(--muted);
}

.wx-chat-stream {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0.85rem 0.75rem 5.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.wx-msg {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  max-width: 100%;
}

.wx-msg--them {
  align-self: flex-start;
  padding-right: 2.2rem;
}

.wx-msg--me {
  align-self: flex-end;
  flex-direction: row;
  justify-content: flex-end;
  padding-left: 2.2rem;
}

.wx-msg--suggest {
  align-self: flex-start;
  padding-right: 2.2rem;
}

.wx-msg--system {
  align-self: center;
  max-width: 90%;
}

.wx-msg--system span {
  display: inline-block;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  background: rgba(80, 96, 104, 0.14);
  color: #4a5a62;
  font-size: 0.74rem;
  line-height: 1.4;
}

.wx-avatar {
  flex: 0 0 auto;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 0.35rem;
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: #f4f8f7;
  background: hsl(var(--wx-hue, 168) 42% 38%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.wx-avatar--agent {
  background: #2f5f73;
}

.wx-avatar--me {
  background: var(--accent);
}

.wx-bubble-wrap {
  min-width: 0;
  max-width: 22rem;
}

.wx-name {
  font-size: 0.72rem;
  color: #5a6a72;
  margin: 0 0 0.2rem 0.1rem;
}

.wx-msg-mode {
  margin-left: 0.35rem;
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
  background: rgba(80, 96, 104, 0.12);
  color: #5a6a72;
  font-size: 0.68rem;
  font-weight: 500;
}

.wx-tone-badge {
  margin-left: 0.35rem;
  padding: 0.05rem 0.34rem;
  border-radius: 4px;
  font-size: 0.66rem;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.wx-tone-badge--briefing {
  background: rgba(70, 110, 150, 0.16);
  color: #355a78;
}

.wx-tone-badge--think {
  background: rgba(120, 95, 40, 0.16);
  color: #7a5a18;
}

.wx-tone-badge--speak {
  background: rgba(40, 120, 95, 0.16);
  color: #1f6b52;
}

.wx-bubble--briefing {
  background: #eef3f7;
  border: 1px dashed rgba(70, 110, 150, 0.45);
  color: #2c3d4a;
  font-size: 0.84rem;
}

.wx-bubble--think {
  background: transparent;
  border: none;
  color: #8a9399;
  font-size: 0.75rem;
  font-style: normal;
}

.wx-bubble--speak {
  background: #fff;
  border: 1px solid rgba(40, 120, 95, 0.28);
  color: #1c2429;
}

.wx-bubble--combo {
  background: var(--reader-soft, #fff);
  border: 1px solid color-mix(in srgb, var(--reader-border, #1a7a6d) 40%, #fff);
  padding: 0.45rem 0.65rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.wx-think-fold {
  margin: 0;
  border-bottom: 1px dashed rgba(120, 130, 138, 0.35);
  padding-bottom: 0.35rem;
}

.wx-think-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #8a9399;
  user-select: none;
}

.wx-think-summary::-webkit-details-marker {
  display: none;
}

.wx-think-summary::before {
  content: "▸";
  font-size: 0.68rem;
  color: #9aa3a9;
  transition: transform 0.15s ease;
}

.wx-think-fold[open] .wx-think-summary::before {
  transform: rotate(90deg);
}

.wx-think-hint {
  font-weight: 400;
  color: #a3abb1;
  font-size: 0.68rem;
}

.wx-think-body {
  margin-top: 0.3rem;
  font-size: 0.74rem;
  line-height: 1.45;
  color: #8a9399;
  font-style: normal;
  white-space: pre-wrap;
}

.wx-speak-block {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.wx-speak-label {
  font-size: 0.7rem;
  font-weight: 650;
  color: var(--reader-accent, #1f6b52);
}

.wx-speak-body {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #1c2429;
  white-space: pre-wrap;
}

.wx-avatar--reader {
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 0.45rem;
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25), 0 0 0 2px var(--reader-border, transparent);
}

.wx-msg--reader {
  padding-bottom: 0.15rem;
}

.wx-msg--reader .wx-name strong {
  font-size: 0.82rem;
  font-weight: 700;
}

.wx-msg--reader .wx-bubble--speak {
  background: var(--reader-soft, #fff);
  border-color: color-mix(in srgb, var(--reader-border, #1a7a6d) 45%, #fff);
}

.wx-msg--reader .wx-bubble--think {
  border-left: none;
  color: #8a9399;
  font-style: normal;
}

.wx-msg--reader .wx-bubble--combo {
  border-left: 3px solid var(--reader-border, #1a7a6d);
}

.wx-msg--reader .wx-bubble--briefing {
  border-color: color-mix(in srgb, var(--reader-border, #355a78) 55%, #fff);
}

.wx-msg.is-selected .wx-bubble--speak {
  box-shadow: 0 0 0 2px rgba(31, 122, 92, 0.35);
}

.wx-msg--me .wx-name {
  text-align: right;
  margin-right: 0.1rem;
}

.wx-bubble {
  position: relative;
  background: #fff;
  border: 1px solid rgba(180, 195, 202, 0.65);
  border-radius: 0.2rem 0.55rem 0.55rem 0.55rem;
  padding: 0.55rem 0.7rem;
  box-shadow: 0 1px 0 rgba(21, 32, 40, 0.04);
  line-height: 1.5;
  color: var(--ink);
  font-size: 0.88rem;
}

.wx-bubble--me {
  background: #c8ebe3;
  border-color: rgba(26, 122, 109, 0.22);
  border-radius: 0.55rem 0.2rem 0.55rem 0.55rem;
}

.wx-bubble--suggest {
  display: block;
}

.wx-msg.is-selected .wx-bubble {
  background: #e7f4f1;
  border-color: rgba(26, 122, 109, 0.4);
}

.wx-msg-actions {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  margin-top: 0.28rem;
  padding-left: 0.1rem;
}

.wx-msg-actions--me {
  justify-content: flex-end;
  padding-left: 0;
  padding-right: 0.1rem;
}

.wx-msg-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  border: none;
  border-radius: 0.35rem;
  background: transparent;
  color: #6a7a82;
  cursor: pointer;
}

.wx-msg-action:hover {
  background: rgba(45, 62, 70, 0.08);
  color: #2f4048;
}

.wx-msg-action.is-on {
  color: var(--accent);
  background: rgba(26, 122, 109, 0.1);
}

.wx-msg-more-wrap {
  position: relative;
}

.wx-msg-more-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.25rem);
  z-index: 8;
  min-width: 8.5rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 8px 20px rgba(21, 32, 40, 0.12);
}

.wx-msg-more-item {
  display: block;
  width: 100%;
  padding: 0.4rem 0.55rem;
  border: none;
  background: transparent;
  text-align: left;
  font: inherit;
  font-size: 0.78rem;
  color: var(--ink);
  cursor: pointer;
}

.wx-msg-more-item:hover {
  background: #f2f6f5;
}

.wx-toast {
  position: fixed;
  z-index: 1200;
  min-width: 4.5rem;
  max-width: min(18rem, calc(100vw - 1rem));
  padding: 0.35rem 0.7rem;
  border-radius: 0.35rem;
  background: rgba(28, 36, 42, 0.92);
  color: #f4f7f6;
  font-size: 0.78rem;
  line-height: 1.3;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease;
  box-shadow: 0 6px 18px rgba(15, 22, 28, 0.22);
  white-space: nowrap;
}

.wx-toast.is-show {
  opacity: 1;
  visibility: visible;
}

.wx-dims {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0 0 0.4rem;
}

.wx-dim {
  display: inline-flex;
  align-items: baseline;
  gap: 0.15rem;
  padding: 0.1rem 0.35rem;
  background: #f2f6f5;
  border: 1px solid #d7e2e0;
  font-size: 0.72rem;
  color: var(--muted);
}

.wx-dim b {
  font-size: 0.92rem;
  color: var(--ink);
  font-weight: 700;
  font-family: var(--font-display);
}

.wx-insight-claim {
  margin: 0 0 0.35rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.45;
}

.wx-note {
  margin: 0;
  color: #3d4d57;
  font-size: 0.86rem;
  line-height: 1.62;
}

.wx-note + .wx-note {
  margin-top: 0.55rem;
}

.wx-bubble--review-prose .wx-note:first-child {
  margin-top: 0;
}

.wx-bubble--review-prose .wx-note:last-child {
  margin-bottom: 0;
}

.wx-note.muted,
.wx-note.muted strong {
  color: #6a7a82;
}

.wx-review-quote {
  margin: 0 0 0.55rem;
  padding: 0.45rem 0.55rem;
  border-left: 3px solid color-mix(in srgb, var(--reader-border, #1a7a6d) 55%, #cfd8d4);
  background: color-mix(in srgb, var(--reader-soft, #f6f8f7) 80%, #fff);
  border-radius: 0 4px 4px 0;
}

.wx-review-quote-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted, #66736e);
  margin-bottom: 0.25rem;
}

.wx-review-quote-text,
.wx-review-quote p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.55;
  color: color-mix(in srgb, var(--ink, #1a1f1c) 88%, #66736e);
}

.wx-review-quote-text + .wx-review-quote-text {
  margin-top: 0.4rem;
}

.wx-note-muted {
  opacity: 0.82;
  font-size: 0.78rem;
}

.wx-review-points {
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px dashed color-mix(in srgb, var(--muted, #66736e) 35%, transparent);
}

.wx-review-points + .wx-review-points {
  margin-top: 0.45rem;
  padding-top: 0;
  border-top: none;
}

.wx-review-points-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted, #66736e);
  margin-bottom: 0.3rem;
}

.wx-review-points-list {
  margin: 0;
  padding: 0 0 0 1.05rem;
  list-style: disc;
}

.wx-review-points-list li {
  margin: 0.28rem 0;
  line-height: 1.55;
  color: #4a5a64;
}

.wx-bubble--typing {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  min-width: 2.6rem;
  padding: 0.7rem 0.85rem;
}

.wx-bubble--typing span {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: #8aa0a8;
  animation: wx-typing 1.1s infinite ease-in-out;
}

.wx-bubble--typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.wx-bubble--typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes wx-typing {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

.wx-chat-composer-inner {
  position: absolute;
  left: 0.7rem;
  right: 0.7rem;
  bottom: 0.75rem;
  z-index: 8;
  display: flex;
  flex-direction: column;
  margin: 0;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: none;
}

/* 底部托盘：挡住滚动内容，但不盖住白色输入框 */
.wx-chat::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--wx-composer-dock, 6.25rem);
  z-index: 7;
  background: #dde6e9;
  pointer-events: none;
}

.wx-chat-composer-inner textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  resize: none;
  overflow-y: auto;
  /* 默认 1 行，最多 10 行（含上下 padding） */
  --wx-line: calc(0.8rem * 1.45);
  --wx-pad-y: 0.85rem;
  min-height: calc(var(--wx-pad-y) + var(--wx-line));
  max-height: calc(var(--wx-pad-y) + 10 * var(--wx-line));
  height: calc(var(--wx-pad-y) + var(--wx-line));
  border: none;
  background: transparent;
  padding: 0.5rem 0.65rem 0.35rem;
  font: inherit;
  font-size: 0.8rem;
  line-height: 1.45;
}

.wx-chat-composer-inner textarea:focus {
  outline: none;
}

.wx-chat-composer-inner:focus-within {
  outline: 2px solid rgba(26, 122, 109, 0.25);
  outline-offset: 0;
}

.wx-chat-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.2rem 0.35rem 0.35rem;
  flex-shrink: 0;
}

.wx-mode-tabs {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.2rem;
  flex: 0 1 auto;
  min-width: 0;
}

.wx-mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  height: 1.45rem;
  padding: 0 0.45rem 0 0.35rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #6a757c;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  line-height: 1;
  white-space: nowrap;
}

.wx-mode-tab:hover {
  background: #f1f4f6;
  color: #2b343b;
}

.wx-mode-tab.active {
  background: #e8ecef;
  color: #2b343b;
}

.wx-mode-tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.9rem;
  height: 0.9rem;
  color: inherit;
}

.wx-mode-tab-icon svg {
  display: block;
  width: 0.9rem;
  height: 0.9rem;
}

.wx-mode-tab-label {
  line-height: 1;
}

.wx-mode-wrap {
  display: none;
}

.wx-mode-pill {
  display: none;
}

.wx-mode-menu {
  display: none !important;
}

.wx-mode-item {
  display: none;
}

.wx-chat-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  flex-shrink: 0;
  margin-left: auto;
}

.wx-ctx-progress {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #8a959c;
  cursor: pointer;
}

.wx-ctx-progress:hover {
  background: rgba(14, 20, 25, 0.05);
  color: #6b757c;
}

.wx-ctx-progress svg {
  display: block;
  transform: rotate(-90deg);
  pointer-events: none;
}

.ctx-usage-backdrop {
  display: none !important;
}

.ctx-usage-dialog {
  position: fixed;
  z-index: 73;
  width: auto;
  max-width: none;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #e6eaed;
  border-radius: 0;
  box-shadow: 0 -8px 28px rgba(14, 20, 25, 0.12);
  overflow: hidden;
  border-bottom: none;
}

.ctx-usage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0.95rem 0.35rem;
}

.ctx-usage-head h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #2b343b;
}

.ctx-usage-body {
  padding: 0.2rem 0.95rem 0.95rem;
}

.ctx-usage-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
  font-size: 0.82rem;
}

.ctx-usage-pct {
  font-weight: 600;
  color: #2b343b;
}

.ctx-usage-tokens {
  color: #7a858c;
  font-variant-numeric: tabular-nums;
}

.ctx-usage-bar {
  display: flex;
  width: 100%;
  height: 0.55rem;
  border-radius: 999px;
  overflow: hidden;
  background: #e8ecef;
  margin-bottom: 0.85rem;
}

.ctx-usage-seg {
  height: 100%;
  min-width: 2px;
}

.ctx-usage-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.ctx-usage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.82rem;
}

.ctx-usage-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #3d474e;
  min-width: 0;
}

.ctx-usage-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 2px;
  flex-shrink: 0;
}

.ctx-usage-count {
  color: #6b757c;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.wx-ctx-track {
  fill: none;
  stroke: #d7e0e4;
  stroke-width: 2.4;
}

.wx-ctx-value {
  fill: none;
  stroke: #6b757c;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.wx-chat-attach {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #6b757c;
  cursor: pointer;
}

.wx-chat-attach:hover {
  color: var(--ink);
  background: rgba(14, 20, 25, 0.05);
}

.wx-chat-attach svg {
  display: block;
}

.wx-chat-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 999px;
  background: var(--accent, #1a7a6d);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(14, 20, 25, 0.12);
}

.wx-chat-send:hover {
  filter: brightness(1.06);
}

.wx-chat-send:active {
  transform: translateY(1px);
}

.wx-chat-send svg {
  display: block;
}

.preview-html {
  border: none;
  border-radius: 0;
  padding: 1rem 0;
  max-height: none;
  overflow: visible;
  background: transparent;
  line-height: 1.75;
}

.preview-html h1 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 0.8rem;
}

.draft-reading {
  max-width: 42rem;
}

.draft-stage {
  margin: 0 0 0.85rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.draft-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 1.25rem;
  color: var(--ink);
}

.draft-sec {
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.draft-sec:first-of-type {
  border-top: none;
  padding-top: 0;
}

.draft-sec h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.45rem;
}

.draft-retell {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--ink);
}

.draft-intent {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
}

.draft-ev {
  margin-top: 0.65rem;
  padding: 0.55rem 0.65rem;
  border-left: 2px solid var(--line);
  background: #f7f9fa;
}

.draft-ev.ok { border-left-color: var(--accent); }
.draft-ev.wait { border-left-color: var(--warn); }
.draft-ev.no { border-left-color: #c45c5c; opacity: 0.75; }

.draft-ev .pill { margin-bottom: 0.25rem; }
.draft-ev p {
  margin: 0.25rem 0 0;
  font-size: 0.86rem;
  line-height: 1.55;
  color: #3d4d57;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 240px;
  overflow: auto;
  background: #0e1419;
  color: #d7e2e8;
  border-radius: 0;
  padding: 0.85rem 1rem;
  margin-top: 0.5rem;
}

.list-check {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.kv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.5rem;
}

@media (max-width: 700px) {
  .kv { grid-template-columns: 1fr; }
}

.kv label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.84rem;
  color: var(--muted);
}

.export-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.85rem 0;
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.article-diff-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  margin: 0.35rem 0 0.55rem;
  font-size: 0.8rem;
  color: var(--muted, #66736e);
}

.article-diff-note {
  margin: 0.35rem 0 0;
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
  background: color-mix(in srgb, var(--reader-soft, #f6f8f7) 88%, #fff);
  font-size: 0.84rem;
  line-height: 1.55;
}

.article-diff-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: min(52vh, 520px);
  overflow: auto;
  padding-right: 0.15rem;
}

.article-diff-block {
  border-radius: 6px;
  padding: 0.5rem 0.6rem;
  border: 1px solid color-mix(in srgb, var(--line, #d7e2e0) 80%, transparent);
}

.article-diff-block p {
  margin: 0.35rem 0 0;
  font-size: 0.84rem;
  line-height: 1.55;
}

.article-diff-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.08rem 0.35rem;
  border-radius: 4px;
}

.article-diff-block--add {
  background: color-mix(in srgb, #e8f6ef 82%, #fff);
  border-color: color-mix(in srgb, #8bc4a8 45%, #d7e2e0);
}

.article-diff-block--add .article-diff-tag {
  background: #d4eddf;
  color: #1f6b45;
}

.article-diff-block--del {
  background: color-mix(in srgb, #fdeeee 82%, #fff);
  border-color: color-mix(in srgb, #e0a8a8 45%, #d7e2e0);
}

.article-diff-block--del .article-diff-tag {
  background: #f8d9d9;
  color: #8b2e2e;
}

.article-diff-block--change {
  background: color-mix(in srgb, #f7f8fb 88%, #fff);
}

.article-diff-block--change .article-diff-tag {
  background: #e6ebf2;
  color: #3d4f66;
}

.article-diff-old {
  color: #8b4a4a;
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, #c87070 65%, transparent);
}

.article-diff-new {
  color: #1f6b45;
  font-weight: 600;
}

.article-inline-diff {
  border: 1px solid color-mix(in srgb, var(--line, #d7e2e0) 88%, transparent);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.article-marked-wrap {
  border: 1px solid color-mix(in srgb, var(--line, #d7e2e0) 88%, transparent);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.article-marked-head,
.article-inline-diff-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem 0.75rem;
  padding: 0.45rem 0.65rem;
  font-size: 0.76rem;
  color: var(--muted, #66736e);
  background: color-mix(in srgb, var(--reader-soft, #f6f8f7) 90%, #fff);
  border-bottom: 1px solid color-mix(in srgb, var(--line, #d7e2e0) 80%, transparent);
}

.article-mark-legend,
.article-inline-diff-legend {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.72rem;
}

.article-mark-legend i,
.article-inline-diff-legend i {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 2px;
  margin-right: 0.2rem;
  vertical-align: middle;
}

.article-mark-legend .legend-del,
.article-inline-diff-legend .legend-del {
  background: color-mix(in srgb, #f5caca 85%, #fff);
  border: 1px solid color-mix(in srgb, #d88 35%, transparent);
}

.article-mark-legend .legend-add,
.article-inline-diff-legend .legend-add {
  background: color-mix(in srgb, #c8ebd6 85%, #fff);
  border: 1px solid color-mix(in srgb, #6a9 35%, transparent);
}

.article-marked-body {
  padding: 0.15rem 0;
}

.preview-html .article-marked-body p {
  margin: 0 0 0.85rem;
  line-height: 1.72;
  font-size: 0.94rem;
  color: var(--ink, #1a1f1c);
}

.preview-html .article-marked-body p.article-mark-del {
  color: #b53a3a;
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, #c87070 70%, transparent);
  margin-bottom: 0.2rem;
}

.preview-html .article-marked-body p.article-mark-add {
  color: #1a7a47;
  font-weight: 600;
  margin-top: 0;
}

.preview-html .article-marked-body p.article-mark-del + p.article-mark-add {
  margin-top: -0.35rem;
  margin-bottom: 0.95rem;
}

.agent-write-confirm {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}
.agent-write-confirm.hidden { display: none; }
.agent-write-confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 28, 24, 0.45);
}
.agent-write-confirm-card {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: min(80vh, 640px);
  overflow: auto;
  background: var(--panel, #fff);
  border-radius: 12px;
  padding: 1rem 1.1rem 1.05rem;
  box-shadow: 0 18px 48px rgba(0,0,0,0.18);
  border: 1px solid color-mix(in srgb, var(--line, #d5ddd7) 80%, transparent);
}
.agent-write-confirm-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}
.agent-write-item {
  border: 1px solid var(--line, #d5ddd7);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  margin-bottom: 0.55rem;
  background: color-mix(in srgb, var(--panel, #fff) 92%, #e8efe9);
}
.agent-write-item-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: baseline;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}
.agent-write-preview {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted, #5a655c);
  max-height: 160px;
  overflow: auto;
}
