﻿/* ========================================
   全真法事通 H5 - 全局样式 v2
   配色：玄色 + 金色 + 米白
   道家美学：庄重 · 神秘 · 雅致
   ======================================== */

:root {
  --primary: #1a1a24;
  --primary-light: #2d2d3f;
  --primary-dark: #0c0c14;
  --primary-surface: #222233;
  --gold: #b8944b;
  --gold-light: #cfb377;
  --gold-pale: #e8dcc4;
  --gold-bg: #faf6ed;
  --bg: #f8f5ef;
  --bg-warm: #faf7f1;
  --bg-white: #ffffff;
  --bg-card: #fdfcf8;
  --text: #1e1b16;
  --text-body: #3a3530;
  --text-secondary: #6b6358;
  --text-light: #9b9386;
  --text-muted: #bfb8ab;
  --border: #e5ddd0;
  --border-light: #f0ebe0;
  --shadow-sm: 0 1px 3px rgba(26,26,36,0.04);
  --shadow: 0 2px 12px rgba(26,26,36,0.06);
  --shadow-md: 0 4px 20px rgba(26,26,36,0.10);
  --shadow-lg: 0 8px 32px rgba(26,26,36,0.14);
  --fav: #b8443a;
  --danger: #c0392b;
  --success: #5b8c5a;
  --link: #5b7a9d;
  --font-heading: "Songti SC","SimSun","STSong","Noto Serif SC","KaiTi","STKaiti",serif;
  --font-body: "PingFang SC","Hiragino Sans GB","Microsoft YaHei","Heiti SC",sans-serif;
  --font-2xs: 10px;
  --font-xs: 11px;
  --font-sm: 13px;
  --font-base: 14px;
  --font-md: 16px;
  --font-lg: 18px;
  --font-xl: 21px;
  --font-2xl: 26px;
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing: 12px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;
  --radius-xs: 3px;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 999px;
  --nav-height: 44px;
  --tab-height: 56px;
  --search-height: 50px;
  --safe-bottom: env(safe-area-inset-bottom,0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  max-width: 100vw;
  letter-spacing: 0.01em;
}
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(184,148,75,0.03) 0%, transparent 70%),
              radial-gradient(ellipse at 80% 50%, rgba(26,26,36,0.02) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}
a { color: inherit; text-decoration: none; }
button { font-family: var(--font-body); cursor: pointer; border: none; outline: none; }
input, textarea { font-family: var(--font-body); outline: none; border: none; background: none; }
img { max-width: 100%; display: block; }

#app {
  min-height: 100vh;
  padding-bottom: calc(var(--tab-height) + var(--safe-bottom));
  position: relative;
  z-index: 1;
}
.page {
  display: none;
  animation: pageFadeIn 0.3s ease;
}
.page.active { display: block; }
.sub-page {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg);
  z-index: 100;
  overflow-y: auto;
  animation: slideInRight 0.28s cubic-bezier(0.22,0.61,0.36,1);
}
.sub-page.active { display: block; }

@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
  from { transform: translateX(8%); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}

.tab-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--tab-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 0.5px solid var(--border-light);
  display: flex;
  z-index: 90;
}
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: var(--font-xs);
  color: var(--text-muted);
  transition: all 0.25s ease;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.tab-item.active { color: var(--primary); font-weight: 500; }
.tab-item.active::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 20px; height: 2px;
  background: var(--gold);
  border-radius: 1px;
}
.tab-icon { font-size: 21px; line-height: 1; transition: transform 0.2s ease; }
.tab-item.active .tab-icon { transform: scale(1.1); }

.nav-bar {
  position: sticky;
  top: 0;
  background: var(--primary);
  color: white;
  padding: 0 var(--spacing);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  z-index: 50;
  letter-spacing: 0.05em;
}
.nav-bar::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
  opacity: 0.4;
}
.nav-back {
  font-size: 20px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-light);
  -webkit-tap-highlight-color: transparent;
  font-family: var(--font-heading);
  cursor: pointer;
  user-select: none;
  border-radius: 8px;
  transition: background 0.15s;
}
.nav-back:active {
  background: rgba(255,255,255,0.12);
}
.nav-title {
  flex: 1;
  text-align: center;
  font-size: var(--font-md);
  font-weight: 500;
  font-family: var(--font-heading);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 var(--spacing-sm);
}
.nav-action {
  width: 32px;
  text-align: right;
  font-size: 18px;
  color: var(--gold-light);
  -webkit-tap-highlight-color: transparent;
}
.search-bar {
  display: flex;
  align-items: center;
  padding: var(--spacing-sm) var(--spacing);
  background: var(--bg-white);
  position: sticky;
  top: 0;
  z-index: 30;
}
.search-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  height: 38px;
  background: var(--bg);
  border-radius: var(--radius-full);
  padding: 0 14px;
  border: 1px solid var(--border-light);
  transition: all 0.25s ease;
}
.search-input-wrap:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(184,148,75,0.12);
}
.search-icon-svg {
  width: 16px; height: 16px;
  margin-right: 8px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: color 0.25s;
}
.search-input-wrap:focus-within .search-icon-svg { color: var(--gold); }
.search-input {
  flex: 1;
  font-size: var(--font-base);
  height: 100%;
  color: var(--text);
}
.search-input::placeholder { color: var(--text-muted); }
.search-clear {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
  flex-shrink: 0;
  transition: all 0.2s;
}
.search-clear:hover { background: rgba(0,0,0,0.06); color: var(--text-secondary); }

