/* Mobile-first · warm professional theme */
:root {
  --bg: #ffffff;
  --bg-accent: #f5f0d8;
  --card: #fdf9e7;
  --spread-surface: #fefcf5;
  --primary: #c4785a;
  --primary-hover: #b0684c;
  --primary-soft: #f3e8e0;
  --accent: #6b9080;
  --accent-soft: #e8f0ec;
  --text: #383838;
  --text-muted: #6b6b6b;
  --border: rgba(56, 56, 56, 0.1);
  --user-bubble: #f5f0d8;
  --bot-bubble: #fdf9e7;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 20px rgba(56, 56, 56, 0.08);
  --header-h: 64px;
  --composer-h: 72px;
  --font: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --report-line-height: 1.85;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
}

a {
  color: var(--primary);
  text-decoration: none;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  height: var(--header-h);
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand {
  grid-column: 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  min-width: min-content;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: 0.02em;
}

.brand-lockup-img {
  display: block;
  width: auto;
  height: auto;
  max-height: var(--brand-lockup-max-h, 52px);
  max-width: none;
  object-fit: contain;
  flex-shrink: 0;
}

.lang-btn {
  grid-column: 2;
  justify-self: end;
  border: 1px solid var(--primary-soft);
  background: var(--card);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.lang-btn:active {
  transform: scale(0.97);
}

/* Cards & buttons */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 20px;
  margin: 0 16px 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  padding: 12px 24px;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--primary-soft);
  color: var(--primary);
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Chat page */
.page-chat {
  --home-bg: #fdf6dc;
  --home-blue: #45a5be;
  --home-dark: #535148;
  --home-btn: #535148;
  --home-btn-text: #fefcf5;
  --brand-lockup-max-h: 52px;
  --bg: #fdf6dc;
  --card: #fefcf5;
  --text: #383838;
  --text-muted: #383838;
  --border: rgba(56, 56, 56, 0.12);
  --user-bubble: #f5f0d8;
  --bot-bubble: #fefcf5;
  display: flex;
  flex-direction: column;
  /* svh=可见视口，避免 Android 底栏把输入区顶出可点区域 */
  height: 100vh;
  height: 100svh;
  max-height: 100vh;
  max-height: 100svh;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: #fdf6dc;
  color: #383838;
  font-size: 17px;
  --composer-h: 88px;
}

/* 对话页：浅黄顶栏 + 报告页同款 Logo/EN（EN 加细白边） */
.page-chat .app-header--home {
  background: var(--home-bg);
  border-bottom: none;
  backdrop-filter: none;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 16px;
  box-sizing: border-box;
  height: var(--header-h);
  min-height: var(--header-h);
}

.page-chat .brand-lockup-img--header {
  max-height: var(--brand-lockup-max-h, 52px);
}

.page-chat .lang-btn--home {
  background: var(--card);
  border: 1px solid #fff;
  color: var(--primary);
  border-radius: 999px;
  padding: 6px 14px;
  min-width: unset;
  font-size: 0.85rem;
  font-weight: 600;
}

.page-chat .chat-composer {
  background: rgba(253, 246, 220, 0.97);
  border-top: 1px solid rgba(56, 56, 56, 0.1);
}

.page-chat .report-lang-quick-replies {
  background: #fdf6dc;
  border-top: 1px solid rgba(56, 56, 56, 0.1);
}

.page-chat .message {
  font-size: 0.95rem;
  line-height: 1.55;
}

.page-chat .message.assistant {
  background: #fefcf5;
  border-color: rgba(56, 56, 56, 0.1);
}

.page-chat .typing-text {
  font-size: 0.88rem;
  color: #383838;
}

.page-chat .composer-form {
  margin-bottom: 0;
  max-width: min(920px, calc(100% - 24px));
  /* 一体输入条，去掉输入框与发送钮之间的竖线感 */
  align-items: center;
  gap: 4px;
  padding: 4px 4px 4px 10px;
  border: 1px solid rgba(56, 56, 56, 0.14);
  border-radius: 28px;
  background: #fefcf5;
}

.page-chat .composer-form textarea {
  font-size: 1.05rem;
  background: transparent;
  color: #383838;
  border: none;
  min-height: 44px;
  padding: 10px 8px;
  box-shadow: none;
}

.page-chat .composer-form textarea:focus {
  outline: none;
  border: none;
  box-shadow: none;
}

.page-chat .composer-form:focus-within {
  border-color: var(--primary);
  outline: 2px solid var(--primary-soft);
  outline-offset: 1px;
}

.page-chat .composer-form .btn-send {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.page-chat .chat-composer {
  padding-top: 10px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
}

.page-chat .report-lang-quick-replies__hint {
  font-size: 0.95rem;
  color: #383838;
}

.page-chat .report-lang-quick-replies__btn {
  font-size: 0.98rem;
}

.page-chat .scroll-to-top,
.page-chat .scroll-to-bottom {
  color: #383838;
  font-size: 0.88rem;
}

.page-chat .card {
  background: #fefcf5;
}

.chat-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  /* 手机：壳内滚动，输入区不 fixed，避免 Android 点不穿 */
  overflow: hidden;
}

.chat-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* 输入区已在文档流底部，无需再为 fixed 预留 padding */
  padding-bottom: 0;
}

.chat-stream {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(92, 64, 51, 0.35) transparent;
  -webkit-overflow-scrolling: touch;
}

