/* 星眠 H5 — 组件样式 */

/* ===== Tab Bar ===== */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  padding: 6px 4px calc(6px + var(--safe-bottom));
  background: #111113;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--transition-fast);
}
.tab-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
}
.tab-label {
  font-size: 10px;
  color: #7c7c85;
  transition: color var(--transition-fast);
}
.tab-item--active .tab-label {
  color: #ff5d6c;
}
.tab-item--center {
  position: relative;
  margin-top: -18px;
}
.tab-item--center .tab-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary-end));
  box-shadow: 0 4px 14px rgba(255, 68, 102, 0.35);
  padding: 10px;
}

/* ===== Toast ===== */
#toast-container {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast-item {
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  background: rgba(31, 32, 39, 0.95);
  color: var(--text-primary);
  font-size: var(--text-md);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: auto;
  max-width: 80vw;
  text-align: center;
}
.toast-item--show {
  opacity: 1;
  transform: translateY(0);
}
.toast-msg {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Loading Overlay ===== */
#loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.loading-overlay--show {
  opacity: 1;
  pointer-events: auto;
}
.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.loading-text {
  margin-top: 12px;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Modal ===== */
#modal-container {
  position: fixed;
  inset: 0;
  z-index: 9990;
  pointer-events: none;
}
.modal-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  pointer-events: auto;
}
.modal-box {
  width: 300px;
  max-width: 85vw;
  padding: 24px 20px 16px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.4);
  text-align: center;
}
.modal-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.modal-content {
  font-size: var(--text-md);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}
.modal-actions {
  display: flex;
  gap: 10px;
}
.modal-btn {
  flex: 1;
  padding: 10px 0;
  border-radius: var(--radius-pill);
  font-size: var(--text-md);
  font-weight: 600;
  transition: opacity var(--transition-fast);
}
.modal-btn:active { opacity: 0.7; }
.modal-btn--cancel {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}
.modal-btn--confirm {
  background: rgba(255, 93, 108, 0.15);
  color: var(--color-primary);
}

/* ===== Action Sheet ===== */
.action-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 9970;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  padding-bottom: var(--safe-bottom);
}
.action-sheet-overlay--hide {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.action-sheet {
  width: 100%;
  max-width: 500px;
  padding: 8px 12px 0;
}
.action-sheet-item {
  padding: 16px;
  text-align: center;
  font-size: var(--text-lg);
  color: var(--text-primary);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  margin-bottom: 2px;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.action-sheet-item:active { background: rgba(255, 255, 255, 0.04); }
.action-sheet-cancel {
  padding: 14px;
  text-align: center;
  font-size: var(--text-lg);
  color: var(--text-secondary);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  margin-top: 8px;
  cursor: pointer;
}
.action-sheet-cancel:active { background: rgba(255, 255, 255, 0.04); }

/* ===== Picker ===== */
.picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 9960;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  padding-bottom: var(--safe-bottom);
}
.picker-overlay--hide {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.picker-panel {
  width: 100%;
  max-width: 500px;
  max-height: 60vh;
  background: var(--bg-card);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.picker-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.picker-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
}
.picker-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-size: var(--text-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}
.picker-close:active { background: rgba(255, 255, 255, 0.12); }
.picker-list {
  overflow-y: auto;
  padding: 8px 0;
}
.picker-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.picker-item:active { background: rgba(255, 255, 255, 0.04); }
.picker-item--active {
  background: rgba(255, 93, 108, 0.08);
}
.picker-item-name {
  flex: 1;
  font-size: var(--text-md);
  color: var(--text-primary);
}
.picker-item-desc {
  font-size: var(--text-xs);
}
.picker-item-check {
  color: var(--color-primary);
  font-size: var(--text-lg);
  font-weight: 700;
}

/* ===== Recording Bar ===== */
.recording-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9950;
  padding: calc(var(--safe-top) + 6px) 16px 8px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.recording-bar--hide {
  opacity: 0;
  transition: opacity 0.2s ease;
}
.recording-bar-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: rgba(255, 59, 48, 0.12);
  border: 1px solid rgba(255, 59, 48, 0.2);
}
.recording-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff3b30;
  animation: pulse-dot 0.8s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}
