/* ═══════════════════════════════════════════════
   中医体质自测 App — 传统中医风格 UI
   ═══════════════════════════════════════════════ */

/* ─── 基础变量 ─── */
:root {
  --clay-red: #8B2F2F;
  --clay-red-light: #A84848;
  --clay-red-dark: #6B1F1F;
  --gold: #C8A951;
  --gold-light: #E0C876;
  --gold-dark: #A6883A;
  --cream: #FDF5E6;
  --cream-dark: #F0E6D0;
  --ink: #2C1810;
  --ink-light: #5C3A28;
  --paper: #F5E6CC;
  --paper-dark: #E8D5B0;
  --white: #FFFDF5;
  --shadow: rgba(44, 24, 16, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.6;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(200, 169, 81, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(139, 47, 47, 0.04) 0%, transparent 50%);
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 3px; }

/* ─── App Container ─── */
.app-container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: var(--white);
  box-shadow: 0 0 40px var(--shadow);
}

/* ─── Pages ─── */
.page {
  display: none;
  animation: fadeIn 0.3s ease;
}
.page.active { display: block; }

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

/* ─── Header ─── */
.header {
  background: linear-gradient(135deg, var(--clay-red), var(--clay-red-dark));
  color: var(--gold-light);
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
}
.header::before {
  content: "☯";
  position: absolute;
  right: -10px;
  top: -20px;
  font-size: 120px;
  opacity: 0.08;
  color: var(--gold);
}
.header h1 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 2px;
}
.header p {
  font-size: 0.85rem;
  color: var(--cream);
  opacity: 0.8;
  margin-top: 4px;
}
.header .subtitle {
  font-size: 0.75rem;
  color: var(--gold-light);
  opacity: 0.6;
  margin-top: 2px;
}

/* ─── Header with back button ─── */
.header-back {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-back .back-btn {
  background: none;
  border: none;
  color: var(--gold-light);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.2s;
}
.header-back .back-btn:hover {
  background: rgba(255,255,255,0.1);
}
.header-back .header-content {
  flex: 1;
}
.header-back .header-content h1 { margin: 0; }
.header-back .btn-back {
  background: none;
  border: none;
  color: var(--gold-light);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.header-back .btn-back:hover {
  background: rgba(255,255,255,0.15);
}
.header-back .lang-toggle {
  flex-shrink: 0;
}


/* ─── Content Area ─── */
.content {
  padding: 20px 20px 100px;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s;
  padding: 14px 28px;
  width: 100%;
  font-family: inherit;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--clay-red), var(--clay-red-dark));
  color: var(--gold-light);
  box-shadow: 0 4px 15px rgba(139, 47, 47, 0.3);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(139, 47, 47, 0.4); transform: translateY(-1px); }

.btn-secondary {
  background: var(--gold);
  color: var(--ink);
  box-shadow: 0 4px 15px rgba(200, 169, 81, 0.3);
}
.btn-secondary:hover { box-shadow: 0 6px 20px rgba(200, 169, 81, 0.4); }

.btn-outline {
  background: transparent;
  color: var(--clay-red);
  border: 2px solid var(--clay-red);
}
.btn-outline:hover { background: rgba(139, 47, 47, 0.06); }

.btn-ghost {
  background: transparent;
  color: var(--ink-light);
  border: 1px solid var(--paper-dark);
}
.btn-ghost:hover { background: var(--paper); }

.btn-sm {
  padding: 10px 18px;
  font-size: 0.9rem;
  width: auto;
}

/* ─── Auth Pages ─── */
.auth-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 28px;
  text-align: center;
}
.auth-logo {
  font-size: 3.5rem;
  margin-bottom: 8px;
}
.auth-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--clay-red);
  letter-spacing: 4px;
}
.auth-subtitle {
  color: var(--ink-light);
  font-size: 0.9rem;
  margin: 8px 0 32px;
  opacity: 0.7;
}
.auth-form {
  text-align: left;
}
.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--ink-light);
  margin-bottom: 6px;
  font-weight: 500;
}
.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--paper-dark);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  background: var(--white);
  color: var(--ink);
  transition: border-color 0.2s;
  font-family: inherit;
}
.form-input:focus {
  outline: none;
  border-color: var(--clay-red);
  box-shadow: 0 0 0 3px rgba(139, 47, 47, 0.1);
}
.form-input::placeholder { color: #bbb; }

.form-group .error-text {
  color: var(--clay-red);
  font-size: 0.8rem;
  margin-top: 4px;
  display: none;
}

.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--ink-light);
}
.auth-switch a {
  color: var(--clay-red);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}