.cat-scroll {
  display: flex;
  padding: var(--spacing-sm) var(--spacing);
  background: var(--bg-white);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  gap: 6px;
  position: sticky;
  top: var(--search-height);
  z-index: 29;
  border-bottom: 1px solid var(--border-light);
}
.cat-scroll::-webkit-scrollbar { display: none; }
.cat-item {
  flex-shrink: 0;
  font-size: var(--font-sm);
  color: var(--text-secondary);
  padding: 7px 18px;
  border-radius: var(--radius-full);
  background: var(--bg);
  white-space: nowrap;
  transition: all 0.3s cubic-bezier(0.22,0.61,0.36,1);
  -webkit-tap-highlight-color: transparent;
  font-family: var(--font-heading);
  letter-spacing: 0.03em;
  position: relative;
  overflow: hidden;
  z-index: 1;
}
.cat-item.active {
  color: var(--gold-light);
  background: var(--primary);
  box-shadow: 0 2px 8px rgba(26,26,36,0.2);
}
.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--spacing);
  margin: var(--spacing-sm) var(--spacing);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: all 0.2s ease;
}
.card:active { box-shadow: var(--shadow); border-color: var(--gold-pale); }

.ritual-list { padding-top: var(--spacing-sm); }
.ritual-card {
  display: flex;
  overflow: hidden;
  min-height: 82px;
  gap: var(--spacing);
}
.ritual-cover {
  width: 72px; height: 72px;
  border-radius: var(--radius);
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--gold);
  position: relative;
  overflow: hidden;
}
.ritual-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, var(--gold-pale) 0%, transparent 50%);
  opacity: 0.08;
}
.ritual-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  gap: 4px;
}
.ritual-name {
  font-size: var(--font-md);
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-heading);
  letter-spacing: 0.03em;
}
.ritual-desc {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  line-height: 1.6;
}
.ritual-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ritual-category {
  font-size: var(--font-2xs);
  color: var(--gold);
  background: var(--gold-bg);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.04em;
}
.ritual-step-count {
  font-size: var(--font-2xs);
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.notation-scroll {
  height: calc(100vh - 104px - var(--tab-height) - var(--safe-bottom));
  overflow-y: auto;
  padding: 0 24px 0 4px;
  -webkit-overflow-scrolling: touch;
}
.group-title {
  padding: 14px 10px 8px;
  font-size: var(--font-sm);
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.06em;
  font-family: var(--font-heading);
}
.notation-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}
.music-card {
  width: calc(50% - 4px);
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px 10px 16px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.2s ease;
}
.music-card:active { box-shadow: var(--shadow); border-color: var(--gold-pale); }
.card-first-text {
  font-size: 48px;
  font-weight: 700;
  color: var(--primary);
  line-height: 64px;
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
}
.card-name {
  font-size: var(--font-xs);
  color: var(--text-secondary);
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  letter-spacing: 0.03em;
}
.letter-nav {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  z-index: 25;
  gap: 1px;
}
.letter-item {
  width: 20px; height: 19px;
  line-height: 19px;
  text-align: center;
  font-size: 10px;
  color: var(--text-muted);
  -webkit-tap-highlight-color: transparent;
  transition: all 0.2s ease;
  border-radius: 50%;
  font-weight: 500;
}
.letter-item.active {
  color: var(--gold);
  background: var(--primary);
  font-weight: 600;
  transform: scale(1.15);
}
.notation-header {
  position: relative;
  background: linear-gradient(165deg, var(--primary-dark) 0%, var(--primary) 40%, var(--primary-light) 100%);
  padding: 36px 20px 28px;
  text-align: center;
  overflow: hidden;
}
.notation-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse 80% 60% at 20% 80%, rgba(184,148,75,0.06) 0%, transparent 50%),
              radial-gradient(ellipse 60% 50% at 80% 20%, rgba(184,148,75,0.04) 0%, transparent 50%);
  pointer-events: none;
}
.notation-name {
  font-size: var(--font-2xl);
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.08em;
  font-family: var(--font-heading);
  position: relative;
}
.notation-meta {
  font-size: var(--font-sm);
  color: rgba(255,255,255,0.4);
  margin-top: 6px;
}

