/* Design tokens: 你可以从这里集中调整米白、酒红、暖金和圆角体系。 */
:root {
  color-scheme: light;
  --bg: #f6efe4;
  --surface: #fffaf2;
  --surface-strong: #fdf4e8;
  --surface-muted: #efe1cf;
  --primary: #7f1d2d;
  --primary-strong: #5d1320;
  --primary-soft: #f7e1df;
  --accent: #b9822c;
  --accent-soft: #f4dfbd;
  --sage: #5d7c69;
  --sage-soft: #e0e9df;
  --ink: #241719;
  --muted: #77655d;
  --line: rgba(127, 29, 45, 0.16);
  --line-soft: rgba(127, 29, 45, 0.09);
  --focus: #2f6f88;
  --shadow-soft: 0 24px 64px rgba(83, 44, 26, 0.16);
  --shadow-card: 0 18px 46px rgba(83, 44, 26, 0.11);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-sans);
  background:
    radial-gradient(circle at 11% 9%, rgba(185, 130, 44, 0.18), transparent 24%),
    radial-gradient(circle at 86% 16%, rgba(127, 29, 45, 0.12), transparent 26%),
    linear-gradient(135deg, #f7efe3 0%, #f1e0ca 54%, #ead4bd 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(127, 29, 45, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(127, 29, 45, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), transparent 78%);
}

button,
a,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 20;
  transform: translateY(-140%);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: #fff;
  background: var(--primary);
  text-decoration: none;
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(12px, 2vw, 28px);
}

