/* 麻将拆搭技巧训练 · 小程序风 H5（对齐 小程序拆搭 主题） */

:root {
  --felt: #0a3f2e;
  --felt-deep: #051c15;
  --felt-mid: #0d553c;
  --felt-soft: #187a54;
  --ivory: #f1f0ea;
  --ivory-card: #fbfaf7;
  --ink: #101a14;
  --ink-soft: #384840;
  --muted: #68756c;
  --line: rgba(10, 63, 46, 0.11);
  --gold: #c9a84b;
  --gold-deep: #9a7528;
  --gold-soft: #f3ead2;
  --gold-glow: rgba(201, 168, 75, 0.28);
  --danger: #b54a4a;
  --shadow-deep: rgba(5, 28, 21, 0.22);
  --hero-grad: linear-gradient(165deg, #0b4533 0%, #0a3f2e 40%, #06281c 75%, #051c15 100%);
  --nav-grad: linear-gradient(180deg, #0b4533 0%, #0a3f2e 55%, #06281c 100%);
  --tab-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--ivory);
  color: var(--ink);
  font-family: 'PingFang SC', 'Hiragino Sans GB', 'Noto Sans SC', -apple-system, sans-serif;
  font-size: 15px;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

.font-display {
  font-family: 'Songti SC', 'STSong', 'Noto Serif SC', 'Songti', serif;
}

#app {
  min-height: 100%;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  background: var(--ivory);
}

.boot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 12px;
  color: var(--muted);
}

.boot-spinner,
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--line);
  border-top-color: var(--felt);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--tab-h) + var(--safe-b));
  background: var(--ivory);
}

.app-shell--stack {
  padding-bottom: var(--safe-b);
}

/* —— Tab bar —— */
.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 480px;
  height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: flex;
  background: #fbfaf7;
  border-top: 1px solid rgba(10, 63, 46, 0.08);
  z-index: 50;
}

.tabbar button {
  flex: 1;
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}

.tabbar button.is-active {
  color: var(--felt);
  font-weight: 600;
}

.tabbar .tab-ico {
  font-size: 18px;
  line-height: 1;
}

/* —— 秘籍页置顶教程入口 —— */
.course-pins {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: -4px 0 16px;
  padding-bottom: 4px;
  background: var(--ivory);
}