.recording-time {
  font-size: var(--text-md);
  font-weight: 600;
  color: #ff453a;
  min-width: 36px;
}
.recording-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  flex: 1;
  text-align: center;
}

/* ===== Sidebar ===== */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 9900;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  justify-content: flex-end;
}
.sidebar-panel {
  width: 300px;
  max-width: 80vw;
  height: 100%;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  animation: slideInRight 0.25s ease;
}
@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 12px) 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.sidebar-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
}
.sidebar-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-size: var(--text-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}
.sidebar-close:active { background: rgba(255, 255, 255, 0.12); }
.sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
.sidebar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  transition: background var(--transition-fast);
  font-size: var(--text-md);
  color: var(--text-primary);
}
.sidebar-row:active { background: rgba(255, 255, 255, 0.03); }

/* ===== Toggle Switch ===== */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  transition: background var(--transition-normal);
}
.toggle-slider::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition-normal);
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--color-primary);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* ===== Text Input Overlay ===== */
.text-input-overlay {
  position: fixed;
  inset: 0;
  z-index: 9920;
  display: flex;
  align-items: flex-end;
  background: rgba(0, 0, 0, 0.5);
}
.text-input-panel {
  width: 100%;
  background: var(--bg-card);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 16px 16px calc(16px + var(--safe-bottom));
}
.text-input-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.text-input-cancel {
  font-size: var(--text-md);
  color: var(--text-secondary);
  padding: 4px 8px;
}
.text-input-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
}
.text-input-confirm {
  font-size: var(--text-md);
  color: var(--color-primary);
  font-weight: 600;
  padding: 4px 8px;
}

/* ===== Chat Layout ===== */
.chat-header {
  flex-shrink: 0;
}
.chat-scroll {
  -webkit-overflow-scrolling: touch;
}
.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-empty {
  padding: 40px 0;
}
.chat-row {
  display: flex;
  animation: fadeIn 0.25s ease;
}
.chat-row--user {
  justify-content: flex-end;
}
.chat-row--ai {
  justify-content: flex-start;
}
.chat-input-bar {
  flex-shrink: 0;
}

/* ===== Suggestions ===== */
.suggestions-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.suggestion-btn {
  cursor: pointer;
  font-size: var(--text-xs);
  transition: background var(--transition-fast);
}
.suggestion-btn:active {
  background: rgba(255, 255, 255, 0.14);
}

/* ===== Plus Menu ===== */
.plus-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 9910;
  display: flex;
  align-items: flex-end;
  background: rgba(0, 0, 0, 0.5);
}
.plus-menu {
  width: 100%;
  max-width: 500px;
  background: var(--bg-card);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding-bottom: var(--safe-bottom);
}
.plus-menu-item {
  padding: 16px 20px;
  font-size: var(--text-md);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background var(--transition-fast);
}
.plus-menu-item:active { background: rgba(255, 255, 255, 0.04); }
.plus-menu-cancel:active { background: rgba(255, 255, 255, 0.12); }

/* ===== Custom Nav ===== */
.custom-nav {
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* ===== Immersive Swiper ===== */
.immersive-swiper {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.immersive-card {
  flex: 0 0 100vw;
  scroll-snap-align: center;
}
.immersive-hero {
  padding: 0 16px;
}

/* ===== Role Grid (Discover) ===== */
.role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.role-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition-fast);
  position: relative;
}
.role-card:active { transform: scale(0.97); }
.role-card-cover {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
}
.role-card-info {
  padding: 10px 14px 14px;
  flex: 1;
}
.role-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.role-card-name {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text-primary);
}
.role-card-title {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.role-card-quote {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.role-card-skeleton {
  padding: 0;
  background: var(--bg-card);
  border-radius: var(--radius-card);
  overflow: hidden;
}

/* ===== Category Cards ===== */
.category-scroll {
  -webkit-overflow-scrolling: touch;
}
.category-card {
  flex: 0 0 140px;
  height: 90px;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition-fast);
}
.category-card:active { transform: scale(0.96); }
.category-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 20%, rgba(0,0,0,0.6) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10px 12px;
}
.category-card-name {
  font-size: var(--text-md);
  font-weight: 700;
  color: #fff;
}
.category-card-desc {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 2px;
}
.filter-scroll {
  -webkit-overflow-scrolling: touch;
}
.search-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background var(--transition-fast);
}
.search-btn:active { background: rgba(255, 255, 255, 0.12); }
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 0;
}