.app-window {
  width: min(1480px, 100%);
  min-height: min(920px, calc(100vh - 40px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(127, 29, 45, 0.14);
  border-radius: var(--radius-xl);
  background: rgba(255, 250, 242, 0.86);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.landing-window {
  overflow: auto;
}

.site-nav {
  min-height: 78px;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto minmax(210px, 1fr);
  align-items: center;
  gap: var(--space-5);
  padding: 18px clamp(18px, 3vw, 36px);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 250, 242, 0.78);
}

.nav-brand,
.nav-links,
.nav-actions,
.hero-actions,
.badge,
.btn,
.check-item,
.signal-score,
.chat-heading,
.message-row,
.loading-message {
  display: flex;
  align-items: center;
}

.nav-brand {
  gap: 11px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 800;
}

.brand-icon {
  width: 42px;
  height: 42px;
  color: var(--primary);
}

.brand-icon rect {
  fill: var(--primary-soft);
  stroke: currentColor;
  stroke-width: 1.7;
}

.brand-icon path {
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-text {
  font-size: 17px;
  letter-spacing: 0;
}

.nav-links {
  justify-content: center;
  gap: clamp(16px, 3vw, 34px);
}

.nav-links a {
  position: relative;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.nav-links a::after {
  position: absolute;
  right: 0;
  bottom: -9px;
  left: 0;
  height: 2px;
  transform: scaleX(0);
  transform-origin: center;
  border-radius: 999px;
  background: var(--accent);
  content: "";
  transition: transform 180ms ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--primary);
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after {
  transform: scaleX(1);
}

.nav-actions {
  justify-content: flex-end;
  gap: var(--space-3);
}

.btn {
  min-height: 44px;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn-primary {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 14px 26px rgba(127, 29, 45, 0.22);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-strong);
  box-shadow: 0 18px 32px rgba(127, 29, 45, 0.26);
}

.btn-outline {
  border: 1px solid var(--line);
  color: var(--primary);
  background: rgba(255, 250, 242, 0.78);
}

.btn-outline:hover:not(:disabled) {
  border-color: rgba(127, 29, 45, 0.32);
  background: var(--primary-soft);
}

.btn-icon {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
}

.btn-icon path,
.check-item svg path {
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.landing-content {
  display: grid;
  gap: clamp(18px, 3vw, 34px);
  padding: clamp(18px, 3vw, 36px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, 35%);
  align-items: center;
  gap: clamp(20px, 4vw, 54px);
  padding: clamp(24px, 4vw, 48px);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(255, 250, 242, 0.92), rgba(253, 244, 232, 0.82)),
    radial-gradient(circle at 82% 18%, rgba(185, 130, 44, 0.18), transparent 42%);
  box-shadow: var(--shadow-card);
}

.landing-hero {
  min-height: clamp(520px, 68vh, 700px);
}

.badge {
  width: fit-content;
  gap: 9px;
  margin-bottom: var(--space-5);
  padding: 9px 13px;
  border: 1px solid rgba(127, 29, 45, 0.13);
  border-radius: var(--radius-sm);
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 13px;
  font-weight: 800;
}

.badge-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(185, 130, 44, 0.15);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: var(--space-5);
  color: var(--primary-strong);
  font-size: clamp(38px, 6vw, 76px);
  font-weight: 650;
  letter-spacing: 0;
  line-height: 0.96;
}

.hero-lede,
.chat-intro p {
  max-width: 660px;
  margin-bottom: var(--space-8);
  color: var(--muted);
  font-size: clamp(16px, 1.6vw, 20px);
  line-height: 1.72;
}

.hero-actions {
  flex-wrap: wrap;
  gap: var(--space-5);
}

.text-link {
  color: var(--primary);
  font-weight: 800;
  text-decoration-color: rgba(127, 29, 45, 0.34);
  text-underline-offset: 5px;
}

.text-link:hover {
  color: var(--primary-strong);
  text-decoration-color: currentColor;
}

.hero-visual {
  min-height: 280px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, rgba(127, 29, 45, 0.08), rgba(185, 130, 44, 0.12)),
    var(--surface-strong);
  overflow: hidden;
}

.hero-visual svg {
  width: min(100%, 390px);
  height: auto;
}

.visual-ring,
.visual-pulse,
.visual-grid {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.visual-ring {
  stroke: url(#signalGradient);
  stroke-width: 9;
  opacity: 0.95;
}

.visual-ring.thin {
  stroke-width: 4;
  opacity: 0.46;
}

.visual-pulse {
  stroke: var(--primary);
  stroke-width: 5;
  filter: drop-shadow(0 10px 18px rgba(127, 29, 45, 0.18));
}

.visual-grid {
  stroke: rgba(127, 29, 45, 0.12);
  stroke-width: 1.4;
}

.visual-nodes circle {
  fill: var(--surface);
  stroke: var(--accent);
  stroke-width: 4;
}

.method-section {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1.3fr);
  gap: clamp(20px, 4vw, 42px);
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: rgba(255, 250, 242, 0.72);
  box-shadow: var(--shadow-card);
}

.section-heading h2 {
  max-width: 520px;
  margin: 0;
  color: var(--primary-strong);
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1.08;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.method-card {
  min-height: 220px;
  padding: 22px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 248, 0.82);
}

.method-card span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.method-card h3 {
  margin: 42px 0 12px;
  color: var(--primary-strong);
  font-size: 22px;
  line-height: 1.18;
}

.method-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.68;
}

.experience-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: clamp(18px, 2vw, 28px);
  padding: clamp(18px, 3vw, 36px);
}

.chat-grid {
  height: 100%;
}

.workspace {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: var(--space-6);
}

.chat-intro {
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: rgba(255, 250, 242, 0.76);
  box-shadow: var(--shadow-card);
}

.chat-intro h1 {
  margin-bottom: var(--space-4);
  font-size: clamp(34px, 4.2vw, 58px);
}

.chat-intro p {
  margin-bottom: 0;
}

.chat-shell {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: rgba(255, 250, 242, 0.82);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.chat-heading {
  justify-content: space-between;
  gap: var(--space-4);
  padding: 22px clamp(18px, 3vw, 28px);
  border-bottom: 1px solid var(--line-soft);
}

.eyebrow {
  margin-bottom: 7px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.chat-heading h2,
.panel-head h2 {
  margin-bottom: 0;
  color: var(--primary-strong);
  font-size: 24px;
  line-height: 1.18;
}

.status-line {
  min-height: 1px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.messages {
  min-height: 0;
  overflow: auto;
  padding: 24px clamp(18px, 3vw, 28px) 18px;
  scroll-behavior: smooth;
}

.message-row {
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 18px;
}

.message-row.user {
  flex-direction: row-reverse;
}

.avatar {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  border-radius: var(--radius-sm);
  color: #fff;
  background: var(--primary);
  font-size: 13px;
  font-weight: 900;
}

.message-row.user .avatar {
  color: var(--primary);
  background: var(--accent-soft);
}

.message {
  max-width: min(720px, calc(100% - 56px));
  min-width: 72px;
  padding: 16px 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  color: var(--ink);
  background: #fffdf8;
  box-shadow: 0 12px 28px rgba(83, 44, 26, 0.08);
  line-height: 1.72;
  white-space: pre-wrap;
}

.message-row.assistant .message {
  border-bottom-left-radius: 4px;
  background: linear-gradient(135deg, #fffaf2, #f7e7d7);
}

.message-row.user .message {
  border-bottom-right-radius: 4px;
  color: #2c2015;
  background: var(--sage-soft);
}

.loading-message {
  gap: 10px;
  color: var(--muted);
}

.typing-dots {
  display: inline-flex;
  gap: 4px;
}

.typing-dots i {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--primary);
  opacity: 0.35;
  animation: typing-pulse 1s infinite ease-in-out;
}

.typing-dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dots i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typing-pulse {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: 0.3;
  }
  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-3);
  padding: 18px clamp(18px, 3vw, 28px) 22px;
  border-top: 1px solid var(--line-soft);
  background: rgba(253, 244, 232, 0.7);
}

textarea {
  width: 100%;
  min-height: 62px;
  max-height: 180px;
  resize: none;
  border: 1px solid rgba(127, 29, 45, 0.18);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  color: var(--ink);
  background: #fffdf8;
  line-height: 1.5;
  outline: none;
}

textarea::placeholder {
  color: rgba(36, 23, 25, 0.5);
}

textarea:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 4px rgba(47, 111, 136, 0.13);
}

.send-button {
  min-width: 104px;
  min-height: 62px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-md);
  color: #fff;
  background: var(--primary);
  cursor: pointer;
  font-weight: 900;
  transition: background-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.send-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: var(--primary-strong);
  box-shadow: 0 16px 28px rgba(127, 29, 45, 0.22);
}