.notation-swiper { width: 100%; overflow: hidden; }
.nota-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  z-index: 50;
}
.nota-nav-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}
.nota-nav-btn:active { opacity: 0.7; }
.notation-image-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  background: var(--bg);
  min-height: 300px;
}
.notation-full-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}
.page-indicator {
  text-align: center;
  padding: 8px;
  font-size: var(--font-xs);
  color: var(--text-muted);
  background: var(--bg-white);
  letter-spacing: 0.03em;
}
.notation-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  background: var(--bg-white);
}
.notation-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: all 0.3s ease;
  cursor: pointer;
  padding: 8px;
  background-clip: content-box;
}
.notation-dot.active { background: var(--gold); width: 24px; border-radius: 3px; }

.ritual-header {
  position: relative;
  background: linear-gradient(165deg, var(--primary-dark) 0%, var(--primary) 40%, var(--primary-light) 100%);
  padding: 48px 20px 40px;
  text-align: center;
  overflow: hidden;
}
.ritual-header::before {
  content: '';
  position: absolute;
  top: -60%; left: 50%;
  transform: translateX(-50%);
  width: 200%; height: 200%;
  background: radial-gradient(ellipse at center, rgba(184,148,75,0.08) 0%, transparent 60%);
  pointer-events: none;
}
.ritual-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.3;
}
.ritual-detail-name {
  font-size: var(--font-2xl);
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.1em;
  font-family: var(--font-heading);
  position: relative;
}
.ritual-detail-meta {
  font-size: var(--font-sm);
  color: rgba(255,255,255,0.4);
  margin-top: 8px;
  letter-spacing: 0.05em;
}
.section-title {
  font-size: var(--font-xs);
  color: var(--text-muted);
  padding: 18px 14px 8px;
  font-weight: 500;
  letter-spacing: 0.05em;
}
.steps-list { padding: 0 12px; }
.ritual-step {
  background: var(--bg-card);
  border-radius: var(--radius);
  margin: 8px 0;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: box-shadow 0.2s ease;
}
.step-header {
  display: flex;
  align-items: flex-start;
  padding: 14px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-warm);
  gap: 12px;
}
.step-order {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: white; flex-shrink: 0;
  font-weight: 600;
  font-family: var(--font-heading);
}
.step-MUSIC   { background: var(--gold); }
.step-CHANT   { background: var(--primary); }
.step-RECITE  { background: #5b7a9d; }
.step-ACTION  { background: #5b8c5a; }
.step-default { background: var(--text-muted); }
.step-info { flex: 1; min-width: 0; }
.step-title {
  font-size: var(--font-md);
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-heading);
  letter-spacing: 0.03em;
  word-break: break-all;
  line-height: 1.5;
}
.step-type-label {
  display: inline-block;
  font-size: 10px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 1px 7px;
  margin-top: 5px;
  letter-spacing: 0.04em;
}
.step-body {
  padding: 16px 14px;
}
.step-desc {
  font-size: var(--font-base);
  color: var(--text-body);
  line-height: 2;
  white-space: pre-wrap;
  word-break: break-all;
  letter-spacing: 0.02em;
}
.step-lyrics {
  margin-top: 14px;
  padding: 14px;
  background: var(--gold-bg);
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}
.lyrics-title {
  font-size: var(--font-xs);
  color: var(--gold);
  margin-bottom: 8px;
  letter-spacing: 0.05em;
  font-family: var(--font-heading);
}
.lyrics-content {
  font-size: var(--font-base);
  color: #4a3f2e;
  line-height: 2.2;
  white-space: pre-wrap;
  word-break: break-all;
  letter-spacing: 0.02em;
}
.locked-hint {
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
  font-size: var(--font-base);
}
.mine-page { min-height: 100vh; background: var(--bg); padding-bottom: 20px; }
.user-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 20px 40px;
  background: linear-gradient(165deg, var(--primary-dark), var(--primary) 50%, var(--primary-light));
  position: relative;
  overflow: hidden;
}
.user-card::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(184,148,75,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.user-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 20%; right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(184,148,75,0.4), transparent);
}
.user-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(184,148,75,0.4);
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--gold);
  position: relative;
}
.user-name {
  font-size: var(--font-xl);
  font-weight: 500;
  color: var(--gold-light);
  margin-top: 12px;
  font-family: var(--font-heading);
  letter-spacing: 0.06em;
}
.user-email {
  font-size: var(--font-sm);
  color: rgba(255,255,255,0.7);
  margin-top: 4px;
  letter-spacing: 0.03em;
  word-break: break-all;
}
.stats-row {
  display: flex;
  background: var(--bg-card);
  margin: -8px 12px 0;
  border-radius: var(--radius-md);
  padding: 18px 0;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  position: relative;
  z-index: 1;
}
.stat-item {
  flex: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-val {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  font-family: var(--font-heading);
}
.stat-label {
  font-size: var(--font-2xs);
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* ── 试用状态徽章（用户卡片内） ── */
.access-badge {
  display: inline-block;
  margin-top: 10px;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: var(--font-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: all 0.3s ease;
}
.access-badge.trial {
  background: rgba(91,140,90,0.22);
  color: #a5d6a7;
  border: 1px solid rgba(91,140,90,0.4);
}
.access-badge.permanent {
  background: rgba(184,148,75,0.2);
  color: var(--gold-light);
  border: 1px solid rgba(184,148,75,0.4);
}
.access-badge.expired {
  background: rgba(192,57,43,0.25);
  color: #ef9a9a;
  border: 1px solid rgba(192,57,43,0.4);
}
/* ── 激活 CTA 卡片 ── */
.activate-cta {
  margin: 0 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(184,148,75,0.2);
  position: relative;
  overflow: hidden;
}
.activate-cta::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 120px; height: 100%;
  background: radial-gradient(ellipse at 100% 50%, rgba(184,148,75,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.activate-cta-info { flex: 1; position: relative; }
.activate-cta-title {
  font-size: var(--font-base);
  font-weight: 600;
  color: var(--gold-light);
  font-family: var(--font-heading);
  letter-spacing: 0.04em;
}
.activate-cta-desc {
  font-size: var(--font-xs);
  color: rgba(255,255,255,0.5);
  margin-top: 3px;
  letter-spacing: 0.02em;
}
.activate-cta-btn {
  flex-shrink: 0;
  padding: 10px 22px;
  background: var(--gold);
  color: #fff;
  border-radius: var(--radius-full);
  font-size: var(--font-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: all 0.2s ease;
  white-space: nowrap;
  position: relative;
}
.activate-cta-btn:active { transform: scale(0.95); opacity: 0.9; }
.menu-list {
  margin: 12px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}
.menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 14px;
  font-size: var(--font-base);
  color: var(--text-body);
  border-bottom: 1px solid var(--border-light);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: var(--bg-warm); }
.menu-arrow { color: var(--text-muted); font-size: 14px; font-family: var(--font-heading); }
.menu-hint { color: var(--primary); font-size: 12px; padding: 2px 8px; }
.menu-item-logout { color: #e74c3c; }
.menu-item-logout:active { background: rgba(231,76,60,0.08); }
.version-text {
  text-align: center;
  padding: 32px 12px 8px;
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.5;
  letter-spacing: 0.04em;
  user-select: none;
}
.modal-mask {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(12,12,20,0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
  width: 290px;
  max-width: 88vw;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
}
.modal-title {
  font-size: var(--font-lg);
  font-weight: 600;
  text-align: center;
  margin-bottom: 18px;
  color: var(--text);
  font-family: var(--font-heading);
  letter-spacing: 0.05em;
}
.modal-btn {
  padding: 15px 0;
  text-align: center;
  font-size: var(--font-base);
  color: var(--primary);
  border-top: 1px solid var(--border-light);
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 0.03em;
  transition: background 0.15s;
}
.modal-btn:active { background: var(--bg-warm); }
.modal-cancel { color: var(--text-muted); }

.admin-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: var(--font-base);
  margin-bottom: 10px;
  border: 1px solid var(--border);
  transition: border-color 0.2s;
}
.admin-input:focus { border-color: var(--gold); }
.admin-textarea {
  width: 100%;
  height: 180px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: var(--font-sm);
  margin-bottom: 10px;
  border: 1px solid var(--border);
  resize: vertical;
  transition: border-color 0.2s;
}
.admin-textarea:focus { border-color: var(--gold); }
.admin-btns { display: flex; gap: 10px; }
.admin-btn-cancel {
  flex: 1;
  padding: 12px 0;
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-secondary);
  font-size: var(--font-base);
  text-align: center;
  letter-spacing: 0.03em;
}
.admin-btn-save {
  flex: 1;
  padding: 12px 0;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--gold-light);
  font-size: var(--font-base);
  text-align: center;
  letter-spacing: 0.03em;
}
.admin-btn-save:active { opacity: 0.85; }
.about-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 20px 48px;
  background: linear-gradient(165deg, var(--primary-dark), var(--primary) 50%, var(--primary-light));
  position: relative;
  overflow: hidden;
}
.about-header::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(184,148,75,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.about-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 15%; right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.3;
}
.about-logo { font-size: 52px; margin-bottom: 14px; position: relative; }
.about-app-name {
  font-size: var(--font-2xl);
  font-weight: 700;
  color: var(--gold);
  font-family: var(--font-heading);
  letter-spacing: 0.12em;
  position: relative;
}
.about-version {
  font-size: var(--font-sm);
  color: rgba(255,255,255,0.35);
  margin-top: 6px;
  letter-spacing: 0.05em;
}
.about-section { padding: 14px; }
.about-section-title {
  font-size: var(--font-sm);
  color: var(--text-muted);
  padding: 12px 0 6px;
  font-weight: 500;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 6px;
}
.feature-item {
  display: flex;
  align-items: flex-start;
  padding: 8px 0;
  gap: 10px;
}
.feature-icon { font-size: 18px; flex-shrink: 0; width: 24px; text-align: center; }
.feature-text { font-size: var(--font-base); color: var(--text-secondary); line-height: 1.6; }
.contact-item {
  display: flex;
  align-items: center;
  padding: 14px;
  background: var(--bg-card);
  border-radius: var(--radius);
  -webkit-tap-highlight-color: transparent;
  border: 1px solid var(--border-light);
}
.contact-label { font-size: var(--font-base); color: var(--text-body); flex-shrink: 0; }
.contact-value { font-size: var(--font-sm); color: var(--primary); margin-left: auto; margin-right: 6px; }
.contact-hint { font-size: var(--font-2xs); color: var(--text-muted); }
.about-footer {
  text-align: center;
  padding: 40px;
  font-size: var(--font-sm);
  color: var(--text-muted);
  letter-spacing: 0.05em;
  font-family: var(--font-heading);
}

.my-rituals-page { min-height: 100vh; background: var(--bg); padding-bottom: 20px; }
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
}
.count-text { font-size: var(--font-sm); color: var(--text-muted); }
.new-btn {
  background: var(--primary);
  color: var(--gold-light);
  font-size: var(--font-sm);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  letter-spacing: 0.03em;
  transition: all 0.2s ease;
}
.new-btn:active { opacity: 0.85; }
.set-list { padding: 0 12px; }
.set-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: box-shadow 0.2s;
}
.set-card:active { box-shadow: var(--shadow); }
.set-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
}
.set-title {
  font-size: var(--font-md);
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-heading);
  letter-spacing: 0.03em;
}
.set-count { font-size: var(--font-xs); color: var(--text-muted); }
.set-actions {
  display: flex;
  gap: 18px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
  font-size: var(--font-sm);
  color: var(--primary);
}
.set-actions span { -webkit-tap-highlight-color: transparent; }
.act-del { color: var(--danger); }
.editor-mask {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg);
  z-index: 200;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.editor-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  font-size: var(--font-base);
  position: sticky;
  top: 0;
  z-index: 5;
}
.editor-title { font-size: var(--font-md); font-weight: 600; font-family: var(--font-heading); letter-spacing: 0.04em; }
.editor-done { color: var(--gold); font-weight: 600; -webkit-tap-highlight-color: transparent; }
.editor-body { flex: 1; overflow-y: auto; padding: 14px; }
.title-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-card);
  border-radius: var(--radius);
  font-size: var(--font-md);
  font-weight: 600;
  margin-bottom: 14px;
  border: 2px solid var(--primary);
  font-family: var(--font-heading);
  letter-spacing: 0.03em;
}
.notations-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px;
  border: 1px solid var(--border-light);
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: var(--font-sm);
  color: var(--text-secondary);
}
.add-btn { color: var(--gold); font-weight: 500; }
.notation-item {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  gap: 8px;
}
.ni-order { width: 26px; text-align: center; font-size: var(--font-xs); color: var(--text-muted); flex-shrink: 0; }
.ni-name { flex: 1; font-size: var(--font-base); color: var(--text-body); }
.ni-actions { display: flex; gap: 8px; font-size: 13px; color: var(--primary); }
.ni-remove { color: var(--danger); }
.ni-actions span { -webkit-tap-highlight-color: transparent; padding: 2px 5px; border-radius: var(--radius-xs); }
.ni-actions span:active { background: rgba(0,0,0,0.04); }
/* Drag handle */
.ni-drag-handle {
  width: 28px;
  text-align: center;
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 14px;
  cursor: grab;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: none;
}
.ni-drag-handle:active { cursor: grabbing; }
.notation-item.dragging {
  opacity: 0.5;
  background: var(--gold-subtle);
}
.notation-item.drag-over {
  border-top: 2px solid var(--gold);
  background: rgba(184,148,75,0.06);
}
/* Delete button in editor */
.ni-delete {
  color: var(--danger);
  font-size: 13px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  -webkit-tap-highlight-color: transparent;
}
.ni-delete:active { background: rgba(231,76,60,0.1); }