.auth-switch a:hover { text-decoration: underline; }

/* ─── Main Menu ─── */
.menu-header {
  text-align: center;
  padding: 30px 20px 20px;
}
.menu-header .greeting {
  font-size: 1.2rem;
  color: var(--clay-red);
  font-weight: 600;
}
.menu-header .greeting-sub {
  font-size: 0.85rem;
  color: var(--ink-light);
  opacity: 0.7;
  margin-top: 4px;
}
.menu-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 24px;
}
.menu-card {
  background: var(--white);
  border: 1px solid var(--paper-dark);
  border-radius: var(--radius);
  padding: 18px 20px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: inherit;
}
.menu-card:hover {
  border-color: var(--gold);
  box-shadow: 0 4px 20px var(--shadow);
  transform: translateY(-2px);
}
.menu-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.menu-card-icon.red { background: rgba(139, 47, 47, 0.1); }
.menu-card-icon.gold { background: rgba(200, 169, 81, 0.15); }
.menu-card-icon.green { background: rgba(34, 139, 34, 0.1); }
.menu-card-icon.blue { background: rgba(0, 0, 128, 0.08); }
.menu-card-body { flex: 1; }
.menu-card-body h3 { font-size: 1rem; font-weight: 600; }
.menu-card-body p { font-size: 0.8rem; color: var(--ink-light); opacity: 0.7; margin-top: 2px; }
.menu-card-arrow { color: var(--gold); font-size: 1.2rem; }

/* ─── Quiz Page ─── */
.quiz-progress {
  padding: 16px 20px 0;
}
.progress-bar-track {
  width: 100%;
  height: 6px;
  background: var(--paper-dark);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--clay-red));
  border-radius: 3px;
  transition: width 0.4s ease;
}
.progress-text {
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink-light);
  margin-top: 8px;
  opacity: 0.7;
}
.progress-category {
  text-align: center;
  font-size: 0.75rem;
  color: var(--gold-dark);
  font-weight: 500;
  margin-top: 4px;
}