.insight-panel {
  min-width: 0;
  align-self: start;
  display: grid;
  gap: var(--space-5);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 24px;
  background: linear-gradient(180deg, rgba(255, 250, 242, 0.92), rgba(244, 223, 189, 0.42));
  box-shadow: var(--shadow-card);
}

.panel-head h2 {
  font-size: 28px;
}

.signal-card,
.checklist,
.next-step {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 248, 0.78);
  box-shadow: 0 14px 34px rgba(83, 44, 26, 0.08);
}

.signal-card {
  padding: 20px;
}

.signal-score {
  justify-content: space-between;
  gap: var(--space-3);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.signal-score strong {
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 12px;
}

.score-meter {
  height: 126px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  gap: 9px;
  margin-top: 22px;
}

.score-meter span {
  height: var(--height);
  min-height: 30px;
  border-radius: var(--radius-sm) var(--radius-sm) 4px 4px;
  background: linear-gradient(to top, var(--primary), var(--accent));
}

.score-meter span:nth-child(2n) {
  background: linear-gradient(to top, var(--sage), var(--accent-soft));
}

.checklist {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.check-item {
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--primary-strong);
  background: rgba(247, 225, 223, 0.58);
  font-weight: 800;
}

.check-item svg {
  width: 20px;
  height: 20px;
  color: var(--sage);
}

.next-step {
  padding: 20px;
  background: var(--primary);
}

.next-step span {
  color: var(--accent-soft);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.next-step p {
  margin: 10px 0 0;
  color: #fffaf2;
  line-height: 1.62;
}

.panel,
#stateView {
  display: none !important;
}

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


/* Chat page rail: 锁定对话工作台高度，消息只在内部滑动，不再撑长整页。 */
.chat-page {
  height: 100vh;
  overflow: hidden;
}

.chat-shell-page {
  height: 100vh;
  min-height: 0;
}

.chat-window {
  height: min(920px, calc(100vh - 40px));
  min-height: 0;
}

.chat-grid,
.chat-workspace,
.chat-shell {
  min-height: 0;
}

.chat-workspace {
  overflow: hidden;
}

.chat-shell {
  height: 100%;
}

.messages {
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.messages::-webkit-scrollbar {
  width: 10px;
}

.messages::-webkit-scrollbar-track {
  background: rgba(127, 29, 45, 0.07);
  border-radius: 999px;
}

.messages::-webkit-scrollbar-thumb {
  border: 2px solid rgba(255, 250, 242, 0.92);
  border-radius: 999px;
  background: rgba(127, 29, 45, 0.38);
}

.messages::-webkit-scrollbar-thumb:hover {
  background: rgba(127, 29, 45, 0.55);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 1120px) {
  .site-nav {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .nav-brand,
  .nav-links,
  .nav-actions {
    justify-content: center;
  }

  .hero,
  .method-section,
  .experience-grid {
    grid-template-columns: 1fr;
  }

  .method-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .insight-panel {
    align-self: stretch;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
  }

  .panel-head {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .shell {
    padding: 0;
  }

  .app-window {
    min-height: 100vh;
    border-radius: 0;
    border-right: 0;
    border-left: 0;
  }

  .site-nav {
    padding: 16px;
  }

  .nav-links {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 3px;
  }

  .nav-actions {
    flex-wrap: wrap;
  }

  .landing-content,
  .experience-grid {
    padding: 16px;
  }

  .hero,
  .chat-intro,
  .method-section {
    padding: 24px;
  }

  h1 {
    font-size: clamp(36px, 12vw, 52px);
  }

  .hero-visual {
    min-height: 220px;
  }

  .method-grid,
  .insight-panel {
    grid-template-columns: 1fr;
  }

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

  .send-button {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .nav-brand,
  .nav-actions {
    justify-content: flex-start;
  }

  .nav-actions .btn {
    flex: 1 1 auto;
  }

  .hero-actions .btn,
  .hero-actions .text-link {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .method-card {
    min-height: auto;
  }

  .message {
    max-width: calc(100% - 52px);
    font-size: 15px;
  }
}




/* Chat density tune: 介绍卡更矮，真正的对话框更高。 */
.chat-grid {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
}

.chat-intro {
  padding: clamp(14px, 2vw, 20px);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 28px rgba(83, 44, 26, 0.08);
}

.chat-intro .badge {
  margin-bottom: 10px;
  padding: 7px 10px;
  font-size: 12px;
}

.chat-intro h1 {
  margin-bottom: 8px;
  font-size: clamp(24px, 2.8vw, 36px);
  line-height: 1.08;
}

.chat-intro p {
  margin-bottom: 0;
  font-size: clamp(14px, 1.2vw, 16px);
  line-height: 1.55;
}

.chat-shell {
  min-height: 620px;
}

@media (max-width: 820px) {
  .chat-workspace {
    gap: 12px;
  }

  .chat-intro {
    padding: 14px 16px;
  }

  .chat-intro .badge {
    margin-bottom: 8px;
  }

  .chat-intro h1 {
    font-size: clamp(24px, 7vw, 32px);
  }

  .chat-intro p {
    font-size: 15px;
    line-height: 1.5;
  }

  .chat-shell {
    height: auto;
    min-height: 76vh;
  }
}

@media (max-width: 520px) {
  .chat-intro h1 {
    font-size: 28px;
  }

  .chat-shell {
    min-height: 78vh;
  }
}

/* Tall chat box without trapping the page scroll. */
.chat-page {
  height: auto;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
}

.chat-shell-page {
  height: auto;
  min-height: 100vh;
  align-items: start;
}

.chat-window {
  height: auto;
  min-height: calc(100vh - 40px);
  overflow: visible;
}

.chat-grid {
  height: auto;
  align-items: start;
}

.chat-workspace {
  overflow: visible;
}

.chat-shell {
  height: clamp(880px, 118vh, 1240px);
  min-height: 880px;
}

@media (max-width: 820px) {
  .chat-window {
    min-height: 100vh;
  }

  .chat-shell {
    height: min(1100px, 122vh);
    min-height: 900px;
  }
}

@media (max-width: 520px) {
  .chat-shell {
    height: min(1120px, 126vh);
    min-height: 920px;
  }
}


/* Chat page without the side signal panel. */
.chat-grid-single {
  grid-template-columns: minmax(0, 1fr);
}

/* Plan page side panel: shows the active earning plan and starts retro. */
.plan-panel {
  align-content: start;
}

.plan-summary {
  min-height: 260px;
  display: grid;
  align-content: start;
  gap: 14px;
}

.plan-empty,
.plan-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 248, 0.86);
  box-shadow: 0 14px 34px rgba(83, 44, 26, 0.08);
}

.plan-empty {
  padding: 18px;
}

.plan-status-dot {
  width: 13px;
  height: 13px;
  border-radius: 4px;
  background: var(--accent);
  box-shadow: 0 0 0 7px rgba(188, 131, 44, 0.15);
}

.plan-empty h3,
.plan-card h3 {
  margin: 0;
  color: var(--primary-strong);
  font-size: clamp(20px, 2.4vw, 26px);
  line-height: 1.2;
}

.plan-empty p,
.plan-meta {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.plan-kicker {
  width: fit-content;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.plan-points {
  display: grid;
  gap: 10px;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}

.plan-points li {
  position: relative;
  padding: 11px 12px 11px 34px;
  border: 1px solid rgba(127, 29, 45, 0.1);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: rgba(247, 225, 223, 0.4);
  line-height: 1.58;
}

.plan-points li::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 19px;
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: var(--sage);
}

.plan-prediction {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.plan-prediction-item {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(244, 223, 189, 0.48);
}

.plan-prediction-item:last-child {
  grid-column: 1 / -1;
}

.plan-prediction-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.plan-prediction-item strong {
  color: var(--primary-strong);
  font-size: 14px;
  line-height: 1.45;
}

.retro-button {
  width: 100%;
}

.retro-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

@media (max-width: 560px) {
  .plan-prediction {
    grid-template-columns: 1fr;
  }
}

/* Landing hero art title: highlights AI 赚钱 as the key visual phrase. */
.hero-title-art {
  max-width: 820px;
  display: grid;
  gap: 0.08em;
  margin-bottom: var(--space-5);
  color: var(--primary-strong);
  font-family: "Arial Black", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  font-size: clamp(42px, 6.4vw, 78px);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: 0;
  text-wrap: balance;
  text-shadow: 0 3px 0 rgba(185, 130, 44, 0.16), 0 18px 36px rgba(127, 29, 45, 0.12);
}

.title-line {
  display: block;
}

.title-line-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.18em;
}

.title-ai-money {
  position: relative;
  display: inline-block;
  padding: 0 0.08em 0.04em;
  color: transparent;
  background: linear-gradient(112deg, var(--primary-strong) 0%, var(--primary) 42%, var(--accent) 78%, #5d7c69 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-stroke: 1px rgba(127, 29, 45, 0.18);
  filter: drop-shadow(0 12px 18px rgba(127, 29, 45, 0.16));
}

.title-ai-money::before {
  content: "";
  position: absolute;
  left: -0.05em;
  right: -0.05em;
  bottom: 0.03em;
  height: 0.22em;
  z-index: -1;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(247, 225, 223, 0.95), rgba(244, 223, 189, 0.95));
  transform: skewX(-10deg);
}

.title-ai-money::after {
  content: "";
  position: absolute;
  right: -0.13em;
  top: 0.08em;
  width: 0.18em;
  height: 0.18em;
  border-radius: 0.05em;
  background: var(--accent);
  box-shadow: -0.28em 0.46em 0 rgba(93, 124, 105, 0.88);
}

@media (max-width: 820px) {
  .hero-title-art {
    font-size: clamp(40px, 10.5vw, 64px);
    line-height: 1.02;
  }
}

@media (max-width: 520px) {
  .hero-title-art {
    font-size: clamp(36px, 13vw, 50px);
  }

  .title-line-main {
    gap: 0.12em;
  }
}

/* Refined landing art title: smaller, more crafted, less shouty. */
.hero-title-art {
  max-width: 760px;
  gap: 0.16em;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  font-size: clamp(30px, 4.4vw, 54px);
  font-weight: 900;
  line-height: 1.12;
  text-shadow: 0 1px 0 #fff8ec, 0 10px 24px rgba(127, 29, 45, 0.12);
}

.hero-title-art .title-line {
  width: fit-content;
  color: var(--primary-strong);
  background: linear-gradient(180deg, #9f2940 0%, #661124 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-title-art .title-line:not(.title-line-main) {
  padding-left: 0.04em;
}

.title-line-main {
  gap: 0.2em;
}

.title-ai-money {
  padding: 0.03em 0.18em 0.08em;
  border: 1px solid rgba(185, 130, 44, 0.36);
  border-radius: 8px;
  color: transparent;
  background:
    linear-gradient(135deg, rgba(255, 250, 242, 0.96), rgba(244, 223, 189, 0.66)) padding-box,
    linear-gradient(110deg, #7f1d2d, #b9822c, #5d7c69) border-box;
  -webkit-background-clip: padding-box, border-box;
  background-clip: padding-box, border-box;
  box-shadow: inset 0 -0.12em 0 rgba(185, 130, 44, 0.18), 0 12px 24px rgba(127, 29, 45, 0.12);
}

.title-ai-money {
  text-shadow: none;
}

.title-ai-money::before {
  left: 0.12em;
  right: 0.12em;
  bottom: 0.09em;
  height: 0.12em;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(185, 130, 44, 0.2), rgba(127, 29, 45, 0.28));
  transform: none;
}

.title-ai-money::after {
  right: -0.08em;
  top: -0.06em;
  width: 0.16em;
  height: 0.16em;
  border-radius: 0.04em;
  background: #b9822c;
  box-shadow: -0.24em 0.58em 0 rgba(93, 124, 105, 0.8);
}

@media (max-width: 820px) {
  .hero-title-art {
    font-size: clamp(30px, 8vw, 44px);
    line-height: 1.16;
  }
}

@media (max-width: 520px) {
  .hero-title-art {
    font-size: clamp(28px, 9.6vw, 38px);
  }
}

/* Reference-style hero title: black editorial plaque with white italic art lettering. */
.hero-title-art {
  width: fit-content;
  max-width: min(780px, 100%);
  display: grid;
  justify-items: center;
  gap: 0.03em;
  padding: clamp(18px, 3vw, 30px) clamp(24px, 5vw, 56px);
  border: 1px solid rgba(255, 250, 242, 0.12);
  border-radius: 6px;
  color: #fffaf2;
  background:
    radial-gradient(circle at 18% 78%, rgba(185, 130, 44, 0.18), transparent 28%),
    radial-gradient(circle at 80% 12%, rgba(127, 29, 45, 0.2), transparent 30%),
    linear-gradient(180deg, #080707 0%, #161010 100%);
  box-shadow: 0 22px 48px rgba(39, 17, 12, 0.22);
  font-family: "Bodoni 72", "Didot", "Baskerville", "KaiTi", "STKaiti", "FangSong", "Songti SC", Georgia, serif;
  font-size: clamp(28px, 4vw, 50px);
  font-style: italic;
  font-weight: 400;
  line-height: 1.03;
  letter-spacing: 0;
  text-align: center;
  text-wrap: balance;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.28), 0 10px 26px rgba(255, 250, 242, 0.16);
}

.hero-title-art .title-line {
  width: auto;
  color: #fffaf2;
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  -webkit-text-fill-color: #fffaf2;
}

.hero-title-art .title-line:not(.title-line-main) {
  padding-left: 0;
}

.title-line-main {
  justify-content: center;
  gap: 0.18em;
}

.title-ai-money {
  position: relative;
  display: inline-block;
  padding: 0 0.08em 0.06em;
  border: 0;
  border-radius: 0;
  color: #fffdf7;
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  -webkit-text-fill-color: #fffdf7;
  box-shadow: none;
  filter: none;
  font-size: 1.12em;
  font-weight: 600;
  text-shadow: 0 0 16px rgba(255, 250, 242, 0.4), 0 5px 18px rgba(185, 130, 44, 0.24);
}

.title-ai-money::before {
  left: 0.04em;
  right: 0.04em;
  bottom: 0.02em;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(244, 223, 189, 0.95), rgba(185, 130, 44, 0.82), transparent);
  transform: none;
}

.title-ai-money::after {
  right: -0.16em;
  top: 0.06em;
  width: 0.12em;
  height: 0.12em;
  border-radius: 50%;
  background: #fffaf2;
  box-shadow: -0.22em 0.52em 0 rgba(185, 130, 44, 0.95), 0 0 14px rgba(255, 250, 242, 0.66);
}

@media (max-width: 820px) {
  .hero-title-art {
    max-width: 100%;
    font-size: clamp(27px, 7vw, 42px);
  }
}

@media (max-width: 520px) {
  .hero-title-art {
    padding: 18px 20px;
    font-size: clamp(24px, 8vw, 34px);
  }
}

/* Final hero title direction: keep original background and burgundy color, use elegant italic art lettering. */
.hero-title-art {
  width: auto;
  max-width: 760px;
  justify-items: start;
  gap: 0.02em;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--primary-strong);
  background: transparent;
  box-shadow: none;
  font-family: "Bodoni 72", "Didot", "Baskerville", "STKaiti", "KaiTi", "FangSong", "Songti SC", Georgia, serif;
  font-size: clamp(32px, 4.8vw, 58px);
  font-style: italic;
  font-weight: 500;
  line-height: 1.05;
  text-align: left;
  text-shadow: 0 1px 0 rgba(255, 250, 242, 0.96), 0 10px 24px rgba(127, 29, 45, 0.12);
}

.hero-title-art .title-line {
  width: auto;
  color: var(--primary-strong);
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  -webkit-text-fill-color: var(--primary-strong);
}

.hero-title-art .title-line:not(.title-line-main) {
  padding-left: 0;
}

.title-line-main {
  justify-content: flex-start;
  gap: 0.2em;
}

.title-ai-money {
  position: relative;
  display: inline-block;
  padding: 0 0.06em 0.04em;
  border: 0;
  border-radius: 0;
  color: var(--primary);
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  -webkit-text-fill-color: var(--primary);
  box-shadow: none;
  filter: none;
  font-size: 1.1em;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(255, 250, 242, 0.98), 0 12px 26px rgba(127, 29, 45, 0.16);
}

.title-ai-money::before {
  left: 0;
  right: 0;
  bottom: 0.02em;
  height: 0.08em;
  z-index: -1;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(185, 130, 44, 0.08), rgba(185, 130, 44, 0.5), rgba(185, 130, 44, 0.08));
  transform: none;
}

.title-ai-money::after {
  right: -0.12em;
  top: 0.05em;
  width: 0.11em;
  height: 0.11em;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: -0.22em 0.54em 0 rgba(93, 124, 105, 0.72);
}

@media (max-width: 820px) {
  .hero-title-art {
    max-width: 100%;
    font-size: clamp(31px, 8vw, 46px);
    line-height: 1.1;
  }
}

@media (max-width: 520px) {
  .hero-title-art {
    padding: 0;
    font-size: clamp(28px, 9.6vw, 38px);
  }
}

/* Profile setup form: one question per input box in the chat history. */
.profile-form-row {
  align-items: flex-start;
}

.profile-form-message {
  width: min(940px, calc(100% - 56px));
  min-width: 0;
  padding: clamp(16px, 2.4vw, 24px);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  border-bottom-left-radius: 4px;
  background: linear-gradient(135deg, #fffaf2, #f8eadb);
  box-shadow: 0 14px 34px rgba(83, 44, 26, 0.08);
}

.profile-question-form {
  display: grid;
  gap: 16px;
}

.profile-form-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.profile-question-form h3 {
  margin: 0;
  color: var(--primary-strong);
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.18;
}

.profile-question-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.profile-question-field {
  min-width: 0;
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid rgba(127, 29, 45, 0.14);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 248, 0.82);
}

.profile-question-label {
  justify-self: start;
  color: var(--primary);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.35;
}

.profile-question-field input,
.profile-question-field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(127, 29, 45, 0.16);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  color: var(--ink);
  background: #fffaf2;
  font: inherit;
  line-height: 1.5;
  outline: none;
}

.profile-question-field textarea {
  resize: vertical;
  min-height: 74px;
}

.profile-question-field input:focus,
.profile-question-field textarea:focus {
  border-color: rgba(127, 29, 45, 0.5);
  box-shadow: 0 0 0 4px rgba(127, 29, 45, 0.1);
}

.profile-question-field input:disabled,
.profile-question-field textarea:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.profile-form-status {
  min-height: 20px;
  margin: 0;
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
}

.profile-form-actions {
  display: flex;
  justify-content: flex-end;
}

.profile-question-form.is-submitted .profile-form-status {
  color: var(--sage);
}

@media (max-width: 760px) {
  .profile-form-message {
    width: min(100%, calc(100% - 52px));
  }

  .profile-question-grid {
    grid-template-columns: 1fr;
  }
}

/* Flow-mode diagnosis: the setup form turns into result cards in the same surface. */
.profile-setup-copy {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid rgba(127, 29, 45, 0.1);
  border-radius: var(--radius-md);
  background: rgba(247, 225, 223, 0.34);
}

.profile-setup-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.62;
}

.flow-surface {
  background: linear-gradient(135deg, #fffaf2, #f7e7d7);
}

.flow-loading-card,
.flow-result {
  display: grid;
  gap: 16px;
}

.flow-loading-card h3,
.flow-result h3 {
  margin: 0;
  color: var(--primary-strong);
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.16;
}

.flow-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.flow-result-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(127, 29, 45, 0.12);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 248, 0.86);
  box-shadow: 0 10px 24px rgba(83, 44, 26, 0.06);
}