.picker-mask {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(12,12,20,0.6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 210;
  display: flex;
  align-items: flex-end;
}
.picker-panel {
  background: var(--bg-card);
  width: 100%;
  height: 100%;
  border-radius: 0;
  padding: 16px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  position: relative;
}
.picker-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.picker-title { font-size: var(--font-md); font-weight: 600; font-family: var(--font-heading); letter-spacing: 0.04em; }
.picker-search {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius-full);
  font-size: var(--font-base);
  margin-bottom: 10px;
  border: 1px solid var(--border-light);
}
.picker-search:focus { border-color: var(--gold); }
.picker-body { position: relative; display: flex; flex-direction: column; flex: 1; min-height: 0; }
.picker-list { overflow-y: auto; flex: 1; min-height: 0; position: relative; padding-right: 26px; }
.picker-group { margin-bottom: 2px; }
.picker-group-title {
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
  padding: 8px 2px 2px;
  font-family: var(--font-heading);
  letter-spacing: 0.08em;
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 1;
}
.picker-letter-nav {
  position: absolute;
  right: 2px; top: 104px; bottom: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  z-index: 5;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.picker-letter-item {
  width: 20px; height: 19px;
  line-height: 19px;
  text-align: center;
  font-size: 10px;
  color: var(--text-muted);
  border-radius: 50%;
  font-weight: 500;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.picker-letter-item.active {
  color: var(--gold);
  background: var(--primary);
  font-weight: 600;
  transform: scale(1.15);
}
.picker-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px 12px 0;
  border-bottom: 1px solid var(--border-light);
  -webkit-tap-highlight-color: transparent;
}
.pi-name { font-size: var(--font-base); color: var(--text-body); }
.pi-add { font-size: 20px; color: var(--gold); font-weight: 600; width: 28px; text-align: center; }
.pv-swiper { background: var(--bg); }
.pv-slide {
  width: 100%;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 18px;
}
.pv-img-wrap { width: 100%; display: flex; justify-content: center; }
.pv-img { width: 100%; height: auto; border-radius: var(--radius-xs); }
.pv-noimg { font-size: 48px; color: var(--text-muted); margin-bottom: 10px; }
.pv-name {
  font-size: var(--font-base);
  color: var(--text-secondary);
  text-align: center;
  margin-top: 10px;
  font-family: var(--font-heading);
  letter-spacing: 0.04em;
}
.pv-text-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: calc(100vh - 160px);
  background: #fff;
}
.pv-text-content {
  font-size: 22px;
  font-family: "KaiTi","STKaiti","FangSong","仿宋","楷体",serif;
  color: #2c2c2c;
  line-height: 1.8;
  text-align: center;
  white-space: pre-wrap;
  word-break: break-word;
  max-width: 88%;
  box-sizing: border-box;
}
.pv-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
  padding: 14px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-light);
}
.pv-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--gold-light);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.pv-btn:active { background: var(--primary-light); transform: scale(0.95); }
.pv-info {
  font-size: var(--font-base);
  color: var(--text);
  min-width: 60px;
  text-align: center;
  font-family: var(--font-heading);
}

