:root {
  --bg: #fffaf7;
  --page-bg: #f8efea;
  --panel-bg: rgba(255, 252, 249, 0.92);
  --panel-strong: rgba(255, 255, 255, 0.96);
  --ink: #111111;
  --muted: #66625f;
  --accent-red: #ff3a38;
  --accent-orange: #d97a16;
  --soft-pink: #e5b8b8;
  --soft-pink-light: #f8e9e5;
  --mustard: #e2cb7a;
  --leaf: #6d8f72;
  --rule: #efc8c3;
  --flower: #f7d8cc;
  --flower-core: #ecab88;
  --border: rgba(211, 190, 175, 0.45);
  --shadow: 0 28px 60px rgba(169, 132, 120, 0.1);
  --soft-shadow: 0 18px 36px rgba(150, 112, 94, 0.08);
  --panel-radius: 30px;
  --shell-gap: 20px;
  --body-font-scale: 1;
  --cover-font-scale: 1;
  --preview-scale: 1;
  --card-width: 372px;
  --card-height: 496px;
}

* {
  box-sizing: border-box;
  scrollbar-width: none;
}

*::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

body {
  color: var(--ink);
  font-family: "Noto Sans SC", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 250, 248, 0.96) 0%, rgba(251, 243, 238, 0.98) 34%, rgba(244, 231, 223, 1) 100%);
  position: relative;
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
  filter: blur(8px);
}

body::before {
  top: -120px;
  left: -80px;
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(248, 198, 188, 0.28) 0%, rgba(248, 198, 188, 0) 72%);
}

body::after {
  right: -80px;
  bottom: -120px;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(226, 203, 122, 0.2) 0%, rgba(226, 203, 122, 0) 72%);
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(340px, 380px) minmax(0, 1fr);
  gap: var(--shell-gap);
  min-height: 100vh;
  padding: 20px;
  align-items: start;
}

.control-panel {
  min-width: 0;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 2px;
  background: transparent;
  scrollbar-gutter: stable;
}

.workspace-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(380px, 430px) minmax(0, 1fr);
  gap: var(--shell-gap);
  align-items: start;
}

.workspace-side,
.workspace-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--shell-gap);
}

.workspace-side {
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 2px;
  scrollbar-gutter: stable;
}

.preview-panel {
  min-width: 0;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  overflow-x: auto;
  display: flex;
  flex-direction: column;
  padding: 26px;
  border-radius: 38px;
  background:
    linear-gradient(180deg, rgba(255, 252, 249, 0.95) 0%, rgba(248, 239, 234, 0.92) 100%);
  border: 1px solid rgba(211, 190, 175, 0.42);
  box-shadow: 0 26px 70px rgba(134, 97, 79, 0.1);
  scrollbar-gutter: stable;
}