.flow-result-card h4 {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 16px;
  line-height: 1.35;
}

.flow-result-card p {
  margin: 0;
  color: var(--ink);
  line-height: 1.68;
  white-space: pre-line;
}

.flow-next-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding-top: 4px;
}

.flow-next-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.flow-next-field span {
  color: var(--primary);
  font-size: 14px;
  font-weight: 900;
}

.flow-next-field textarea {
  width: 100%;
  min-height: 58px;
  resize: vertical;
  border: 1px solid rgba(127, 29, 45, 0.16);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  color: var(--ink);
  background: #fffaf2;
  font: inherit;
  line-height: 1.5;
  outline: none;
}

.flow-next-field textarea:focus {
  border-color: rgba(127, 29, 45, 0.5);
  box-shadow: 0 0 0 4px rgba(127, 29, 45, 0.1);
}

@media (max-width: 760px) {
  .flow-card-grid,
  .flow-next-form {
    grid-template-columns: 1fr;
  }

  .flow-next-form .btn {
    width: 100%;
  }
}

/* Diagnosis page card mode: remove chat UI and show the setup/result surface directly. */
.diagnosis-page .chat-grid {
  padding: clamp(16px, 3vw, 36px);
}

.diagnosis-page .chat-workspace {
  display: block;
  overflow: visible;
}