.fav-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 22px;
  z-index: 10;
  color: rgba(255,255,255,0.35);
  -webkit-tap-highlight-color: transparent;
  transition: all 0.2s ease;
}
.fav-btn.fav-active { color: var(--fav); animation: heartBeat 0.3s ease; }
@keyframes heartBeat {
  0% { transform: scale(1); }
  50% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.preview-mask {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(12,12,20,0.96);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: previewIn 0.2s ease;
}
@keyframes previewIn { from { opacity: 0; } to { opacity: 1; } }
.preview-img { max-width: 100%; max-height: 90vh; object-fit: contain; }
.preview-text {
  max-width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 48px 32px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}
.preview-text-inner {
  font-size: 26px;
  font-family: "KaiTi","STKaiti","FangSong","仿宋","楷体",serif;
  color: #2c2c2c;
  line-height: 1.8;
  text-align: center;
  word-break: break-word;
}
/* ── 全屏预览工具栏 ── */
.preview-toolbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 302;
  background: linear-gradient(180deg, rgba(12,12,20,0.95) 0%, transparent 100%);
}
.preview-toolbar-close {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  color: var(--gold);
  background: rgba(184,148,75,0.12);
  border-radius: 50%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.2s;
  user-select: none;
}
.preview-toolbar-close:active { background: rgba(184,148,75,0.3); }
.preview-toolbar-page {
  font-size: 14px;
  color: rgba(255,255,255,0.75);
  font-family: var(--font-heading);
  letter-spacing: 0.04em;
}
/* ── 全屏预览底部导航 ── */
.preview-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 16px 12px 24px;
  z-index: 302;
  background: linear-gradient(0deg, rgba(12,12,20,0.95) 0%, transparent 100%);
}
.preview-nav-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--gold-light);
  border: none;
  font-size: 17px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.preview-nav-btn:active { background: var(--primary-light); transform: scale(0.92); }