.panel-card {
  background: var(--panel-bg);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  box-shadow: var(--soft-shadow);
  border-radius: var(--panel-radius);
  padding: 24px 22px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.workspace-main > .panel-card,
.workspace-main > .preview-panel {
  min-height: 0;
  height: calc(100vh - 44px);
}

.workspace-main > .panel-card {
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.panel-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 88px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.panel-kicker,
.preview-kicker {
  margin: 0 0 8px;
  color: #dc7c77;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.panel-card h1,
.preview-head h2 {
  margin: 0;
  font-family: "Noto Serif SC", serif;
  font-weight: 700;
}

.panel-card h1 {
  font-size: 26px;
  line-height: 1.16;
}

.control-panel .panel-card h1,
.workspace-side .panel-card h1 {
  font-size: 20px;
  white-space: nowrap;
}

.panel-desc {
  margin: 14px 0 0;
  color: #6f655f;
  font-size: 14px;
  line-height: 1.8;
  max-width: 32ch;
}

.field-label {
  display: block;
  margin-bottom: 10px;
  color: #5f534b;
  font-size: 14px;
  font-weight: 700;
}

.text-input,
.text-output {
  width: 100%;
  border: 1px solid #ead8cf;
  border-radius: 22px;
  background: #fffdfb;
  color: #43362f;
  font: inherit;
  line-height: 1.78;
  padding: 18px 18px;
  resize: vertical;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.text-input:focus,
.text-output:focus {
  border-color: rgba(255, 94, 88, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 0 0 4px rgba(255, 94, 88, 0.08);
}

.text-input {
  min-height: 420px;
}

.text-output {
  min-height: 260px;
}

.copy-summary-card {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(233, 214, 203, 0.82);
  border-radius: 20px;
  background: rgba(255, 248, 244, 0.86);
}

.copy-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.copy-summary-head .field-label {
  margin-bottom: 0;
}

.summary-output {
  width: 100%;
  min-height: 132px;
  border: 1px solid rgba(234, 216, 207, 0.95);
  border-radius: 16px;
  background: rgba(255, 253, 251, 0.92);
  color: #5d4f48;
  font: inherit;
  font-size: 13px;
  line-height: 1.72;
  padding: 12px 14px;
  resize: vertical;
  outline: none;
}

.summary-output:focus {
  border-color: rgba(255, 94, 88, 0.38);
  box-shadow: 0 0 0 4px rgba(255, 94, 88, 0.08);
}

.summary-status {
  min-height: 18px;
  margin: 8px 0 0;
  color: #b27f73;
  font-size: 12px;
  line-height: 1.5;
}

.wechat-sync-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}

.wechat-sync-mode {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.sync-mode-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid rgba(233, 214, 203, 0.9);
  background: rgba(255, 255, 255, 0.72);
  color: #6d5548;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.sync-mode-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.sync-mode-chip:has(input:checked) {
  border-color: rgba(255, 94, 88, 0.4);
  background: linear-gradient(135deg, rgba(243, 141, 136, 0.14), rgba(255, 94, 88, 0.1));
  color: #b44740;
}

.form-hint {
  margin: -4px 0 2px;
  color: #8c7367;
  font-size: 12px;
  line-height: 1.55;
}

.wechat-digest-input {
  min-height: 82px;
  resize: vertical;
}

.wechat-sync-btn {
  width: 100%;
  margin-top: 4px;
  flex: 0 0 auto;
}

.wechat-fetch-btn {
  width: 100%;
  margin-top: 2px;
}

.wechat-sync-result {
  min-height: 124px;
  font-size: 13px;
  line-height: 1.7;
}

.wechat-sync-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.wechat-history-btn {
  width: 100%;
  padding: 10px 12px;
  font-size: 12px;
}

.wechat-history-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(216, 164, 137, 0.18);
  border-radius: 18px;
}

.wechat-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.wechat-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 280px;
  overflow: auto;
}

.wechat-history-empty {
  margin: 0;
  color: #907769;
  font-size: 13px;
}

.wechat-history-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: rgba(255, 247, 244, 0.86);
  border-radius: 14px;
  border: 1px solid rgba(216, 164, 137, 0.14);
}

.wechat-history-item-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
}

.wechat-history-item-title {
  min-width: 0;
  color: #6f4e3f;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wechat-history-item-meta {
  color: #b07f66;
  font-size: 12px;
}