/* Welcome page: one screen, no scrollbar (Plan B) */
.chat-stream--welcome,
.chat-stream:has(#chatEmptyHint:not([hidden])) {
  overflow: hidden;
  /* 空状态靠上：提示落在顶栏与「准备好了吗」之间 */
  justify-content: flex-start;
  padding-top: clamp(1.25rem, 8vh, 3.5rem);
}

.chat-stream::-webkit-scrollbar {
  width: 8px;
}

.chat-stream::-webkit-scrollbar-thumb {
  background: rgba(92, 64, 51, 0.28);
  border-radius: 999px;
}

.chat-stream::-webkit-scrollbar-thumb:hover {
  background: rgba(92, 64, 51, 0.42);
}

.chat-scroll-hint {
  flex-shrink: 0;
  margin: 0;
  padding: 8px 16px 4px;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  background: linear-gradient(180deg, var(--bg) 0%, transparent 100%);
}

.welcome {
  text-align: center;
  margin-top: 24px;
}

.welcome-emoji {
  font-size: 2.5rem;
  margin: 0 0 8px;
}

.welcome-title {
  font-size: 1.35rem;
  margin: 0 0 12px;
  color: var(--text);
}

.welcome-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0 0 20px;
}

.demo-hint {
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}

.message-list {
  list-style: none;
  margin: 0;
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message {
  max-width: 88%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.55;
  /* 避免短答如「d b」被拆成竖排 */
  word-break: normal;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.message.user {
  align-self: flex-end;
  min-width: 3.25rem;
  background: var(--user-bubble);
  border-bottom-right-radius: 4px;
  color: var(--text);
}

.message.assistant {
  align-self: flex-start;
  background: var(--bot-bubble);
  box-shadow: 0 2px 12px rgba(56, 56, 56, 0.06);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.chat-empty-hint {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: left;
  padding: 4px 12px 8px;
  margin: 0 auto;
  width: 100%;
  max-width: min(1040px, calc(100% - 16px));
  color: #383838;
  font-size: 0.92rem;
  line-height: 1.72;
  min-height: 0;
}

.chat-empty-hint[hidden] {
  display: none !important;
}

.chat-empty-hint--minimal {
  max-width: 28rem;
  margin: 0 auto;
  padding: 0.5rem 1rem 2rem;
  text-align: center;
  align-items: center;
}

/* 中文散文诗 / 英文整句：按 html lang 切换 */
.chat-empty-hint--minimal .chat-empty-hint__verses {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  margin: 0;
}

.chat-empty-hint--minimal .chat-empty-hint__rules-en {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  margin: 0;
}

html[lang='en'] .chat-empty-hint--minimal .chat-empty-hint__verses {
  display: none;
}

html[lang='en'] .chat-empty-hint--minimal .chat-empty-hint__rules-en {
  display: flex;
}

.chat-empty-hint--minimal .chat-empty-hint__rule {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 400;
  font-style: normal;
  line-height: 1.55;
  color: #383838;
  text-align: center;
  opacity: 0.9;
}

.chat-empty-hint--minimal .chat-empty-hint__verse {
  display: inline-block;
  margin: 0;
  max-width: 100%;
  font-size: 0.95rem;
  font-weight: 400;
  font-style: italic;
  line-height: 1.55;
  color: #383838;
  text-align: left;
  opacity: 0.88;
}

.chat-empty-hint--minimal .chat-empty-hint__verse-a,
.chat-empty-hint--minimal .chat-empty-hint__verse-b {
  display: block;
}

.chat-empty-hint--minimal .chat-empty-hint__verse-b {
  margin-top: 0.12rem;
  padding-left: 1.35em;
}

/* 提示与「准备好了吗？」拉开，提示更靠上半屏（需压过全局 lead 的 margin:0 !important） */
.chat-empty-hint--minimal .chat-empty-hint__lead {
  margin: clamp(2.25rem, 12vh, 4.5rem) 0 0.55rem !important;
  text-align: center;
  font-style: normal;
}

.chat-empty-hint--minimal .chat-empty-hint__cta {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  opacity: 0.9;
  text-align: center;
}

.chat-empty-hint__divider {
  margin: 10px auto 12px;
  width: min(92vw, 420px);
  max-width: 100%;
}

.chat-empty-hint__intro {
  margin: 0 0 0.85em !important;
  color: #383838;
  font-size: 0.88rem;
  line-height: 1.68;
  width: 100%;
  max-width: min(720px, 100%);
  text-align: center;
}

.chat-empty-hint__cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  max-width: min(960px, 100%);
  margin: 0 auto 0.75em;
  align-items: stretch;
}

.chat-empty-hint__capsule {
  border-radius: 22px;
  padding: 14px 12px 16px;
  min-height: 100%;
  color: #383838;
}

.chat-empty-hint__capsule--lang {
  background: #dcfde5;
}

.chat-empty-hint__capsule--report {
  background: #dce3fd;
}

.chat-empty-hint__capsule--calibration {
  background: #fddcf3;
}

.chat-empty-hint__capsule-title {
  margin: 0 0 0.55em;
  font-weight: 600;
  color: #383838;
  font-size: 0.88rem;
  line-height: 1.5;
}

.chat-empty-hint__capsule-body {
  margin: 0;
  color: #383838;
  font-size: 0.82rem;
  line-height: 1.65;
}

.chat-empty-hint__steps {
  margin: 0;
  padding-left: 1.05em;
  color: #383838;
  font-size: 0.8rem;
  line-height: 1.62;
}

.chat-empty-hint__steps li {
  margin-bottom: 0.5em;
}

.chat-empty-hint__steps li:last-child {
  margin-bottom: 0;
}

.chat-empty-hint p {
  margin: 0 0 0.85em;
}

.chat-empty-hint p:last-child {
  margin-bottom: 0;
}

.chat-empty-hint__lead {
  font-size: clamp(1.85rem, 8vw, 2.35rem);
  font-weight: 600;
  text-align: center;
  margin: 0 !important;
  color: #928b77;
  letter-spacing: 0.02em;
  line-height: 1.28;
  width: 100%;
}

.chat-empty-hint__cta {
  margin-top: 0.5em !important;
  padding-top: 0;
  border-top: none;
  font-weight: 600;
  text-align: center;
  color: #383838;
  font-size: 0.96rem;
  line-height: 1.68;
  width: 100%;
  max-width: min(720px, 100%);
}

@media (max-width: 640px) {
  .chat-stream--welcome,
  .chat-stream:has(#chatEmptyHint:not([hidden])) {
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .chat-stream--welcome::-webkit-scrollbar,
  .chat-stream:has(#chatEmptyHint:not([hidden]))::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  .chat-empty-hint {
    padding: 2px 10px 4px;
  }

  .chat-empty-hint__lead {
    font-size: clamp(1.55rem, 7vw, 1.85rem);
  }

  .chat-empty-hint__divider {
    margin: 8px auto 10px;
  }

  .chat-empty-hint__intro {
    font-size: 0.82rem;
    margin-bottom: 0.7em !important;
  }

  .chat-empty-hint__cards {
    grid-template-columns: 1fr;
    max-width: min(420px, 100%);
    gap: 8px;
    margin-bottom: 0.6em;
  }

  .chat-empty-hint__capsule {
    padding: 12px 14px 14px;
  }

  .chat-empty-hint__capsule-title {
    font-size: 0.88rem;
  }

  .chat-empty-hint__capsule-body,
  .chat-empty-hint__steps {
    font-size: 0.82rem;
    line-height: 1.6;
  }

  .chat-empty-hint__cta {
    font-size: 0.88rem;
    margin-top: 0.35em !important;
  }
}

@media (min-width: 641px) and (max-width: 900px) {
  .chat-empty-hint__capsule {
    padding: 12px 10px 14px;
  }

  .chat-empty-hint__capsule-title {
    font-size: 0.84rem;
  }

  .chat-empty-hint__capsule-body,
  .chat-empty-hint__steps {
    font-size: 0.78rem;
    line-height: 1.58;
  }
}

@media (min-width: 901px) {
  .chat-empty-hint__capsule-title {
    font-size: 0.92rem;
  }

  .chat-empty-hint__capsule-body,
  .chat-empty-hint__steps {
    font-size: 0.86rem;
  }
}

.report-lang-quick-replies {
  padding: 10px 14px 4px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.report-lang-quick-replies[hidden] {
  display: none !important;
}

.report-lang-quick-replies__hint {
  margin: 0 0 10px;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  color: var(--text);
}

.report-lang-quick-replies__actions {
  display: flex;
  gap: 10px;
}

.report-lang-quick-replies__btn {
  flex: 1;
  min-height: 44px;
  font-size: 0.9rem;
}

.composer-form--report-lang-pick textarea {
  opacity: 0.55;
  cursor: not-allowed;
}

.typing[hidden] {
  display: none !important;
}

.typing {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 16px 6px;
  padding: 0;
  align-self: flex-start;
  opacity: 0.75;
}

.typing-dots span {
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-right: 3px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: bounce 1.2s infinite ease-in-out;
}

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

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

.typing-text {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.chat-composer {
  /* 参与 flex 排版钉在壳底；勿用 fixed（Android Edge/Chrome 易点不中） */
  position: relative;
  flex-shrink: 0;
  z-index: 50;
  width: 100%;
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid var(--border);
  pointer-events: auto;
  touch-action: manipulation;
}

.shared-device-privacy {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  max-width: 640px;
  margin: 0 auto 8px;
  padding: 0 4px;
  font-size: 0.72rem;
  line-height: 1.55;
  color: #6b6658;
}

.shared-device-privacy__badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  background: #fdeeee;
  color: #b54a4a;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.35;
}

.shared-device-privacy__text {
  flex: 1 1 12rem;
  min-width: 0;
  margin: 0;
  text-align: left;
}

.shared-device-privacy--report {
  max-width: none;
  margin: 0 0 12px;
  padding: 0;
}

.composer-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 640px;
  margin: 0 auto;
}

.composer-form textarea {
  flex: 1;
  resize: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 10px 16px;
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
  max-height: 120px;
  background: var(--card);
  color: var(--text);
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-user-select: text;
  user-select: text;
}

.composer-form textarea:focus {
  outline: 2px solid var(--primary-soft);
  border-color: var(--primary);
}

.composer-form textarea:disabled {
  opacity: 0.55;
  background: #ece8d8;
  color: var(--text-muted);
}

.btn-send {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-send:disabled {
  background: var(--primary-soft);
  color: var(--text-muted);
  cursor: not-allowed;
}

.scroll-to-bottom {
  position: fixed;
  left: 50%;
  bottom: calc(var(--composer-h) + 18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.scroll-to-bottom[hidden] {
  display: none;
}

.scroll-to-top {
  position: fixed;
  right: 16px;
  /* 顶栏下方，避免被 logo 栏挡住一半 */
  top: calc(var(--header-h) + 10px + env(safe-area-inset-top, 0px));
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.scroll-to-top[hidden] {
  display: none;
}

.scroll-to-top:hover {
  color: var(--primary);
  border-color: var(--primary-soft);
}

.scroll-to-bottom:hover {
  color: var(--primary);
  border-color: var(--primary-soft);
}

@media (min-width: 768px) {
  .scroll-to-bottom {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
  }

  .scroll-to-top {
    position: absolute;
    top: 8px;
    right: 16px;
  }

  .chat-shell {
    position: relative;
  }
}

/* Report page */
.page-report-e {
  --report-col: 560px;
  --brand-lockup-max-h: 52px;
}

.page-report .report-main {
  padding: 8px 0 32px;
}

@media (min-width: 768px) {
  .page-report-e {
    --header-h: 72px;
    --brand-lockup-max-h: 58px;
  }

  .page-report-e .app-header--report {
    grid-template-columns: 1fr min(var(--report-col), calc(100% - 32px)) 1fr;
    padding: 0;
  }

  .page-report-e .app-header--report .brand {
    grid-column: 1;
    justify-self: center;
    padding: 0 12px;
  }

  .page-report-e .app-header--report .lang-btn {
    grid-column: 3;
    justify-self: end;
    margin-right: 16px;
  }
}

@media (min-width: 900px) {
  .page-report-e {
    --report-col: 640px;
    --brand-lockup-max-h: 62px;
  }
}

.hero {
  text-align: center;
  background: linear-gradient(165deg, #fff 0%, var(--primary-soft) 100%);
}

.hero .summary-text {
  text-align: left;
  margin-top: 8px;
}

.report-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin: 0 0 8px;
}

.score-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
}

.score-value {
  font-size: clamp(3rem, 12vw, 4rem);
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.score-unit {
  font-size: 1.1rem;
  color: var(--text-muted);
}

.level-badge {
  display: inline-block;
  margin: 12px 0;
  padding: 6px 16px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  border-radius: 999px;
  font-size: 0.95rem;
}

.summary-text {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0;
  text-align: center;
}

.chart-section h2,
.card h2 {
  font-size: 1.1rem;
  margin: 0 0 16px;
  color: var(--text);
}

.chart-wrap {
  position: relative;
  height: min(280px, 55vw);
  margin-bottom: 16px;
}

.dimension-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dimension-list-traits .dim-trait-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.dimension-list-traits .dim-trait-item:last-child {
  border-bottom: none;
}

.dim-trait-name {
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}

.dim-trait-value {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.section-block {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

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

.section-block h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: var(--primary);
}

.section-block p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.report-actions {
  padding: 0 16px;
  margin-top: 8px;
}

.section-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: -8px 0 16px;
}

.identity-label {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  margin: 0 0 12px;
}

.identity-dash {
  grid-column: 1;
  justify-self: end;
  margin-right: 0.5em;
  font-size: 1.35rem;
  font-weight: 200;
  color: var(--accent);
  letter-spacing: -0.08em;
  line-height: 1.35;
  transform: scaleX(0.72);
  transform-origin: right center;
}

.identity-text {
  grid-column: 2;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.35;
  text-align: center;
}

/* Report · 方案 E */
.page-report-e .card {
  background: var(--spread-surface);
}

.page-report-e .report-hero {
  text-align: center;
  padding-top: 20px;
}

.page-report-e {
  font-family: var(--font);
  line-height: var(--report-line-height);
}

.report-greeting {
  margin: 2em 0 0;
  line-height: 1.4;
  text-align: left;
}

.greeting-you-line {
  margin: 8px 0 12px;
  text-align: center;
  line-height: 1.35;
}

.greeting-to {
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "Songti SC", "Noto Serif SC", "SimSun", serif;
  font-size: 2.15rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--text);
}

.greeting-you {
  font-family: "Microsoft YaHei", "Microsoft YaHei UI", "Microsoft JhengHei", sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.golden-sentence {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0 0 16px;
  line-height: var(--report-line-height);
  font-style: italic;
}

.share-text {
  font-size: 0.95rem;
  line-height: var(--report-line-height);
  color: var(--text);
  text-align: left;
  font-family: var(--font);
}

.share-text p {
  margin: 0 0 1em;
  text-indent: 0;
}

/* 用两个全角空格（　）顶格，视觉上稳定等于「退两字」 */
.share-text p::before {
  content: '\3000\3000';
}

.share-text p:last-child {
  margin-bottom: 0;
}

.report-share-actions {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.share-footer-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.media-toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(12px);
  max-width: min(92vw, 360px);
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(45, 40, 34, 0.92);
  color: #fff;
  font-size: 0.95rem;
  line-height: 1.45;
  text-align: center;
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-sizing: border-box;
}

.media-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.share-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px !important;
  margin-top: 8px;
}

.share-footer-notes {
  flex: 1 1 100%;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.share-footer-logo {
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
}

.share-footer-name {
  margin: 0;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

.share-footer-url {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  word-break: break-all;
}

.full-report-error {
  font-size: 0.88rem;
  color: #b45309;
  margin: 8px 0 0;
}

.full-report-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 12px;
  line-height: 1.55;
}

.full-report-status {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

.report-full-details {
  margin-top: 16px;
}

.btn-full-report-cta {
  display: block;
  width: 100%;
  min-height: 48px;
  margin: 12px 0 0;
  padding: 0.85rem 1.25rem;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.3;
  text-align: center;
  cursor: pointer;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-full-report-cta:hover {
  filter: brightness(0.94);
}

.btn-full-report-cta:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.btn-full-report-cta:disabled {
  opacity: 0.65;
  cursor: wait;
}

.btn-full-report-cta[data-state="ready"][aria-expanded="true"] {
  background: var(--accent-soft);
  color: var(--accent);
}

.full-report-save-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 8px;
}

.full-report-save-btn {
  width: 100%;
  min-height: 48px;
  font-size: 1rem;
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}

.full-report-save-hint {
  margin: 0 0 14px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted, #6b6560);
}

@media (min-width: 480px) {
  .full-report-save-bar {
    flex-direction: row;
  }

  .full-report-save-btn {
    flex: 1 1 0;
  }
}

/* Hide native <details> label ("详细信息" / "Details"); open/close is via CTA */
.report-full-details > summary,
.report-full-details-summary {
  display: none !important;
  list-style: none;
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.report-full-details > summary::-webkit-details-marker {
  display: none;
}

.report-disclaimer,
.report-explore-hint,
.report-footer-note,
.report-footer-disclaimer {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: var(--report-line-height);
  margin: 12px 0 0;
}

.report-footer-note:first-child,
.report-footer-disclaimer:first-child {
  margin-top: 0;
}

.full-report-preamble {
  font-size: 0.92rem;
  line-height: var(--report-line-height);
  color: var(--text);
  font-family: var(--font);
  font-style: italic;
  text-indent: 2em;
}

.full-report-preamble-locked {
  margin: 0 0 16px;
}

.full-report-heading {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin: 8px 0 18px;
  line-height: 1.5;
  font-family: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
}

.full-report-reader-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
  flex-wrap: wrap;
}

.full-report-pinch-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  flex: 1 1 auto;
}

.full-report-font-controls {
  display: inline-flex;
  gap: 6px;
  flex-shrink: 0;
}

.full-report-font-btn {
  min-width: 44px;
  min-height: 40px;
  padding: 0 12px;
  font-size: 0.95rem;
  font-weight: 700;
  -webkit-tap-highlight-color: transparent;
}

/* Kindle 风阅读层：衬线、两端对齐、可缩放字号 */
.full-report-body {
  --full-report-font-size: 17px;
  --full-report-line-height: 1.78;
  --full-report-letter-spacing: 0.028em;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", "Noto Serif SC",
    "Source Han Serif SC", "SimSun", "Songti TC", serif;
  font-size: var(--full-report-font-size);
  line-height: var(--full-report-line-height);
  letter-spacing: var(--full-report-letter-spacing);
  color: var(--text);
  max-width: none;
  width: 100%;
  margin: 0;
  padding-top: 4px;
  touch-action: pan-y;
  -webkit-text-size-adjust: 100%;
}

.full-chapter-card {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0 0 1.35em;
  margin: 0 0 1.35em;
  border-bottom: 1px solid rgba(56, 56, 56, 0.08);
}

.full-chapter-card:last-child {
  margin-bottom: 0;
  border-bottom: none;
}

.full-chapter-title {
  font-family: inherit;
  font-size: 1.12em;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.85em;
  line-height: 1.45;
  letter-spacing: 0.02em;
  text-align: left;
  padding-bottom: 0.45em;
  border-bottom: 1px solid rgba(56, 56, 56, 0.08);
}

.full-chapter-content {
  font-size: 1em;
  line-height: inherit;
  letter-spacing: inherit;
  color: var(--text);
  font-weight: 400;
}

.full-chapter-content .full-para {
  margin: 0 0 1em;
  font-weight: 400;
  text-align: justify;
  text-justify: inter-ideograph;
  text-indent: 0;
  hyphens: auto;
}

.full-chapter-content .full-para::before {
  content: '\3000\3000';
}

.full-chapter-content .full-para:last-child {
  margin-bottom: 0;
}

.full-zone-title {
  font-family: inherit;
  font-weight: 700;
  font-size: 1.06em;
  color: var(--text);
  margin: 1.15em 0 0.65em;
  line-height: 1.5;
  letter-spacing: 0.02em;
  text-align: left;
  text-indent: 0;
}

.full-chapter-content .full-zone-title:first-child {
  margin-top: 0;
}

.full-subheading {
  font-family: inherit;
  font-weight: 600;
  font-size: 1.02em;
  color: var(--text);
  margin: 0.95em 0 0.5em;
  line-height: 1.5;
  text-align: left;
  text-indent: 0;
}

/* 网格悬挂缩进：换行与正文齐平，不再顶到圆点下 */
.full-list-item {
  display: grid;
  grid-template-columns: 1.35em minmax(0, 1fr);
  column-gap: 0.35em;
  align-items: start;
  margin: 0 0 0.75em;
  padding: 0;
  text-indent: 0;
  font-weight: 400;
  font-size: 1em;
  line-height: inherit;
  letter-spacing: inherit;
}

.full-list-item__mark {
  text-align: center;
  line-height: inherit;
  user-select: none;
}

.full-list-item__body {
  min-width: 0;
  text-align: justify;
  text-justify: inter-ideograph;
}

.full-zone-note {
  font-size: 0.92em;
  margin: 0.15em 0 0.9em;
  padding-left: 0;
  line-height: 1.6;
  text-align: justify;
}

.full-zone-note-label {
  font-weight: 700;
  font-style: normal;
  color: var(--text);
}

.full-zone-note-body {
  font-style: italic;
  color: var(--text-muted);
  font-weight: 400;
}

.full-report-generating {
  margin: 8px 0 16px;
}

.bird-flight-track {
  position: relative;
  height: 48px;
  margin: 0 0 12px;
  overflow: hidden;
}

.bird-flight-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  position: absolute;
  top: 4px;
  left: 0;
  display: block;
  animation: birdFly 3.5s ease-in-out infinite;
}

@keyframes birdFly {
  0% {
    transform: translateX(0) translateY(0);
  }
  25% {
    transform: translateX(calc(50% - 20px)) translateY(-4px);
  }
  50% {
    transform: translateX(calc(100% - 40px)) translateY(2px);
  }
  75% {
    transform: translateX(calc(50% - 20px)) translateY(-3px);
  }
  100% {
    transform: translateX(0) translateY(0);
  }
}

.full-report-progress-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.full-report-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--primary));
  border-radius: 999px;
  transition: width 0.6s ease;
}

@media (prefers-reduced-motion: reduce) {
  .bird-flight-icon {
    animation: none;
    left: 50%;
    transform: translateX(-50%);
  }

  .full-report-progress-bar {
    transition: none;
  }
}

/* Avatar / visual gene code — legacy, v1.1 */
.avatar-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

@media (min-width: 480px) {
  .avatar-row {
    flex-direction: row;
    align-items: flex-start;
  }
}

.avatar-host {
  flex-shrink: 0;
}

.avatar-stack {
  position: relative;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--bg);
}

.avatar-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-layer svg {
  width: 100%;
  height: 100%;
}

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

.gene-code-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin: 0 0 4px;
}

.gene-code {
  font-family: ui-monospace, monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 12px;
  word-break: break-all;
}

.gene-legend {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.gene-legend li {
  margin-bottom: 6px;
}

.gene-tag {
  display: inline-block;
  min-width: 2.2em;
  font-weight: 700;
  color: var(--accent);
  font-family: ui-monospace, monospace;
}

/* Soundscape */
.soundscape-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.soundscape-bar-wrap {
  height: 6px;
  background: var(--bg-accent);
  border-radius: 3px;
  overflow: hidden;
}

.soundscape-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--primary));
  transition: width 0.15s linear;
}