.diagnosis-page .chat-intro,
.diagnosis-page .chat-heading,
.diagnosis-page .composer,
.diagnosis-page .profile-form-row .avatar,
.diagnosis-page .loading-row .avatar {
  display: none;
}

.diagnosis-page .chat-shell {
  height: auto;
  min-height: 0;
  display: block;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.diagnosis-page .messages {
  min-height: 0;
  padding: 0;
  overflow: visible;
  scrollbar-gutter: auto;
}

.diagnosis-page .message-row {
  display: block;
  margin: 0;
}

.diagnosis-page .profile-form-message {
  width: 100%;
  max-width: none;
  padding: clamp(22px, 3.4vw, 36px);
  border-radius: var(--radius-lg);
}

.diagnosis-page .profile-question-form {
  gap: clamp(18px, 2vw, 26px);
}

.diagnosis-page .profile-question-form h3,
.diagnosis-page .flow-result h3 {
  font-size: clamp(28px, 3.2vw, 44px);
}

.diagnosis-page .profile-question-grid {
  gap: clamp(14px, 1.8vw, 24px);
}

.diagnosis-page .profile-question-field {
  padding: clamp(14px, 2vw, 22px);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 248, 0.88);
}

.diagnosis-page .profile-question-label {
  font-size: clamp(15px, 1.4vw, 18px);
}