.course-pin {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 12px 14px 14px;
  border: 1.5px solid rgba(201, 168, 75, 0.45);
  border-radius: 16px;
  background: linear-gradient(145deg, #fffdf8, #f6edd2);
  box-shadow: 0 4px 14px rgba(5, 28, 21, 0.06);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.course-pin:active {
  transform: scale(0.985);
}

.course-pin-ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(10, 63, 46, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.course-pin-body {
  flex: 1;
  min-width: 0;
}

.course-pin-title {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.3;
}

.course-pin-hint {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}

.course-pin-go {
  flex-shrink: 0;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--felt);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

/* —— Hero + sheet —— */
.app-shell--felt {
  background: var(--ivory);
}

.hero {
  background: var(--hero-grad);
  color: #fff;
  padding: calc(14px + var(--safe-t)) 18px 42px;
  position: relative;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  width: 220px;
  height: 220px;
  top: -70px;
  right: -50px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 168, 75, 0.28) 0%, transparent 68%);
  pointer-events: none;
  animation: softPulse 5s ease-in-out infinite;
}

.hero-body {
  position: relative;
  z-index: 1;
  animation: fadeUp 0.45s ease both;
}

.hero-brand {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.15;
  margin: 0;
  color: #f8f6ef;
}

.hero-tagline {
  margin: 8px 0 0;
  font-size: 13px;
  color: rgba(243, 234, 210, 0.62);
  letter-spacing: 0.08em;
}

.hero-sub {
  opacity: 0.78;
  font-size: 13px;
  margin: 0;
}

.hero-cta {
  margin-top: 18px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 12px 14px 16px;
  border-radius: 16px;
  border: 1.5px solid rgba(201, 168, 75, 0.4);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
  color: #fff;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.hero-cta:active {
  transform: scale(0.99);
  background: rgba(255, 255, 255, 0.16);
}

.cta-text {
  flex: 1;
  min-width: 0;
}

.cta-name {
  display: block;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cta-meta {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: rgba(243, 234, 210, 0.58);
}

.cta-go {
  flex-shrink: 0;
  min-width: 52px;
  height: 52px;
  padding: 0 10px;
  border-radius: 14px;
  background: linear-gradient(145deg, #f7efd8 0%, #c9a84b 100%);
  color: var(--felt-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.06em;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
}

.sheet {
  margin-top: -24px;
  background: var(--ivory);
  border-radius: 22px 22px 0 0;
  padding: 20px 16px 28px;
  position: relative;
  z-index: 1;
  flex: 1;
  box-shadow: 0 -10px 28px var(--shadow-deep);
  animation: fadeUp 0.4s ease both;
}

.sheet--home {
  min-height: 0;
}

.more-tip {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 8px;
  letter-spacing: 0.04em;
}

/* —— Chips —— */
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(10, 63, 46, 0.06);
  color: var(--ink-soft);
  border: 0;
  cursor: pointer;
}

.chip.is-active {
  background: var(--felt);
  color: #fff;
  box-shadow: inset 0 -2px 0 rgba(201, 168, 75, 0.55);
}

/* —— Bank grid —— */
.bank-group {
  margin-bottom: 18px;
  animation: fadeUp 0.4s ease both;
}

.group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 12px;
}

.group-bar {
  width: 4px;
  height: 14px;
  border-radius: 999px;
  background: var(--felt-soft);
}

.group-bar--gold {
  background: linear-gradient(180deg, #e4c76a, #c9a84b);
}

.group-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
  margin: 8px 0 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.bank-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.bank-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ivory-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 10px 12px 12px;
  text-align: left;
  cursor: pointer;
  position: relative;
  min-height: 72px;
  box-shadow: 0 2px 8px rgba(5, 28, 21, 0.04);
  font: inherit;
  color: inherit;
}

.bank-tile:active {
  transform: scale(0.98);
}

.bank-tile.is-level {
  background: linear-gradient(145deg, #fffdf8, #f6edd2);
  border-color: rgba(201, 168, 75, 0.4);
}

.tile-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.tile-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.bank-ico {
  font-size: 22px;
}

.bank-name {
  display: block;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.25;
}

.bank-count {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.bank-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(24, 122, 84, 0.12);
  color: var(--felt-soft);
}

.bank-badge--gold {
  background: rgba(201, 168, 75, 0.28);
  color: var(--gold-deep);
}

.tone-green { background: rgba(24, 122, 84, 0.14); }
.tone-red { background: rgba(181, 74, 74, 0.14); }
.tone-blue { background: rgba(59, 110, 165, 0.14); }
.tone-chili { background: rgba(196, 90, 42, 0.14); }
.tone-amber { background: rgba(201, 148, 50, 0.18); }
.tone-teal { background: rgba(32, 140, 128, 0.14); }
.tone-rose { background: rgba(176, 72, 104, 0.14); }
.tone-indigo { background: rgba(88, 92, 168, 0.14); }
.tone-olive { background: rgba(120, 132, 64, 0.16); }
.tone-gold { background: rgba(201, 168, 75, 0.22); }
.tone-copper { background: rgba(168, 112, 64, 0.18); }

/* —— 我的 · 运势卡 —— */
.hero--mine {
  padding-bottom: 36px;
}

.fortune-card {
  position: relative;
  z-index: 1;
  width: 100%;
  display: block;
  padding: 16px 14px 12px;
  border-radius: 18px;
  background: linear-gradient(145deg, #fffef9 0%, #f7efd8 48%, #efe2bc 100%);
  border: 1.5px solid rgba(201, 168, 75, 0.72);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  font: inherit;
  animation: fadeUp 0.45s ease both;
}

.fortune-card:active {
  transform: scale(0.985);
}

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

.fortune-eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: rgba(10, 63, 46, 0.55);
  letter-spacing: 0.08em;
}

.fortune-title {
  display: block;
  margin-top: 4px;
  font-size: 24px;
  font-weight: 800;
  color: #0a3f2e;
  letter-spacing: 0.08em;
  line-height: 1.15;
}

.fortune-date-badge {
  flex-shrink: 0;
  min-width: 72px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #0a3f2e;
  text-align: center;
  box-shadow: 0 6px 14px rgba(10, 63, 46, 0.22);
}

.fortune-date-md {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: #f3e6b8;
  letter-spacing: 0.02em;
}

.fortune-date-week {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.72);
}

.fortune-preview {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.fortune-chip {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(10, 63, 46, 0.07);
  border: 1px solid rgba(10, 63, 46, 0.08);
}

.fortune-chip-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: rgba(10, 63, 46, 0.5);
  letter-spacing: 0.04em;
}

.fortune-chip-value {
  display: block;
  margin-top: 5px;
  font-size: 16px;
  font-weight: 800;
  color: #0a3f2e;
  line-height: 1.2;
}

.fortune-chip-value--sm {
  font-size: 12px;
  margin-top: 0;
  font-weight: 700;
}

.fortune-colors {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  min-height: 18px;
  flex-wrap: wrap;
}

.fortune-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
  display: inline-block;
}

.fortune-cta {
  margin-top: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  background: linear-gradient(90deg, #0b4533 0%, #0a3f2e 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
}

.fortune-cta-text {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.fortune-cta-arrow {
  font-size: 18px;
  opacity: 0.85;
  line-height: 1;
}

/* legacy aliases kept for other pages */
.cta-card {
  margin: 16px 0 0;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  cursor: pointer;
}

/* —— Stack nav —— */
.stack-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--nav-grad);
  color: #fff;
  padding: calc(8px + var(--safe-t)) 12px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 16px var(--shadow-deep);
}

.stack-nav .back {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.stack-nav h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  flex: 1;
}

.page-body {
  padding: 14px 14px 28px;
}

/* —— Practice —— */
.quiz-card {
  background: var(--ivory-card);
  border-radius: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  margin-bottom: 12px;
}

.quiz-meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.quiz-q {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  margin: 0;
}

.hand-felt {
  background: linear-gradient(165deg, #0d553c, #0a3f2e 55%, #06281c);
  border-radius: 16px;
  padding: 14px 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin: 12px 0;
  box-shadow: inset 0 0 0 1px rgba(201, 168, 75, 0.2);
}

.divider-label {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0 10px;
}

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

.option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #fff;
  cursor: pointer;
}

.option.is-selected {
  border-color: var(--felt);
  background: rgba(10, 63, 46, 0.06);
}

.option.is-correct {
  border-color: var(--felt-soft);
  background: rgba(24, 122, 84, 0.12);
}

.option.is-wrong {
  border-color: var(--danger);
  background: rgba(181, 74, 74, 0.08);
}

.option-label {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(10, 63, 46, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  flex-shrink: 0;
}

.option.is-selected .option-label {
  background: var(--felt);
  color: #fff;
}

.tile {
  width: 36px;
  height: 48px;
  border-radius: 4px;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.tile--text {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--felt);
  border: 1px solid var(--line);
}

.hand-felt .tile {
  width: 32px;
  height: 42px;
}

.feedback {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.55;
}

.feedback.is-ok {
  background: rgba(24, 122, 84, 0.1);
  color: var(--felt);
}

.feedback.is-bad {
  background: rgba(181, 74, 74, 0.1);
  color: var(--danger);
}

.explain {
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(201, 168, 75, 0.12);
  border: 1px solid rgba(201, 168, 75, 0.28);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.6;
}

.practice-foot {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 8px;
  padding: 10px 0 calc(10px + var(--safe-b));
  background: linear-gradient(180deg, transparent, var(--ivory) 30%);
}

.btn {
  flex: 1;
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

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

.btn-ghost {
  background: rgba(10, 63, 46, 0.08);
  color: var(--felt);
}

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

/* —— Lists —— */
.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 12px;
  background: var(--ivory-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: left;
  cursor: pointer;
  width: 100%;
  color: inherit;
  font: inherit;
}

.list-item .num {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(10, 63, 46, 0.08);
  color: var(--felt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.list-item .title {
  font-weight: 700;
  font-size: 14px;
}

.list-item .desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.list-item .arrow {
  margin-left: auto;
  color: var(--muted);
}

.article {
  background: var(--ivory-card);
  border-radius: 16px;
  padding: 18px 16px;
  border: 1px solid var(--line);
  white-space: pre-wrap;
  line-height: 1.75;
  font-size: 14px;
  color: var(--ink-soft);
}

.panel {
  background: var(--ivory-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
}

.panel-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 10px;
}

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

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

.switch {
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: rgba(10, 63, 46, 0.15);
  border: 0;
  position: relative;
  cursor: pointer;
}

.switch.is-on {
  background: var(--felt);
}

.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}

.switch.is-on::after {
  transform: translateX(18px);
}

/* —— 运势页（对齐小程序 fortune / 本地 xhs-fortune 红历卡） —— */
.fortune-page {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #f7f1e7 0%, #ebe2d4 100%);
}

.fortune-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
  padding: calc(10px + var(--safe-t)) 14px 8px;
  pointer-events: none;
}

.fortune-top > * {
  pointer-events: auto;
}

.fortune-top h1 {
  margin: 0;
  text-align: center;
  font-size: 17px;
  font-weight: 800;
  color: #8a2a2a;
  letter-spacing: 0.12em;
  grid-column: 2;
}

.fortune-top-slot {
  width: 36px;
  height: 36px;
}

.fortune-back {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #b71c1c;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  justify-self: start;
}

.today-chip {
  justify-self: end;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(180, 40, 40, 0.14);
  background: rgba(255, 255, 255, 0.94);
  color: #c62828;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.fortune-sheet {
  flex: 1;
  min-height: 100vh;
  min-height: 100dvh;
  box-sizing: border-box;
  display: flex;
  align-items: safe center;
  justify-content: center;
  padding: calc(52px + var(--safe-t)) 16px 24px;
}

.rb-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  border-radius: 18px;
  overflow: hidden;
  background: #fffdf9;
  border: 1px solid rgba(180, 40, 40, 0.12);
  box-shadow: 0 12px 28px rgba(70, 25, 15, 0.12);
}

.wm-layer {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  overflow: hidden;
}

.wm-text {
  position: absolute;
  font-size: 11px;
  font-weight: 800;
  color: rgba(40, 22, 18, 0.12);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.rb-head,
.rb-body {
  position: relative;
  z-index: 1;
}

.rb-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 16px 18px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.18), transparent 55%),
    linear-gradient(180deg, #d32f2f 0%, #b71c1c 100%);
  color: #fff;
  text-align: center;
}

.rb-brand {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  opacity: 0.92;
}

.rb-date-row {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
}

.date-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.date-nav--prev { left: 4px; }
.date-nav--next { right: 4px; }
.date-nav:active { background: rgba(255, 255, 255, 0.28); }

.rb-date {
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}

.rb-head-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  opacity: 0.95;
  line-height: 1.35;
  padding: 0 8px;
}