.wechat-history-materials {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wechat-history-material {
  padding-top: 8px;
  border-top: 1px dashed rgba(216, 164, 137, 0.2);
}

.wechat-history-material:first-child {
  padding-top: 0;
  border-top: 0;
}

.wechat-history-material-name {
  color: #5f534b;
  font-size: 12px;
  line-height: 1.5;
  word-break: break-all;
}

.wechat-history-material-info {
  margin-top: 2px;
  color: #9a877c;
  font-size: 11px;
  line-height: 1.5;
  word-break: break-all;
}

.button-row,
.copy-head,
.tool-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.copy-head {
  align-items: center;
}

.copy-head .field-label {
  margin-bottom: 0;
}

.undo-fill-btn {
  display: block;
  margin: 6px 0 0;
  padding: 0;
  border: 0;
  background: none;
  color: #c4887f;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.undo-fill-btn:hover {
  color: var(--accent-red);
}

.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(60, 40, 30, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.confirm-dialog {
  background: #fffdfb;
  border: 1px solid rgba(211, 190, 175, 0.5);
  border-radius: 20px;
  padding: 24px 26px 20px;
  box-shadow: 0 24px 60px rgba(120, 80, 60, 0.18);
  max-width: 360px;
  width: 90%;
  text-align: center;
}

.confirm-dialog p {
  margin: 0 0 18px;
  color: #5f534b;
  font-size: 15px;
  line-height: 1.6;
}

.confirm-dialog-btns {
  display: flex;
  gap: 10px;
}

.confirm-dialog-btns .action-btn {
  flex: 1;
}

.tool-row {
  margin-top: 14px;
  align-items: stretch;
  flex-wrap: wrap;
  padding: 14px;
  border-radius: 22px;
  background: rgba(255, 247, 242, 0.88);
  border: 1px solid rgba(233, 214, 203, 0.8);
}

.button-row {
  margin-top: 14px;
}

.font-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  flex: 1 1 220px;
  min-width: 0;
}

.inline-label {
  margin: 0;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(233, 214, 203, 0.72);
}

.action-btn,
.ghost-btn,
.mini-btn,
.mini-action-btn {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  font: inherit;
}

.action-btn:hover,
.ghost-btn:hover,
.mini-btn:hover,
.mini-action-btn:hover {
  transform: translateY(-1px);
}

.action-btn {
  flex: 1;
  padding: 14px 18px;
  background: #f1e4dc;
  color: #734c3b;
  box-shadow: 0 10px 24px rgba(216, 164, 137, 0.18);
  font-weight: 700;
}

.primary-btn {
  background: linear-gradient(135deg, #f38d88 0%, #ff5e58 100%);
  color: #fff;
}

.ghost-btn {
  padding: 11px 16px;
  background: #fff2ee;
  color: #d86259;
  border: 1px solid rgba(216, 98, 89, 0.18);
  white-space: nowrap;
}

#add-card-btn {
  flex: 0 0 auto;
  min-width: 148px;
  align-self: center;
  box-shadow: 0 8px 20px rgba(216, 98, 89, 0.08);
}

.mini-btn {
  min-width: 48px;
  padding: 8px 12px;
  background: #f4e8df;
  color: #755142;
}

.mini-action-btn {
  flex: 0 0 auto;
  padding: 8px 14px;
  background: #fff2ee;
  color: #c9564e;
  border: 1px solid rgba(216, 98, 89, 0.18);
  font-size: 13px;
  font-weight: 700;
}

.value-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff6f2;
  color: #9b6554;
  font-size: 14px;
  font-weight: 700;
}

.preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
  padding: 0 2px 18px;
  border-bottom: 1px solid rgba(211, 190, 175, 0.36);
  position: sticky;
  top: 0;
  z-index: 4;
  background: linear-gradient(180deg, rgba(248, 239, 234, 0.96) 0%, rgba(248, 239, 234, 0.82) 72%, rgba(248, 239, 234, 0) 100%);
  backdrop-filter: blur(8px);
}

.preview-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.preview-scale-control {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(223, 125, 119, 0.16);
}

.preview-scale-label {
  color: #9b6554;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.preview-scale-range {
  width: 160px;
  accent-color: #ff6b63;
}

.status-text {
  margin: 0;
  color: #91756a;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(223, 125, 119, 0.16);
}

.preview-stage-shell {
  overflow: auto;
  padding: 4px 12px 18px 2px;
}

.preview-scale-stage {
  width: 100%;
  min-width: fit-content;
}

.cards-grid {
  display: flex;
  flex-direction: column;
  gap: 28px;
  width: max-content;
  transform: scale(var(--preview-scale));
  transform-origin: top left;
}

.card {
  position: relative;
  width: var(--card-width);
  min-width: var(--card-width);
  height: var(--card-height);
  background:
    radial-gradient(circle at top left, rgba(255, 245, 241, 0.95), transparent 34%),
    radial-gradient(circle at bottom right, rgba(250, 234, 227, 0.8), transparent 28%),
    linear-gradient(180deg, #fffdfb 0%, var(--bg) 54%, #fef7f2 100%);
  overflow: hidden;
  box-shadow: var(--shadow);
  border-radius: 0;
  border: 1px solid rgba(216, 196, 184, 0.55);
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 42%),
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.42), transparent 10%);
  pointer-events: none;
  z-index: 0;
}

.cover-content,
.text-content {
  position: relative;
  z-index: 2;
}