.diagnosis-page .profile-question-field textarea {
  min-height: 96px;
  font-size: clamp(16px, 1.5vw, 20px);
}

.diagnosis-page .profile-setup-copy {
  padding: clamp(16px, 2.2vw, 24px);
}

.diagnosis-page .profile-setup-copy p {
  font-size: clamp(16px, 1.45vw, 20px);
}

.diagnosis-page .flow-result-card {
  padding: clamp(16px, 2vw, 24px);
}

@media (max-width: 760px) {
  .diagnosis-page .profile-form-message {
    padding: 18px;
  }
}

/* Keep the diagnosis intro card while the rest of the chat chrome stays hidden. */
.diagnosis-page .chat-intro {
  display: block;
  margin-bottom: clamp(18px, 2vw, 28px);
}

.flow-action-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(127, 29, 45, 0.12);
  border-radius: var(--radius-md);
  background: rgba(247, 225, 223, 0.32);
}

.flow-action-buttons p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.5;
}

@media (max-width: 560px) {
  .flow-action-buttons .btn {
    width: 100%;
  }
}

/* Opportunity result mode: one candidate result per card, with matching verify buttons. */
.opportunity-card-grid {
  grid-template-columns: 1fr;
}

.opportunity-result-card {
  display: grid;
  gap: 10px;
  padding: clamp(18px, 2.2vw, 26px);
}