/* ===== Announcement Card ===== */
.announcement-card {
  cursor: pointer;
  transition: transform var(--transition-fast);
}
.announcement-card:active { transform: scale(0.98); }

/* ===== Messages ===== */
.chat-list {
  display: flex;
  flex-direction: column;
}
.chat-list-item {
  cursor: pointer;
}
.chat-swipe-content {
  background: var(--bg-card);
}
.unread-dot {
  flex-shrink: 0;
}

/* ===== Profile ===== */
.profile-header {
  position: relative;
}
.profile-stats {
  text-align: center;
}
.profile-stat {
  text-align: center;
  flex: 1;
}
.profile-stat-num {
  display: block;
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
}
.profile-action {
  cursor: pointer;
  transition: transform var(--transition-fast);
}
.profile-action:active { transform: scale(0.96); }
.profile-menu-item {
  cursor: pointer;
  transition: background var(--transition-fast);
}
.profile-menu-item:active { background: rgba(255, 255, 255, 0.03); }

/* ===== Settings ===== */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-md);
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.settings-row:active { background: rgba(255, 255, 255, 0.03); }

/* ===== Wallet (matches mini-program) ===== */
.wallet-page {
  position: relative;
  padding: 0 16px 60px;
  min-height: 100vh;
  box-sizing: border-box;
  overflow: hidden;
}

/* Ambient glows */
.wallet-glow {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
}
.wallet-glow--1 {
  top: -100px;
  left: -50px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(80, 180, 200, 0.12), transparent 70%);
}
.wallet-glow--2 {
  top: 50px;
  right: -75px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(100, 200, 180, 0.08), transparent 70%);
}

/* Header */
.wallet-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0 20px;
  z-index: 1;
}
.wallet-header__label {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}
.wallet-header__amount {
  margin-top: 4px;
  font-size: 40px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}
.wallet-header__split {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.wallet-header__tag {
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.06);
}
.wallet-header__icon {
  width: 50px;
  height: 50px;
}

/* Quick links */
.wallet-links {
  position: relative;
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  z-index: 1;
}
.wallet-link {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 10px;
  border-radius: 6px;
  background: rgba(255,255,255,0.04);
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
}
.wallet-link:active { background: rgba(255,255,255,0.08); }
.wallet-link__arrow {
  color: rgba(255,255,255,0.3);
  font-size: 16px;
}

/* Section */
.wallet-section {
  position: relative;
  margin-bottom: 16px;
  z-index: 1;
}
.wallet-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.wallet-section__title {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  margin-bottom: 10px;
}
.wallet-section__head .wallet-section__title {
  margin-bottom: 0;
}

/* Payment method selector */
.wallet-pay-methods {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.wallet-pay-method {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px;
  border-radius: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: all 0.15s;
}
.wallet-pay-method:active { background: rgba(255,255,255,0.08); }
.wallet-pay-method--active {
  background: rgba(100, 220, 200, 0.1);
  border-color: rgba(100, 220, 200, 0.4);
  color: #64DCc8;
}

.wallet-section__close {
  font-size: 12px;
  color: rgba(255,255,255,0.3);
  cursor: pointer;
}

/* Recharge grid */
.wallet-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.wallet-card {
  position: relative;
  padding: 14px 6px 12px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%);
  text-align: center;
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
  transition: all 0.15s;
  cursor: pointer;
}
.wallet-card:active {
  transform: scale(0.97);
  border-color: rgba(255,255,255,0.15);
}
.wallet-card--active {
  border-color: rgba(100, 220, 200, 0.5);
  background: linear-gradient(180deg, rgba(100, 220, 200, 0.1) 0%, rgba(100, 220, 200, 0.03) 100%);
}
.wallet-card__badge {
  position: absolute;
  top: -1px;
  right: -1px;
  padding: 2px 6px;
  border-radius: 5px 5px 5px 0;
  font-size: 9px;
  font-weight: 600;
  color: #0a0a0f;
  background: linear-gradient(135deg, #64DCc8, #4ECDC4);
}
.wallet-card__icon {
  width: 28px;
  height: 28px;
  margin-bottom: 4px;
}
.wallet-card__coins {
  font-size: 14px;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
}
.wallet-card__price {
  margin-top: 4px;
  font-size: 11px;
  color: rgba(255,255,255,0.35);
}

/* Transaction list */
.wallet-list {
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,0.06);
}
.wallet-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.wallet-item:last-child { border-bottom: none; }
.wallet-item__name {
  font-size: 14px;
  color: rgba(255,255,255,0.7);
}
.wallet-item__time {
  margin-top: 3px;
  font-size: 11px;
  color: rgba(255,255,255,0.2);
}
.wallet-item__amount {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
}
.wallet-item__amount--in { color: #64DCc8; }
.wallet-nodata {
  padding: 24px 0;
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,0.15);
}