.quiz-card {
  background: var(--white);
  border: 1px solid var(--paper-dark);
  border-radius: var(--radius);
  margin: 16px 20px 0;
  padding: 24px 20px;
  box-shadow: 0 2px 10px var(--shadow);
}
.quiz-number {
  display: inline-block;
  background: var(--clay-red);
  color: var(--gold-light);
  font-size: 0.75rem;
  padding: 2px 10px;
  border-radius: 10px;
  font-weight: 600;
  margin-bottom: 12px;
}
.quiz-question {
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.7;
  min-height: 60px;
}
.quiz-rating {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rating-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 2px solid var(--paper-dark);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  background: var(--white);
}
.rating-option:hover {
  border-color: var(--gold);
  background: rgba(200, 169, 81, 0.04);
}
.rating-option.selected {
  border-color: var(--clay-red);
  background: rgba(139, 47, 47, 0.04);
}
.rating-option .score {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
  color: white;
}
.rating-option .score.s1 { background: #4CAF50; }
.rating-option .score.s2 { background: #8BC34A; }
.rating-option .score.s3 { background: #FFC107; color: var(--ink); }
.rating-option .score.s4 { background: #FF9800; }
.rating-option .score.s5 { background: #F44336; }
.rating-option .label-text {
  font-size: 0.9rem;
  color: var(--ink-light);
}
.rating-option.selected .label-text {
  color: var(--clay-red);
  font-weight: 500;
}

.quiz-nav {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
}
.quiz-nav .btn { width: auto; flex: 1; }
.quiz-nav .btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* ─── Results Page ─── */
.results-summary {
  text-align: center;
  padding: 24px 20px;
  background: linear-gradient(135deg, rgba(139,47,47,0.04), rgba(200,169,81,0.06));
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.results-summary .results-date {
  font-size: 0.8rem;
  color: var(--ink-light);
  opacity: 0.6;
}
.results-summary h2 {
  color: var(--clay-red);
  margin: 8px 0;
}
.results-summary .results-sub {
  color: var(--ink-light);
  font-size: 0.9rem;
  opacity: 0.7;
}

/* Radar chart placeholder */
.radar-container {
  width: 280px;
  height: 280px;
  margin: 10px auto;
  position: relative;
}

/* Top 3 syndromes */
.top-card {
  background: var(--white);
  border: 1px solid var(--paper-dark);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
  border-left: 4px solid var(--gold);
  transition: all 0.2s;
}
.top-card:nth-child(1) { border-left-color: var(--clay-red); }
.top-card:nth-child(2) { border-left-color: var(--gold); }
.top-card:nth-child(3) { border-left-color: var(--gold-dark); }

.top-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.top-card-header .name {
  font-weight: 600;
  font-size: 1.05rem;
}
.top-card-header .score-badge {
  padding: 2px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}
.score-badge.high { background: rgba(244, 67, 54, 0.12); color: #D32F2F; }
.score-badge.medium { background: rgba(255, 152, 0, 0.12); color: #E65100; }
.score-badge.low { background: rgba(76, 175, 80, 0.12); color: #388E3C; }

.top-card .score-bar {
  margin-top: 8px;
  height: 4px;
  background: var(--paper-dark);
  border-radius: 2px;
  overflow: hidden;
}
.top-card .score-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease;
}

/* Section accordion */
.section-toggle {
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  padding: 14px 18px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--paper-dark);
  transition: background 0.2s;
  font-family: inherit;
}
.section-toggle:hover { background: var(--paper); }
.section-toggle .arrow { transition: transform 0.3s; }
.section-toggle.open .arrow { transform: rotate(180deg); }

.section-content {
  display: none;
  padding: 16px 18px;
  border-bottom: 1px solid var(--paper-dark);
}
.section-content.open { display: block; }

.section-content ul {
  padding-left: 20px;
  margin: 6px 0;
}
.section-content li {
  margin-bottom: 6px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ink-light);
}

.section-content .herb-box {
  background: var(--paper);
  border-left: 3px solid var(--gold);
  padding: 10px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 10px 0;
  font-size: 0.9rem;
  color: var(--ink-light);
}

/* ─── History Page ─── */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.history-item {
  background: var(--white);
  border: 1px solid var(--paper-dark);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s;
}
.history-item:hover {
  border-color: var(--gold);
  box-shadow: 0 2px 12px var(--shadow);
}
.history-item .date {
  font-size: 0.8rem;
  color: var(--ink-light);
  opacity: 0.6;
}
.history-item .top-syndromes {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.history-item .tag {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  background: var(--paper);
  color: var(--ink-light);
}
.history-item .tag.first {
  background: var(--clay-red);
  color: var(--gold-light);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-light);
  opacity: 0.5;
}
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state p { font-size: 0.9rem; }

/* ─── All Scores (full table) ─── */
.scores-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}
.scores-item {
  background: var(--paper);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  display: flex;
  justify-content: space-between;
}
.scores-item .score-val {
  font-weight: 600;
}
.scores-item.highlight {
  background: rgba(139, 47, 47, 0.08);
  border: 1px solid rgba(139, 47, 47, 0.2);
}

/* ─── Nav Bar ─── */
.nav-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--white);
  border-top: 1px solid var(--paper-dark);
  display: flex;
  padding: 8px 0 env(safe-area-inset-bottom, 8px);
  box-shadow: 0 -4px 20px var(--shadow);
  z-index: 100;
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-light);
  opacity: 0.5;
  transition: all 0.2s;
  font-family: inherit;
}
.nav-item.active {
  opacity: 1;
  color: var(--clay-red);
}
.nav-item .nav-icon { font-size: 1.3rem; }
.nav-item .nav-label { font-size: 0.65rem; font-weight: 500; }

/* ─── Payment Page ─── */
.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--paper-dark);
  border-radius: 8px;
  font-size: 0.95rem;
  background: var(--cream);
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus {
  border-color: var(--gold);
  background: var(--white);
}
.form-input::placeholder {
  color: var(--ink-light);
  opacity: 0.4;
}

.payment-plan:hover {
  border-color: var(--gold) !important;
  box-shadow: 0 2px 12px var(--shadow);
}

.btn-paypal, .btn-applepay {
  transition: opacity 0.2s, transform 0.15s;
}
.btn-paypal:hover, .btn-applepay:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}
.btn-paypal:active, .btn-applepay:active {
  transform: translateY(0);
}

/* ─── TCM Guide ─── */
.tcm-section-header:hover {
  background: rgba(200, 169, 81, 0.06);
}
.tcm-section-body {
  animation: slideDown 0.25s ease;
}
@keyframes slideDown {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 2000px; }
}