.opportunity-result-card h4 {
  margin-bottom: 0;
  font-size: clamp(18px, 1.7vw, 22px);
}

.opportunity-actions {
  align-items: stretch;
}

.opportunity-action-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.opportunity-action-group .btn {
  min-width: 112px;
}

@media (max-width: 560px) {
  .opportunity-actions {
    display: grid;
  }

  .opportunity-action-group {
    display: grid;
    grid-template-columns: 1fr;
  }

  .opportunity-action-group .btn {
    width: 100%;
  }
}


/* Verify result mode: fixed risk-diagnosis cards in a single column. */
.verify-card-grid {
  grid-template-columns: 1fr;
}

.verify-result-card {
  padding: clamp(18px, 2.2vw, 26px);
}

.verify-result-card h4 {
  font-size: clamp(18px, 1.6vw, 22px);
}

/* Plan page card mode: entry choices and single-card plan results. */
.plan-page .composer {
  display: none;
}

.plan-page .chat-shell {
  grid-template-rows: auto minmax(0, 1fr);
}

.plan-entry-surface,
.plan-entry-result,
.plan-idea-result {
  min-height: 100%;
}

.plan-entry-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.plan-entry-card {
  display: grid;
  gap: 14px;
  align-content: start;
}

.plan-entry-card .btn {
  width: fit-content;
  align-self: end;
  margin-top: 4px;
}