.rb-dot {
  opacity: 0.55;
  padding: 0 2px;
}

.rb-body {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 14px 14px;
  background: linear-gradient(180deg, #fffefb 0%, #fffaf3 100%);
  overflow: hidden;
}

.rb-seal {
  position: absolute;
  right: 14px;
  top: 18px;
  width: 48px;
  height: 48px;
  border: 2px solid rgba(198, 40, 40, 0.18);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 900;
  color: rgba(198, 40, 40, 0.16);
  transform: rotate(-12deg);
  pointer-events: none;
  z-index: 0;
}

.rb-hero-row,
.rb-chong-bar,
.rb-block,
.rb-foot {
  position: relative;
  z-index: 1;
}

.rb-hero-row {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 10px;
}

.rb-dir-card,
.rb-wear-card {
  min-width: 0;
  padding: 12px 10px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #f0e6d8;
  box-shadow: 0 2px 8px rgba(80, 40, 10, 0.04);
  text-align: center;
}

.rb-dir-k {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: #c62828;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.rb-dir-v {
  display: block;
  font-size: 24px;
  font-weight: 900;
  color: #1c2430;
  line-height: 1.15;
  letter-spacing: 0.04em;
}

.rb-dir-sub {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #8a8174;
  line-height: 1.3;
}

.rb-swatches {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.rb-swatch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.rb-swatch-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
  display: inline-block;
}

.rb-swatch-name {
  font-size: 14px;
  font-weight: 800;
  color: #1c2430;
}

.rb-chong-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(90deg, #fff5f5 0%, #fff 55%);
  border: 1px solid #f3d4d4;
}

.rb-chong-k {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 900;
  color: #fff;
  background: #c62828;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.08em;
}

.rb-chong-v {
  font-size: 13px;
  font-weight: 800;
  color: #1c2430;
  line-height: 1.3;
  text-align: center;
}

.rb-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 10px 10px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #f0e6d8;
}