/* Music card (inline in soundscape section) */
.music-card-locked {
  text-align: center;
  padding: 16px 0;
}

.music-card-locked p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0;
}

.music-choose-hint {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0 0 14px;
  text-align: center;
}

.music-choose-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.music-song-option {
  padding: 14px;
  background: var(--bg-accent);
  border-radius: 12px;
  text-align: center;
}

.music-song-cover {
  width: 100%;
  max-width: 180px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  margin: 0 auto 8px;
  display: block;
}

.music-song-title {
  font-weight: 500;
  margin: 0 0 2px;
}

.music-song-duration {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin: 0 0 8px;
}

.music-song-option audio {
  width: 100%;
  margin-bottom: 10px;
}

.music-choose-btn {
  width: 100%;
}

.music-card-generating {
  text-align: center;
  padding: 16px 0;
}

.music-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--bg-accent);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 10px;
  animation: music-spin 0.8s linear infinite;
}

@keyframes music-spin {
  to { transform: rotate(360deg); }
}

.music-progress-text {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin: 4px 0 0;
}

.music-player {
  text-align: center;
}

.music-cover {
  width: 100%;
  max-width: 240px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  margin: 0 auto 12px;
  display: block;
}

.music-title {
  font-weight: 500;
  margin: 0 0 10px;
}