.plan-entry-card.is-locked {
  background: rgba(248, 239, 226, 0.78);
}

.plan-entry-note {
  width: fit-content;
  padding: 7px 10px;
  border: 1px solid rgba(127, 29, 45, 0.14);
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: rgba(255, 250, 242, 0.78);
  font-size: 13px;
  font-weight: 900;
}

.plan-idea-card {
  max-width: 760px;
}

.plan-idea-form {
  display: grid;
  gap: 14px;
}

.plan-idea-form textarea {
  min-height: 168px;
}

.plan-idea-actions {
  justify-content: flex-start;
}

.plan-result-card p {
  line-height: 1.72;
}

@media (max-width: 760px) {
  .plan-entry-grid {
    grid-template-columns: 1fr;
  }

  .plan-entry-card .btn {
    width: 100%;
  }
}
/* Collapsible current plan: compact saved-plan rows for the retro side panel. */
.plan-card-collapsible {
  position: relative;
  display: block;
  padding: 14px 46px 14px 14px;
}

.plan-card-summary {
  display: grid;
  min-width: 0;
  cursor: pointer;
  list-style: none;
}

.plan-card-summary::-webkit-details-marker {
  display: none;
}

.plan-card-summary-text {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.plan-card-summary h3 {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: clamp(18px, 1.5vw, 22px);
  line-height: 1.25;
}

.plan-expand-label {
  width: fit-content;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border: 1px solid rgba(127, 29, 45, 0.16);
  border-radius: var(--radius-sm);
  color: var(--primary);
  background: rgba(255, 250, 242, 0.86);
  font-size: 12px;
  font-weight: 900;
}

.plan-delete-button {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(127, 29, 45, 0.2);
  border-radius: 50%;
  color: var(--primary);
  background: rgba(255, 250, 242, 0.94);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.plan-delete-button:hover,
.plan-delete-button:focus-visible {
  color: #fffaf2;
  background: var(--primary);
  transform: translateY(-1px);
}

.plan-delete-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.plan-card-collapsible[open] .plan-expand-label {
  color: #fffaf2;
  background: var(--primary);
}

.plan-card-collapsible[open] .plan-expand-label::before {
  content: "收起详细计划";
}

.plan-card-collapsible[open] .plan-expand-label {
  font-size: 0;
}

.plan-card-collapsible[open] .plan-expand-label::before {
  font-size: 12px;
}

.plan-card-detail {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(127, 29, 45, 0.1);
}

@media (max-width: 560px) {
  .plan-card-collapsible {
    padding-right: 44px;
  }

  .plan-expand-label {
    width: 100%;
  }
}

.plan-card-collapsible.is-current-plan {
  border-color: rgba(127, 29, 45, 0.24);
  background: rgba(255, 250, 242, 0.96);
}
/* Payment modal: Native payment QR and local mock confirmation. */
.payment-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(36, 23, 25, 0.42);
  backdrop-filter: blur(10px);
}

.payment-modal[hidden] {
  display: none;
}

.payment-dialog {
  position: relative;
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 26px;
  border: 1px solid rgba(127, 29, 45, 0.16);
  border-radius: var(--radius-lg);
  background: rgba(255, 250, 242, 0.98);
  box-shadow: 0 28px 72px rgba(36, 23, 25, 0.28);
}

.payment-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(127, 29, 45, 0.18);
  border-radius: 50%;
  color: var(--primary);
  background: rgba(255, 250, 242, 0.9);
  cursor: pointer;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

.payment-dialog h2 {
  margin: 0;
  padding-right: 34px;
  color: var(--primary-strong);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.15;
}

.payment-description,
.payment-status {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.payment-price {
  color: var(--primary);
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
}

.payment-qr {
  min-height: 236px;
  display: grid;
  place-items: center;
  padding: 14px;
  border: 1px solid rgba(127, 29, 45, 0.12);
  border-radius: var(--radius-md);
  background: #fffaf2;
}

.payment-qr svg {
  width: min(220px, 100%);
  height: auto;
  display: block;
}

.payment-dialog .btn {
  width: 100%;
}