/* Agreement */
.wallet-agreement {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 16px;
  z-index: 1;
}
.wallet-agreement__check {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  box-sizing: border-box;
  cursor: pointer;
  flex-shrink: 0;
}
.wallet-agreement__check--on {
  background: #64DCc8;
  border-color: #64DCc8;
}
.wallet-agreement__text {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
}
.wallet-agreement__link {
  color: #64DCc8;
  cursor: pointer;
}

/* Empty */
.wallet-empty {
  position: relative;
  padding: 60px 0;
  text-align: center;
  z-index: 1;
}
.wallet-empty__text {
  font-size: 14px;
  color: rgba(255,255,255,0.25);
}

/* Payment overlay */
.wallet-pay-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}
.wallet-pay-card {
  padding: 32px 24px;
  border-radius: 16px;
  background: var(--bg-surface);
  text-align: center;
  max-width: 300px;
  width: 90%;
}
.wallet-pay-btn {
  display: block;
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 10px;
}
.wallet-pay-btn:active { opacity: 0.8; }
.wallet-pay-btn--wechat {
  color: #fff;
  background: #07C160;
}
.wallet-pay-btn--alipay {
  color: #fff;
  background: #1677FF;
}
.wallet-pay-close {
  display: block;
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: none;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.5);
  font-size: 14px;
  cursor: pointer;
}

/* ===== Checkin (matches mini-program) ===== */
.checkin-page {
  position: relative;
  padding: 0 16px 60px;
  min-height: 100vh;
  box-sizing: border-box;
  overflow: hidden;
}

/* Ambient glows */
.checkin-glow {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
}
.checkin-glow--1 {
  top: -75px;
  left: -50px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(100, 220, 200, 0.1), transparent 70%);
}
.checkin-glow--2 {
  top: 100px;
  right: -100px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(100, 180, 220, 0.06), transparent 70%);
}

/* Stats */
.checkin-stats {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 24px 0 20px;
  z-index: 1;
}
.checkin-stat {
  text-align: center;
}
.checkin-stat--main {
  min-width: 60px;
}
.checkin-stat__value {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
}
.checkin-stat--main .checkin-stat__value {
  font-size: 28px;
  color: #64DCc8;
}
.checkin-stat__label {
  margin-top: 4px;
  font-size: 11px;
  color: rgba(255,255,255,0.4);
}

/* Calendar */
.checkin-calendar {
  position: relative;
  padding: 16px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  z-index: 1;
}
.checkin-calendar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.checkin-calendar__nav {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.06);
  cursor: pointer;
}
.checkin-calendar__nav:active { background: rgba(255,255,255,0.1); }
.checkin-calendar__month {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
}

/* Weekdays */
.checkin-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 8px;
}
.checkin-weekday {
  text-align: center;
  font-size: 11px;
  color: rgba(255,255,255,0.3);
}

/* Day grid */
.checkin-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.checkin-day {
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.03);
}
.checkin-day--empty { background: transparent; }
.checkin-day--today {
  border: 1px solid rgba(100, 220, 200, 0.5);
}
.checkin-day--checked {
  background: linear-gradient(135deg, rgba(100, 220, 200, 0.25), rgba(100, 220, 200, 0.1));
  color: #64DCc8;
}

/* Checkin button */
.checkin-btn {
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: #0a0a0f;
  background: linear-gradient(135deg, #64DCc8, #4ECDC4);
  cursor: pointer;
}
.checkin-btn:active { opacity: 0.8; }
.checkin-btn--done {
  color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.06);
}