/* ─── Card Flip ─── */
.card-flip-container {
  perspective: 1000px;
  cursor: pointer;
}
.card-flip-inner {
  position: relative;
  transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
  transform-style: preserve-3d;
}
.card-flip-inner.flipped {
  transform: rotateY(180deg);
}
.card-face {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  position: relative;
  top: 0;
  left: 0;
  width: 100%;
}
.card-collection-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

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

/* ─── Responsive ─── */
@media (max-width: 480px) {
  .app-container { max-width: 100%; box-shadow: none; }
}
@media (min-width: 481px) {
  body { padding: 20px; }
  .app-container { border-radius: 16px; overflow: hidden; min-height: calc(100vh - 40px); }
  .nav-bar { max-width: 480px; border-radius: 0 0 16px 16px; }
}

/* ─── Disease highlight ─── */
.disease-tag {
  color: #D32F2F;
  font-weight: 700;
}

/* ─── Language Toggle ─── */
.lang-toggle {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(200,169,81,0.4);
  color: var(--gold-light);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  flex-shrink: 0;
  letter-spacing: 1px;
}
.lang-toggle:hover {
  background: rgba(255,255,255,0.2);
  border-color: var(--gold);
}
.auth-lang-toggle {
  background: rgba(139,47,47,0.08);
  border: 1px solid var(--clay-red-light);
  color: var(--clay-red);
  font-size: 0.9rem;
  padding: 5px 20px;
  border-radius: 20px;
}
.auth-lang-toggle:hover {
  background: rgba(139,47,47,0.15);
  border-color: var(--clay-red);
}
.vip-gate {
  background: linear-gradient(135deg, rgba(200,169,81,0.08), rgba(200,169,81,0.15));
  border: 2px dashed var(--gold);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  margin: 12px 0;
}
.vip-gate-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}
.vip-gate-text {
  font-size: 0.9rem;
  color: var(--ink-light);
  margin-bottom: 12px;
}
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--cream);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  opacity: 0;
  transition: all 0.3s;
  z-index: 200;
  white-space: nowrap;
}
.toast.show {
  opacity: 0.9;
  transform: translateX(-50%) translateY(0);
}

/* ─── Loading ─── */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--ink-light);
}
.spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 12px;
  border: 3px solid var(--paper-dark);
  border-top-color: var(--clay-red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Delete button ─── */
.delete-btn {
  background: none;
  border: none;
  color: var(--ink-light);
  opacity: 0.4;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 4px 8px;
  transition: all 0.2s;
}
.delete-btn:hover { opacity: 1; color: var(--clay-red); }

/* ═══════════════════════════════════════════════
   时辰养生闹钟页面
   ═══════════════════════════════════════════════ */

/* ─── 当前时辰大卡 ─── */
.current-alarm-card {
  background: linear-gradient(135deg, var(--clay-red), var(--clay-red-dark));
  color: var(--cream);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.current-alarm-card::before {
  content: "☯";
  position: absolute;
  right: -10px;
  top: -20px;
  font-size: 7rem;
  opacity: 0.08;
  transform: rotate(15deg);
}
.alarm-clock-display {
  display: flex;
  align-items: center;
  gap: 16px;
}
.alarm-clock-icon {
  font-size: 2.8rem;
  flex-shrink: 0;
  line-height: 1;
}
.alarm-current-info {
  flex: 1;
  min-width: 0;
}
.alarm-period-name {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 2px;
}
.alarm-meridian-name {
  font-size: 0.85rem;
  opacity: 0.8;
  margin-bottom: 4px;
}
.alarm-time-range {
  font-size: 0.8rem;
  opacity: 0.7;
}
.alarm-current-desc {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.15);
  font-size: 0.92rem;
  line-height: 1.5;
}
.alarm-personalized-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--gold);
  color: var(--clay-red-dark);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 6px;
}

/* ─── 闹钟总开关 ─── */
.alarm-master-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--paper);
  border-radius: 12px;
  margin-bottom: 16px;
}
.alarm-master-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
}
.alarm-master-sub {
  font-size: 0.75rem;
  opacity: 0.6;
  margin-top: 2px;
}