.preview-nav-btn.disabled {
  opacity: 0.3;
  pointer-events: none;
}
.preview-nav-page {
  font-size: 14px;
  color: rgba(255,255,255,0.75);
  min-width: 50px;
  text-align: center;
  font-family: var(--font-heading);
}

.load-more { text-align: center; padding: 18px; font-size: var(--font-sm); color: var(--text-muted); }
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 72px 0;
  color: var(--text-muted);
}
.empty-icon { font-size: 48px; margin-bottom: 14px; }
.empty-text { font-size: var(--font-base); }
.empty-sub { font-size: var(--font-sm); margin-top: 6px; }
.loading-wrap { text-align: center; padding: 140px; color: var(--text-muted); font-size: var(--font-base); }

.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(26,26,36,0.88);
  color: var(--gold-light);
  padding: 10px 22px;
  border-radius: var(--radius-full);
  font-size: var(--font-base);
  z-index: 400;
  pointer-events: none;
  animation: toastIn 0.25s ease;
  letter-spacing: 0.03em;
  font-family: var(--font-heading);
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.85); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.sanyuan-page { min-height: 100vh; background: var(--bg); padding-bottom: 20px; }
.fav-page { min-height: 100vh; background: var(--bg); padding-bottom: 20px; }

.notification-banner {
  background: var(--primary);
  color: var(--gold-light);
  text-align: center;
  padding: 10px;
  font-size: var(--font-sm);
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 500;
  animation: slideDown 0.3s ease;
  letter-spacing: 0.03em;
}
@keyframes slideDown { from { transform: translateY(-100%); } to { transform: translateY(0); } }