.cover-content {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 110px 46px 126px;
}

.eyebrow-row {
  display: flex;
  align-items: center;
  gap: 18px;
  color: #e17f79;
  font-size: clamp(10px, calc(1.35vw * var(--cover-font-scale)), 24px);
  letter-spacing: 0.12em;
}

.eyebrow-line {
  width: calc(76px * var(--cover-font-scale));
  height: 2px;
  background: var(--rule);
}

.cover-title {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  line-height: 1.06;
}

.title-main,
.title-accent {
  display: block;
  font-family: "Noto Serif SC", serif;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.title-main {
  color: #060606;
  font-size: clamp(24px, calc(4vw * var(--cover-font-scale)), 70px);
}

.title-accent {
  color: var(--accent-red);
  font-size: clamp(22px, calc(3.8vw * var(--cover-font-scale)), 62px);
}

.tag-pill {
  padding: calc(10px * var(--cover-font-scale)) calc(26px * var(--cover-font-scale));
  border-radius: 999px;
  border: 1.5px solid rgba(223, 125, 119, 0.45);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(250, 240, 237, 0.92));
  color: #d97e78;
  font-size: clamp(10px, calc(1.45vw * var(--cover-font-scale)), 24px);
  letter-spacing: 0.22em;
  box-shadow: 0 8px 20px rgba(226, 177, 170, 0.14);
}

.shape {
  position: absolute;
  z-index: 1;
}

.shape-top-mustard {
  top: -110px;
  left: 38%;
  width: 52%;
  height: 25%;
  background: var(--mustard);
  border-radius: 44% 56% 62% 38% / 49% 33% 67% 51%;
  transform: rotate(12deg);
  opacity: 0.82;
  filter: saturate(0.9);
}

.shape-top-pink {
  top: -6%;
  right: -10%;
  width: 42%;
  height: 14%;
  background: var(--soft-pink);
  border-radius: 58% 42% 44% 56% / 60% 40% 60% 40%;
  transform: rotate(18deg);
  opacity: 0.72;
}

.shape-top-leaf {
  top: 8%;
  right: -8%;
  width: 36%;
  height: 18%;
}

.shape-top-leaf::before,
.shape-top-leaf::after,
.shape-bottom-leaf::before,
.shape-bottom-leaf::after {
  content: "";
  position: absolute;
  background: var(--leaf);
  border-radius: 22px;
  opacity: 0.9;
}

.shape-top-leaf::before {
  inset: 0 46% 38% 18%;
  transform: rotate(68deg);
}

.shape-top-leaf::after {
  inset: 28% 10% 6% 54%;
  transform: rotate(14deg);
}

.shape-bottom-pink {
  bottom: 6%;
  left: -22%;
  width: 40%;
  height: 32%;
  background: var(--soft-pink);
  border-radius: 50% 50% 42% 58% / 40% 60% 40% 60%;
  opacity: 0.78;
}

.shape-bottom-mustard {
  bottom: -6%;
  left: -12%;
  width: 36%;
  height: 18%;
  background: var(--mustard);
  border-radius: 52% 48% 46% 54% / 62% 52% 48% 38%;
  opacity: 0.78;
}

.shape-bottom-leaf {
  bottom: -4%;
  left: 16%;
  width: 40%;
  height: 18%;
  transform: rotate(-8deg);
  background:
    linear-gradient(36deg, transparent 0 30%, var(--leaf) 30% 38%, transparent 38% 100%),
    linear-gradient(58deg, transparent 0 44%, var(--leaf) 44% 52%, transparent 52% 100%),
    linear-gradient(72deg, transparent 0 58%, var(--leaf) 58% 66%, transparent 66% 100%);
  opacity: 0.88;
}

.shape-bottom-leaf::before {
  inset: 26% 56% 0 4%;
  transform: rotate(30deg);
}

.shape-bottom-leaf::after {
  inset: 0 24% 32% 44%;
  transform: rotate(42deg);
}

