@import url("./design-tokens.css");

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--di-page-gradient), #fafafa;
  color: var(--ink);
  font-family: var(--di-font);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}
button, input, select { font: inherit; }
button, label, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 2px solid var(--di-primary);
  outline-offset: 3px;
}

.topbar, .app-shell, .site-footer { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.topbar {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 12px;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--di-radius-md);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: var(--di-shadow-sm);
  backdrop-filter: blur(var(--di-blur-md));
  -webkit-backdrop-filter: blur(var(--di-blur-md));
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  color: var(--ink);
  text-decoration: none;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  transition: color var(--di-duration-fast) var(--di-ease);
}
.brand-dot { color: var(--di-primary); }
.brand:hover { color: var(--di-ink); }
.brand-mark,
.brand strong,
.brand small { display: none; }
.topbar-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
#accountChip { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.trial-meter {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.trial-meter.is-empty { color: #b45309; }
.trial-banner {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px 32px;
  width: min(1120px, calc(100% - 48px));
  margin: 12px auto 0;
  padding: 24px 28px;
  border: 1px solid rgba(204, 255, 0, 0.35);
  border-radius: 1.75rem;
  background: rgba(0, 0, 0, 0.62);
  color: #ebebeb;
  font-size: 16px;
  line-height: 1.6;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.trial-banner::before,
.trial-banner::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(28px);
  pointer-events: none;
  z-index: 0;
}
.trial-banner::before {
  width: 180px;
  height: 180px;
  left: -48px;
  top: -90px;
  background: rgba(204, 255, 0, 0.34);
}
.trial-banner::after {
  width: 150px;
  height: 150px;
  right: 12%;
  bottom: -90px;
  background: rgba(16, 185, 129, 0.28);
}
.trial-banner[hidden] { display: none !important; }
.trial-banner-lead, .trial-banner-actions, .trial-waitlist { position: relative; z-index: 1; }
.trial-banner-actions { display: flex; flex: 1 1 280px; flex-direction: column; align-items: flex-end; gap: 10px; min-width: min(100%, 280px); }
.trial-invite {
  flex: none;
  height: 44px;
  min-height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: #ccff00;
  color: #000;
  font: 700 15px/1 "Space Grotesk", "Noto Sans SC", sans-serif;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(204, 255, 0, 0.28);
}
.trial-invite:hover { background: #d6ff4d; color: #000; }
.trial-banner-lead { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.trial-banner-copy { margin: 0; color: #ebebeb; font-size: 16px; font-weight: 500; line-height: 1.6; }
.trial-banner.is-saved { border-color: rgba(255, 255, 255, 0.1); }
.trial-banner.is-saved .trial-banner-copy { color: rgba(255, 255, 255, 0.6); opacity: 0.5; }
.trial-banner.is-saved::before, .trial-banner.is-saved::after { opacity: 0.35; }
.trial-waitlist {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.trial-waitlist input {
  flex: 1 1 14rem;
  width: 14rem;
  max-width: 100%;
  min-width: 0;
  height: 40px;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #ebebeb;
  font: 14px/1.4 "Space Grotesk", "Noto Sans SC", sans-serif;
}
.trial-waitlist input::placeholder { color: rgba(255, 255, 255, 0.42); }
.trial-waitlist input:focus { outline: none; background: rgba(204, 255, 0, 0.06); }
.trial-waitlist button {
  flex: none;
  height: 40px;
  min-height: 40px;
  padding: 0 22px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font: 700 14px/1 "Space Grotesk", "Noto Sans SC", sans-serif;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: none;
}
.trial-waitlist button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); color: #fff; }
.trial-waitlist button:disabled { opacity: .55; cursor: wait; box-shadow: none; }
.trial-waitlist-feedback { margin: 0; color: #ccff00; font-size: 13px; line-height: 1.5; }
.trial-waitlist-feedback:empty { display: none; }
.trial-waitlist-feedback.is-success {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ccff00;
  font-size: 15px;
  font-weight: 700;
}
.trial-waitlist-feedback.is-success::before {
  content: "";
  width: 20px;
  height: 20px;
  flex: none;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / contain no-repeat;
}
.trial-banner a { margin-left: 8px; color: #ccff00; font-weight: 700; text-decoration: none; }
.trial-banner a:hover { color: #d6ff4d; }
.ghost-button, .accent-button, .ai-button {
  border-radius: var(--di-radius-full);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  transition: opacity var(--di-duration-fast) var(--di-ease), color var(--di-duration-fast) var(--di-ease), background var(--di-duration-fast) var(--di-ease);
}
.ghost-button { border: 1px solid var(--line); background: transparent; color: var(--di-neutral); }
.ghost-button:hover { color: var(--di-primary); background: rgba(59, 130, 246, 0.06); }
.accent-button { border: 0 solid rgb(229, 231, 235); background: var(--di-surface); color: #fff; }
.accent-button:hover { opacity: 0.9; }
.ai-button { border: 0 solid rgb(229, 231, 235); background: var(--di-surface); color: #fff; }
.ai-button:disabled { cursor: wait; opacity: .55; }
.ghost-button:hover, .accent-button:hover, .ai-button:hover, .copy-button:hover { transform: none; }
.file-button { position: relative; overflow: hidden; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: none; }
.eyebrow::before { content: ""; width: 16px; height: 1px; background: var(--di-primary); }
.live-dot { display: none; }

.composer-shell {
  margin: 20px 0 16px;
  padding: 1px;
  border-radius: var(--di-radius-md);
  background: var(--di-shell-gradient);
  box-shadow: var(--di-shadow-sm);
}
.composer-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 12px;
  align-items: stretch;
  margin: 0;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: calc(var(--di-radius-md) - 1px);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: var(--di-shadow-glass);
  backdrop-filter: blur(var(--di-blur-lg));
  -webkit-backdrop-filter: blur(var(--di-blur-lg));
}
.composer-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.composer-label { color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 0; }
.composer-hero textarea {
  width: 100%;
  min-height: 72px;
  max-height: 180px;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--di-radius-sm);
  background: rgba(250, 250, 250, 0.9);
  color: var(--ink);
  font: 15px/1.55 var(--di-font);
}
.composer-hero textarea::placeholder { color: #a1a1aa; }
.composer-hero textarea:focus {
  border-color: var(--di-primary);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--di-primary) 28%, transparent);
}
.composer-side { display: flex; }
.optimize-button {
  flex: 1;
  min-height: 72px;
  border: 0 solid rgb(229, 231, 235);
  border-radius: var(--di-radius-full);
  background: var(--di-surface);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: opacity var(--di-duration-fast) var(--di-ease);
}
.optimize-button:hover { opacity: 0.9; transform: none; }
.optimize-button:disabled { cursor: wait; opacity: .55; transform: none; }
.composer-status { grid-column: 1 / -1; color: var(--muted); font-size: 12px; line-height: 1.45; }

.article-editor { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(420px, 1.2fr); gap: 42px; align-items: end; margin-bottom: 28px; padding: 27px 30px 30px; border-radius: 18px; background: #252822; color: #f4f1e8; box-shadow: var(--shadow); }
.article-editor-copy { max-width: 470px; }
.article-editor-copy .eyebrow { color: #aeb3a4; }
.article-editor-copy .eyebrow::before { background: var(--di-primary); }
.article-editor-copy h2 { margin: 14px 0 10px; color: #f4f1e8; font-size: clamp(25px, 3vw, 38px); line-height: 1.2; letter-spacing: -.05em; }
.article-editor-copy p { margin: 0; color: #b8bdaf; font-size: 13px; line-height: 1.8; }
.article-editor-form label { display: block; margin-bottom: 8px; color: #c8ccb9; font-size: 12px; font-weight: 700; }
.article-editor-form textarea { display: block; width: 100%; min-height: 154px; resize: vertical; padding: 14px 15px; border: 1px solid #596052; border-radius: 12px; background: #171917; color: #eef1e5; font: 14px/1.75 ui-monospace, SFMono-Regular, Menlo, "PingFang SC", "Microsoft YaHei", sans-serif; }
.article-editor-form textarea::placeholder { color: #737a6d; }
.article-editor-form textarea:focus { border-color: var(--di-primary); outline: 3px solid color-mix(in srgb, var(--di-primary) 20%, transparent); }
.article-editor-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 11px; }
.article-editor-actions .accent-button { border-color: transparent; background: var(--di-surface); color: #fff; }
.article-editor-actions .ghost-button { border-color: #596052; color: #d7dacb; }
.article-editor-actions span { margin-left: auto; color: #9da497; font-size: 11px; }

.lab-shell {
  padding: 1px;
  border-radius: var(--di-radius-md);
  background: var(--di-shell-gradient);
  box-shadow: var(--di-shadow-sm);
}
.lab-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  height: clamp(640px, calc(100vh - 120px), 1280px);
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: calc(var(--di-radius-md) - 1px);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: var(--di-shadow-glass);
  backdrop-filter: blur(var(--di-blur-lg));
  -webkit-backdrop-filter: blur(var(--di-blur-lg));
}
.insight-panel {
  min-height: 0;
  overflow-y: auto;
  padding: 8px 16px 20px;
  background: rgba(250, 250, 250, 0.72);
  border-left: 1px solid var(--line);
  scrollbar-color: #d4d4d8 transparent;
  scrollbar-width: thin;
}
.preview-panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.panel-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.panel-kicker > span { display: none; }
.mood-picker { margin: 0; padding: 0; border: 0; }
.theme-group { padding: 0; margin: 0; border: 0; }
.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 0; }
.theme-chip {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
  min-height: 0;
  padding: 7px 10px 7px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color var(--di-duration-fast) var(--di-ease), background var(--di-duration-fast) var(--di-ease),
    box-shadow var(--di-duration-fast) var(--di-ease);
}
.theme-chip::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 999px;
  background: var(--theme-primary, var(--di-primary));
  opacity: .55;
}
.theme-chip:hover { transform: none; border-color: color-mix(in srgb, var(--theme-primary, var(--di-primary)) 45%, var(--line)); }
.theme-chip b { color: var(--ink); font-size: 12px; font-weight: 600; line-height: 1.2; }
.theme-chip span { display: none; }
.theme-chip.is-classic { --theme-primary: #71717a; }
.theme-chip.is-classic::before { background: var(--theme-primary); }
.theme-chip.is-active {
  border-color: color-mix(in srgb, var(--theme-primary, var(--di-primary)) 40%, var(--line));
  background: linear-gradient(
    145deg,
    #ffffff 0%,
    color-mix(in srgb, var(--theme-primary, var(--di-primary)) 16%, #ffffff) 100%
  );
  box-shadow: none;
}
.theme-chip.is-classic.is-active {
  border-color: color-mix(in srgb, #71717a 40%, var(--line));
  background: linear-gradient(145deg, #ffffff 0%, color-mix(in srgb, #71717a 14%, #ffffff) 100%);
}
.theme-chip.is-active b { color: var(--ink); }
.theme-chip.is-classic.is-active b { color: var(--ink); }
.mood-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 0; }
.mood-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: var(--di-radius-sm);
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color var(--di-duration-fast) var(--di-ease), background var(--di-duration-fast) var(--di-ease), color var(--di-duration-fast) var(--di-ease);
}
.mood-card:hover { transform: none; border-color: var(--di-primary); }
.mood-card b { color: var(--ink); font-size: 12px; font-weight: 600; }
.mood-card span { color: var(--muted); font-size: 10px; }
.mood-card.is-active { border-color: var(--di-surface); background: var(--di-surface); }
.mood-card.is-active b { color: #fff; }
.mood-card.is-active span { color: rgba(255, 255, 255, 0.72); }
.skin-current { color: var(--muted); font-size: 10px; font-weight: 400; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.style-parameters { margin-top: 0; padding-top: 0; border-top: 0; }
.style-parameters-mount { min-width: 0; }
.parameters-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.parameters-heading > span { color: var(--muted); font-size: 10px; }

.control-group {
  padding: 0;
  border-bottom: 1px solid var(--line);
}
.control-group:last-child { border-bottom: 0; }
.control-group[hidden] { display: none !important; }
.group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 14px 2px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.group-toggle:hover { opacity: 0.72; }
.group-icon {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.group-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}
.control-group.is-open .group-icon {
  color: var(--di-ink);
}
.group-label {
  flex: 0 1 auto;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.group-toggle .group-hint {
  flex: 1;
  min-width: 0;
  color: var(--muted);
  font-weight: 400;
  font-size: 11px;
  text-align: right;
}
.group-chevron {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-left: 4px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
  transition: transform var(--di-duration) var(--di-ease);
}
.control-group.is-open .group-chevron { transform: rotate(225deg); }
.group-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--di-duration) cubic-bezier(0.4, 0.2, 0.6, 1);
}
.control-group.is-open .group-body {
  grid-template-rows: 1fr;
}
.group-body-inner {
  overflow: hidden;
  min-height: 0;
}
.control-group.is-open .group-body-inner {
  padding-bottom: 14px;
}
@media (prefers-reduced-motion: reduce) {
  .group-body { transition: none; }
  .group-chevron { transition: none; }
}
.group-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 14px; font-size: 12px; font-weight: 800; }
.group-hint { color: var(--muted); font-weight: 500; font-size: 10px; }
.color-control, .range-control, .toggle-control, .select-control { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; color: var(--muted); font-size: 12px; }
.color-control input { width: 28px; height: 20px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; }
.select-control { margin: 10px 0; }
.select-control select { width: 136px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font-size: 11px; }
.range-control { display: block; margin: 11px 0 17px; }
.range-control > span { display: flex; justify-content: space-between; margin-bottom: 7px; }
.range-control output { color: var(--ink); font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; height: 3px; appearance: none; border-radius: var(--di-radius-full); background: #e4e4e7; }
input[type="range"]::-webkit-slider-thumb { width: 15px; height: 15px; appearance: none; border: 2px solid var(--panel); border-radius: 50%; background: var(--di-surface); box-shadow: 0 0 0 1px var(--di-surface); }
input[type="range"]::-moz-range-thumb { width: 13px; height: 13px; border: 2px solid var(--panel); border-radius: 50%; background: var(--di-surface); box-shadow: 0 0 0 1px var(--di-surface); }
.toggle-control { position: relative; margin: 11px 0; }
.toggle-control input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-control i { width: 31px; height: 18px; padding: 2px; border-radius: 99px; background: #d4d4d8; transition: background .15s; }
.toggle-control i::before { content: ""; display: block; width: 14px; height: 14px; border-radius: 50%; background: white; transition: transform .15s; }
.toggle-control input:checked + i { background: var(--di-surface); }
.toggle-control input:checked + i::before { transform: translateX(13px); background: #fff; }

.workspace-pane { margin-top: 22px; }
.editor-heading, .structure-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.editor-heading strong, .structure-heading strong { font-size: 13px; }
.editor-heading span, .structure-heading > span, .structure-heading div > span { color: var(--muted); font-size: 10px; }
.editor-label { display: block; margin: 17px 0 7px; color: var(--muted); font-size: 11px; font-weight: 700; }
.editor-label small { color: #9a9c94; font-weight: 500; }
.title-input, .markdown-editor { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #fffefa; color: var(--ink); }
.title-input { min-height: 40px; padding: 9px 11px; font-size: 13px; }
.markdown-editor { display: block; min-height: 300px; padding: 12px; resize: vertical; font: 12px/1.75 ui-monospace, SFMono-Regular, Menlo, Consolas, "PingFang SC", "Microsoft YaHei", sans-serif; }
.title-input::placeholder, .markdown-editor::placeholder { color: #9ea097; }
.title-input:focus, .markdown-editor:focus { border-color: var(--di-primary); outline: 3px solid color-mix(in srgb, var(--di-primary) 18%, transparent); }
.markdown-tip { margin: 9px 0 0; color: var(--muted); font-size: 10px; line-height: 1.7; }
.markdown-tip code { padding: 1px 3px; border-radius: 3px; background: #f4f4f5; color: var(--ink); font-family: ui-monospace, monospace; }
.editor-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.editor-actions .accent-button { border-color: var(--di-surface); }
.editor-actions span { width: 100%; color: var(--muted); font-size: 10px; }
.editor-actions .ai-button { padding-inline: 12px; font-size: 11px; }
.editor-actions .accent-button#copyArticleButton { border-color: transparent; background: var(--di-surface); color: #fff; }
.ai-tip { margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.editor-toggle { margin: 15px 0 0; padding: 10px; border: 1px solid #e0e1d9; border-radius: 9px; background: rgba(255,255,255,.45); }
.structure-editor { margin-top: 23px; padding-top: 20px; border-top: 1px solid var(--line); }
.structure-heading { margin-bottom: 10px; }
.structure-heading div { display: grid; gap: 3px; }
.structure-list { display: grid; gap: 7px; max-height: 295px; overflow: auto; padding-right: 2px; }
.structure-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) 91px; align-items: center; gap: 8px; min-height: 48px; padding: 7px; border: 1px solid #e0e1d9; border-radius: 9px; background: rgba(255,255,255,.55); }
.structure-row.is-fixed { grid-template-columns: 22px minmax(0, 1fr); opacity: .72; }
.structure-index { color: var(--di-primary); font: 10px ui-monospace, monospace; }
.structure-copy { min-width: 0; }
.structure-copy b { display: block; color: var(--ink); font-size: 10px; }
.structure-copy small { display: block; overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.structure-row select { min-width: 0; width: 100%; padding: 6px 5px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); font-size: 10px; }
.structure-empty { margin: 0; padding: 13px; border: 1px dashed var(--line); border-radius: 9px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.parameter-divider { margin-top: 25px; }
.insight-heading { margin: -1px 0 0; color: var(--ink); font-size: 12px; font-weight: 800; }

.preview-header { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.preview-header-actions { display: flex; align-items: center; gap: 10px; min-width: 0; }
.copy-button { flex-shrink: 0; border: 0 solid rgb(229, 231, 235); border-radius: var(--di-radius-full); padding: 8px 14px; background: var(--di-surface); color: #fff; font-size: 12px; font-weight: 500; transition: opacity var(--di-duration-fast) var(--di-ease); }
.copy-button:hover { opacity: 0.9; }
.copy-feedback { min-height: 0; margin: 0; color: var(--ink); font-size: 11px; text-align: right; white-space: nowrap; }
.preview-stage { flex: 1; min-height: 0; overflow: auto; padding: 20px; background: var(--paper); }
.web-preview { min-height: 100%; }
.article-page { min-height: 100%; padding: 44px 48px 32px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.04); scrollbar-width: thin; scrollbar-color: #d2d2d7 transparent; }
.article-page > * { max-width: var(--content-width, 620px); margin-left: auto; margin-right: auto; }
.article-page [contenteditable="true"] { outline: none; caret-color: var(--accent-color, #6e8e23); }
.article-page [contenteditable="true"]:focus { box-shadow: inset 0 0 0 1px rgba(140,172,34,.28); border-radius: 6px; }
.article-content [data-block-index].is-block-menu-target {
  outline: 1.5px solid color-mix(in srgb, var(--di-primary, #3b82f6) 55%, transparent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* 浮层盖在白纸预览上。字色不要跟工作台的浅色变量走，否则会变成白底浅字。 */
.block-type-menu {
  position: fixed;
  z-index: 80;
  min-width: 148px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: #161616;
  color: #f4f4f5;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}
.block-type-menu-label {
  margin: 0;
  padding: 6px 10px 4px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.block-type-menu-item {
  display: block;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #f4f4f5;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.block-type-menu-item:hover,
.block-type-menu-item:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  outline: none;
}
.block-type-menu-item.is-active {
  background: #ccff00;
  color: #141414;
}
.block-type-menu-item.is-active:hover,
.block-type-menu-item.is-active:focus-visible {
  background: #d6ff4d;
  color: #141414;
}
.article-meta { margin-bottom: 22px; color: #8e9389; font-size: 10px; letter-spacing: .08em; }
.article-page h2 { margin: 0 0 12px; color: var(--title-color, #20231f); font-family: var(--heading-font, inherit); font-size: var(--title-size, 26px); font-weight: var(--heading-weight, 800); line-height: var(--heading-line-height, 1.33); letter-spacing: var(--heading-letter-spacing, -.04em); }
.article-page h2[hidden] { display: none !important; }
.article-subtitle { margin: 0 0 29px; color: #8e9389; font-size: 12px; line-height: 1.7; }
.article-content { color: var(--text-color, #3f3f3f); font-family: var(--body-font, inherit); }
.article-content p { margin: 0 0 var(--paragraph-spacing, 18px); font-size: var(--font-size, 16px); line-height: var(--line-height, 1.75); letter-spacing: var(--letter-spacing, .3px); text-align: var(--text-align, left); text-indent: var(--text-indent, 0); }
.article-content .lead { color: var(--accent-color, #718c25); font-weight: 750; text-indent: 0; }
.article-content .section-title { margin: var(--heading-before, 31px) 0 var(--heading-after, 12px); color: var(--text-color, #3f3f3f); font-family: var(--heading-font, inherit); font-size: var(--heading-size, 27px); font-weight: var(--heading-weight, 800); line-height: var(--heading-line-height, 1.35); letter-spacing: var(--heading-letter-spacing, -.04em); text-indent: 0; }
.article-content .section-title.level-3 { font-size: var(--subheading-size, 23px); }
.article-content .section-title.level-4, .article-content .section-title.level-5, .article-content .section-title.level-6 { font-size: var(--minor-heading-size, 20px); }
.article-content .section-title::before { content: ""; display: inline-block; width: 17px; height: 4px; margin: 0 8px 4px 0; border-radius: 99px; background: var(--accent-color, #718c25); }
.article-content .article-list { margin: 0 0 var(--paragraph-spacing, 18px); padding-left: var(--list-indent, 1.5em); font-size: var(--font-size, 16px); line-height: var(--line-height, 1.75); text-align: var(--text-align, left); }
.article-content .article-list li { margin: var(--list-item-spacing, 6px) 0; }
.article-content .inline-code { padding: .08em .3em; border-radius: 4px; background: var(--code-background, #f0f4e5); color: var(--code-color, #3f3f3f); font: .9em ui-monospace, SFMono-Regular, Menlo, monospace; }
.article-content .inline-highlight { padding: .05em var(--highlight-padding, 2px); border-radius: var(--highlight-radius, 3px); background: var(--highlight-color, #d7fa5c); color: var(--highlight-text-color, inherit); font-weight: 700; }
/* 荧光笔与复制一致：纯色底，不用渐变（公众号 Dark Mode 会把文字底渐变压成纯色） */
.article-page[data-highlight-style="marker"] .inline-highlight {
  padding: .05em var(--highlight-padding, 2px);
  border-radius: var(--highlight-radius, 3px);
  background: var(--highlight-color, #d7fa5c);
  box-shadow: none;
}
.article-page[data-highlight-style="underline"] .inline-highlight,
.article-page[data-theme="nocturne"][data-highlight-style="underline"] .inline-highlight {
  padding: 0; background: transparent; border-radius: 0;
  border-bottom: 3px solid var(--highlight-color, #d7fa5c); box-shadow: none; font-weight: 700;
}
.article-page[data-highlight-style="bold"] .inline-highlight,
.article-page[data-theme="nocturne"][data-highlight-style="bold"] .inline-highlight { padding: 0; background: transparent; font-weight: 800; }
.article-page[data-highlight-style="strikethrough"] .inline-highlight,
.article-page[data-theme="nocturne"][data-highlight-style="strikethrough"] .inline-highlight {
  padding: 0; background: transparent; border-radius: 0; box-shadow: none; font-weight: 700;
  color: var(--highlight-text-color, inherit);
  text-decoration: line-through;
  text-decoration-color: var(--highlight-color, #d7fa5c);
}
.article-page[data-highlight-style="text-underline"] .inline-highlight,
.article-page[data-theme="nocturne"][data-highlight-style="text-underline"] .inline-highlight {
  padding: 0; background: transparent; border-radius: 0; box-shadow: none; font-weight: 700;
  color: var(--highlight-text-color, inherit);
  text-decoration: underline;
  text-underline-offset: .14em;
  text-decoration-color: var(--highlight-color, #d7fa5c);
}
.article-page[data-highlight-style="wavy"] .inline-highlight,
.article-page[data-theme="nocturne"][data-highlight-style="wavy"] .inline-highlight {
  padding: 0; background: transparent; border-radius: 0; box-shadow: none; font-weight: 700;
  color: var(--highlight-text-color, inherit);
  text-decoration: underline;
  text-decoration-style: wavy;
  text-underline-offset: .16em;
  text-decoration-color: var(--highlight-color, #d7fa5c);
}
.article-content .inline-link { color: var(--link-color, #3f6f9f); text-decoration: underline; text-underline-offset: .14em; }
.article-content .inline-strike { text-decoration: line-through; }
.article-content .inline-underline { text-decoration: underline; text-underline-offset: .14em; }
.article-page[data-highlight-style="underline"] .inline-underline {
  padding: 0; background: transparent; border-radius: 0; text-decoration: none;
  border-bottom: 3px solid var(--highlight-color, #d7fa5c); font-weight: 700;
}
.article-content .inline-wavy {
  text-decoration: underline;
  text-decoration-style: wavy;
  text-underline-offset: .16em;
  text-decoration-color: var(--accent-color, #718c25);
}
.article-content .article-table {
  width: 100%; border-collapse: collapse; margin: 0 0 var(--paragraph-spacing, 18px);
  font-size: var(--font-size, 16px); line-height: var(--line-height, 1.75); text-align: left;
}
.article-content .article-table th,
.article-content .article-table td {
  border: 1px solid var(--divider-color, #718c25); padding: 8px 10px; text-indent: 0; vertical-align: top;
}
.article-content .article-table th {
  background: var(--card-color, #f3f5eb); color: var(--title-color, var(--text-color, #3f3f3f)); font-weight: 700;
}
.article-page[data-link-underline="false"] .inline-link { text-decoration: none; }
.article-content .article-code { overflow: auto; margin: 22px 0 26px; padding: var(--card-padding, 20px); border-radius: var(--card-radius, 12px); background: var(--code-background, #f0f4e5); color: var(--code-color, #3f3f3f); font: var(--code-font-size, 13px)/var(--code-line-height, 1.6) ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; }
.article-content .article-image { margin: 22px 0 26px; text-align: center; }
.article-content .article-image img { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: var(--image-radius, 12px); }
.article-content .article-image figcaption { margin-top: 7px; color: var(--muted-color, #8e9389); font-size: var(--caption-size, 11px); line-height: 1.6; }
.quote-card { display: block; margin: 18px 0 22px; padding: var(--card-padding, 20px); border-left: calc(var(--card-border-width, 1px) + 2px) solid var(--accent-color, #718c25); border-radius: var(--card-radius, 12px); background: var(--quote-color, #f7f8f1); color: var(--text-color, #3f3f3f); font-size: calc(var(--font-size, 16px) - 1px); line-height: var(--line-height, 1.75); text-align: var(--text-align, left); }
.quote-card strong { display: block; margin-bottom: 7px; color: var(--card-title-color, var(--accent-color, #718c25)); font-size: var(--quote-title-size, 11px); letter-spacing: .1em; }
.content-card { display: block; margin: 18px 0 22px; padding: var(--card-padding, 20px); border: var(--card-border-width, 1px) solid var(--accent-color, #718c25); border-radius: var(--card-radius, 12px); background: var(--card-color, #f3f5eb); color: var(--text-color, #3f3f3f); font-size: calc(var(--font-size, 16px) - 1px); line-height: var(--line-height, 1.75); text-align: var(--text-align, left); }
.content-card strong { display: block; margin-bottom: 7px; color: var(--card-title-color, var(--accent-color, #718c25)); font-size: var(--card-title-size, 11px); letter-spacing: .1em; }
.plain-quote { padding-left: 1em; border-left: 2px solid var(--accent-color, #718c25); font-style: italic; }
.image-note { color: var(--muted-color, #8e9389) !important; font-size: calc(var(--font-size, 16px) - 1px) !important; }
.article-divider {
  height: 0; margin: var(--divider-margin, 27px) 0; border: 0;
  border-top: var(--divider-thickness, 1px) solid var(--divider-color, #718c25);
  background: transparent; opacity: 1;
}
.fake-image {
  height: 116px; display: grid; place-items: center; margin: 22px 0 26px;
  border-radius: var(--image-radius, 12px); background: var(--accent-color, #718c25); color: #fff;
  font-size: 11px; font-weight: 800; letter-spacing: .13em; text-align: center; padding: 12px;
}

.steps-block, .stat-block {
  display: block; margin: 18px 0 22px; padding: var(--card-padding, 20px);
  border-radius: var(--card-radius, 12px); background: var(--card-color, #f3f5eb);
  color: var(--text-color, #3f3f3f); font-size: calc(var(--font-size, 16px) - 1px);
  line-height: var(--line-height, 1.75);
}
.steps-block strong, .stat-block strong {
  display: block; margin-bottom: 12px; color: var(--card-title-color, var(--accent-color, #718c25));
  font-size: var(--card-title-size, 11px); letter-spacing: .1em;
}
.steps-items { display: grid; gap: var(--list-item-spacing, 6px); }
.steps-item { display: flex; align-items: flex-start; gap: 12px; margin: 0; text-indent: 0; }
.steps-index {
  flex: 0 0 auto; min-width: 28px; color: color-mix(in srgb, var(--accent-color, #718c25) 55%, transparent);
  font-size: 1.15em; font-weight: var(--heading-weight, 800); line-height: 1.2;
}
.steps-text { flex: 1; min-width: 0; }
.stat-block { border: var(--card-border-width, 1px) solid var(--accent-color, #718c25); background: transparent; }
.stat-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px;
}
.stat-item { text-align: center; }
.stat-item b {
  display: block; color: var(--accent-color, #718c25);
  font-size: calc(var(--heading-size, 27px) - 2px); font-weight: var(--heading-weight, 800); line-height: 1.2;
}
.stat-item span { display: block; margin-top: 4px; color: var(--muted-color, #8e9389); font-size: var(--caption-size, 11px); line-height: 1.5; }
@media (max-width: 720px) {
  .stat-grid { grid-template-columns: 1fr; }
}

/* ===== 造型层：标题样式 ===== */
.article-content .section-title::before { content: none; }
.article-page[data-heading-style="bar"] .section-title::before {
  content: ""; display: inline-block; width: 17px; height: 4px; margin: 0 8px 4px 0; border-radius: 99px; background: var(--accent-color, #718c25);
}
.article-page[data-heading-style="line"] .section-title {
  padding-bottom: 10px; border-bottom: 1px solid var(--accent-color, #718c25);
}
.article-page[data-heading-style="index"] .article-content { counter-reset: section; }
.article-page[data-heading-style="index"] .section-title.level-2 { counter-increment: section; display: flex; align-items: baseline; gap: 12px; }
.article-page[data-heading-style="index"] .section-title.level-2::before {
  content: counter(section, decimal-leading-zero); display: inline-block;
  width: auto; height: auto; margin: 0; border-radius: 0; background: none;
  flex: 0 0 auto; white-space: nowrap;
  color: color-mix(in srgb, var(--accent-color, #718c25) 55%, transparent);
  font-size: 1.35em; font-weight: var(--heading-weight, 800); line-height: 1; letter-spacing: 0;
}
.article-page[data-heading-style="index"] .section-title.level-3::before,
.article-page[data-heading-style="index"] .section-title.level-4::before,
.article-page[data-heading-style="index"] .section-title.level-5::before,
.article-page[data-heading-style="index"] .section-title.level-6::before { content: none; }
.article-page[data-heading-style="block"] .section-title {
  display: inline-block; padding: 6px 14px; border-radius: 8px;
  background: var(--accent-color, #718c25); color: var(--page-color, #fff);
}
.article-page[data-heading-style="block"] .section-title::before { content: none; }

/* 叠号双语：大序号 + 标题# + 英文副标 */
.article-page[data-heading-style="poster"] .article-content { counter-reset: section; }
.article-page[data-heading-style="poster"] .section-title.level-2 {
  counter-increment: section;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 0;
  border: 0;
}
.article-page[data-heading-style="poster"] .section-title.level-2::before {
  content: counter(section, decimal-leading-zero);
  display: block;
  width: auto; height: auto; margin: 0 0 4px; border-radius: 0; background: none;
  color: var(--text-color, #18181b);
  font-size: 1.85em; font-weight: 800; line-height: 1; letter-spacing: 0;
}
.article-page[data-heading-style="poster"] .section-title.level-2::after {
  content: attr(data-sub);
  display: block;
  margin-top: 2px;
  color: var(--text-color, #18181b);
  font-size: 0.48em; font-weight: 700; line-height: 1.2; letter-spacing: 0.14em;
  text-transform: uppercase;
  background: none; height: auto; flex: 0 0 auto;
}
.article-page[data-heading-style="poster"] .section-title.level-3::before,
.article-page[data-heading-style="poster"] .section-title.level-4::before,
.article-page[data-heading-style="poster"] .section-title.level-5::before,
.article-page[data-heading-style="poster"] .section-title.level-6::before { content: none; }

/* 序号黑卡：左侧大号 + 黑底白字标题 + 英文 */
.article-page[data-heading-style="panel"] .article-content { counter-reset: section; }
.article-page[data-heading-style="panel"] .section-title.level-2.heading-panel {
  counter-increment: section;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding: 0;
  border: 0;
}
.article-page[data-heading-style="panel"] .section-title.level-2.heading-panel::before {
  content: counter(section, decimal-leading-zero);
  display: block;
  flex: 0 0 auto;
  width: auto; height: auto; margin: 0; border-radius: 0; background: none;
  color: var(--text-color, #18181b);
  font-size: 2.35em; font-weight: 900; line-height: 1; letter-spacing: 0;
}
.article-page[data-heading-style="panel"] .section-title.level-2.heading-panel::after { content: none !important; }
.article-page[data-heading-style="panel"] .heading-panel-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}
.article-page[data-heading-style="panel"] .heading-panel-main {
  display: inline-block;
  padding: 7px 12px;
  background: var(--text-color, #18181b);
  color: var(--page-color, #fff);
  font-size: 0.72em;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.02em;
}
.article-page[data-heading-style="panel"] .heading-panel-sub {
  display: block;
  margin-top: 6px;
  color: var(--text-color, #18181b);
  font-size: 0.42em;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1.2;
}
.article-page[data-heading-style="panel"] .section-title.level-3::before,
.article-page[data-heading-style="panel"] .section-title.level-4::before,
.article-page[data-heading-style="panel"] .section-title.level-5::before,
.article-page[data-heading-style="panel"] .section-title.level-6::before { content: none; }

/* 黄圈序号：倾斜黄椭圆 + 渐变数字 + 居中标题 */
.article-page[data-heading-style="oval"] .article-content { counter-reset: section; }
.article-page[data-heading-style="oval"] .section-title.level-2.heading-oval {
  counter-increment: section;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 0;
  border: 0;
}
.article-page[data-heading-style="oval"] .section-title.level-2.heading-oval::before,
.article-page[data-heading-style="oval"] .section-title.level-2.heading-oval::after { content: none !important; }
.article-page[data-heading-style="oval"] .heading-oval-badge {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 86px;
  height: 64px;
  border-radius: 50%;
  background: #ffe566;
  transform: rotate(-14deg);
  box-shadow: 5px 3px 0 0 color-mix(in srgb, #ffe566 70%, #222);
}
.article-page[data-heading-style="oval"] .heading-oval-badge::after {
  content: "";
  position: absolute;
  inset: -4px -6px;
  border: 1.5px solid color-mix(in srgb, #222 28%, transparent);
  border-radius: 50%;
  transform: rotate(6deg);
  pointer-events: none;
}
.article-page[data-heading-style="oval"] .heading-oval-num::before {
  content: counter(section, decimal-leading-zero);
  display: block;
  font-size: 42px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  background: linear-gradient(180deg, #0a0a0a 20%, #6b5a16 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.article-page[data-heading-style="oval"] .heading-oval-text {
  display: block;
  color: var(--text-color, #18181b);
  font-size: 1em;
  font-weight: var(--heading-weight, 800);
  line-height: 1.25;
}
.article-page[data-heading-style="oval"] .section-title.level-3::before,
.article-page[data-heading-style="oval"] .section-title.level-4::before,
.article-page[data-heading-style="oval"] .section-title.level-5::before,
.article-page[data-heading-style="oval"] .section-title.level-6::before { content: none; }

/* 新标题样式时，关掉主题自带的章节装饰线 */
.article-page[data-theme][data-heading-style="poster"] .section-title.level-2::after {
  content: attr(data-sub);
  flex: 0 0 auto;
  height: auto;
  background: none;
  color: var(--text-color, #18181b);
  font-size: 0.48em; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
}
.article-page[data-theme][data-heading-style="panel"] .section-title.level-2::after,
.article-page[data-theme][data-heading-style="oval"] .section-title.level-2::after {
  content: none !important;
  flex: 0;
  height: 0;
  background: none;
}

/* ===== 造型层：卡片样式（内容卡与引用卡统一） ===== */
.content-card, .quote-card { box-sizing: border-box; }
.article-page[data-card-style="border"] .content-card,
.article-page[data-card-style="border"] .quote-card {
  border: 0; border-left: calc(var(--card-border-width, 1px) + 3px) solid var(--accent-color, #718c25);
  border-radius: 0 var(--card-radius, 12px) var(--card-radius, 12px) 0;
}
.article-page[data-card-style="outline"] .content-card,
.article-page[data-card-style="outline"] .quote-card {
  border: var(--card-border-width, 1px) solid var(--accent-color, #718c25);
  background: transparent;
}
.article-page[data-card-style="soft"] .content-card { border: 0; background: var(--card-color, #f3f5eb); }
.article-page[data-card-style="soft"] .quote-card { border: 0; background: var(--quote-color, #f7f8f1); }
.article-page[data-card-style="band"] .content-card,
.article-page[data-card-style="band"] .quote-card {
  border: 0; border-radius: var(--card-radius, 12px); overflow: hidden;
  background: var(--card-color, #f3f5eb); padding: 0 0 var(--card-padding, 20px);
}
.article-page[data-card-style="band"] .quote-card { background: var(--quote-color, #f7f8f1); }
.article-page[data-card-style="band"] .content-card strong,
.article-page[data-card-style="band"] .quote-card strong {
  margin: calc(var(--card-padding, 20px) * -1) calc(var(--card-padding, 20px) * -1) 12px;
  padding: 10px var(--card-padding, 20px); background: var(--accent-color, #718c25);
  color: var(--page-color, #fff); font-size: var(--card-title-size, 11px); letter-spacing: .1em;
}

/* ===== 造型层：列表样式 ===== */
.article-content .article-list { list-style: none; padding-left: 0; counter-reset: listitem; }
.article-content li > .article-list { margin: 2px 0 0; }
.article-content .article-list li { position: relative; padding-left: calc(var(--list-indent, 1.5em) + .4em); counter-increment: listitem; }
.article-content .article-list li::before { position: absolute; left: 0; top: 0; }
.article-page[data-list-style="dot"] .article-list ul,
.article-page[data-list-style="dot"] .article-list { }
.article-page[data-list-style="dot"] ul.article-list li::before { content: "•"; color: var(--accent-color, #718c25); }
.article-page[data-list-style="dot"] ol.article-list li::before { content: counter(listitem) "."; color: var(--accent-color, #718c25); font-weight: 700; }
.article-page[data-list-style="circle"] ul.article-list li::before {
  content: ""; top: .55em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-color, #718c25);
}
.article-page[data-list-style="circle"] ol.article-list li::before {
  content: counter(listitem); width: 20px; height: 20px; display: grid; place-items: center;
  border-radius: 50%; background: var(--accent-color, #718c25); color: var(--page-color, #fff);
  font-size: .72em; font-weight: 800; line-height: 1;
}
.article-page[data-list-style="ghost"] ol.article-list li::before {
  content: counter(listitem, decimal-leading-zero); color: color-mix(in srgb, var(--accent-color, #718c25) 38%, transparent);
  font-size: 1.5em; font-weight: var(--heading-weight, 800); line-height: 1.1;
}
.article-page[data-list-style="ghost"] ul.article-list li::before { content: "—"; color: color-mix(in srgb, var(--accent-color, #718c25) 50%, transparent); }
.article-page[data-list-style="check"] ul.article-list li::before { content: "✓"; color: var(--accent-color, #718c25); font-weight: 800; }
.article-page[data-list-style="check"] ol.article-list li::before { content: "→"; color: var(--accent-color, #718c25); font-weight: 800; }

.preview-footer { display: flex; justify-content: flex-end; gap: 16px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; flex-wrap: wrap; }
.preview-footer-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.preview-tool-toggle { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-size: 11px; font-weight: 650; cursor: pointer; user-select: none; }
.preview-tool-toggle input { width: 14px; height: 14px; accent-color: var(--ink); }
.compliance-panel { margin: 0 20px 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.compliance-panel--page {
  margin: 16px 0 0;
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: var(--di-shadow-sm);
}
.compliance-panel[hidden] { display: none !important; }
.compliance-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.compliance-level { margin: 0; font-size: 12px; font-weight: 600; color: var(--ink); }
.compliance-level[data-level="ok"] { color: var(--ink); }
.compliance-level[data-level="warn"] { color: #8a5a12; }
.compliance-level[data-level="risk"] { color: #8b2e2e; }
.compliance-list { margin: 0; padding-left: 16px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.compliance-list li { margin: 2px 0; }
.compliance-list .rule { margin-left: 8px; color: var(--muted); font-size: 10px; }
.compliance-list li { position: relative; }
.compliance-help { margin-left: 6px; padding: 0 3px; border: 0; background: transparent; color: #62766a; font-size: 12px; cursor: help; }
.compliance-tooltip { position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 10; display: none; max-width: 290px; padding: 8px 10px; border: 1px solid #d5dfd4; border-radius: 7px; background: #fff; box-shadow: 0 6px 20px #2039231c; color: #3f4c42; font-size: 11px; line-height: 1.5; }
.compliance-list li:hover .compliance-tooltip, .compliance-list li:focus-within .compliance-tooltip { display: block; }

/* 暗色预览：模拟读者端夜间底，便于看对比度（非平台真实算法） */
.preview-stage.is-dark-preview { background: #191919; }
.preview-stage.is-dark-preview .article-page {
  background: #191919 !important;
  box-shadow: none;
  color: #e8e8e8;
}
.preview-stage.is-dark-preview .article-meta,
.preview-stage.is-dark-preview .article-subtitle { color: #9a9a9a; }
.preview-stage.is-dark-preview .article-page h2 { color: #f2f2f2; }
.preview-stage.is-dark-preview .article-content { color: #e4e4e4; }
.preview-stage.is-dark-preview .article-content .section-title { color: #f0f0f0; }
.preview-stage.is-dark-preview .quote-card,
.preview-stage.is-dark-preview .content-card {
  background: #242424;
  color: #e4e4e4;
}
.preview-stage.is-dark-preview .article-content .article-code {
  background: #242424;
  color: #d7e0f2;
}
.preview-stage.is-dark-preview .fake-image { color: #191919; }

.algorithm-card { display: grid; grid-template-columns: 25px 1fr; gap: 11px; margin-top: 22px; }
.algorithm-step { width: 23px; height: 23px; display: grid; place-items: center; border: 1px solid var(--di-primary); border-radius: 50%; color: var(--di-primary); font-family: ui-monospace, monospace; font-size: 10px; font-weight: 800; }
.algorithm-card strong { display: block; margin-bottom: 6px; font-size: 12px; }
.algorithm-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.75; }
.insight-divider { height: 1px; margin: 25px 0 19px; background: var(--line); }
.token-heading { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--muted); font-size: 10px; }
.token-heading span:last-child { color: #9a9c94; font-family: ui-monospace, monospace; }
.token-preview pre { max-height: 180px; overflow: auto; margin: 0; padding: 13px; border-radius: 10px; background: #18181b; color: #e4e4e7; font: 10px/1.75 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; }
.doc-link { display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; color: var(--ink); font-size: 11px; font-weight: 700; text-decoration: none; }
.doc-link:hover { color: var(--di-primary); }

/* 深夜科技杂志：深色背景、蓝灰正文、绿色关键词和证据截图卡片。 */
.article-page[data-style="deep-night"] {
  background: var(--page-color, #171717) !important;
  color: var(--text-color, #91a6cc);
  scrollbar-color: #46515e transparent;
}
.article-page[data-style="deep-night"] .article-meta {
  color: var(--muted-color, #7184a5);
}
.article-page[data-style="deep-night"] h2 {
  color: var(--title-color, #d7e0f2);
  font-style: italic;
}
.article-page[data-style="deep-night"] .article-subtitle {
  color: var(--muted-color, #7184a5);
}
.article-page[data-style="deep-night"] .article-content p {
  color: var(--text-color, #91a6cc);
}
.article-page[data-style="deep-night"] .article-content .lead {
  color: var(--accent-color, #00a878);
  font-weight: 700;
}
.article-page[data-style="deep-night"] .highlight-line {
  margin-top: -8px;
}
.article-page[data-style="deep-night"] .highlight-line mark {
  padding: .08em .3em;
  border-radius: 2px;
  background: var(--highlight-color, #d8c878);
  color: #1b2430;
  font-weight: 700;
}
.article-page[data-style="deep-night"] .section-title {
  color: var(--title-color, #d7e0f2);
  font-style: italic;
  font-weight: 800;
}
.article-page[data-style="deep-night"] .section-title::before {
  display: none;
}
.article-page[data-style="deep-night"] .fake-image {
  height: 145px;
  border: 2px solid var(--border-color, #858585);
  border-radius: var(--image-radius, 20px);
  background: var(--page-color, #171717);
  color: var(--muted-color, #7184a5);
}
.article-page[data-style="deep-night"] .article-content .article-list { color: var(--text-color, #91a6cc); }
.article-page[data-style="deep-night"] .article-content .inline-code { background: #202727; color: #d7e0f2; }
.article-page[data-style="deep-night"] .article-content .article-code { background: #202727; color: #d7e0f2; }
.article-page[data-style="deep-night"] .article-content .article-image { padding: 0; border: 2px solid var(--border-color, #858585); border-radius: var(--image-radius, 20px); overflow: hidden; background: var(--page-color, #171717); }
.article-page[data-style="deep-night"] .article-content .article-image img { max-width: 82%; }
.article-page[data-style="deep-night"] .quote-card {
  border: 1px solid var(--border-color, #858585);
  border-left-width: 3px;
  background: var(--card-color, #202727);
}
.article-page[data-style="deep-night"] .content-card { border-color: var(--accent-color, #00a878); background: var(--card-color, #202727); }
.article-page[data-style="deep-night"] .plain-quote { border-left-color: var(--accent-color, #00a878); color: var(--text-color, #91a6cc); }

/* ---------- 深空青 nocturne：炭黑底、近白标题、青绿关键词、黄条黑字 ---------- */
.article-page[data-theme="nocturne"] {
  color-scheme: dark;
}
.article-page[data-theme="nocturne"] h2,
.article-page[data-theme="nocturne"] .section-title {
  color: var(--title-color, #f3f4f6);
  font-style: normal;
}
.article-page[data-theme="nocturne"][data-heading-style="index"] .section-title.level-2::before {
  display: inline-block;
  color: var(--accent-color, #3ddc97);
}
.article-page[data-theme="nocturne"] .article-content strong {
  color: var(--accent-color, #3ddc97);
}
.article-page[data-theme="nocturne"] .content-card,
.article-page[data-theme="nocturne"] .quote-card,
.article-page[data-theme="nocturne"] .steps-block,
.article-page[data-theme="nocturne"] .stat-block {
  border: 1px solid var(--border-color, #333333);
  color: var(--text-color, #d1d5db);
}
.article-page[data-theme="nocturne"] .content-card,
.article-page[data-theme="nocturne"] .steps-block {
  background: var(--card-color, #242424);
}
.article-page[data-theme="nocturne"] .quote-card {
  background: var(--quote-color, #1f1f1f);
}
.article-page[data-theme="nocturne"] .highlight-line mark,
.article-page[data-theme="nocturne"] .inline-highlight {
  background: var(--highlight-color, #f6d35a);
  color: var(--highlight-text-color, #1a1a1a);
}
.article-page[data-theme="nocturne"] .article-content .inline-code,
.article-page[data-theme="nocturne"] .article-content .article-code {
  background: var(--code-background, #141414);
  color: var(--code-color, #a7f3d0);
}
.article-page[data-theme="nocturne"] .steps-index {
  color: var(--accent-color, #3ddc97);
}

/* =====================================================================
   Yooco 十二套精选主题盖层（data-theme）
   颜色/字号由 state 的 CSS 变量注入，这里只定义各主题自己的组件外观。
   ===================================================================== */

/* ---------- 清氧绿 fresh：教程测评，信息密度高，大圆角软卡 ---------- */
.article-page[data-theme="fresh"] .lead {
  margin: 0 0 26px; padding: 20px 22px; border: 1.5px solid color-mix(in srgb, var(--accent-color) 18%, transparent);
  border-radius: 16px; background: var(--card-color); color: var(--title-color);
  font-weight: 650; text-indent: 0;
}
.article-page[data-theme="fresh"] .section-title.level-2 { display: flex; align-items: center; gap: 10px; }
.article-page[data-theme="fresh"] .section-title.level-2::before {
  width: auto; height: auto; margin: 0; border-radius: 0; background: none;
  flex: 0 0 auto; color: var(--accent-color); font-size: .82em; font-weight: 800;
}
.article-page[data-theme="fresh"] .section-title.level-2::after {
  content: ""; flex: 1 1 auto; height: 1px; background: color-mix(in srgb, var(--accent-color) 22%, transparent);
}
.article-page[data-theme="fresh"] .content-card {
  border: 0; border-radius: 14px; background: var(--card-color); box-shadow: 0 2px 10px rgba(5,150,105,.06);
}
.article-page[data-theme="fresh"] .quote-card {
  border: 0; border-left: 4px solid var(--accent-color); border-radius: 0 12px 12px 0; background: var(--quote-color);
}
.article-page[data-theme="fresh"] .steps-block,
.article-page[data-theme="fresh"] .stat-block { border: 0; border-radius: 14px; }
.article-page[data-theme="fresh"] .article-divider {
  border-top-style: solid; opacity: .55; margin-top: 34px; margin-bottom: 34px;
}

/* ---------- 素墨 mono：全灰阶克制，大留白，点睛暖色走强调色变量 ---------- */
.article-page[data-theme="mono"] .lead {
  margin: 0 0 24px; padding: 0 0 18px; border: 0; border-bottom: 1px solid var(--divider-color);
  background: transparent; color: var(--title-color); font-weight: 600; text-indent: 0;
}
.article-page[data-theme="mono"] .section-title.level-2 { padding-bottom: 0; border-bottom: 0; }
.article-page[data-theme="mono"] .content-card,
.article-page[data-theme="mono"] .quote-card {
  border: 0; border-left: 3px solid var(--divider-color); border-radius: 0; background: var(--card-color);
}
.article-page[data-theme="mono"] .content-card strong,
.article-page[data-theme="mono"] .quote-card strong { letter-spacing: .18em; text-transform: uppercase; }
.article-page[data-theme="mono"] .steps-block,
.article-page[data-theme="mono"] .stat-block { border: 1px solid var(--divider-color); border-radius: 4px; background: var(--card-color); }
.article-page[data-theme="mono"] .article-divider { opacity: .8; margin-top: 48px; margin-bottom: 40px; }

/* ---------- 静山 serene：超大留白、衬线大字、1px 细线分层、几乎无色块 ---------- */
.article-page[data-theme="serene"] .lead {
  margin: 8px 0 44px; padding: 34px 16px; border: 0; border-top: 1px solid var(--divider-color); border-bottom: 1px solid var(--divider-color);
  border-radius: 0; background: transparent; text-align: center; color: var(--title-color);
  font-family: var(--heading-font); font-size: calc(var(--heading-size) * .72); font-weight: 600; line-height: 1.85; text-indent: 0;
}
.article-page[data-theme="serene"] .section-title.level-2 {
  padding-bottom: 14px; border-bottom: 0; font-family: var(--heading-font);
}.article-page[data-theme="serene"] .section-title.level-2::after {
  content: ""; display: block; width: 3px; height: 26px; margin-top: 16px; background: var(--accent-color);
}
.article-page[data-theme="serene"] .content-card {
  border: 1px solid var(--divider-color); border-radius: 0; background: var(--page-color);
}
.article-page[data-theme="serene"] .quote-card {
  border: 0; border-top: 1px solid var(--divider-color); border-bottom: 1px solid var(--divider-color);
  border-radius: 0; background: transparent; text-align: center; font-family: var(--heading-font); color: var(--title-color);
}
.article-page[data-theme="serene"] .quote-card strong { text-align: center; letter-spacing: .3em; font-weight: 600; }
.article-page[data-theme="serene"] .steps-block,
.article-page[data-theme="serene"] .stat-block { border: 1px solid var(--divider-color); border-radius: 0; background: var(--page-color); }
.article-page[data-theme="serene"] .article-divider { height: 1px; opacity: 1; margin-top: 56px; margin-bottom: 56px; }

/* ---------- 票据卡 stub：米白纸感、青色描边、柔影、虚线装订 ---------- */
.article-page[data-theme="stub"] .lead {
  margin: 0 0 26px; padding: 20px 22px; border: 1.5px solid var(--accent-color); border-radius: 12px;
  background: var(--page-color); box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--accent-color) 55%, transparent); color: var(--title-color); font-weight: 700; text-indent: 0;
}
.article-page[data-theme="stub"] .section-title.level-2 {
  border-radius: 10px;
}
.article-page[data-theme="stub"] .content-card,
.article-page[data-theme="stub"] .quote-card {
  border: 1.5px solid var(--accent-color); border-radius: 12px; background: var(--card-color); box-shadow: 0 6px 18px -10px color-mix(in srgb, var(--accent-color) 45%, transparent);
}
.article-page[data-theme="stub"] .steps-block,
.article-page[data-theme="stub"] .stat-block {
  border: 1.5px dashed var(--divider-color); border-radius: 12px; background: var(--card-color);
}
.article-page[data-theme="stub"] .article-divider {
  border-top: 2px dashed var(--divider-color); opacity: 1; margin-top: 34px; margin-bottom: 30px;
}
.article-page[data-theme="stub"] .fake-image {
  border: 1.5px dashed var(--divider-color); background: var(--card-color); color: var(--muted-color); box-shadow: none;
}

/* ---------- 手札橙 editorial：编辑部内刊，墨黑+橙，统一小圆角，细边框分层 ---------- */
.article-page[data-theme="editorial"] .lead {
  margin: 0 0 22px; padding: 16px 18px; border: 0; border-left: 4px solid #1e1f23; border-radius: 0 6px 6px 0;
  background: var(--card-color); color: var(--title-color); font-weight: 650; text-indent: 0;
}
.article-page[data-theme="editorial"] .section-title.level-2::before { background: var(--accent-color); width: 6px; height: 20px; border-radius: 1px; }
.article-page[data-theme="editorial"] .content-card {
  border: 1px solid var(--border-color); border-radius: 6px; background: var(--card-color);
}
.article-page[data-theme="editorial"] .quote-card {
  border: 0; border-left: 4px solid var(--accent-color); border-radius: 0 6px 6px 0; background: var(--quote-color);
}
.article-page[data-theme="editorial"] .steps-block,
.article-page[data-theme="editorial"] .stat-block { border: 1px solid var(--border-color); border-radius: 6px; background: var(--card-color); }
.article-page[data-theme="editorial"] .article-divider { opacity: .7; margin-top: 28px; margin-bottom: 24px; }

/* ---------- 硬边：按 data-hard-edge 开启。平涂不进这份名单。圆角和描边色跟各自主题变量走 ---------- */
.article-page[data-hard-edge="1"] .lead {
  margin: 0 0 26px; padding: 16px 18px; border: 2px solid var(--border-color, #111111); border-radius: var(--card-radius, 6px);
  box-shadow: 4px 4px 0 var(--border-color, #111111);
  color: var(--title-color, #111111); font-weight: 800; text-indent: 0;
}
.article-page[data-theme="citrus"] .lead,
.article-page[data-theme="playful"] .lead { background: var(--highlight-color, #ffe566); }
.article-page[data-theme="grunge"] .lead { background: var(--card-color, #ffffff); }
.article-page[data-theme="bauhaus"] .lead { background: #F0C020; color: var(--title-color, #121212); }
.article-page[data-theme="newsprint"] .lead { background: var(--quote-color, #f5f5f5); }
.article-page[data-hard-edge="1"][data-heading-style="block"] .section-title {
  max-width: 100%; box-sizing: border-box; border: 2px solid var(--border-color, #111111); border-radius: var(--card-radius, 6px);
  background: var(--accent-color, #e8b006);
  box-shadow: 4px 4px 0 var(--border-color, #111111);
}
.article-page[data-theme="citrus"][data-heading-style="block"] .section-title { color: var(--title-color, #111111); }
.article-page[data-theme="playful"][data-heading-style="block"] .section-title,
.article-page[data-theme="grunge"][data-heading-style="block"] .section-title,
.article-page[data-theme="bauhaus"][data-heading-style="block"] .section-title { color: var(--page-color, #fffdf5); }
.article-page[data-hard-edge="1"] .content-card,
.article-page[data-hard-edge="1"] .quote-card,
.article-page[data-hard-edge="1"] .steps-block,
.article-page[data-hard-edge="1"] .stat-block,
.article-page[data-hard-edge="1"] .toc-card {
  border: 2px solid var(--border-color, #111111); border-radius: var(--card-radius, 6px);
  box-shadow: 4px 4px 0 var(--border-color, #111111);
}
.article-page[data-hard-edge="1"] .content-card,
.article-page[data-hard-edge="1"] .steps-block,
.article-page[data-hard-edge="1"] .stat-block,
.article-page[data-hard-edge="1"] .toc-card { background: var(--card-color, #ffffff); }
.article-page[data-hard-edge="1"] .quote-card { background: var(--quote-color, #fff6d8); }
.article-page[data-hard-edge="1"] .content-card strong,
.article-page[data-hard-edge="1"] .quote-card strong,
.article-page[data-hard-edge="1"] .steps-block strong,
.article-page[data-hard-edge="1"] .stat-block strong { color: var(--card-title-color, #111111); }
.article-page[data-hard-edge="1"] .steps-index,
.article-page[data-hard-edge="1"] .stat-item b { color: var(--title-color, #111111); }
.article-page[data-hard-edge="1"][data-list-style="circle"] ol.article-list li::before {
  box-sizing: border-box; border: 2px solid var(--border-color, #111111);
}
.article-page[data-theme="citrus"][data-list-style="circle"] ol.article-list li::before { color: var(--title-color, #111111); }
.article-page[data-theme="playful"][data-list-style="circle"] ol.article-list li::before,
.article-page[data-theme="grunge"][data-list-style="circle"] ol.article-list li::before { color: var(--page-color, #fffdf5); }
.article-page[data-theme="bauhaus"][data-list-style="circle"] ol.article-list li::before {
  background: var(--link-color, #1040C0); color: var(--page-color, #F0F0F0);
}
.article-page[data-theme="bauhaus"] .article-content p strong,
.article-page[data-theme="bauhaus"] .article-content li strong,
.article-page[data-theme="bauhaus"] .article-content p b,
.article-page[data-theme="bauhaus"] .article-content li b,
.article-page[data-theme="bauhaus"] .content-card strong,
.article-page[data-theme="bauhaus"] .quote-card strong,
.article-page[data-theme="bauhaus"] .stat-item b,
.article-page[data-theme="bauhaus"][data-highlight-style="bold"] .inline-highlight {
  color: var(--link-color, #1040C0);
}
.article-page[data-theme="bauhaus"] .content-card > strong:first-child,
.article-page[data-theme="bauhaus"] .quote-card > strong:first-child,
.article-page[data-theme="bauhaus"] .steps-block > strong:first-child,
.article-page[data-theme="bauhaus"] .stat-block > strong:first-child {
  color: var(--card-title-color, #D02020);
}
.article-page[data-theme="bauhaus"] .content-card strong:not(:first-child),
.article-page[data-theme="bauhaus"] .quote-card strong:not(:first-child) {
  display: inline;
  margin: 0;
  font-size: inherit;
  letter-spacing: inherit;
}
.article-page[data-theme="citrus"] .article-divider {
  border-top: 2px solid var(--border-color, #111111); opacity: 1; margin-top: 32px; margin-bottom: 28px;
}
.article-page[data-hard-edge="1"] .fake-image,
.article-page[data-hard-edge="1"] .article-code {
  border: 2px solid var(--border-color, #111111); box-shadow: 4px 4px 0 var(--border-color, #111111);
}
.article-page[data-hard-edge="1"] .article-code { border-radius: var(--card-radius, 6px); }
.article-page[data-hard-edge="1"] .fake-image {
  border-radius: var(--image-radius, 6px);
  background: var(--highlight-color, #ffe566); color: var(--title-color, #111111);
}
.article-page[data-theme="bauhaus"] .fake-image { background: #F0C020; color: var(--title-color, #121212); }

/* ---------- 平涂 flat：软底色块，明确不要硬投影 ---------- */
.article-page[data-theme="flat"] .content-card,
.article-page[data-theme="flat"] .quote-card,
.article-page[data-theme="flat"] .steps-block,
.article-page[data-theme="flat"] .stat-block,
.article-page[data-theme="flat"] .toc-card,
.article-page[data-theme="flat"] .lead,
.article-page[data-theme="flat"] .section-title,
.article-page[data-theme="flat"] .fake-image,
.article-page[data-theme="flat"] .article-code {
  box-shadow: none;
}
.article-page[data-theme="flat"] .content-card,
.article-page[data-theme="flat"] .quote-card,
.article-page[data-theme="flat"] .steps-block,
.article-page[data-theme="flat"] .stat-block {
  border: 0; border-radius: var(--card-radius, 8px);
}

/* ---------- 报章 newsprint：章节标题用墨色衬线，底下一道粗墨线。绯红只留在重点下划线和链接 ---------- */
.article-page[data-theme="newsprint"] .section-title {
  color: var(--title-color, #111111);
  padding-bottom: 8px;
  border-bottom: 3px solid var(--border-color, #111111);
}

/* ---------- 六套精选：大标题气质分开。预览和复制稿用同一套内联意思 ---------- */
.article-page[data-theme="citrus"] h2 {
  display: inline-block; max-width: 100%; box-sizing: border-box;
  margin: 0 0 18px; padding: 0 0 4px;
  border-bottom: 8px solid var(--highlight-color, #ffe566);
  background: transparent; color: var(--title-color, #111111);
}
.article-page[data-theme="playful"] h2 {
  margin: 0 0 18px; padding: 0; border: 0; background: transparent;
  color: var(--accent-color, #8b5cf6);
}
.article-page[data-theme="grunge"] h2 {
  display: block; margin: 0 0 18px; padding: 0 0 0 14px;
  border-left: 8px solid var(--accent-color, #dc143c);
  background: transparent; color: var(--title-color, #1a1a1a);
}
.article-page[data-theme="flat"] h2 {
  margin: 0 0 14px; padding: 0; border: 0; background: transparent;
  color: var(--accent-color, #3b82f6); font-weight: 700;
}
.article-page[data-theme="newsprint"] h2 {
  display: block; margin: 0 0 26px; padding: 0 0 8px;
  border-bottom: 3px solid var(--border-color, #111111);
  box-shadow: 0 5px 0 var(--accent-color, #cc0000);
  background: transparent; color: var(--title-color, #111111);
}
.article-page[data-theme="bauhaus"] h2 {
  display: inline-block; max-width: 100%; box-sizing: border-box;
  margin: 0 0 22px; padding: 8px 14px;
  border: 2px solid var(--border-color, #121212); border-radius: 0;
  background: var(--accent-color, #d02020); color: var(--page-color, #f0f0f0);
  box-shadow: 4px 4px 0 var(--border-color, #121212);
}

/* 六套重点长得不一样：柠边是黄条，乐几是琥珀胶囊，撕贴是暗金底，平涂是蓝字，报章是红线，包豪是直角蓝底加黑边 */
.article-page[data-theme="citrus"] .inline-highlight {
  padding: 0; border-radius: 0; background: transparent; box-shadow: none;
  color: var(--highlight-text-color, #1a1a1a); font-weight: 800; text-decoration: none;
  border-bottom: 6px solid var(--highlight-color, #ffe566);
}
.article-page[data-theme="playful"] .inline-highlight {
  padding: 1px 8px; border-radius: 12px; border-bottom: 0; box-shadow: none; text-decoration: none;
  background: var(--highlight-color, #fbbf24); color: var(--highlight-text-color, #1e293b); font-weight: 800;
}
.article-page[data-theme="grunge"] .inline-highlight {
  padding: 0 3px; border-radius: 2px; border-bottom: 0; box-shadow: none; text-decoration: none;
  background: var(--highlight-color, #c5a945); color: var(--highlight-text-color, #1a1a1a); font-weight: 800;
}
.article-page[data-theme="flat"] .inline-highlight {
  padding: 0; border-radius: 0; border-bottom: 0; box-shadow: none; text-decoration: none;
  background: transparent; color: var(--accent-color, #3b82f6); font-weight: 800;
}
.article-page[data-theme="newsprint"] .inline-highlight {
  padding: 0; border-radius: 0; background: transparent; box-shadow: none; text-decoration: none;
  color: var(--highlight-text-color, #111111); font-weight: 700;
  border-bottom: 2px solid var(--accent-color, #cc0000);
}
.article-page[data-theme="bauhaus"] .inline-highlight {
  padding: 0 3px; border-radius: 0; box-shadow: none; text-decoration: none;
  background: var(--highlight-color, #1040C0); color: var(--highlight-text-color, #ffffff); font-weight: 800;
  border-bottom: 2px solid var(--border-color, #121212);
}

/* ---------- 精选主题通用：自动目录与结尾签名（颜色跟随 CSS 变量） ---------- */
.toc-card { margin: 0 0 32px; padding: 18px 20px; border: 1px solid var(--border-color); border-radius: 10px; background: color-mix(in srgb, var(--card-color) 70%, transparent); }
.toc-title { margin: 0 0 12px; color: var(--muted-color); font-size: 10px; font-weight: 800; letter-spacing: .25em; text-transform: uppercase; }
.toc-list p { display: flex; align-items: baseline; gap: 10px; margin: 0 0 8px; text-indent: 0; }
.toc-list p:last-child { margin-bottom: 0; }
.toc-list b { flex: 0 0 auto; color: var(--accent-color); font-size: 12px; font-weight: 800; }
.toc-list span { color: var(--title-color); font-size: 13px; font-weight: 600; }
.signature-card { margin: 28px 0 0; padding: 20px 0 0; border-top: 1px solid var(--divider-color); text-align: right; }
.signature-name { margin: 0 0 8px; color: var(--title-color); font-size: 14px; font-weight: 700; }
.signature-card p:last-child { margin: 0; color: var(--muted-color); font-size: 12px; line-height: 1.8; text-indent: 0; }

.template-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: end; padding: 65px 0 73px; }
.template-strip h2 { max-width: 580px; margin: 15px 0 0; font-size: clamp(25px, 3.3vw, 39px); line-height: 1.24; letter-spacing: -.045em; }
.template-strip p { max-width: 410px; margin: 0 0 3px; color: var(--muted); font-size: 14px; line-height: 1.85; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 22px 0 27px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }

@media (max-width: 1080px) {
  .lab-grid { grid-template-columns: minmax(0, 1fr) 280px; }
}
@media (max-width: 760px) {
  .topbar, .app-shell, .site-footer, .trial-banner { width: calc(100% - 36px); }
  .topbar { min-height: 52px; }
  .topbar-actions .ghost-button:first-child { display: none; }
  .composer-hero { grid-template-columns: 1fr; }
  .optimize-button { min-height: 48px; }
  .lab-grid { grid-template-columns: 1fr; height: auto; overflow: visible; }
  .preview-panel { min-height: 690px; }
  .insight-panel { border-top: 1px solid var(--line); border-left: 0; overflow: visible; }
}
@media (max-width: 460px) {
  .topbar-actions { gap: 5px; }
  .topbar-actions .accent-button { padding-inline: 11px; }
  .brand small { display: none; }
  .article-page { padding: 28px 20px 24px; }
  .copy-button { width: auto; }
  .copy-feedback { text-align: right; }
  .site-footer { flex-direction: column; gap: 5px; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }

/* 标题样式册入选的九款：仅影响二级章节标题。 */
.article-page[data-heading-style^="atlas-"] .article-content { counter-reset: atlas-section; }
.article-page[data-heading-style^="atlas-"] .section-title.level-2.heading-atlas {
  counter-increment: atlas-section; display: block; position: relative; min-width: 0;
  padding: 0; border: 0; border-radius: 0; background: transparent;
  color: var(--text-color); text-align: left; overflow-wrap: anywhere;
}
.article-page[data-heading-style^="atlas-"] .section-title.level-2.heading-atlas::before,
.article-page[data-heading-style^="atlas-"] .section-title.level-2.heading-atlas::after { content: none !important; display: none !important; }
.heading-atlas-main { display: block; min-width: 0; outline-offset: 3px; }
.heading-atlas-label { display: block; font-size: 11px; font-weight: 600; line-height: 1.6; letter-spacing: .1em; }
.heading-atlas-sub { outline-offset: 2px; }
.heading-atlas-first,.heading-atlas-second { overflow-wrap: anywhere; }
.article-page .heading-atlas.atlas-editorial { font-family: "Songti SC", "Noto Serif CJK SC", SimSun, serif; font-weight: 500; line-height: 1.48; letter-spacing: .04em; }
.heading-atlas.atlas-editorial .heading-atlas-label { margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid var(--divider-color); color: var(--muted-color); font-family: var(--body-font); letter-spacing: .06em; }
.heading-atlas.atlas-index .heading-atlas-main { padding: 18px 18px 15px; border: 1px solid var(--text-color); }
.heading-atlas.atlas-index .heading-atlas-number { position: absolute; top: -10px; left: 14px; z-index: 1; padding: 0 8px; background: var(--page-color); color: var(--text-color); font: 11px/1.7 ui-monospace, monospace; letter-spacing: .06em; }
.heading-atlas.atlas-index .heading-atlas-number::before { content: "INDEX / " counter(atlas-section, decimal-leading-zero); }
.heading-atlas.atlas-index .heading-atlas-label { margin-top: 8px; color: var(--muted-color); }
.heading-atlas.atlas-quote .heading-atlas-quote-mark { display: block; color: var(--accent-color); font: 72px/.8 Georgia, serif; }
.article-page[data-heading-style="atlas-quote"] .section-title.level-2.heading-atlas.atlas-quote { display: flex; flex-direction: column; align-items: stretch; font-family: "Songti SC", "Noto Serif CJK SC", SimSun, serif; font-weight: 500; line-height: 1.5; }
.heading-atlas.atlas-quote .heading-atlas-quote-mark { order: 0; }
.heading-atlas.atlas-quote .heading-atlas-main { order: 1; }
.heading-atlas.atlas-quote .heading-atlas-label { order: 2; }
.heading-atlas.atlas-quote .heading-atlas-label { margin-top: 15px; padding-top: 9px; border-top: 1px solid var(--divider-color); color: var(--muted-color); font-family: var(--body-font); }
.heading-atlas.atlas-pill .heading-atlas-label { display: table; margin-bottom: 14px; padding: 4px 12px; border-radius: 999px; background: var(--accent-color); color: var(--text-color); font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.heading-atlas.atlas-vertical { display: grid !important; grid-template-columns: 24px minmax(0,1fr); column-gap: 18px; align-items: start; }
.heading-atlas.atlas-vertical .heading-atlas-label { grid-column: 1; writing-mode: vertical-rl; padding-right: 8px; border-right: 1px solid var(--divider-color); color: var(--muted-color); font: 10px/1.4 ui-monospace, monospace; letter-spacing: .12em; }
.heading-atlas.atlas-vertical .heading-atlas-main { grid-column: 2; font-family: "Songti SC", "Noto Serif CJK SC", SimSun, serif; font-weight: 500; }
.heading-atlas.atlas-ticket { padding: 17px 18px !important; background: var(--text-color) !important; color: var(--page-color) !important; font-weight: 500; }
.heading-atlas.atlas-ticket .heading-atlas-label { margin-bottom: 12px; color: var(--page-color); font-size: 10px; }
.heading-atlas.atlas-ticket .heading-atlas-ticket-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 24px; padding-top: 9px; border-top: 1px dashed var(--page-color); color: var(--page-color); font: 10px/1.4 ui-monospace, monospace; letter-spacing: .06em; }
.heading-atlas.atlas-marker .heading-atlas-first,.heading-atlas.atlas-marker .heading-atlas-second,.heading-atlas.atlas-weight .heading-atlas-first,.heading-atlas.atlas-weight .heading-atlas-second { display: block; }
.heading-atlas.atlas-marker .heading-atlas-second { display: table; padding: 0 3px; box-shadow: inset 0 -.6em 0 var(--highlight-color); }
.heading-atlas.atlas-marker .heading-atlas-label,.heading-atlas.atlas-shadow .heading-atlas-label,.heading-atlas.atlas-weight .heading-atlas-label { margin-top: 12px; color: var(--muted-color); }
.heading-atlas.atlas-shadow .heading-atlas-main { padding: 0 5px 5px 0; font-weight: 900; text-shadow: 2px 2px 0 var(--page-color), 4px 4px 0 color-mix(in srgb, var(--accent-color) 38%, transparent); }
.heading-atlas.atlas-weight .heading-atlas-first { font-weight: 900; }
.heading-atlas.atlas-weight .heading-atlas-second { font-weight: 300; letter-spacing: .1em; }
@media (max-width: 460px) {
  .heading-atlas.atlas-vertical { column-gap: 12px; }
  .heading-atlas.atlas-ticket { padding: 14px !important; }
  .heading-atlas.atlas-index .heading-atlas-main { padding: 16px 13px 13px; }
}

/* 表情：图标在文字里。无序列表不再另画圆点。有序只留普通数字，别用大号序号把前面的图标盖住。分隔线用整行符号。 */
.article-page[data-theme="emoji"] ul.article-list li::before { content: none; }
.article-page[data-theme="emoji"] .article-content ul.article-list,
.article-page[data-theme="emoji"] .article-content ul.article-list li { padding-left: 0; }
.article-page[data-theme="emoji"] ol.article-list li::before {
  content: counter(listitem) ".";
  top: 0; left: 0; width: auto; height: auto; display: block;
  border: 0; border-radius: 0; background: none; place-items: unset;
  color: var(--muted-color, #9A9084);
  font-size: .95em; font-weight: 650; line-height: inherit;
}
.article-page[data-theme="emoji"] .article-content ol.article-list li { padding-left: 1.8em; }
.article-page[data-theme="emoji"] .emoji-rule {
  margin: 28px 0; padding: 0; border: 0; text-align: center;
  color: var(--muted-color, #9A9084); font-size: 15px; line-height: 1.6; letter-spacing: .08em;
}
.article-page[data-theme="emoji"] .section-title { border-bottom-color: var(--divider-color, #E6DCCA); }

/* 空行 / 菜单插入的重点框、图文头。颜色仍用当前主题的重点色和标题色。 */
.article-page .content-card.highlight-box {
  margin: 18px 0 22px;
  padding: var(--card-padding, 20px);
  border: 0;
  border-radius: var(--card-radius, 12px);
  background: var(--highlight-color, #d7fa5c);
  color: var(--highlight-text-color, #1a1a1a);
  box-shadow: none;
}
.article-page .content-card.highlight-box strong {
  display: block;
  margin: 0 0 7px;
  padding: 0;
  background: transparent;
  color: var(--highlight-text-color, #1a1a1a);
  font-size: var(--card-title-size, 11px);
  font-weight: 800;
  letter-spacing: .1em;
}
.article-masthead { margin: 4px 0 22px; }
.article-masthead-title {
  margin: 0 0 8px;
  color: var(--title-color, #20231f);
  font-family: var(--heading-font, inherit);
  font-size: var(--title-size, 26px);
  font-weight: var(--heading-weight, 800);
  line-height: var(--heading-line-height, 1.33);
  letter-spacing: var(--heading-letter-spacing, -.04em);
}
.article-masthead-sub {
  min-height: 1.4em;
  margin: 0 0 12px;
  color: var(--muted-color, #8e9389);
  font-size: calc(var(--font-size, 16px) - 1px);
  line-height: 1.6;
  text-indent: 0;
}
.article-masthead-sub:empty::before {
  content: attr(data-placeholder);
  color: var(--muted-color, #8e9389);
}
.article-masthead .fake-image { margin: 0; }
.article-content .slash-slot {
  min-height: 1.75em;
  margin: 8px 0 0;
  padding: 2px 0;
  color: var(--text-color, #3f3f3f);
  font-size: var(--font-size, 16px);
  line-height: 1.75;
  text-indent: 0;
  outline: none;
}
.article-content .slash-slot.is-blank::before {
  content: attr(data-placeholder);
  color: var(--muted-color, #8e9389);
  font-size: 14px;
}
.slash-card-menu { min-width: 196px; z-index: 90; }
.slash-card-hint {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, .55);
  font-size: 11px;
  font-weight: 400;
}
.block-type-menu-item.is-active .slash-card-hint { color: rgba(20, 20, 20, .62); }
.slash-card-empty {
  margin: 0;
  padding: 8px 10px 10px;
  color: rgba(255, 255, 255, .62);
  font-size: 12px;
}
.slash-card-group {
  margin-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding-top: 8px;
}

/* 图文栅格：双栏图文、三列要点。颜色、圆角、描边跟当前主题变量，不另写一套色。 */
.smart-grid {
  display: grid;
  gap: 14px;
  margin: 18px 0 22px;
  align-items: stretch;
}
.smart-grid-media { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.smart-grid-points { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.article-content .smart-grid p { margin: 0; text-indent: 0; }
.smart-grid-figure { position: relative; min-height: 168px; height: 100%; }
.smart-grid-empty {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 168px;
  height: 100%;
  margin: 0;
  padding: 16px;
  border: 1.5px dashed var(--border-color, #dedfd8);
  border-radius: var(--image-radius, 12px);
  background: transparent;
  color: var(--muted-color, #8e9389);
  font: 600 13px/1.5 inherit;
  cursor: pointer;
}
.smart-grid-empty:hover,
.smart-grid-empty:focus-visible {
  border-color: var(--accent-color, #718c25);
  color: var(--title-color, #20231f);
  outline: none;
}
.smart-grid-photo.fake-image {
  height: 100%;
  min-height: 168px;
  margin: 0;
  font-size: 13px;
  letter-spacing: .06em;
}
.smart-grid-img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 168px;
  object-fit: cover;
  border-radius: var(--image-radius, 12px);
}
.smart-grid-swap {
  position: absolute;
  right: 8px;
  bottom: 8px;
  margin: 0;
  padding: 4px 10px;
  border: 1px solid var(--border-color, #dedfd8);
  border-radius: 999px;
  background: var(--page-color, #fff);
  color: var(--title-color, #20231f);
  font: 600 12px/1.4 inherit;
  cursor: pointer;
}
.article-content .smart-grid-copy {
  display: flex;
  align-items: center;
  min-height: 168px;
  padding: 16px 18px;
  border: 1px solid var(--border-color, #dedfd8);
  border-radius: var(--card-radius, 12px);
  background: var(--card-color, #f3f5eb);
  color: var(--text-color, #3f3f3f);
  font-size: var(--font-size, 16px);
  line-height: var(--line-height, 1.75);
}
.smart-grid-copy.is-empty {
  border-style: dashed;
  background: transparent;
  color: var(--muted-color, #8e9389);
}
.smart-grid-copy.is-empty::before {
  content: attr(data-placeholder);
  color: var(--muted-color, #8e9389);
}
.smart-grid-point {
  min-height: 132px;
  padding: 14px 12px;
  border: 1px solid var(--border-color, #dedfd8);
  border-radius: var(--card-radius, 12px);
  background: var(--card-color, #f3f5eb);
  color: var(--text-color, #3f3f3f);
}
.smart-grid-point.is-empty {
  border-style: dashed;
  background: transparent;
}
.article-content .smart-grid-point-title,
.article-content .smart-grid-point-body { min-height: 1.45em; }
.article-content .smart-grid-point-title {
  margin: 0 0 6px;
  color: var(--title-color, #20231f);
  font-family: var(--heading-font, inherit);
  font-size: calc(var(--font-size, 16px) + 1px);
  font-weight: var(--heading-weight, 800);
  line-height: 1.35;
  letter-spacing: var(--heading-letter-spacing, -.04em);
}
.article-content .smart-grid-point-body {
  color: var(--text-color, #3f3f3f);
  font-size: calc(var(--font-size, 16px) - 1px);
  line-height: var(--line-height, 1.75);
}
.smart-grid-point-title:empty::before,
.smart-grid-point-body:empty::before {
  content: attr(data-placeholder);
  color: var(--muted-color, #8e9389);
  font-weight: 500;
  letter-spacing: 0;
}
.article-page[data-hard-edge="1"] .smart-grid-copy:not(.is-empty),
.article-page[data-hard-edge="1"] .smart-grid-point:not(.is-empty) {
  border: 2px solid var(--border-color, #111);
  box-shadow: 4px 4px 0 var(--border-color, #111);
}
.article-page[data-theme="flat"] .smart-grid-copy,
.article-page[data-theme="flat"] .smart-grid-point,
.article-page[data-theme="flat"] .smart-grid-photo.fake-image {
  box-shadow: none;
}
@media (max-width: 720px) {
  .smart-grid-media,
  .smart-grid-points { grid-template-columns: 1fr; }
}