.rb-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px;
}

.rb-block-title {
  font-size: 14px;
  font-weight: 900;
  color: #c62828;
  letter-spacing: 0.06em;
}

.rb-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #8a8174;
}

.rb-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-left: 4px;
  display: inline-block;
}

.rb-rail {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
}

@media (min-width: 380px) {
  .rb-rail {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }
}

.rb-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  padding: 8px 0;
  border-radius: 8px;
  background: #faf7f1;
}

.rb-col.rb-ji-soft { background: #fff1f1; }
.rb-col.rb-zhong-soft { background: #eef8ef; }
.rb-col.rb-xiong-soft { background: #f3f4f6; }

.rb-col-name {
  font-size: 12px;
  font-weight: 800;
  color: #1c2430;
  line-height: 1;
}

.rb-col-sub {
  font-size: 9px;
  font-weight: 700;
  color: #9a9183;
  line-height: 1;
  white-space: nowrap;
  transform: scale(0.92);
}

.rb-badge {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.rb-ji { background: #c62828; }
.rb-zhong { background: #2e7d32; }
.rb-xiong { background: #1f2937; }

.rb-mark {
  min-height: 12px;
  font-size: 10px;
  font-weight: 800;
  color: #c62828;
  line-height: 1.1;
  text-align: center;
}

.rb-block--hours .rb-col {
  gap: 3px;
}

.rb-foot {
  display: block;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: #a39a8c;
  letter-spacing: 0.04em;
  margin: 2px 0 0;
}

.almanac {
  display: none;
}

.level-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.level-tabs .chip {
  flex: 1;
}

.level-group {
  margin-bottom: 16px;
}

.level-group h3 {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 8px;
}

.state-box {
  text-align: center;
  padding: 40px 16px;
  color: var(--muted);
}

.state-box .err {
  color: var(--danger);
}

.tip {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-top: 16px;
}

.guide-section {
  background: var(--ivory-card);
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 14px;
  margin-bottom: 10px;
}

.guide-section h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.guide-section p,
.guide-section li {
  margin: 0 0 6px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
}

.guide-section ul {
  margin: 0;
  padding-left: 18px;
}

.wrong-hand {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 6px;
}

.wrong-hand .tile {
  width: 22px;
  height: 30px;
}

/* tileImageCache / renderTileMarkup 兼容 */
.mahjong-tile {
  width: 36px;
  height: 48px;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  flex-shrink: 0;
}

.mahjong-tile--sprite {
  background-repeat: no-repeat;
}

.hand-felt .mahjong-tile {
  width: 32px;
  height: 42px;
}

.wrong-hand .mahjong-tile {
  width: 22px;
  height: 30px;
}

.tile-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 2px;
  display: block;
}

.w-7 { width: 28px; }
.h-9 { height: 36px; }
.w-9 { width: 36px; }
.h-12 { height: 48px; }
.relative { position: relative; }
.shrink-0 { flex-shrink: 0; }
.rounded-lg { border-radius: 8px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

/* —— 激活弹窗（对齐原版 standalone） —— */
.act-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.act-overlay.is-hidden {
  display: none !important;
}

.act-card {
  width: 100%;
  max-width: 360px;
  background: var(--ivory-card);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.28);
}

.act-card--center {
  text-align: center;
  padding: 24px;
}

.act-card--sm {
  max-width: 300px;
  padding: 32px 24px;
}

.act-card-head {
  background: linear-gradient(145deg, var(--felt-mid), var(--felt), var(--felt-deep));
  color: #fff;
  text-align: center;
  padding: 22px 20px 18px;
}

.act-card-head h2 {
  margin: 8px 0 0;
  font-size: 20px;
}

.act-emoji {
  font-size: 36px;
  line-height: 1;
}

.act-card-body {
  padding: 20px 22px 8px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink);
}

.act-card-body p {
  margin: 0 0 12px;
}

.act-note {
  background: #fff8e8;
  border: 1px solid rgba(201, 168, 75, 0.45);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 12px;
  color: #5c4810;
  text-align: left;
}

.act-note-title {
  font-weight: 700;
  margin-bottom: 6px !important;
}

.act-qq {
  font-weight: 800;
  color: var(--felt);
}

.act-card-foot {
  padding: 8px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.act-card-foot .btn-ghost {
  background: transparent;
  color: var(--muted);
}

.act-lock {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--felt-mid), var(--felt-deep));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.act-card--center h2 {
  margin: 0 0 6px;
  font-size: 20px;
  color: var(--ink);
}

.act-sub {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.act-sub--sm {
  font-size: 12px;
  margin-bottom: 14px;
}

.act-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--ivory);
  text-align: center;
  font-size: 18px;
  letter-spacing: 0.2em;
  margin-bottom: 8px;
  color: var(--ink);
  outline: none;
}

.act-input:focus {
  border-color: var(--felt);
}

.act-error {
  color: var(--danger);
  font-size: 13px;
  margin: 0 0 10px;
}

.act-error.is-hidden {
  display: none;
}

.act-success {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: rgba(24, 122, 84, 0.14);
  color: var(--felt-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
}

.act-card--center .btn-primary {
  width: 100%;
  margin-top: 4px;
}