.brush {
  opacity: 0.42;
  background:
    linear-gradient(12deg, transparent 0 10%, #fff 10% 20%, transparent 20% 34%, #fff 34% 44%, transparent 44% 100%);
  mix-blend-mode: screen;
}

.brush-top {
  top: 0;
  right: 5%;
  width: 34%;
  height: 5%;
  transform: rotate(-10deg);
}

.brush-left {
  bottom: 20%;
  left: -2%;
  width: 19%;
  height: 6%;
  transform: rotate(-18deg);
}

.brush-right {
  right: 4%;
  bottom: 7%;
  width: 30%;
  height: 6%;
  transform: rotate(-24deg);
  opacity: 0.3;
  background:
    linear-gradient(18deg, transparent 0 10%, #efd9d2 10% 18%, transparent 18% 28%, #efd9d2 28% 36%, transparent 36% 46%, #efd9d2 46% 54%, transparent 54% 100%);
  mix-blend-mode: normal;
}

.text-card {
  padding: 34px 30px 30px;
}

.text-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(255, 240, 233, 0.7), transparent 24%),
    radial-gradient(circle at bottom left, rgba(248, 231, 223, 0.72), transparent 22%);
  z-index: 0;
}

.text-content {
  height: 100%;
  display: flex;
  flex-direction: column;
  z-index: 2;
}

.text-title {
  margin: 0;
  color: var(--accent-orange);
  font-size: clamp(18px, 1.45vw, 28px);
  font-weight: 700;
  line-height: 1.28;
  text-align: center;
  padding-right: 10px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
}

.title-rule {
  width: 100%;
  height: 2px;
  margin: 14px 0 18px;
  background: linear-gradient(90deg, rgba(78, 66, 58, 0.12), rgba(78, 66, 58, 0.78), rgba(78, 66, 58, 0.12));
}

.text-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--muted);
  font-size: calc(18px * var(--body-font-scale));
  line-height: 1.48;
  text-align: center;
  overflow: hidden;
}

.text-block p {
  margin: 0;
  text-wrap: pretty;
}

.text-block .lead-line {
  color: #595552;
  font-weight: 500;
}

.text-block.dense {
  gap: 8px;
  font-size: calc(16px * var(--body-font-scale));
  line-height: 1.4;
}

.text-block.ultra-dense {
  gap: 6px;
  font-size: calc(15px * var(--body-font-scale));
  line-height: 1.34;
}

.corner-flowers {
  position: absolute;
  right: 16px;
  bottom: 14px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  transform: scale(0.82);
  transform-origin: bottom right;
  opacity: 0.82;
}

.flower {
  position: relative;
  width: 58px;
  height: 112px;
}

.flower-small {
  width: 50px;
  height: 98px;
}

.petal {
  position: absolute;
  width: 22px;
  height: 26px;
  background: var(--flower);
  border-radius: 56% 44% 52% 48%;
}

.flower-small .petal {
  width: 18px;
  height: 22px;
}

.petal-top {
  top: 14px;
  left: 18px;
}

.petal-right {
  top: 28px;
  right: 6px;
  transform: rotate(70deg);
}

.petal-bottom {
  top: 46px;
  left: 18px;
  transform: rotate(180deg);
}

.petal-left {
  top: 28px;
  left: 6px;
  transform: rotate(-70deg);
}

.flower-core {
  position: absolute;
  top: 32px;
  left: 20px;
  width: 16px;
  height: 16px;
  background: var(--flower-core);
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(249, 221, 205, 0.55);
}

.flower-small .flower-core {
  top: 30px;
  left: 16px;
  width: 14px;
  height: 14px;
}

.stem {
  position: absolute;
  bottom: 0;
  width: 4px;
  height: 58px;
  background: #4f7f66;
  border-radius: 999px;
  transform-origin: bottom center;
}

.stem-left {
  left: 18px;
  transform: rotate(12deg);
}

.stem-right {
  right: 16px;
  height: 68px;
  transform: rotate(-8deg);
}

.flower-small .stem-left {
  left: 16px;
  height: 52px;
}

.flower-small .stem-right {
  right: 13px;
  height: 60px;
}

.ai-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 18px;
}

.ai-select,
.ai-input {
  width: 100%;
  border: 1px solid #ead8cf;
  border-radius: 18px;
  background: #fffdfb;
  color: #43362f;
  font: inherit;
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ai-select:focus,
.ai-input:focus {
  border-color: var(--accent-red);
  box-shadow: 0 0 0 4px rgba(255, 94, 88, 0.08);
}

.ai-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239b6554' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
  cursor: pointer;
}