::-webkit-scrollbar { width: 0; height: 0; }

/* ===== Puji Import Dialog ===== */
.top-bar-btns { display: flex; gap: 8px; align-items: center; }
.import-btn {
  background: var(--bg-card);
  color: var(--primary);
  font-size: var(--font-sm);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  letter-spacing: 0.03em;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.import-btn:active { opacity: 0.85; }
.import-hint {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius);
}
.import-textarea {
  width: 100%;
  min-height: 180px;
  padding: 14px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--font-base);
  font-family: var(--font-body);
  color: var(--text);
  line-height: 1.8;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}
.import-textarea:focus { border-color: var(--gold); }
.import-preview { margin-top: 16px; }
.import-preview-title {
  font-size: var(--font-md);
  font-weight: 600;
  font-family: var(--font-heading);
  color: var(--text);
  margin-bottom: 6px;
}
.import-preview-stats {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.import-matched-list, .import-unmatched-list {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  padding: 8px 14px;
  margin-bottom: 10px;
}
.import-matched-item, .import-unmatched-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}
.import-matched-item:last-child, .import-unmatched-item:last-child { border-bottom: none; }
.imi-ok { color: var(--success, #27ae60); font-size: 14px; flex-shrink: 0; }
.imi-no { color: var(--danger, #c0392b); font-size: 14px; flex-shrink: 0; }
.imi-name { font-size: var(--font-base); color: var(--text); }
.import-confirm-btn {
  width: 100%;
  padding: 13px;
  background: var(--primary);
  color: var(--gold-light);
  border: none;
  border-radius: var(--radius);
  font-size: var(--font-base);
  font-weight: 600;
  margin-top: 12px;
  letter-spacing: 0.04em;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.2s ease;
}
.import-confirm-btn:active { opacity: 0.85; }
.import-no-match {
  text-align: center;
  font-size: var(--font-sm);
  color: var(--text-muted);
  padding: 20px 0;
}

/* ===== Admin Management Page ===== */
.admin-tabs { display: flex; background: var(--bg-white); border-bottom: 1px solid var(--border); position: sticky; top: 48px; z-index: 10; }
.admin-tab { flex: 1; text-align: center; padding: 12px 0; font-size: 14px; color: var(--text-secondary); border-bottom: 2px solid transparent; transition: all 0.2s; }
.admin-tab.active { color: var(--gold); border-bottom-color: var(--gold); font-weight: 600; }
.admin-content { padding: 12px; min-height: calc(100vh - 100px); }
.admin-add-btn { width: 100%; padding: 12px; background: var(--gold); color: #fff; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; margin-bottom: 12px; cursor: pointer; }
.admin-add-btn:active { background: var(--gold-light); }
.admin-list { background: var(--bg-white); border-radius: 8px; overflow: hidden; box-shadow: var(--shadow-sm); }
.admin-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border-light); }
.admin-item:last-child { border-bottom: none; }
.admin-item-info { flex: 1; min-width: 0; }
.admin-item-name { display: block; font-size: 14px; color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-item-cat { display: inline-block; font-size: 12px; color: var(--text-light); margin-top: 2px; }
.admin-item-actions { display: flex; gap: 8px; flex-shrink: 0; }
.admin-btn-edit { padding: 6px 14px; background: var(--gold-bg); color: var(--gold); border: 1px solid var(--gold); border-radius: 6px; font-size: 12px; cursor: pointer; }
.admin-btn-edit:active { background: var(--gold); color: #fff; }
.admin-btn-del { padding: 6px 14px; background: #fff; color: #c44; border: 1px solid #c44; border-radius: 6px; font-size: 12px; cursor: pointer; }
.admin-btn-del:active { background: #c44; color: #fff; }

/* Admin Edit Form */
.admin-edit-form { padding: 12px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; font-weight: 500; }
.form-input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; color: var(--text); background: var(--bg-white); box-sizing: border-box; }
.form-input:focus { border-color: var(--gold); outline: none; }
.form-textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; color: var(--text); background: var(--bg-white); box-sizing: border-box; resize: vertical; line-height: 1.8; font-family: inherit; }
.form-textarea:focus { border-color: var(--gold); outline: none; }
.form-radio-group { display: flex; gap: 20px; }
.form-radio { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text); cursor: pointer; }
.form-radio input { width: 18px; height: 18px; accent-color: var(--gold); }
.admin-save-btn { width: 100%; padding: 12px; background: var(--primary); color: var(--gold-light); border: none; border-radius: 8px; font-size: 15px; font-weight: 600; margin-top: 8px; cursor: pointer; }
.admin-save-btn:active { background: var(--primary-light); }

/* Admin Images */
.admin-images { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.admin-img-item { width: calc(50% - 5px); background: var(--bg-white); border-radius: 8px; overflow: hidden; box-shadow: var(--shadow-sm); }
.admin-img-item img { width: 100%; height: 120px; object-fit: cover; display: block; cursor: pointer; background: var(--bg); }
.admin-img-info { padding: 6px 8px; font-size: 11px; color: var(--text-light); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-img-actions { display: flex; gap: 4px; padding: 0 8px 8px; }
.admin-btn-move { width: 28px; height: 28px; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 6px; font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.admin-btn-move:active { background: var(--gold-bg); }
.admin-img-actions .admin-btn-del { flex: 1; padding: 4px; text-align: center; }
.admin-upload-area { border: 2px dashed var(--border); border-radius: 8px; padding: 20px; text-align: center; }
.admin-upload-area input[type=file] { font-size: 13px; }
.admin-upload-hint { font-size: 12px; color: var(--text-light); margin-top: 6px; }

/* Admin Search */
.admin-search-wrap { padding: 8px 12px; background: var(--bg-white); border-bottom: 1px solid var(--border-light); }
.admin-search-input { width: 100%; padding: 8px 14px; border: 1px solid var(--border); border-radius: 20px; font-size: 14px; background: var(--bg); color: var(--text); box-sizing: border-box; }
.admin-search-input:focus { border-color: var(--gold); outline: none; }
.admin-search-input::placeholder { color: var(--text-muted); }

/* Admin Pending Images (new notation) */
.admin-pending-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.admin-pending-item { width: calc(50% - 4px); background: var(--bg-white); border-radius: 8px; overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--border-light); }
.admin-pending-item img { width: 100%; height: 80px; object-fit: cover; display: block; }
.admin-pending-item span { display: block; padding: 4px 8px; font-size: 11px; color: var(--text-light); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Admin: 邀请码管理 ── */
.admin-stats-cards { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; }
.admin-stat-card { flex: 1 1 calc(50% - 4px); min-width: calc(50% - 4px); background: var(--gold-bg); border-radius: 10px; padding: 14px 10px; text-align: center; border: 1px solid var(--gold-pale); }
.stat-num { font-size: 28px; font-weight: 700; color: var(--gold); }
.stat-label { font-size: 12px; color: var(--text-light); margin-top: 4px; }

.admin-generate-section { display: flex; align-items: center; gap: 8px; padding: 12px; background: var(--bg-white); border-bottom: 1px solid var(--border-light); }
.generate-label { font-size: 14px; color: var(--text); white-space: nowrap; }
.admin-gen-input { width: 60px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; text-align: center; }
.admin-gen-btn { padding: 6px 18px; background: var(--gold); color: #fff; border: none; border-radius: 6px; font-size: 14px; font-weight: 600; cursor: pointer; }
.admin-gen-btn:active { background: var(--gold-light); }

.admin-codes-filter { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--bg); border-bottom: 1px solid var(--border-light); }
.filter-label { font-size: 13px; color: var(--text-light); }
#admin-codes-filter { padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: var(--bg-white); color: var(--text); }

.admin-codes-list { padding: 8px 12px; }
.admin-code-item { background: var(--bg-white); border-radius: 10px; padding: 12px; margin-bottom: 8px; box-shadow: var(--shadow-sm); border: 1px solid var(--border-light); }
.code-main { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.code-value { font-size: 18px; font-weight: 700; font-family: monospace; color: var(--primary); letter-spacing: 2px; }
.code-status { font-size: 12px; padding: 2px 10px; border-radius: 10px; font-weight: 600; }
.code-status.unused { background: #e6f7e6; color: #389e0d; }
.code-status.used { background: #f0f0f0; color: #8c8c8c; }
.code-detail { display: flex; gap: 16px; font-size: 12px; color: var(--text-light); }
.code-actions { display: flex; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-light); }
.admin-btn-copy { padding: 4px 14px; background: var(--gold-bg); color: var(--gold); border: 1px solid var(--gold-pale); border-radius: 6px; font-size: 13px; cursor: pointer; }
.admin-btn-copy:active { background: var(--gold-pale); }

@media (min-width: 768px) {
  body {
    max-width: 480px;
    margin: 0 auto;
    box-shadow: 0 0 50px rgba(26,26,36,0.15);
    min-height: 100vh;
  }
  #app { min-height: 100vh; }
}
