:root {
  --bg: #f4f1ec;
  --panel: #fcfbf8;
  --panel-border: #e6ddd3;
  --primary: #d9281c;
  --primary-dark: #a71313;
  --text: #1f1b17;
  --muted: #7b6d60;
  --blue: #248bc7;
  --green: #94aa2a;
  --purple: #8c69c9;
  --brown: #9c3c2c;
  --gold: #d2a318;
  --shadow: 0 18px 40px rgba(78, 40, 22, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top, rgba(217, 40, 28, 0.12), transparent 30%),
    linear-gradient(180deg, #f3efe9 0%, #ece7e0 100%);
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

body {
  padding-bottom: 32px;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  background: linear-gradient(180deg, #e5291b 0%, #cc1f16 100%);
  color: #fff6f2;
  padding: max(24px, env(safe-area-inset-top)) 20px 22px;
  box-shadow: 0 12px 36px rgba(125, 13, 13, 0.18);
}

/* 输入框 / 文本框跟随页面字体（textarea 默认是等宽字体） */
textarea {
  font-family: inherit;
}

/* 日文用日文字体（汉字字形不同）；英文 / 越南文优先系统拉丁字体，越南文声调符号显示更好 */
html[lang="ja"] body {
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", "PingFang SC", sans-serif;
}

html[lang="en"] body,
html[lang="vi"] body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", sans-serif;
}

/* 语言切换（assets/i18n.js 挂到顶栏右上角；App 里和「设置」按钮并排） */
.topbar {
  position: relative;
}

.lang-switch,
.topbar-tools {
  position: absolute;
  top: max(20px, env(safe-area-inset-top));
  right: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-tools .lang-switch {
  position: static;
}

.lang-select {
  -webkit-appearance: none;
  appearance: none;
  padding: 6px 28px 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23fff6f2' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat right 11px center;
  color: #fff6f2;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.lang-select option {
  color: #1f1b17;
}

.topbar-mark {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 12px;
  letter-spacing: 0.18em;
}

.topbar h1 {
  margin: 14px 0 6px;
  font-size: 31px;
  line-height: 1.15;
}

.topbar p {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.08em;
  color: rgba(255, 244, 238, 0.84);
}

.page {
  width: min(100%, 960px);
  margin: -14px auto 0;
  padding: 0 16px 28px;
}

.panel {
  background: rgba(252, 251, 248, 0.92);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 18px;
  backdrop-filter: blur(10px);
  margin-top: 16px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.panel-head h2 {
  margin: 5px 0 0;
  font-size: 24px;
}

.round-badge,
.method-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
}

.round-badge {
  background: #fff0dd;
  color: #a85d03;
  border: 1px solid #f1d7ae;
}

.method-pill {
  background: #fff5f3;
  color: var(--primary);
  border: 1px solid #f1c4bd;
}

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

.field {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.field span {
  font-size: 13px;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid #ded3c7;
  border-radius: 16px;
  background: #fffdfa;
  padding: 14px 15px;
  font-size: 15px;
  color: var(--text);
  outline: none;
}

/* iOS WebKit 的日期时间框有固有最小宽度，会撑出卡片右边 */
.field input[type="datetime-local"] {
  -webkit-appearance: none;
  appearance: none;
  min-width: 0;
  min-height: 50px;
  text-align: left;
}

.field input[type="datetime-local"]::-webkit-date-and-time-value {
  text-align: left;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #d98b85;
  box-shadow: 0 0 0 4px rgba(217, 40, 28, 0.08);
}

.field-inline {
  align-self: end;
}

.action-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

button {
  border: 0;
  border-radius: 16px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.primary-button {
  flex: 1;
  background: linear-gradient(135deg, var(--primary) 0%, #f1563f 100%);
  color: #fff;
}

.ghost-button {
  background: #fff8f5;
  color: #7a433a;
  border: 1px solid #edd3cb;
}

.info-grid {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px 16px;
  align-items: start;
}

.info-label {
  color: #978677;
  font-size: 16px;
}

.info-value {
  font-size: 18px;
  line-height: 1.45;
}

.info-value.strong {
  font-size: 20px;
  font-weight: 700;
}

.info-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.highlight-red {
  color: var(--primary);
}

.highlight-gold {
  color: var(--gold);
}

.focus-card {
  margin-top: 16px;
  min-height: 72px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(250, 243, 236, 0.94)),
    linear-gradient(90deg, rgba(36, 139, 199, 0.08), rgba(217, 40, 28, 0.08));
  border: 1px solid #eaded1;
  padding: 16px;
  font-size: 18px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.analysis-result {
  margin-top: 16px;
  border-radius: 20px;
  border: 1px solid #eadbcf;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 241, 233, 0.96));
  padding: 18px;
}

.analysis-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.analysis-mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid #ead9cc;
  background: linear-gradient(180deg, rgba(255, 251, 246, 0.96), rgba(250, 243, 236, 0.96));
}

.analysis-mode-copy {
  display: grid;
  gap: 4px;
}

.analysis-mode-copy strong {
  font-size: 16px;
}

.analysis-mode-copy span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.analysis-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid #ead8ca;
}

.analysis-mode-button {
  min-width: 108px;
  padding: 10px 14px;
  border-radius: 999px;
  background: transparent;
  border: 0;
  color: #8a6251;
  font-size: 14px;
  font-weight: 700;
}

.analysis-mode-button.is-active {
  background: linear-gradient(135deg, var(--primary) 0%, #f1563f 100%);
  color: #fff;
  box-shadow: 0 10px 22px rgba(217, 40, 28, 0.18);
}


.auth-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: #7a433a;
  background: #fff8f5;
  border: 1px solid #edd3cb;
}

.auth-status-badge.is-authenticated {
  color: #236042;
  background: #ecfaf1;
  border-color: #cbe7d4;
}

.auth-status-badge.is-warning {
  color: #9a5718;
  background: #fff3e3;
  border-color: #f1d0a5;
}

.auth-summary {
  margin-top: 6px;
  line-height: 1.8;
  color: #5e5045;
}

.auth-user-card {
  margin-top: 14px;
  border-radius: 20px;
  border: 1px solid #eadccf;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 241, 233, 0.96));
  padding: 16px;
}

.auth-user-empty {
  display: grid;
  gap: 6px;
}

.auth-user-empty strong {
  font-size: 18px;
}

.auth-user-empty p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.auth-user-main {
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-avatar {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  object-fit: cover;
  background: #f0e4d8;
}

.auth-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(135deg, #d9281c 0%, #f1563f 100%);
}

.auth-user-meta {
  display: grid;
  gap: 4px;
}

.auth-user-meta strong {
  font-size: 20px;
}

.auth-user-meta span {
  color: var(--muted);
  font-size: 14px;
}

.auth-account-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.auth-account-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #ecdccf;
  color: #7f6051;
  font-size: 13px;
}

.auth-provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.auth-provider-button {
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid #ecd7c6;
  background: rgba(255, 255, 255, 0.92);
  color: #5f4b3f;
}

.auth-provider-button strong {
  font-size: 16px;
}

.auth-provider-button span {
  font-size: 12px;
  color: #8d6c58;
}

.auth-provider-button.is-disabled {
  opacity: 0.56;
  cursor: not-allowed;
}

.auth-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.payment-card {
  margin-bottom: 16px;
  border-radius: 20px;
  border: 1px solid #ead8ca;
  background: linear-gradient(180deg, rgba(255, 249, 243, 0.98), rgba(255, 255, 255, 0.94));
  padding: 18px;
}

.payment-card.is-locked {
  background:
    radial-gradient(circle at top right, rgba(255, 202, 133, 0.2), transparent 28%),
    linear-gradient(180deg, rgba(255, 244, 232, 0.98), rgba(255, 252, 247, 0.96));
}

.payment-card.is-paid {
  background:
    radial-gradient(circle at top right, rgba(126, 214, 162, 0.18), transparent 30%),
    linear-gradient(180deg, rgba(244, 255, 248, 0.98), rgba(255, 255, 255, 0.96));
}

.payment-card.is-idle {
  background:
    radial-gradient(circle at top right, rgba(191, 194, 198, 0.16), transparent 28%),
    linear-gradient(180deg, rgba(250, 248, 245, 0.98), rgba(255, 255, 255, 0.96));
}

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

.payment-card-head h3 {
  margin: 4px 0 0;
  font-size: 22px;
}

.payment-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: #7a433a;
  background: #fff8f5;
  border: 1px solid #edd3cb;
}

.payment-status-badge.is-paid {
  color: #236042;
  background: #ecfaf1;
  border-color: #cbe7d4;
}

.payment-status-badge.is-warning,
.payment-status-badge.is-locked {
  color: #9a5718;
  background: #fff3e3;
  border-color: #f1d0a5;
}

.payment-status-badge.is-test {
  color: #7b4f08;
  background: #fff6cf;
  border-color: #ecd27b;
}

.payment-description {
  margin: 14px 0 0;
  line-height: 1.8;
  color: #57483c;
}

.payment-methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.payment-method-button {
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid #ecd7c6;
  background: rgba(255, 255, 255, 0.9);
  color: #5f4b3f;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.payment-method-button.is-active {
  border-color: #d47a43;
  box-shadow: 0 10px 28px rgba(176, 98, 45, 0.12);
  transform: translateY(-1px);
}

.payment-method-button.is-disabled {
  opacity: 0.56;
}

.payment-method-button.is-inactive {
  background: linear-gradient(180deg, #fbf8f4, #fffdfa);
}

.payment-method-title {
  font-size: 15px;
  font-weight: 700;
  color: #3f322a;
}

.payment-method-sub {
  font-size: 12px;
  color: #8d6c58;
}

.payment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.payment-meta-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #ecdccf;
  color: #7f6051;
  font-size: 13px;
}

.payment-meta-chip.is-warning {
  color: #9a5718;
  background: #fff4e4;
  border-color: #efcf9e;
}

.payment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.test-toggle-button {
  min-width: 168px;
}

.test-toggle-button.is-active {
  color: #7b4f08;
  background: #fff5d2;
  border-color: #e2c76a;
}

.payment-history-panel {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed #e7d6c8;
}

.payment-history-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  color: #6f5746;
}

.payment-history-head span {
  font-size: 12px;
  color: #9a7b68;
}

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

.payment-history-item {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid #ead9cb;
  background: rgba(255, 255, 255, 0.88);
}

.payment-history-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.payment-history-row.is-muted {
  margin-top: 6px;
  color: #8f7562;
  font-size: 12px;
}

.payment-history-status {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #8a5a08;
  background: #fff2de;
}

.payment-history-status.is-approved {
  color: #176241;
  background: #eaf7f0;
}

.payment-history-status.is-chain_pending,
.payment-history-status.is-created {
  color: #8a5a08;
  background: #fff2de;
}

.payment-history-status.is-rejected {
  color: #8d2a1f;
  background: #fdecea;
}

.payment-history-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.payment-history-chip {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: #7c5f4f;
  background: #f7efe8;
}

.payment-history-chip.is-current {
  color: #236042;
  background: #ecfaf1;
  border: 1px solid #cbe7d4;
}

.payment-history-chip.is-warn {
  color: #8d2a1f;
  background: #fdecea;
}

.payment-history-note {
  margin: 10px 0 0;
  color: #7b6353;
  line-height: 1.7;
  font-size: 12px;
}

.manual-payment-panel {
  margin-top: 14px;
}

.manual-payment-card {
  border-radius: 18px;
  border: 1px solid #ead8ca;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 248, 241, 0.96));
  padding: 16px;
}

.manual-payment-card.is-placeholder {
  background: linear-gradient(180deg, rgba(250, 248, 244, 0.98), rgba(255, 252, 248, 0.96));
}

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

.manual-payment-head strong {
  display: block;
  font-size: 16px;
  color: #52392d;
}

.manual-payment-head p {
  margin: 8px 0 0;
  color: #7d6656;
  line-height: 1.7;
  font-size: 14px;
}

.manual-payment-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff4e6;
  border: 1px solid #efd5b0;
  color: #99611a;
  font-size: 12px;
  font-weight: 700;
}

.manual-payment-info {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.manual-payment-item {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #efe0d4;
  background: rgba(255, 255, 255, 0.86);
}

.manual-payment-item-label {
  display: block;
  color: #907261;
  font-size: 12px;
  margin-bottom: 6px;
}

.manual-payment-item-value {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.manual-payment-item-value code {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 13px;
  color: #43352c;
  background: transparent;
}

.manual-copy-button {
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 12px;
  background: #fff5ec;
  color: #8f532b;
  border: 1px solid #ebd2bf;
  font-size: 13px;
  font-weight: 700;
}

.manual-payment-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
}

/* 二维码跟着卡片宽度走（以前按屏幕宽 88vw，嵌在卡片里会把整列撑出屏幕，11-10 修） */
.manual-payment-qr a {
  display: block;
  width: 100%;
  max-width: 320px;
}

.manual-payment-qr img {
  display: block;
  width: 100%;
  border-radius: 18px;
  border: 1px solid #ead9cb;
  background: #fff;
  image-rendering: pixelated;
}

.manual-payment-qr-tip {
  margin: 10px 0 0;
  font-size: 12px;
  color: #8d6f5b;
}

.manual-payment-note,
.manual-proof-status {
  margin: 12px 0 0;
  color: #7b6353;
  line-height: 1.8;
  font-size: 13px;
}

.manual-proof-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #e7d6c8;
}

.manual-proof-row + .manual-proof-row {
  margin-top: 10px;
}

.manual-proof-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.manual-proof-tip {
  color: #8a6b58;
  font-size: 12px;
  line-height: 1.7;
}

.analysis-help {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.analysis-result.is-empty {
  color: var(--muted);
  line-height: 1.7;
}

.analysis-section + .analysis-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed #e5d8ca;
}

.analysis-title {
  margin: 0 0 10px;
  font-size: 18px;
}

.analysis-story-section {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.analysis-story-block {
  display: grid;
  gap: 12px;
}

.analysis-body {
  margin: 0;
  color: #3a3129;
  line-height: 1.8;
  white-space: pre-wrap;
}

.analysis-story {
  font-size: 16px;
}

.analysis-thread {
  display: grid;
  gap: 16px;
}

.analysis-turn {
  border-radius: 18px;
  border: 1px solid #ebddd0;
  background: #fffdfa;
  padding: 14px;
  box-shadow: 0 10px 24px rgba(112, 69, 42, 0.05);
}

.analysis-turn-question {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff3e8;
  color: #5f3825;
  line-height: 1.8;
  font-weight: 600;
}

.analysis-turn-answer {
  display: grid;
  gap: 12px;
}

.analysis-overview-shell {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.analysis-score-card {
  border-radius: 18px;
  padding: 16px;
  border: 1px solid #edd8c0;
  background:
    radial-gradient(circle at top right, rgba(213, 55, 37, 0.08), transparent 34%),
    linear-gradient(180deg, #fff7ee, #fffdf9);
}

.analysis-score-main {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.analysis-score-number {
  min-width: 78px;
  height: 78px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #c74b1e, #e59a3a);
  color: #fff;
  font-size: 32px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(188, 84, 26, 0.24);
}

.analysis-score-meta {
  display: grid;
  gap: 4px;
}

.analysis-score-label {
  color: #8b6148;
  font-size: 13px;
}

.analysis-score-grade {
  color: #6c2e19;
  font-size: 18px;
  font-weight: 700;
}

.analysis-score-tone {
  color: #5a4738;
  font-size: 14px;
  line-height: 1.7;
}

.analysis-score-note {
  color: #9a7a64;
  font-size: 12px;
  line-height: 1.6;
}

.analysis-score-basis {
  color: #7b5a45;
  font-size: 13px;
  line-height: 1.7;
}

.analysis-score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.analysis-score-metric {
  border-radius: 14px;
  border: 1px solid #ead8ca;
  background: rgba(255, 255, 255, 0.82);
  padding: 12px;
}

.analysis-score-metric-label {
  color: #87624b;
  font-size: 12px;
  margin-bottom: 6px;
}

.analysis-score-metric-value {
  color: #ac3e20;
  font-size: 24px;
  font-weight: 700;
}

.analysis-score-factors {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.analysis-score-factor-group {
  border-radius: 14px;
  border: 1px solid #ead8ca;
  background: rgba(255, 255, 255, 0.82);
  padding: 12px;
}

.analysis-score-factor-title {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

.analysis-score-factor-title.good {
  color: #246446;
  background: #e9f8ee;
}

.analysis-score-factor-title.risk {
  color: #9a3f24;
  background: #fff0e7;
}

.analysis-score-factor-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.analysis-score-factor-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  border: 1px solid transparent;
}

.analysis-score-factor-chip.good {
  color: #246446;
  background: #f1fbf4;
  border-color: #cdebd7;
}

.analysis-score-factor-chip.risk {
  color: #9a3f24;
  background: #fff6f0;
  border-color: #f3d5c5;
}

.analysis-paragraph-card {
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid #eaded2;
  background: linear-gradient(180deg, #fffdfa, #fff8f2);
  box-shadow: 0 6px 18px rgba(112, 69, 42, 0.06);
}

.analysis-paragraph-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.analysis-paragraph-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.analysis-paragraph-summary {
  background: linear-gradient(180deg, #fff5eb, #fffaf4);
  border-color: #f0d0af;
}

.analysis-paragraph-summary .analysis-paragraph-badge {
  background: #ffe6ca;
  color: #a55d11;
}

.analysis-paragraph-detail .analysis-paragraph-badge {
  background: #f3efe8;
  color: #775845;
}

.analysis-paragraph-chance {
  background: linear-gradient(180deg, #f8fbf1, #fffdfa);
  border-color: #d8e5ba;
}

.analysis-paragraph-chance .analysis-paragraph-badge {
  background: #e6f0cf;
  color: #6c8518;
}

.analysis-paragraph-risk {
  background: linear-gradient(180deg, #fff4f2, #fffaf8);
  border-color: #efccc4;
}

.analysis-paragraph-risk .analysis-paragraph-badge {
  background: #ffe0db;
  color: #b24734;
}

.analysis-paragraph-timing {
  background: linear-gradient(180deg, #f5f8ff, #fffdfa);
  border-color: #d4dff6;
}

.analysis-paragraph-timing .analysis-paragraph-badge {
  background: #dfe9ff;
  color: #4766a8;
}

.analysis-paragraph-advice {
  background: linear-gradient(180deg, #fff8ed, #fffdfa);
  border-color: #eed7ae;
}

.analysis-paragraph-advice .analysis-paragraph-badge {
  background: #ffe8bf;
  color: #9d6709;
}

.analysis-turn-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.analysis-turn-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  background: #f6efe8;
  color: #8b5b46;
  border: 1px solid #ead8ca;
}

.analysis-turn-answer p {
  margin: 0;
  color: #3a3129;
  line-height: 1.8;
  white-space: pre-wrap;
}

.analysis-emphasis-strong {
  color: #b64624;
  font-weight: 700;
}

.analysis-emphasis-risk {
  color: #b64624;
  font-weight: 600;
}

.analysis-emphasis-chance {
  color: #6d8c12;
  font-weight: 600;
}

.analysis-emphasis-time {
  color: #4168a5;
  font-weight: 600;
}

.analysis-loading-card {
  border-radius: 18px;
  border: 1px dashed #e7d6c8;
  background: #fffaf5;
  padding: 14px;
}

.analysis-loading-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.analysis-loading-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #d45d32;
  box-shadow: 0 0 0 rgba(212, 93, 50, 0.45);
  animation: pulse-dot 1.5s ease-in-out infinite;
}

.analysis-loading-skeleton {
  height: 14px;
  border-radius: 999px;
  margin: 10px 0 0;
  background: linear-gradient(90deg, rgba(236, 223, 209, 0.55), rgba(255, 247, 238, 0.95), rgba(236, 223, 209, 0.55));
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
}

.analysis-loading-skeleton.short {
  width: 62%;
}

.analysis-loading-status {
  margin-top: 12px;
  color: #7a5a47;
  line-height: 1.8;
}

.analysis-points {
  display: grid;
  gap: 10px;
}

.analysis-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.analysis-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  border: 1px solid #ebd8cb;
  background: #fff9f4;
  color: #87534b;
}

.analysis-tag.strong {
  background: #fff1df;
  color: #a05d08;
  border-color: #f0d0a6;
}

.analysis-tag.good {
  background: #f3f8e6;
  color: #738f14;
  border-color: #d9e6b2;
}

.analysis-tag.warn {
  background: #fff0ef;
  color: #b34331;
  border-color: #f0c6bf;
}

.analysis-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.analysis-card,
.overview-card {
  border-radius: 18px;
  border: 1px solid #ebddd0;
  background: #fffdfa;
  padding: 14px;
}

.overview-hero {
  background:
    radial-gradient(circle at top right, rgba(208, 84, 34, 0.08), transparent 34%),
    linear-gradient(180deg, #fffaf4, #fffdf9);
  border-color: #edd8c5;
}

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

.analysis-card-title {
  margin: 0;
  font-size: 17px;
}

.analysis-card-sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.analysis-body-secondary {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

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

.overview-head strong {
  font-size: 16px;
}

.overview-head span {
  color: var(--muted);
  font-size: 13px;
}

.overview-line {
  margin: 8px 0 0;
  color: #3b342d;
  font-size: 14px;
  line-height: 1.6;
}

.overview-lead {
  margin: 12px 0 0;
  color: #4a372a;
  font-size: 16px;
  line-height: 1.85;
  font-weight: 600;
}

.overview-tags {
  margin-top: 12px;
  margin-bottom: 0;
}

.overview-card-summary {
  background: linear-gradient(180deg, #fff8f0, #fffdfa);
  border-color: #edd6bf;
}

.overview-card-timing {
  background: linear-gradient(180deg, #f5f8ff, #fffdfa);
  border-color: #d4dff6;
}

.overview-card-direction {
  background: linear-gradient(180deg, #f6fbf5, #fffdfa);
  border-color: #d6e7d1;
}

.overview-card-process {
  background: linear-gradient(180deg, #fbf7ff, #fffdfa);
  border-color: #ddd5f1;
}

.overview-card-advice {
  background: linear-gradient(180deg, #fff8ed, #fffdfa);
  border-color: #eed7ae;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@keyframes pulse-dot {
  0%,
  100% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(212, 93, 50, 0.24);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 8px rgba(212, 93, 50, 0);
  }
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.palace {
  min-height: 158px;
  border-radius: 20px;
  padding: 14px 14px 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 242, 236, 0.96));
  border: 1px solid #e8ded2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.palace-top,
.palace-main,
.palace-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.palace-top {
  min-height: 24px;
}

.divinity {
  font-size: 16px;
  font-weight: 700;
  color: var(--blue);
}

.divinity.value {
  color: var(--gold);
}

.palace-icons {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 14px;
  font-style: normal;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.marker-kong {
  color: #8d2431;
}

.marker-horse {
  color: #2b261f;
}

.star-lines,
.stem-lines {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-end;
}

.star-text {
  font-size: 17px;
  line-height: 1.15;
}

.stem-text {
  font-size: 15px;
  font-weight: 700;
  text-align: right;
}

.stem-inline-group {
  display: inline-flex;
  align-items: center;
  gap: 1px;
}

.stem-inline {
  display: inline-flex;
  align-items: center;
}

.door {
  margin-top: 10px;
  font-size: 17px;
  font-weight: 700;
}

.door-rest {
  color: var(--purple);
}

.door-life {
  color: var(--green);
}

.door-hurt,
.door-death,
.door-view {
  color: var(--brown);
}

.door-open {
  color: var(--primary);
}

.door-block,
.door-fear {
  color: #8b63bf;
}

.palace-name {
  font-size: 17px;
}

.earth-stem {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  font-size: 16px;
  font-weight: 700;
}

.earth-stem-text {
  display: inline-flex;
  align-items: center;
}

.stem-green {
  color: var(--green);
}

.stem-red {
  color: var(--primary);
}

.stem-brown {
  color: #8b5e23;
}

.stem-purple {
  color: #8e5dc2;
}

.stem-dark {
  color: #3d352d;
}

.palace-center {
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    radial-gradient(circle at top, rgba(217, 40, 28, 0.1), transparent 55%),
    linear-gradient(180deg, #fffdf8 0%, #f5eee7 100%);
}

.center-round {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary-dark);
}

.center-label {
  margin-top: 8px;
  color: var(--muted);
}

.center-stem {
  margin-top: 10px;
  font-size: 24px;
  font-weight: 800;
}

/* 英文 / 越南文：盘面译名比汉字长——星和天干上下排、字号收小、两个天干放不下就换行，格子不被撑破 */
:is(html[lang="en"], html[lang="vi"]) .palace {
  padding: 10px 9px;
}

:is(html[lang="en"], html[lang="vi"]) :is(.palace-top, .palace-bottom) {
  gap: 4px;
  flex-wrap: wrap;
}

:is(html[lang="en"], html[lang="vi"]) .palace-top {
  flex-wrap: nowrap;
}

:is(html[lang="en"], html[lang="vi"]) .palace-top .divinity {
  min-width: 0;
}

:is(html[lang="en"], html[lang="vi"]) .palace-main {
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
}

:is(html[lang="en"], html[lang="vi"]) .star-lines {
  align-items: flex-start;
}

:is(html[lang="en"], html[lang="vi"]) :is(.divinity, .palace-name) {
  font-size: 14px;
  line-height: 1.2;
}

:is(html[lang="en"], html[lang="vi"]) :is(.star-text, .door) {
  font-size: 15px;
  line-height: 1.2;
}

:is(html[lang="en"], html[lang="vi"]) .door {
  margin-top: 6px;
}

:is(html[lang="en"], html[lang="vi"]) :is(.stem-text, .earth-stem) {
  font-size: 14px;
}

:is(html[lang="en"], html[lang="vi"]) :is(.stem-inline-group, .earth-stem) {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0 5px;
}

:is(html[lang="en"], html[lang="vi"]) .palace-name {
  white-space: nowrap;
}

:is(html[lang="en"], html[lang="vi"]) .earth-stem {
  margin-left: auto;
}

:is(html[lang="en"], html[lang="vi"]) .center-round {
  font-size: 22px;
}

:is(html[lang="en"], html[lang="vi"]) .center-stem {
  font-size: 17px;
}

@media (max-width: 680px) {
  :is(html[lang="en"], html[lang="vi"]) .palace {
    padding: 9px 8px;
  }

  :is(html[lang="en"], html[lang="vi"]) :is(.divinity, .palace-name, .stem-text, .earth-stem) {
    font-size: 13px;
  }

  :is(html[lang="en"], html[lang="vi"]) :is(.star-text, .door) {
    font-size: 14px;
  }

  :is(html[lang="en"], html[lang="vi"]) .center-round {
    font-size: 18px;
  }
}

.footer-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.marker-legend {
  display: flex;
  gap: 18px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.marker-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

@media (max-width: 680px) {
  .topbar h1 {
    font-size: 24px;
  }

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

  .auth-user-main {
    align-items: flex-start;
  }

  .auth-actions {
    justify-content: stretch;
  }

  .auth-actions .ghost-button {
    width: 100%;
  }

  .chart-grid {
    gap: 8px;
  }

  .palace {
    min-height: 146px;
    padding: 12px;
  }

  .divinity,
  .palace-name {
    font-size: 15px;
  }

  .star-text,
  .door {
    font-size: 16px;
  }

  .analysis-tags {
    gap: 6px;
  }

  .analysis-cards-grid,
  .overview-grid {
    grid-template-columns: 1fr;
  }
}

/* Main analyze button sits right under the question box. */
.analyze-main-button {
  display: block;
  width: 100%;
  margin: 4px 0 10px;
  padding: 14px 18px;
  font-size: 17px;
}

/* 设置页「账号与同步」（11-12） */
.account-signin {
  margin: 12px 0 4px;
  min-height: 44px;
}

.account-gis-slot.is-error,
.account-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.account-message {
  margin: 8px 0 0;
  color: var(--primary-dark);
  font-size: 14px;
}

.account-card .ghost-button.danger {
  color: var(--primary-dark);
  border-color: rgba(167, 19, 19, 0.35);
}

/* 解局结果末尾：回首页问别的事（11-12） */
.analysis-next {
  margin-top: 18px;
  text-align: center;
}

.analysis-next .primary-button {
  width: 100%;
  max-width: 360px;
}

.analysis-next p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* 访客付款确认前，「开始解局」的位置换成这条提示（11-12） */
.analyze-locked-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin: 4px 0 10px;
  padding: 12px 14px;
  border: 1px dashed var(--panel-border);
  border-radius: 14px;
  background: rgba(217, 40, 28, 0.04);
}

.analyze-locked-hint p {
  flex: 1 1 220px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.analyze-locked-hint .ghost-button {
  flex: 0 0 auto;
}

/* 站长模式提示（11-12）：说明为什么不用付款，并能一键切成访客测付款 */
.analyze-owner-note {
  margin: 0 0 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(148, 170, 42, 0.1);
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
}

.analyze-owner-note p {
  margin: 0 0 4px;
}

@media (max-width: 680px) {
  .analysis-mode-row {
    flex-direction: column;
    align-items: stretch;
  }
  .analysis-mode-switch {
    display: flex;
    align-self: stretch;
  }
  .analysis-mode-switch .analysis-mode-button {
    flex: 1;
  }
}

[hidden] {
  display: none !important;
}

@media (max-width: 680px) {
  .analysis-panel > .panel-head {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
}

/* Question shown inside the turn header card. */
.overview-question {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff3e8;
  color: #6d3a1d;
  font-weight: 600;
  line-height: 1.6;
}

.overview-question span {
  flex: none;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  line-height: 1.6;
}

.analysis-paragraph-card.is-continued {
  margin-top: -2px;
}

.analysis-turn-tag {
  white-space: nowrap;
  flex: none;
}

/* Phones: flatter cards, wider text column, calmer type. */
@media (max-width: 680px) {
  .analysis-result {
    padding: 10px;
    border-radius: 16px;
  }

  .analysis-turn {
    padding: 0;
    border: 0;
    background: transparent;
  }

  .overview-card,
  .analysis-paragraph-card,
  .analysis-score-card {
    padding: 14px;
    border-radius: 14px;
  }

  .overview-head > div strong {
    font-size: 16px;
  }

  .overview-head > div span {
    display: block;
    margin-top: 2px;
    font-size: 12px;
  }

  .overview-lead {
    font-size: 15px;
    line-height: 1.75;
  }

  .overview-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .overview-line {
    font-size: 14px;
    line-height: 1.7;
  }

  .analysis-story {
    font-size: 15px;
    line-height: 1.8;
  }

  .analysis-paragraph-head {
    margin-bottom: 6px;
  }

  .analysis-score-main {
    display: grid;
    grid-template-columns: 60px 1fr;
    column-gap: 12px;
    row-gap: 2px;
    align-items: center;
  }

  .analysis-score-number {
    grid-row: 1 / 3;
    min-width: 60px;
    width: 60px;
    height: 60px;
    border-radius: 16px;
    font-size: 26px;
  }

  .analysis-score-meta {
    display: contents;
  }

  .analysis-score-label,
  .analysis-score-grade {
    grid-column: 2;
  }

  .analysis-score-label {
    align-self: end;
  }

  .analysis-score-grade {
    align-self: start;
  }

  .analysis-score-tone,
  .analysis-score-note,
  .analysis-score-basis {
    grid-column: 1 / -1;
  }

  .analysis-score-tone {
    margin-top: 8px;
  }

  .analysis-score-grid {
    gap: 8px;
  }

  .analysis-score-metric {
    padding: 10px 8px;
    text-align: center;
  }

  .analysis-score-metric-label {
    white-space: nowrap;
  }

  .analysis-score-factor-group {
    padding: 10px;
  }
}

/* 云端记录（assets/cloud-records.js） */
.cloud-sync-state {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.cloud-sync-state.is-ok {
  color: #5f7a1f;
}

.cloud-sync-state.is-warn {
  color: var(--primary-dark);
}

.cloud-records-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.cloud-records-search {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  margin: 0 0 12px;
  padding: 11px 14px;
  border: 1px solid #e6d6c8;
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

.cloud-records-search:focus {
  outline: none;
  border-color: var(--primary);
}

.cloud-record-memo {
  margin-bottom: 4px;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  word-break: break-all;
}

.cloud-record.has-memo .cloud-record-title {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.cloud-record-memo-edit {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.cloud-record-memo-input {
  -webkit-appearance: none;
  appearance: none;
  flex: 1 1 auto;
  box-sizing: border-box;
  width: 0;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid var(--primary);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

.cloud-record-memo-input:focus {
  outline: none;
}

.cloud-record-memo-edit button {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 13px;
}

.cloud-records-empty {
  margin: 0;
  padding: 16px;
  border: 1px dashed #e3d5c8;
  border-radius: 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.cloud-record {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #ecdfd3;
  border-radius: 16px;
  background: #fffdfa;
}

.cloud-record-main {
  flex: 1;
  min-width: 0;
}

.cloud-record-title {
  font-size: 15px;
  font-weight: 700;
}

.cloud-record-round {
  margin-left: 6px;
  color: var(--primary);
  font-weight: 600;
}

.cloud-record-question {
  margin-top: 4px;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.cloud-record-topic {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #fbefe9;
  color: #7a433a;
  font-size: 12px;
}

.cloud-record-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.cloud-record-actions {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}

.cloud-record-actions button {
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
}

.cloud-record-del.is-danger {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.cloud-records-more {
  width: 100%;
  margin-top: 12px;
}

@media (max-width: 680px) {
  .cloud-record {
    align-items: stretch;
    flex-direction: column;
  }

  .cloud-record-actions button {
    flex: 1;
  }
}

/* 付费卡片：访客切回访问密码登录（11-10） */
.payment-owner-row {
  margin: 10px 0 0;
  text-align: right;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}

.link-button:hover {
  color: var(--primary-dark);
}

/* 页面分 Tab（11-10）：排盘 / 解局 / 记录 / 设置，滚动时吸在顶部（assets/page-tabs.js） */
.page-tabs {
  position: sticky;
  top: 8px;
  z-index: 60;
  display: flex;
  gap: 4px;
  padding: 5px;
  background: rgba(252, 251, 248, 0.95);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.page-tab {
  flex: 1 1 0;
  min-width: 0;
  padding: 10px 6px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.page-tab.is-active {
  background: var(--primary);
  color: #fff;
}

.page-tab[hidden],
.is-tab-hidden {
  display: none !important;
}

.chart-next {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.chart-next .primary-button {
  width: 100%;
  max-width: 360px;
}

/* 设置 Tab 的卡片（网页和 App 共用；App 的「关于与更新」也用这些类） */
.settings-state {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.settings-actions {
  display: flex;
  gap: 10px;
}

.settings-actions .ghost-button {
  flex: 1;
}

.settings-actions [hidden] {
  display: none;
}

/* 站长看到的付款界面预览（11-10）：不出付款按钮、记录和「有访问密码？」 */
.payment-card.is-preview .payment-actions,
.payment-card.is-preview .payment-owner-row,
.payment-card.is-preview .payment-history-panel {
  display: none;
}

/* 「实际支付」金额突出显示（11-10） */
.manual-payment-item.is-amount {
  border-color: #e9b98f;
  background: #fff6ec;
}

.manual-payment-item.is-amount code {
  font-size: 18px;
  font-weight: 700;
  color: #8f3a12;
}

/* 收款卡片标题行：标题和状态在第一行，说明文字占满整行（手机上不再挤成窄条，11-10） */
.manual-payment-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.manual-payment-head > div {
  display: contents;
}

.manual-payment-head strong {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
}

.manual-payment-head p {
  grid-column: 1 / -1;
  grid-row: 2;
}

.manual-payment-head .manual-payment-status {
  grid-column: 2;
  grid-row: 1;
}

/* 11-12：还没解局时藏起「下载 Word / 导出 PDF / 清空」；拿到收款地址后「我已转账，查一下」排第一 */
.analysis-actions[hidden] {
  display: none;
}
.payment-actions.is-refresh-first #refreshPaymentButton {
  order: -1;
  flex: 1 1 100%;
}
.analysis-panel .analysis-result + .payment-card {
  margin-top: 18px;
}

/* 11-13：「八个方向逐个看」每个方向一段，段首方向名加粗 */
.analysis-paragraph-direction {
  background: linear-gradient(180deg, #f7f5fb, #fffdfa);
  border-color: #ddd5ec;
}
.analysis-paragraph-direction .analysis-paragraph-badge {
  background: #ebe4f7;
  color: #6a4f99;
}
.analysis-paragraph-direction .analysis-story strong:first-child {
  color: #5a3f8a;
}