/* ─── 体质标签 ─── */
.alarm-body-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(135deg, var(--gold-light), var(--paper));
  border-radius: 10px;
  margin-bottom: 14px;
  font-size: 0.85rem;
  color: var(--ink);
  border: 1px solid var(--gold);
}
.alarm-body-label .body-tag {
  display: inline-block;
  background: var(--clay-red);
  color: var(--white);
  font-size: 0.7rem;
  padding: 1px 7px;
  border-radius: 6px;
  margin-right: 4px;
}
.alarm-body-label .vip-lock {
  opacity: 0.5;
  font-size: 0.75rem;
  margin-left: auto;
}

/* ─── 时辰时间线 ─── */
.alarm-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: 32px;
}
.alarm-timeline::before {
  content: '';
  position: absolute;
  left: 13px;
  top: 18px;
  bottom: 18px;
  width: 2px;
  background: var(--paper-dark);
}

.alarm-timeline-item {
  position: relative;
  padding: 14px 14px 14px 16px;
  background: var(--white);
  border-radius: 10px;
  margin-bottom: 6px;
  border: 1px solid var(--paper);
  transition: all 0.2s;
}
.alarm-timeline-item:hover {
  border-color: var(--gold);
  box-shadow: 0 2px 8px var(--shadow);
}
.alarm-timeline-item.active {
  border-color: var(--clay-red);
  background: rgba(139,47,47,0.03);
  box-shadow: 0 0 0 1px var(--clay-red-light);
}
.alarm-timeline-item .timeline-dot {
  position: absolute;
  left: -28px;
  top: 18px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--white);
  z-index: 1;
}
.alarm-timeline-item.active .timeline-dot {
  background: var(--clay-red);
  box-shadow: 0 0 0 3px rgba(139,47,47,0.15);
}
.alarm-timeline-item .timeline-dot.muted {
  background: var(--paper-dark);
}

.alarm-item-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alarm-item-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  line-height: 1.3;
}
.alarm-item-info {
  flex: 1;
  min-width: 0;
}
.alarm-item-period {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
}
.alarm-item-meridian {
  font-size: 0.75rem;
  color: var(--ink-light);
  opacity: 0.7;
}
.alarm-item-time {
  font-size: 0.7rem;
  color: var(--ink-light);
  opacity: 0.5;
}

/* ─── 个性化标签 ─── */
.alarm-personalized-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--gold);
  color: var(--clay-red-dark);
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 6px;
  margin-top: 4px;
  cursor: pointer;
}
.alarm-personalized-badge .vip-icon {
  font-size: 0.65rem;
}

/* ─── 闹钟手风琴 ─── */
.alarm-item-header {
  cursor: pointer;
  user-select: none;
}
.alarm-item-header:active {
  opacity: 0.7;
}
.alarm-chevron {
  font-size: 0.7rem;
  color: var(--ink-light);
  opacity: 0.5;
  transition: transform 0.2s;
}
.alarm-timeline-item.expanded .alarm-chevron {
  opacity: 0.8;
}
.alarm-item-body {
  padding: 0 0 12px 44px;
  animation: fadeIn 0.2s ease;
}
.alarm-item-advice {
  font-size: 0.82rem;
  color: var(--ink-light);
  line-height: 1.5;
  margin-bottom: 8px;
}
.alarm-personalized-detail {
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--cream);
  border-radius: 8px;
  border-left: 3px solid var(--gold);
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--ink-light);
  display: none;
}
.alarm-personalized-detail.show {
  display: block;
  animation: fadeIn 0.2s ease;
}

/* ─── 会员锁定覆盖 ─── */
.vip-gate-compact {
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--paper), var(--cream));
  border-radius: 10px;
  border: 1px dashed var(--gold);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.vip-gate-compact .vip-gc-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}
.vip-gate-compact .vip-gc-text {
  flex: 1;
  font-size: 0.82rem;
  line-height: 1.4;
}
.vip-gate-compact button {
  flex-shrink: 0;
}