.ai-key-wrap {
  position: relative;
}

.ai-key-wrap .ai-input {
  padding-right: 46px;
}

.clear-input-btn,
.history-delete-btn {
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font: inherit;
}

.clear-input-btn {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: rgba(216, 98, 89, 0.12);
  color: #c45b52;
  font-size: 18px;
  line-height: 1;
}

.clear-input-btn:hover,
.history-delete-btn:hover {
  background: rgba(216, 98, 89, 0.2);
  color: var(--accent-red);
}

.ai-generate-btn {
  margin-top: 4px;
}

.ai-panel-card {
  min-height: 0;
}

.ai-btn-row {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.ai-btn-row .action-btn {
  flex: 1;
}

.ai-force-btn {
  background: linear-gradient(135deg, #e8c77a 0%, #d4a84a 100%);
  color: #5a3e1a;
  box-shadow: 0 10px 24px rgba(212, 168, 74, 0.18);
}

.ai-cache-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e2cb7a;
  color: #5a3e1a;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}

.ai-result {
  margin-top: 20px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(248, 233, 229, 0.92), rgba(255, 247, 244, 0.86));
  border-radius: 22px;
  border: 1px solid rgba(229, 184, 184, 0.46);
}

.ai-section-title {
  margin: 0 0 10px;
  color: #b56b63;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.ai-style-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  color: #b56b63;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  user-select: none;
  transition: background 0.2s ease;
}

.ai-style-toggle:hover {
  background: rgba(255, 255, 255, 0.75);
}

.ai-style-arrow {
  font-size: 11px;
  transition: transform 0.3s ease;
}

.ai-style-toggle.open .ai-style-arrow {
  transform: rotate(180deg);
}

.ai-style-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.3s ease;
  opacity: 0;
}

.ai-style-body.open {
  max-height: 500px;
  opacity: 1;
}

.ai-style-summary {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 14px;
  color: #7a5e56;
  font-size: 14px;
  line-height: 1.7;
  margin: 10px 0 16px;
}

.ai-style-grid {
  display: grid;
  gap: 10px;
}

.ai-style-item {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 250, 247, 0.9);
  border: 1px solid rgba(223, 125, 119, 0.15);
}

.ai-style-item-label {
  display: block;
  margin-bottom: 6px;
  color: #b56b63;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.ai-style-item-text {
  color: #6f5750;
  font-size: 13px;
  line-height: 1.7;
}

.ai-topics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.topic-group {
  display: grid;
  gap: 10px;
}

.topic-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.topic-group-title {
  margin: 0;
  color: #7a4e47;
  font-size: 15px;
  font-weight: 700;
}

.topic-group-count {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(223, 125, 119, 0.12);
  color: #b56b63;
  font-size: 11px;
  font-weight: 700;
}

.topic-group-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.topic-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 14px;
  border-radius: 18px;
  border: 1.5px solid rgba(223, 125, 119, 0.25);
  background: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  text-align: left;
  font: inherit;
  color: var(--ink);
}

.topic-regen-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #c4a8a0;
  font-size: 14px;
  line-height: 24px;
  text-align: center;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease, background 0.15s ease;
}

.topic-regen-btn:hover {
  color: var(--accent-red);
  background: rgba(255, 58, 56, 0.08);
}

.topic-card.regen-loading .topic-regen-btn {
  animation: regen-spin 0.8s linear infinite;
}

.topic-card.regen-loading {
  pointer-events: none;
  opacity: 0.7;
}

@keyframes regen-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.topic-card:hover {
  border-color: rgba(223, 125, 119, 0.6);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 28px rgba(196, 140, 121, 0.12);
}

.topic-card.active {
  border-color: var(--accent-red);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 14px rgba(223, 125, 119, 0.18);
}

.topic-card-title {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.3;
}

.topic-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.topic-card-tag {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(241, 228, 220, 0.95);
  color: #8b5e4b;
  font-size: 11px;
  font-weight: 700;
}

.topic-card-excerpt {
  font-size: 12px;
  color: #9a8680;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.topic-card-meta {
  display: grid;
  gap: 6px;
  margin-top: 2px;
}