.music-player audio {
  width: 100%;
  margin-bottom: 10px;
}

.music-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.music-loop-btn.is-active,
.music-loop-btn[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}

.music-card-error {
  text-align: center;
  padding: 12px 0;
}

.music-card-error p {
  color: var(--text-secondary);
  margin: 0 0 10px;
  font-size: 0.85rem;
}

/* Paywall */
.paywall {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(61, 52, 41, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.paywall[hidden] {
  display: none !important;
}

.paywall-card {
  max-width: 360px;
  width: 100%;
  margin: 0;
  text-align: center;
}

.paywall-card h2 {
  margin: 0 0 12px;
}

.paywall-price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  margin: 16px 0;
}

.paywall-status {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--accent);
}

.paywall-skip {
  margin-top: 16px;
  font-size: 0.85rem;
}

.paywall-skip a {
  color: var(--text-muted);
}

/* Home · intro + landing */
.page-home {
  --home-bg: #fdf6dc;
  --home-blue: #45a5be;
  --home-lead: #928b77;
  --home-dark: #535148;
  --home-btn: #535148;
  --home-btn-text: #fefcf5;
  --brand-lockup-max-h: 52px;
  min-height: 100dvh;
  background: var(--home-bg);
}

/* 首页：浅黄顶栏 + 报告页同款 Logo/EN（EN 加细白边） */
.page-home .app-header--home {
  background: var(--home-bg);
  border-bottom: none;
  backdrop-filter: none;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 16px;
  box-sizing: border-box;
  height: var(--header-h);
  min-height: var(--header-h);
}

