:root {
  /* 温润高级感基底：暖宣纸白 × 深墨色字阶 */
  --page-bg: radial-gradient(circle at 18% 12%, #f4ede4 0%, transparent 48%),
    radial-gradient(circle at 82% 88%, #eae7f4 0%, transparent 50%),
    linear-gradient(160deg, #ede9e2 0%, #f5f1ea 52%, #ece9f0 100%);
  --app-bg: #f7f5f0;
  --surface: #ffffff;
  --surface-soft: #f2efe9;
  --text: #1c1917;
  --text-sub: #6e6a63;
  --border: rgba(28, 25, 23, 0.08);
  --border-strong: rgba(28, 25, 23, 0.13);

  /* 动态主题色：清醒参谋（琥珀朱砂） */
  --brand: #d95333;
  --brand-soft: #fdf0eb;
  --brand-grad: linear-gradient(135deg, #e76840 0%, #c84229 100%);
  --brand-shadow: rgba(208, 72, 45, 0.26);

  /* 东方易理：松烟青黛 × 鎏金 */
  --jade: #1b4d4f;
  --jade-soft: #edf5f3;
  --jade-border: #c5dcda;
  --gold: #c18d3b;

  /* 星象心镜：暮夜靛紫 */
  --star: #5548c8;
  --star-soft: #f2f0fe;
  --star-border: #d8d3fc;

  /* 状态色 */
  --ok-bg: #eef9f2;
  --ok-text: #166534;
  --err-bg: #fef2f2;
  --err-text: #b91c1c;
}

body[data-theme="iching"] {
  --brand: #1b4d4f;
  --brand-soft: #edf5f3;
  --brand-grad: linear-gradient(135deg, #246164 0%, #153c3e 100%);
  --brand-shadow: rgba(27, 77, 79, 0.28);
}

body[data-theme="zodiac"] {
  --brand: #5548c8;
  --brand-soft: #f2f0fe;
  --brand-grad: linear-gradient(135deg, #5d50d6 0%, #7d5ae2 100%);
  --brand-shadow: rgba(85, 72, 200, 0.26);
}

body[data-theme="lottery"] {
  --brand: #e35a36;
  --brand-soft: #fef0eb;
  --brand-grad: linear-gradient(135deg, #f05a52 0%, #f08949 100%);
  --brand-shadow: rgba(235, 92, 76, 0.28);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page-bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  max-width: 450px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  background: var(--app-bg);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(28, 25, 23, 0.13);
}

@media (min-width: 500px) {
  body {
    padding: 18px 0;
  }
  .app-shell {
    height: calc(100vh - 36px);
    max-height: calc(100vh - 36px);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.92);
  }
}

@media (display-mode: standalone) {
  body {
    padding: 0;
    background: var(--app-bg);
  }
  .app-shell {
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }
}

.protocol-alert {
  margin: 12px 16px 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff4e5;
  border: 1px solid #f5c27a;
  color: #92400e;
  font-size: 12.5px;
  flex-shrink: 0;
}

/* ==================== 零级首屏：极简欢迎登录页 ==================== */
.auth-landing {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
  padding: calc(28px + env(safe-area-inset-top, 0px)) 20px calc(22px + env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(circle at 50% -6%, rgba(217, 83, 51, 0.14) 0%, rgba(247, 245, 240, 0) 56%),
    radial-gradient(circle at 85% 92%, rgba(85, 72, 200, 0.08) 0%, rgba(247, 245, 240, 0) 45%),
    var(--app-bg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  animation: fadeIn 0.28s ease;
}

.auth-landing::-webkit-scrollbar {
  display: none;
}

.landing-hero {
  text-align: center;
  padding-top: 6px;
}

.landing-logo {
  width: 68px;
  height: 68px;
  margin: 0 auto 12px;
  border-radius: 21px;
  background: linear-gradient(145deg, #25283d 0%, #171926 100%);
  color: #f4d6a3;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 34px rgba(23, 25, 38, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.landing-title {
  margin: 0;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--text);
}

.landing-subtitle {
  margin: 5px 0 14px;
  font-size: 13.5px;
  color: var(--text-sub);
  letter-spacing: 0.8px;
}

.landing-pillars {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
}

.landing-pillars span {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-sub);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border);
  padding: 4px 11px;
  border-radius: 999px;
}

.landing-card {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 24px;
  padding: 20px 18px;
  box-shadow: 0 14px 36px rgba(28, 25, 23, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.landing-card-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  text-align: center;
}

.auth-field {
  margin-bottom: 12px;
}

.auth-field label {
  display: block;
  margin-bottom: 5px;
  font-size: 12.5px;
  color: var(--text-sub);
}

.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrap input {
  padding-right: 42px;
}

.pwd-toggle-btn {
  position: absolute;
  right: 8px;
  border: none;
  background: transparent;
  width: 30px;
  height: 30px;
  font-size: 15px;
  color: #8c867d;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-links-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.auth-link-btn {
  border: none;
  background: transparent;
  color: var(--text-sub);
  font-size: 12.5px;
  font-weight: 600;
  padding: 4px 2px;
  cursor: pointer;
}

.auth-link-btn:hover {
  color: var(--brand);
}

.landing-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  color: #a19c93;
  font-size: 12px;
}

.landing-divider::before,
.landing-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Daypal 风格：登录页底部独立 App 安装说明卡片 */
.install-promo-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 15px;
  border-radius: 18px;
  background: #f5f1ea;
  border: 1px solid rgba(28, 25, 23, 0.09);
  box-shadow: 0 6px 20px rgba(28, 25, 23, 0.04);
}

.install-promo-info {
  flex: 1;
  min-width: 0;
}

.install-promo-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #6b4c28;
  line-height: 1.4;
  margin-bottom: 4px;
}

.install-promo-desc {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.5;
}

.inline-guide-link {
  border: none;
  background: transparent;
  padding: 0;
  margin-left: 4px;
  color: #5b4933;
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.install-promo-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.promo-install-btn {
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  background: #23201e;
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s, transform 0.1s;
}

.promo-install-btn:active {
  transform: scale(0.97);
}

.promo-dismiss-btn {
  border: none;
  border-radius: 999px;
  padding: 8px 11px;
  background: #ebe6de;
  color: #6e6a63;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

/* ==================== 顶部极简导航 ==================== */
.app-topbar {
  flex-shrink: 0;
  z-index: 20;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: rgba(247, 245, 240, 0.92);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--brand-grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 6px 14px var(--brand-shadow);
  transition: background 0.25s, box-shadow 0.25s;
}

.brand-text {
  min-width: 0;
}

.brand-text h1 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  line-height: 1.2;
}

.top-date-text {
  display: block;
  font-size: 11px;
  color: var(--text-sub);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.install-subtle-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.install-subtle-btn.ready {
  background: var(--brand-soft);
  border-color: rgba(217, 83, 51, 0.22);
  color: var(--brand);
}

.avatar-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: #23222b;
  color: #f4d6a3;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(28, 25, 23, 0.15);
}

.avatar-btn.logged-in {
  background: linear-gradient(135deg, #272a40 0%, #181a28 100%);
  color: #f4d6a3;
}

/* ==================== 主内容区 ==================== */
.app-main {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 6px 16px 26px;
}

.app-main::-webkit-scrollbar {
  display: none;
}

.tab-view {
  display: none;
  animation: fadeIn 0.2s ease;
}

.tab-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==================== 第一级：极简罗盘大厅 ==================== */
.lobby-welcome {
  padding: 8px 2px 14px;
}

.lobby-greeting {
  margin: 0 0 4px;
  font-size: 12.5px;
  color: var(--text-sub);
}

.lobby-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: var(--text);
}

.fortune-strip {
  width: 100%;
  border: 1px solid rgba(28, 25, 23, 0.07);
  border-radius: 15px;
  padding: 11px 14px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #ffffff 0%, #fbf9f4 100%);
  box-shadow: 0 4px 16px rgba(28, 25, 23, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  transition: transform 0.15s, border-color 0.15s;
}

.fortune-strip:active {
  transform: scale(0.985);
}

.fortune-strip-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
}

.fortune-strip-score {
  flex-shrink: 0;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, #25283d 0%, #343456 100%);
  color: #f4d6a3;
}

.fortune-strip-text {
  font-size: 12.5px;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fortune-strip-arrow {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sub);
}

.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.mode-tile {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 22px;
  padding: 18px 16px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  box-shadow: 0 8px 24px rgba(28, 25, 23, 0.045);
  transition: transform 0.16s, box-shadow 0.16s, border-color 0.16s;
}

.mode-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(28, 25, 23, 0.08);
}

.mode-tile:active {
  transform: scale(0.975);
}

.tile-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 13px;
}

.tile-name {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}

.tile-desc {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.45;
}

.tile-rational {
  background: linear-gradient(155deg, #fff8f5 0%, #ffffff 60%);
  border-color: rgba(217, 83, 51, 0.14);
}
.tile-rational .tile-icon { background: #fce9e1; color: #d95333; }

.tile-iching {
  background: linear-gradient(155deg, #f1f8f6 0%, #ffffff 60%);
  border-color: rgba(27, 77, 79, 0.15);
}
.tile-iching .tile-icon { background: #e0f0ed; color: #1b4d4f; }

.tile-zodiac {
  background: linear-gradient(155deg, #f5f3ff 0%, #ffffff 60%);
  border-color: rgba(85, 72, 200, 0.15);
}
.tile-zodiac .tile-icon { background: #e8e4fd; color: #5548c8; }

.tile-lottery {
  background: linear-gradient(155deg, #fff6f0 0%, #ffffff 60%);
  border-color: rgba(227, 90, 54, 0.15);
}
.tile-lottery .tile-icon { background: #fde8dd; color: #e35a36; }

.lobby-inspire-section {
  padding: 2px;
}

.lobby-inspire-label {
  font-size: 12px;
  color: var(--text-sub);
  margin-bottom: 9px;
}

.lobby-inspire-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lobby-chip {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.lobby-chip:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

/* ==================== 第二级：专注输入工作台 ==================== */
.mode-sub-banner {
  padding: 0 4px 10px;
  font-size: 12.5px;
  color: var(--text-sub);
}

.quota-chip {
  flex-shrink: 0;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-sub);
  font-weight: 600;
}

.app-card {
  background: var(--surface);
  border-radius: 22px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 8px 26px rgba(28, 25, 23, 0.045);
  border: 1px solid var(--border);
}

.install-banner-card {
  background: linear-gradient(135deg, #fdfaf5 0%, #f5f3fb 100%);
  border-color: rgba(85, 72, 200, 0.14);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 15.5px;
  font-weight: 700;
}

.card-sub-desc {
  margin: -4px 0 14px;
  font-size: 12.5px;
  color: var(--text-sub);
}

.field-group {
  margin-bottom: 14px;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.char-hint {
  font-size: 11.5px;
  color: #9e9991;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  background: #fbfaf7;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

input:focus,
textarea:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px var(--brand-soft);
}

textarea {
  resize: vertical;
  min-height: 68px;
}

.inspire-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 0 2px;
  scrollbar-width: none;
}

.inspire-row::-webkit-scrollbar {
  display: none;
}

.inspire-chip {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text-sub);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11.5px;
  cursor: pointer;
}

.inspire-chip:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

.option-item {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.remove-opt-btn {
  width: 32px;
  height: 36px;
  border: none;
  background: transparent;
  color: #9e9991;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
}

.remove-opt-btn:hover {
  background: #fee2e2;
  color: #dc2626;
}

.text-action-btn {
  border: none;
  background: transparent;
  color: var(--brand);
  font-size: 12.5px;
  font-weight: 600;
  padding: 4px 6px;
  cursor: pointer;
}

.text-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.danger-text {
  color: #dc2626;
}

.mode-extra-box {
  padding: 12px;
  border-radius: 14px;
  background: var(--brand-soft);
  margin-bottom: 12px;
}

.iching-box {
  background: var(--jade-soft);
  border: 1px solid var(--jade-border);
}

.zodiac-box {
  background: var(--star-soft);
  border: 1px solid var(--star-border);
}

.extra-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.extra-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
}

.extra-desc {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-sub);
}

.chip-group {
  display: flex;
  gap: 5px;
}

.mini-chip {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(28, 25, 23, 0.08);
  background: #fff;
  color: var(--text-sub);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
}

.mini-chip.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.tag-pill-jade {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--jade);
  color: #f3ead8;
}

.tag-pill-star {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(85, 72, 200, 0.14);
  color: var(--star);
}

.zodiac-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 9px;
}

.zodiac-pill {
  padding: 7px 4px;
  border-radius: 10px;
  border: 1px solid var(--star-border);
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.zodiac-pill.active {
  background: var(--star);
  color: #fff;
  border-color: var(--star);
}

.advanced-wrap {
  margin-bottom: 14px;
}

.advanced-toggle {
  width: 100%;
  border: none;
  border-radius: 11px;
  padding: 9px 12px;
  background: var(--surface-soft);
  color: var(--text-sub);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
}

.advanced-panel {
  margin-top: 8px;
  padding: 12px;
  border-radius: 12px;
  background: #fbfaf7;
  border: 1px dashed var(--border-strong);
}

.weights-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.weight-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 9px;
}

.weight-top {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-sub);
  margin-bottom: 3px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--brand);
}

.primary-cta {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 13px 16px;
  background: var(--brand-grad);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.4px;
  cursor: pointer;
  box-shadow: 0 8px 20px var(--brand-shadow);
  transition: opacity 0.15s, transform 0.1s;
}

.primary-cta:active:not(:disabled) {
  transform: scale(0.985);
}

.primary-cta:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.cta-jade {
  background: linear-gradient(135deg, #246164 0%, #153c3e 100%);
  box-shadow: 0 8px 18px rgba(27, 77, 79, 0.28);
}

.secondary-cta {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  padding: 11px 14px;
  background: #fff;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.soft-cta {
  border: none;
  border-radius: 13px;
  padding: 11px 14px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.mini-primary-btn {
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  background: var(--brand-grad);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.msg {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 12.5px;
}

.msg.ok {
  background: var(--ok-bg);
  color: var(--ok-text);
}

.msg.err {
  background: var(--err-bg);
  color: var(--err-text);
}

.flow-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 2px;
}

.flow-back-btn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.flow-nav-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
}

.badge-group {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
}

.badge-muted {
  background: var(--surface-soft);
  color: var(--text-sub);
}

.badge-jade {
  background: var(--jade);
  color: #f6eedc;
}

.badge-star {
  background: var(--star);
  color: #fff;
}

/* 静心起卦台 */
.iching-stage-card {
  background: linear-gradient(180deg, #ffffff 0%, #f2f7f5 100%);
  border-color: var(--jade-border);
}

.cast-subtitle {
  margin: -4px 0 16px;
  font-size: 13px;
  color: var(--text-sub);
}

.cast-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 26px 16px;
  margin-bottom: 16px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--jade-border);
}

.cast-status {
  margin-top: 14px;
  font-size: 13px;
  color: var(--jade);
  font-weight: 500;
}

.hex-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 68px;
}

.hex-stack-lg {
  width: 118px;
  gap: 9px;
}

.hex-line-row {
  display: flex;
  align-items: center;
  height: 8px;
  position: relative;
}

.hex-stack-lg .hex-line-row {
  height: 11px;
}

.hex-bar-yang {
  width: 100%;
  height: 100%;
  border-radius: 3px;
  background: var(--jade);
}

.hex-bar-yin {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: space-between;
}

.hex-bar-yin span {
  width: 43%;
  height: 100%;
  border-radius: 3px;
  background: var(--jade);
}

.hex-bar-empty {
  width: 100%;
  height: 100%;
  border-radius: 3px;
  border: 1.5px dashed #bfd4d2;
}

.hex-line-row.is-moving .hex-bar-yang,
.hex-line-row.is-moving .hex-bar-yin span {
  background: var(--gold);
}

.hex-moving-dot {
  position: absolute;
  right: -13px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

/* 对齐追问卡 */
.clarify-intro {
  margin: 0 0 12px;
  font-size: 13.5px;
  color: var(--text-sub);
}

.question-block {
  padding: 13px;
  border-radius: 14px;
  background: #faf8f4;
  border: 1px solid var(--border);
  margin-bottom: 11px;
}

.question-title {
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 9px;
}

.choices-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 9px;
}

.choice-chip {
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 12.5px;
  cursor: pointer;
}

.choice-chip.selected {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.custom-answer-input {
  font-size: 13px !important;
  padding: 8px 11px !important;
  background: #fff !important;
}

.answer-preview {
  margin-top: 7px;
  font-size: 11.5px;
  color: var(--text-sub);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.answer-preview strong {
  color: var(--brand);
}

.clear-chip-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-sub);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 11px;
  cursor: pointer;
}

/* 结果卡与专题横幅 */
.result-card.is-iching {
  border-color: var(--jade-border);
}

.result-card.is-zodiac {
  border-color: var(--star-border);
}

.hexagram-banner {
  padding: 14px;
  margin-bottom: 16px;
  border-radius: 16px;
  background: var(--jade-soft);
  border: 1px solid var(--jade-border);
}

.hex-pair {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.hex-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 88px;
}

.hex-tag {
  margin-top: 6px;
  font-size: 10.5px;
  color: var(--text-sub);
}

.hex-name {
  font-size: 16px;
  color: var(--jade);
}

.hex-posture {
  font-size: 11.5px;
  color: #8f6523;
}

.hex-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #8f6523;
}

.hex-moving-text {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(193, 141, 59, 0.16);
}

.arrow-symbol {
  font-size: 16px;
}

.zodiac-banner {
  padding: 14px;
  margin-bottom: 16px;
  border-radius: 16px;
  background: var(--star-soft);
  border: 1px solid var(--star-border);
}

.zodiac-banner-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.zodiac-glyph {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: linear-gradient(135deg, #5d50d6 0%, #7d5ae2 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  flex-shrink: 0;
}

.zodiac-title-line {
  display: flex;
  align-items: center;
  gap: 7px;
}

.zodiac-name {
  font-size: 16px;
  color: var(--star);
}

.zodiac-element {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(85, 72, 200, 0.12);
  color: var(--star);
}

.zodiac-keyword {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 2px;
}

.banner-insight {
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px dashed var(--jade-border);
}

.star-insight {
  border-top-color: var(--star-border);
}

.banner-kicker {
  font-size: 11.5px;
  font-weight: 700;
  margin-bottom: 3px;
}

.jade-kicker { color: var(--jade); }
.star-kicker { color: var(--star); }

.banner-insight p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text);
}

.picked-stamp {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  margin-bottom: 14px;
  border-radius: 15px;
  background: linear-gradient(135deg, #fff5f1 0%, #fdf0e6 100%);
  border: 1px solid #fbd2c3;
}

.picked-label {
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 8px;
  background: var(--brand-grad);
  color: #fff;
}

.picked-name {
  font-size: 19px;
  color: var(--brand);
}

.mind-read-box {
  padding: 11px 13px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: var(--surface-soft);
  border-left: 3.5px solid var(--brand);
  font-size: 13.5px;
}

.plan-block {
  margin-bottom: 16px;
}

.section-kicker {
  font-size: 11.5px;
  font-weight: 700;
  color: #8f8980;
  margin-bottom: 5px;
  letter-spacing: 0.3px;
}

.result-headline {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.5;
}

.section-text {
  margin: 0;
  font-size: 14px;
  color: #36322e;
}

.outcome-stack {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.outcome-card {
  padding: 12px 13px;
  border-radius: 13px;
  font-size: 13px;
}

.outcome-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12.5px;
}

.outcome-card p {
  margin: 0;
}

.outcome-up {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.outcome-up strong { color: #15803d; }

.outcome-risk {
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

.outcome-risk strong { color: #c2410c; }

.option-notes-box {
  margin: 14px 0;
  padding-top: 12px;
  border-top: 1px dashed var(--border-strong);
}

.option-note-item {
  font-size: 13px;
  margin: 7px 0;
}

.option-note-item strong {
  color: var(--brand);
}

.prep-box {
  margin-top: 14px;
  padding: 14px 15px;
  border-radius: 14px;
  background: var(--brand-soft);
  font-size: 13.5px;
}

.prep-box strong {
  display: block;
  margin-bottom: 7px;
  color: var(--brand);
}

.prep-list {
  margin: 0;
  padding-left: 18px;
}

.prep-list li {
  margin: 6px 0;
}

.prep-single {
  margin: 0;
  list-style: none;
  padding-left: 0;
}

.result-footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-strong);
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 9px;
}

.retention-tip {
  margin-top: 10px;
  padding: 8px 11px;
  border-radius: 10px;
  background: #f7f3ec;
  color: #7c674d;
  font-size: 11.5px;
  line-height: 1.5;
}

/* ==================== TAB 2：今日运势 ==================== */
.fortune-hero {
  border-radius: 24px;
  padding: 20px 18px 16px;
  margin-bottom: 14px;
  background:
    radial-gradient(circle at 88% 12%, rgba(244, 214, 163, 0.24) 0%, rgba(244, 214, 163, 0) 46%),
    radial-gradient(circle at 12% 90%, rgba(125, 90, 226, 0.28) 0%, rgba(125, 90, 226, 0) 50%),
    linear-gradient(145deg, #1a1e34 0%, #272748 54%, #352b4f 100%);
  color: #f8f6f2;
  box-shadow: 0 16px 36px rgba(26, 30, 52, 0.28);
}

.fortune-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.fortune-date-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fortune-day-big {
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1px;
  color: #f6ddb2;
}

.fortune-month-year {
  font-size: 15px;
  font-weight: 600;
}

.fortune-sub-date {
  font-size: 12px;
  opacity: 0.78;
  display: flex;
  gap: 5px;
  margin-top: 2px;
}

.fortune-score-box {
  text-align: center;
  padding: 8px 15px;
  border-radius: 16px;
  background: rgba(244, 214, 163, 0.13);
  border: 1px solid rgba(244, 214, 163, 0.26);
  backdrop-filter: blur(8px);
}

.fortune-score-num {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  color: #f6ddb2;
}

.fortune-score-label {
  font-size: 10.5px;
  opacity: 0.86;
}

.fortune-headline {
  font-size: 15px;
  font-weight: 600;
  padding: 11px 13px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 12px;
  color: #fff;
}

.fortune-zodiac-picker {
  margin-top: 2px;
}

.fz-trigger-btn {
  width: 100%;
  border: 1px solid rgba(244, 214, 163, 0.28);
  background: rgba(255, 255, 255, 0.09);
  color: #f8f6f2;
  border-radius: 12px;
  padding: 9px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.fz-trigger-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.fz-trigger-arrow {
  color: #f6ddb2;
  font-size: 12px;
}

.fortune-zodiac-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.16);
  animation: fadeIn 0.18s ease;
}

.fz-pill {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  padding: 7px 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.fz-pill:hover {
  background: rgba(255, 255, 255, 0.16);
}

.fz-pill.active {
  background: #f4d6a3;
  color: #1c1917;
  border-color: #f4d6a3;
  font-weight: 700;
}

.fz-pill-all {
  grid-column: span 3;
}

.yiji-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.yiji-card {
  background: #fff;
  border-radius: 20px;
  padding: 15px;
  box-shadow: 0 6px 20px rgba(28, 25, 23, 0.04);
  border: 1px solid var(--border);
}

.yiji-badge {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

.yi-badge {
  background: #e6f6ec;
  color: #166534;
}

.ji-badge {
  background: #fdebec;
  color: #b91c1c;
}

.yiji-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.yiji-list li {
  font-size: 13px;
  font-weight: 500;
  margin: 4px 0;
  color: var(--text);
}

.dims-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.dim-row-top {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  margin-bottom: 5px;
}

.dim-row-top span {
  color: var(--text-sub);
}

.dim-bar-track {
  height: 7px;
  border-radius: 999px;
  background: #eeeae3;
  overflow: hidden;
}

.dim-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s ease;
}

.lucky-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.lucky-item {
  background: var(--surface-soft);
  border-radius: 13px;
  padding: 10px 8px;
  text-align: center;
}

.lucky-label {
  display: block;
  font-size: 11px;
  color: var(--text-sub);
  margin-bottom: 4px;
}

.lucky-val {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 12.5px;
}

.color-swatch {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.daily-quote-box {
  padding: 13px 14px;
  border-radius: 14px;
  background: #faf8f4;
  border: 1px solid var(--border);
  margin-bottom: 14px;
}

.daily-quote-box p {
  margin: 0;
  font-size: 13.5px;
  color: #3f3b36;
}

/* ==================== TAB 3：我的 ==================== */
.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.account-title-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.account-title {
  font-size: 15px;
}

.account-sub {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--text-sub);
}

.redeem-history-box {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-strong);
  font-size: 12px;
  color: var(--text-sub);
}

.redeem-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
}

.accordion-head-btn {
  width: 100%;
  border: none;
  background: transparent;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  text-align: left;
}

.accordion-head-left strong {
  display: block;
  font-size: 15.5px;
  color: var(--text);
}

.accordion-summary {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-sub);
}

.accordion-arrow {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
}

.pref-group {
  margin-bottom: 13px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.profile-pill {
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-sub);
  font-size: 12px;
  cursor: pointer;
}

.profile-pill.active {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: var(--brand);
  font-weight: 600;
}

.count-inline {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sub);
  margin-left: 4px;
}

.history-empty {
  text-align: center;
  padding: 20px 10px;
  font-size: 12.5px;
  color: #9e9991;
}

.history-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: #fbfaf7;
  border-radius: 14px;
  padding: 11px 13px;
  margin-bottom: 8px;
  cursor: pointer;
  display: block;
}

.history-item:hover {
  border-color: var(--brand);
  background: #fff;
}

.history-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.history-topic {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-time {
  font-size: 11px;
  color: #9e9991;
  flex-shrink: 0;
}

.history-preview {
  font-size: 12px;
  color: var(--text-sub);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==================== 底部三栏 Tab Bar ==================== */
.app-tabbar {
  flex-shrink: 0;
  width: 100%;
  height: calc(62px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  z-index: 30;
}

.tab-btn {
  border: none;
  background: transparent;
  color: #98938b;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s;
}

.tab-btn.active {
  color: var(--brand);
}

/* ==================== 底部弹出抽屉 ==================== */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(24, 22, 20, 0.45);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.bottom-sheet {
  width: 100%;
  max-width: 450px;
  max-height: 85vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 26px 26px 0 0;
  padding: 12px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -10px 40px rgba(24, 22, 20, 0.18);
  animation: slideUp 0.22s ease;
}

@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0.7; }
  to { transform: translateY(0); opacity: 1; }
}

.sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: #e2ddd6;
  margin: 0 auto 14px;
}

.sheet-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.sheet-row input {
  flex: 1;
}

.compact-btn {
  width: auto;
  flex-shrink: 0;
  padding: 10px 14px;
  font-size: 13px;
}

.dev-quick-row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-sub);
}

.install-guide-body {
  font-size: 13px;
  color: #3f3b36;
  line-height: 1.65;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guide-note-banner {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f5f1ea;
  color: #6b4c28;
  font-size: 12.5px;
  font-weight: 500;
}

.guide-platform-box {
  padding: 12px 14px;
  border-radius: 14px;
  background: #fbfaf7;
  border: 1px solid var(--border);
}

.guide-platform-box.is-current {
  background: #fdf6ef;
  border-color: rgba(217, 83, 51, 0.28);
}

.guide-platform-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.guide-current-tag {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
}

.install-guide-steps {
  margin: 0;
  padding-left: 18px;
}

.install-guide-steps li {
  margin: 4px 0;
}