.topic-card-meta-row {
  color: #6f5750;
  font-size: 12px;
  line-height: 1.55;
}

.topic-card-meta-label {
  color: #b56b63;
  font-weight: 700;
}

.topic-card-btn {
  margin-top: auto;
  padding: 6px 0;
  border: 0;
  border-radius: 999px;
  background: #f1e4dc;
  color: #734c3b;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.topic-card-btn:hover {
  background: #e8d5c8;
}

.topic-card.active .topic-card-btn {
  background: linear-gradient(135deg, #f38d88 0%, #ff5e58 100%);
  color: #fff;
}

.ai-preview {
  margin-top: 16px;
}

.ai-preview-topic-meta {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.ai-preview-topic-meta .topic-card-meta-row {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
}

.ai-preview-cards {
  padding: 16px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  max-height: 280px;
  overflow-y: auto;
}

.ai-preview-article {
  padding: 16px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  max-height: 200px;
  overflow-y: auto;
}

.ai-preview-article-title {
  margin: 0 0 8px;
  padding: 11px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  color: #523c34;
  font-family: "Noto Serif SC", serif;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.ai-preview-cards + .ai-section-title,
.ai-preview-article + .action-btn,
.ai-action-row {
  margin-top: 14px;
}

.ai-action-row {
  display: flex;
  gap: 10px;
}

.ai-action-row .action-btn {
  flex: 1;
}

.benchmark-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.benchmark-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.benchmark-head .panel-kicker {
  margin-bottom: 6px;
}

.benchmark-toolbar {
  display: grid;
  gap: 10px;
}

.benchmark-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.benchmark-filter-btn {
  border: 1px solid rgba(223, 125, 119, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: #805e52;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.benchmark-filter-btn.active {
  background: linear-gradient(135deg, #f38d88 0%, #ff5e58 100%);
  border-color: transparent;
  color: #fff;
}

.benchmark-role-map,
.benchmark-workflow {
  display: grid;
  gap: 8px;
}

.benchmark-role-item,
.benchmark-workflow-item {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(223, 125, 119, 0.12);
  color: #6f5750;
  font-size: 13px;
  line-height: 1.6;
}

.benchmark-list {
  display: grid;
  gap: 12px;
}

.benchmark-card {
  display: grid;
  gap: 10px;
  padding: 16px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(223, 125, 119, 0.18);
}

.benchmark-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.benchmark-card-title {
  margin: 0;
  color: #5a4037;
  font-size: 15px;
  font-weight: 700;
}

.benchmark-card-platforms,
.benchmark-card-priority {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.benchmark-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(241, 228, 220, 0.95);
  color: #8b5e4b;
  font-size: 11px;
  font-weight: 700;
}

.benchmark-chip.priority-a {
  background: rgba(255, 94, 88, 0.12);
  color: #be4c45;
}

.benchmark-chip.priority-b {
  background: rgba(212, 168, 74, 0.16);
  color: #8b6724;
}

.benchmark-account-type {
  color: #93766a;
  font-size: 12px;
  line-height: 1.5;
}

.benchmark-meta {
  display: grid;
  gap: 8px;
}

.benchmark-meta-row {
  color: #6f5750;
  font-size: 13px;
  line-height: 1.6;
}

.benchmark-meta-label {
  color: #b56b63;
  font-weight: 700;
}

.benchmark-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.benchmark-link {
  color: #b44740;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 244, 242, 0.92);
  border: 1px solid rgba(223, 125, 119, 0.16);
}

.benchmark-link:hover {
  background: rgba(255, 236, 233, 0.96);
}

.benchmark-usage-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 248, 244, 0.82);
  border: 1px solid rgba(223, 125, 119, 0.18);
}

.benchmark-empty {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  color: #8f786f;
  font-size: 13px;
  line-height: 1.6;
}

.mode-switch-card {
  padding: 14px 18px;
}

.mode-switch-mini {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mode-current-label {
  color: #8d6a5d;
  font-size: 13px;
  font-weight: 700;
}

.mode-toggle-btn {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(243, 141, 136, 0.14), rgba(255, 94, 88, 0.14));
  color: #b44740;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.mode-toggle-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(255, 94, 88, 0.12);
}

.article-mode-panel .panel-desc {
  margin-bottom: 16px;
}

.article-summary-input,
.article-requirements-input {
  min-height: 96px;
}

.article-markdown-preview {
  max-height: 320px;
}

.article-html-preview {
  padding: 16px;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
  max-height: 360px;
  overflow: auto;
}

.article-html-preview:empty::before {
  content: "转换完成后，这里会显示公众号排版结果。";
  color: #9a8680;
}

.article-html-preview img {
  max-width: 100%;
  height: auto;
}

.title-action-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(233, 214, 203, 0.72);
}

.title-action-row .action-btn {
  width: 100%;
  padding: 12px 14px;
  box-shadow: none;
}

.title-action-row .primary-btn {
  box-shadow: 0 10px 22px rgba(255, 94, 88, 0.18);
}

.title-action-row .ghost-save-btn {
  background: #fff8ed;
  border: 1px solid rgba(212, 168, 74, 0.28);
  color: #6e4d1f;
}

.ghost-save-btn {
  background: linear-gradient(135deg, #e8dcc8 0%, #d4c4a0 100%);
  color: #5a4a30;
  box-shadow: 0 10px 24px rgba(180, 160, 120, 0.18);
}

.ai-status {
  margin: 10px 0 0;
  color: #b56b63;
  font-size: 13px;
  min-height: 1.4em;
}

@keyframes ai-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.ai-loading {
  animation: ai-pulse 1.4s ease-in-out infinite;
}

.module-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0 0 18px;
}

.title-gen-panel {
  margin-top: 0;
}

.title-gen-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #7a5e56;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(233, 214, 203, 0.72);
}

.title-gen-check input[type="checkbox"] {
  accent-color: var(--accent-red);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.title-gen-history-wrap {
  margin-top: 14px;
}

.title-gen-history-toggle {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  color: #b56b63;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  user-select: none;
  list-style: none;
  transition: background 0.2s ease;
}

.title-gen-history-toggle::-webkit-details-marker {
  display: none;
}

.title-gen-history-toggle::before {
  content: "▶";
  font-size: 10px;
  margin-right: 8px;
  transition: transform 0.2s ease;
}

.title-gen-history-wrap[open] > .title-gen-history-toggle::before {
  transform: rotate(90deg);
}

.title-gen-history-toggle:hover {
  background: rgba(255, 255, 255, 0.75);
}

.title-gen-history {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.title-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 14px;
  font-size: 13px;
}

.title-history-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #5f534b;
}

.title-history-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.history-delete-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(216, 98, 89, 0.1);
  color: #b86a61;
  font-size: 18px;
  line-height: 1;
}