.page-home .brand-lockup-img--header {
  max-height: var(--brand-lockup-max-h, 52px);
}

.page-home .lang-btn--home {
  background: var(--card);
  border: 1px solid #fff;
  color: var(--primary);
  border-radius: 999px;
  padding: 6px 14px;
  min-width: unset;
  font-size: 0.85rem;
  font-weight: 600;
}

.page-home .lang-btn--home:hover {
  background: var(--primary-soft);
}

.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--home-bg, #fdf6dc);
  opacity: 1;
  transition: opacity 1s ease;
  pointer-events: auto;
}

.intro-overlay.is-fading {
  opacity: 0;
  pointer-events: none;
}

.intro-overlay.is-audio-only {
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}

.intro-overlay[hidden] {
  display: none !important;
}

.intro-video {
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100dvh;
  object-fit: contain;
  background: var(--home-bg, #fdf6dc);
}

.intro-skip {
  position: absolute;
  right: 16px;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 2;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.88);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.intro-unmute {
  position: absolute;
  left: 16px;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 2;
  border: 1px solid var(--primary-soft);
  background: rgba(255, 255, 255, 0.92);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.home-main {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--home-bg, #fdf6dc);
}

.home-main--intro-wait {
  opacity: 0;
  pointer-events: none;
}

.home-main--intro-reveal {
  opacity: 1;
  transition: opacity 1s ease;
  pointer-events: auto;
}

.home-main[hidden] {
  display: none !important;
}

.home-body {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 52px 24px max(32px, env(safe-area-inset-bottom));
  box-sizing: border-box;
}

.home-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  text-align: center;
}

.home-hero {
  text-align: center;
  width: 100%;
  margin: 0 auto;
}

.home-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 0;
  line-height: 1.05;
  transform: translateX(-0.5em);
}