/* ─── Toggle Switch ─── */
.toggle-switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--paper-dark);
  border-radius: 12px;
  transition: 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: var(--white);
  border-radius: 50%;
  transition: 0.2s;
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--clay-red);
}
.toggle-switch input:disabled + .toggle-slider {
  opacity: 0.4;
  cursor: not-allowed;
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

/* ─── Alarm notification toast ─── */
.alarm-toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 380px;
  width: calc(100% - 32px);
  background: var(--clay-red);
  color: var(--cream);
  padding: 14px 18px;
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(139,47,47,0.35);
  z-index: 1000;
  display: none;
  animation: slideUpAlarm 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.alarm-toast.show { display: block; }
@keyframes slideUpAlarm {
  from { transform: translateX(-50%) translateY(30px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}
.alarm-toast-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 6px;
}
.alarm-toast-body {
  font-size: 0.85rem;
  line-height: 1.5;
  opacity: 0.92;
}
.alarm-toast .alarm-toast-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 1.2rem;
  cursor: pointer;
}
.alarm-toast .alarm-toast-close:hover { color: #fff; }

/* ─── 空状态 ─── */
.alarm-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-light);
}
.alarm-empty .empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.5;
}
.alarm-empty .empty-text {
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ─── Alarm active indicator in menu ─── */
#card-alarms .alarm-dot {
  display: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--clay-red);
  animation: pulse-dot 1.5s infinite;
  flex-shrink: 0;
  margin-left: auto;
  align-self: center;
}
#card-alarms .alarm-dot.active { display: block; }

@keyframes pulse-dot {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.3); }
}

/* ═══════════════════════════════════════════════
   定价页 (Pricing Page)
   ═══════════════════════════════════════════════ */

.pricing-wrapper {
  padding: 20px 16px 40px;
  max-width: 720px;
  margin: 0 auto;
}

.pricing-header {
  text-align: center;
  margin-bottom: 24px;
}

.pricing-title {
  font-size: 1.4rem;
  color: var(--clay-red);
  margin-bottom: 6px;
}

.pricing-subtitle {
  font-size: 0.85rem;
  color: var(--ink-light);
  opacity: 0.8;
}

/* Billing toggle */
.billing-toggle {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 24px;
  background: var(--paper);
  border-radius: 24px;
  padding: 3px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.toggle-btn {
  padding: 8px 20px;
  border: none;
  border-radius: 22px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  color: var(--ink-light);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.toggle-btn.active {
  background: var(--clay-red);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(139, 47, 47, 0.25);
}

.badge-save {
  font-size: 0.65rem;
  background: rgba(200, 169, 81, 0.2);
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--gold-dark);
  font-weight: 600;
  white-space: nowrap;
}

.toggle-btn.active .badge-save {
  background: rgba(255, 255, 255, 0.2);
  color: var(--gold-light);
}

/* Tier grid */
.tier-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tier-card {
  background: var(--white);
  border: 1.5px solid var(--paper-dark);
  border-radius: 16px;
  padding: 24px 20px;
  position: relative;
  transition: all 0.2s;
}

.tier-card:hover {
  border-color: var(--gold);
  box-shadow: 0 4px 16px rgba(200, 169, 81, 0.15);
}

.tier-featured {
  border-color: var(--gold);
  border-width: 2px;
  box-shadow: 0 4px 20px rgba(200, 169, 81, 0.2);
}

.featured-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--clay-red-dark);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 14px;
  border-radius: 12px;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.tier-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--clay-red);
  margin-bottom: 4px;
}

.tier-desc {
  font-size: 0.8rem;
  color: var(--ink-light);
  opacity: 0.8;
  margin-bottom: 12px;
  line-height: 1.4;
}

.tier-price {
  margin-bottom: 16px;
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.price-amount {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--ink);
}

.price-period {
  font-size: 0.85rem;
  color: var(--ink-light);
  opacity: 0.7;
}

.tier-features {
  list-style: none;
  margin-bottom: 20px;
  padding: 0;
}

.feature-item {
  font-size: 0.85rem;
  color: var(--ink-light);
  padding: 5px 0;
  line-height: 1.4;
}

.feature-item::before {
  content: none;
}

.btn-subscribe {
  width: 100%;
  padding: 12px 20px;
  border-radius: 12px;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-subscribe.btn-primary {
  background: var(--clay-red);
  color: var(--white);
}

.btn-subscribe.btn-primary:hover {
  background: var(--clay-red-light);
  box-shadow: 0 2px 12px rgba(139, 47, 47, 0.3);
}

.btn-subscribe.btn-secondary {
  background: var(--paper);
  color: var(--ink);
}

.btn-subscribe.btn-secondary:hover {
  background: var(--paper-dark);
}

/* Pricing loading */
.pricing-loading {
  text-align: center;
  padding: 60px 20px;
}

/* Responsive: wider screens show 3-column grid */
@media (min-width: 640px) {
  .tier-grid {
    flex-direction: row;
    gap: 12px;
  }
  .tier-card {
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  .btn-subscribe {
    margin-top: auto;
  }
}