@media (max-width: 1200px) {
  .app-shell {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 16px;
  }

  .control-panel,
  .workspace-grid,
  .workspace-side,
  .workspace-main,
  .preview-panel {
    min-width: 0;
    max-height: none;
    overflow: visible;
  }

  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .workspace-side > .panel-card,
  .workspace-main > .panel-card,
  .workspace-main > .preview-panel {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .preview-panel {
    padding: 22px;
  }

  .preview-head {
    position: static;
    padding-bottom: 0;
    border-bottom: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .ai-topics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 12px;
    gap: 14px;
  }

  .panel-card,
  .preview-panel {
    border-radius: 22px;
  }

  .panel-card h1 {
    font-size: 24px;
    white-space: normal;
  }

  .preview-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .preview-head-actions,
  .preview-scale-control {
    width: 100%;
    justify-content: space-between;
  }

  .preview-scale-range {
    width: 100%;
  }

  .button-row,
  .copy-head,
  .tool-row,
  .font-tools {
    flex-direction: column;
    align-items: stretch;
  }

  #add-card-btn {
    width: 100%;
    min-width: 0;
  }

  .tool-row {
    padding: 12px;
  }

  .stepper {
    justify-content: space-between;
    width: 100%;
  }

  .ai-topics {
    grid-template-columns: 1fr;
  }

  .ai-btn-row,
  .ai-action-row {
    flex-direction: column;
  }

  .mode-switch-mini {
    flex-direction: column;
    align-items: stretch;
  }

  .status-text {
    width: 100%;
  }
}