.home-title-line {
  display: block;
  letter-spacing: 0.03em;
  width: fit-content;
  max-width: 100%;
}

.home-title-line--lead {
  font-family: "Microsoft YaHei", "微软雅黑", var(--font);
  font-size: clamp(2.5rem, 10.5vw, 3.35rem);
  font-style: italic;
  font-weight: 700;
  color: #928b77;
  margin-bottom: 0.06em;
  transform: none;
}

.home-title-line--sub {
  font-family: "Microsoft YaHei", "微软雅黑", var(--font);
  font-size: clamp(2.2rem, 10vw, 3.1rem);
  font-weight: 400;
  color: #45423b;
  text-indent: 0;
  margin-inline: 0;
  padding-left: 1.75em;
  box-sizing: border-box;
  margin-top: 0;
  word-break: keep-all;
  transform: none;
}

html[lang="en"] .home-title-line--sub {
  padding-left: 1.1em;
}

.home-divider {
  border: none;
  margin: 24px auto 0;
  height: 3px;
  width: calc(100% + 2.5rem);
  max-width: min(92vw, 420px);
  background: var(--home-blue, #45a5be);
  display: block;
}

.btn-home-explore {
  display: inline-flex;
  margin: 0;
  background: var(--home-btn);
  color: var(--home-btn-text);
  border-radius: 999px;
  padding: 12px 34px;
  font-size: 0.92rem;
  font-weight: 600;
  box-shadow: none;
  min-width: 148px;
  justify-content: center;
}

.home-cta-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: clamp(48px, 10vh, 64px) auto 0;
}