/* Login state */
.checkin-login {
  position: relative;
  padding: 40px 0;
  text-align: center;
  z-index: 1;
}
.checkin-login__text {
  font-size: 14px;
  color: rgba(255,255,255,0.25);
}

/* Daily tasks */
.checkin-tasks {
  position: relative;
  margin-top: 16px;
  padding: 14px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  z-index: 1;
}
.checkin-tasks__title {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  margin-bottom: 10px;
}
.checkin-task {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.checkin-task:last-child { border-bottom: none; }
.checkin-task__name {
  font-size: 14px;
  color: rgba(255,255,255,0.8);
}
.checkin-task__desc {
  margin-top: 2px;
  font-size: 11px;
  color: rgba(255,255,255,0.3);
}
.checkin-task__reward {
  font-size: 14px;
  font-weight: 600;
  color: #64DCc8;
}

/* Invite section */
.checkin-invite {
  position: relative;
  margin-top: 16px;
  padding: 14px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  z-index: 1;
}
.checkin-invite__header { margin-bottom: 12px; }
.checkin-invite__title {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
}
.checkin-invite__subtitle {
  margin-top: 3px;
  font-size: 11px;
  color: rgba(255,255,255,0.35);
}
.checkin-invite__body {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.checkin-invite__code-box {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  background: rgba(100, 220, 200, 0.08);
  border: 1px dashed rgba(100, 220, 200, 0.3);
  text-align: center;
  cursor: pointer;
}
.checkin-invite__code-box:active { background: rgba(100, 220, 200, 0.14); }
.checkin-invite__code-label {
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  margin-bottom: 4px;
}
.checkin-invite__code {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 4px;
  color: #64DCc8;
  font-family: monospace;
}
.checkin-invite__code-hint {
  margin-top: 4px;
  font-size: 10px;
  color: rgba(100, 220, 200, 0.5);
}
.checkin-invite__stats {
  text-align: center;
  min-width: 60px;
}
.checkin-invite__count {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}
.checkin-invite__count-label {
  margin-top: 2px;
  font-size: 10px;
  color: rgba(255,255,255,0.3);
}
.checkin-invite__actions {
  display: flex;
  gap: 8px;
}
.checkin-invite__btn {
  flex: 1;
  padding: 10px;
  border-radius: 7px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.checkin-invite__btn:active { opacity: 0.8; }
.checkin-invite__btn--copy {
  color: #64DCc8;
  background: rgba(100, 220, 200, 0.12);
}
.checkin-invite__btn--share {
  color: #0a0a0f;
  background: linear-gradient(135deg, #64DCc8, #4ECDC4);
}
.checkin-invite__btn--done {
  color: rgba(255,255,255,0.4) !important;
  background: rgba(255,255,255,0.06) !important;
}

/* Wallet link */
.checkin-wallet {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  z-index: 1;
  cursor: pointer;
}
.checkin-wallet__arrow { color: rgba(255,255,255,0.3); }

/* ===== Ranking ===== */
.rank-list {
  display: flex;
  flex-direction: column;
}
.rank-item {
  cursor: pointer;
  transition: transform var(--transition-fast);
}
.rank-item:active { transform: scale(0.98); }
.rank-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: var(--text-sm);
  font-weight: 700;
  flex-shrink: 0;
}
.rank-badge--1 {
  background: linear-gradient(135deg, #f5af19, #f12711);
  color: #fff;
}
.rank-badge--2 {
  background: linear-gradient(135deg, #bdc3c7, #8e9eab);
  color: #fff;
}
.rank-badge--3 {
  background: linear-gradient(135deg, #cd7f32, #8b5a2b);
  color: #fff;
}
.rank-badge--normal {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

/* ===== Search ===== */
.search-history-item {
  cursor: pointer;
}
.search-result-item {
  cursor: pointer;
  transition: transform var(--transition-fast);
}
.search-result-item:active { transform: scale(0.97); }

/* ===== Character Detail ===== */
.character-cover {
  width: 100%;
  object-fit: cover;
}

/* ===== Story Chat ===== */
.story-card {
  border: 1px solid rgba(97, 215, 255, 0.12);
}

/* ===== Responsive ===== */
@media (min-width: 600px) {
  .tab-bar {
    justify-content: center;
    gap: 32px;
  }
  .role-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