.btn-home-full {
  display: inline-flex;
  margin: 0;
  background: transparent;
  color: var(--home-btn, #2a6f7e);
  border: 1.5px solid var(--home-btn, #45a5be);
  border-radius: 999px;
  padding: 11px 22px;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: none;
  max-width: min(340px, calc(100% - 16px));
  text-align: center;
  justify-content: center;
  line-height: 1.35;
}

.btn-home-full:hover {
  filter: brightness(1.05);
  background: rgba(69, 165, 190, 0.08);
}

.home-full-hint {
  margin: 10px auto 0;
  max-width: min(340px, calc(100% - 16px));
  font-size: 0.72rem;
  line-height: 1.55;
  color: #9a9a9a;
  text-align: center;
}

.btn-home-explore:hover {
  filter: brightness(1.06);
}

.home-footer-desc {
  margin: 28px auto 0;
  max-width: min(340px, calc(100% - 16px));
  font-size: 0.8rem;
  line-height: 1.7;
  color: #8a8a8a;
}

.home-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 4px;
  margin: 24px 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
}

.home-legal a {
  color: #6b6658;
  text-decoration: none;
  font-weight: 500;
}

.home-legal a:hover {
  color: var(--home-blue);
  text-decoration: underline;
}

.home-legal-sep {
  color: #b8b2a0;
  user-select: none;
}

.home-legal-note,
.home-payment-note,
.home-demo-hint {
  margin: 12px auto 0;
  max-width: min(340px, calc(100% - 16px));
  font-size: 0.72rem;
  line-height: 1.55;
  color: #a8a498;
}

.home-demo-hint {
  margin-top: 16px;
  color: var(--text-muted);
}

@media (min-width: 768px) {
  .page-home .app-header--home {
    padding: 0 24px;
  }

  .page-home .brand-lockup-img--header {
    max-height: var(--brand-lockup-max-h, 58px);
  }

  .home-body {
    max-width: 560px;
    padding-left: 40px;
    padding-right: 40px;
    padding-top: 60px;
  }

  .home-title-line--lead {
    font-size: 3.75rem;
  }

  .home-title-line--sub {
    font-size: 3.5rem;
    padding-left: 1.85em;
  }

  .home-divider {
    max-width: 500px;
    margin-top: 28px;
  }

  .home-footer-desc {
    max-width: 460px;
    font-size: 0.85rem;
  }
}

@media (min-width: 1024px) {
  .page-home .app-header--home {
    padding: 0 32px;
  }

  .page-home .brand-lockup-img--header {
    max-height: var(--brand-lockup-max-h, 62px);
  }

  .home-body {
    max-width: 680px;
    padding-left: 48px;
    padding-right: 48px;
    padding-top: 68px;
    padding-bottom: max(40px, env(safe-area-inset-bottom));
  }

  .home-title-line--lead {
    font-size: 4.25rem;
  }

  .home-title-line--sub {
    font-size: 4.05rem;
    padding-left: 1.9em;
  }

  .home-divider {
    max-width: 560px;
    margin-top: 32px;
  }

  .btn-home-explore {
    padding: 13px 38px;
    font-size: 0.95rem;
  }

  .btn-home-full {
    font-size: 0.88rem;
    max-width: 420px;
  }

  .home-full-hint {
    max-width: 420px;
  }

  .home-footer-desc {
    max-width: 540px;
    font-size: 0.88rem;
  }
}

/* Tablet+ */
@media (min-width: 640px) {
  .card {
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
  }

  .message-list {
    max-width: 592px;
    margin-left: auto;
    margin-right: auto;
  }

  .typing {
    max-width: 592px;
    margin-left: auto;
    margin-right: auto;
  }

  .chat-composer .composer-form {
    max-width: 560px;
  }

  .report-actions {
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (min-width: 768px) {
  .chat-shell {
    max-width: min(1040px, calc(100% - 32px));
    margin: 0 auto;
    max-height: calc(100dvh - var(--header-h));
  }

  .page-chat .message-list,
  .page-chat .typing {
    max-width: min(920px, calc(100% - 32px));
    margin-left: auto;
    margin-right: auto;
  }

  .page-chat .chat-composer .composer-form {
    max-width: min(920px, calc(100% - 32px));
  }
}

@media (min-width: 900px) {
  .card {
    max-width: 640px;
  }
}

/* Legal stub pages */
.page-legal {
  --home-bg: #fdf6dc;
  min-height: 100dvh;
  background: var(--home-bg);
}

.page-legal .app-header--home {
  background: var(--home-bg);
  border-bottom: none;
  backdrop-filter: none;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 24px 20px 8px;
  box-sizing: border-box;
  height: auto;
  min-height: var(--header-h);
}

.page-legal .brand-lockup-img--header {
  max-height: 44px;
}

.page-legal .lang-btn--home {
  background: #535148;
  border: none;
  color: #fefcf5;
  border-radius: 6px;
  padding: 6px 10px;
  min-width: 40px;
  font-size: 0.8rem;
  font-weight: 600;
}

.legal-main {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 24px max(40px, env(safe-area-inset-bottom));
  box-sizing: border-box;
}

.legal-main h1 {
  margin: 0 0 20px;
  font-size: 1.35rem;
  font-weight: 700;
  color: #45423b;
  letter-spacing: 0.02em;
}

.legal-main h2 {
  margin: 28px 0 12px;
  font-size: 1rem;
  font-weight: 700;
  color: #45423b;
  letter-spacing: 0.02em;
}

.legal-main p {
  margin: 0 0 16px;
  font-size: 0.88rem;
  line-height: 1.75;
  color: #6b6658;
}

.legal-list {
  margin: 0 0 8px;
  padding-left: 1.25em;
  font-size: 0.88rem;
  line-height: 1.75;
  color: #6b6658;
}

.legal-list li {
  margin: 0 0 12px;
  padding-left: 0.15em;
}

.legal-list li::marker {
  color: #928b77;
}

.legal-bullets {
  margin: 0 0 16px;
  padding-left: 1.25em;
  font-size: 0.88rem;
  line-height: 1.75;
  color: #6b6658;
}

.legal-bullets li {
  margin: 0 0 8px;
}

.legal-bullets li::marker {
  color: #928b77;
}

.legal-contact-line {
  margin-top: 8px;
}

.legal-email {
  color: #45a5be;
  font-weight: 600;
  word-break: break-all;
}

.legal-email-fallback {
  color: #928b77;
  font-size: 0.85rem;
}

.legal-back {
  display: inline-flex;
  margin-top: 28px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #45a5be;
  text-decoration: none;
}

.legal-back:hover {
  text-decoration: underline;
}

@media (min-width: 768px) {
  .page-legal .app-header--home {
    padding: 28px 32px 10px;
  }

  .legal-main {
    padding: 32px 40px max(48px, env(safe-area-inset-bottom));
  }

  .legal-main h1 {
    font-size: 1.5rem;
  }
}


.music-cover-wrap {
  text-align: center;
  margin-bottom: 12px;
}

.music-cover-link {
  display: inline-block;
  cursor: pointer;
}

.music-cover-link:hover .music-cover,
.music-cover-link:hover .music-song-cover {
  opacity: 0.92;
}

.music-song-cover-link {
  display: block;
}

.music-cover-hint {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin: 6px 0 0;
}
