/* ====== 暖伴 NuanBan - Design System ====== */
:root {
  /* Primary Palette - Warm & Trustworthy */
  --color-primary: #E8786A;
  --color-primary-light: #FDE8E5;
  --color-primary-dark: #C75B4E;
  --color-primary-hover: #D4695C;

  /* Secondary - Trust & Calm */
  --color-secondary: #5B9A8B;
  --color-secondary-light: #E6F4F0;
  --color-secondary-dark: #4A7E71;

  /* Accent - Warmth */
  --color-accent: #F4BF4F;
  --color-accent-light: #FFF8E7;
  --color-accent-dark: #D4A430;

  /* Surfaces */
  --color-bg: #FFF8F0;
  --color-bg-card: #FFFFFF;
  --color-bg-input: #FFFDF9;
  --color-bg-warm: #FFF2ED;

  /* Text */
  --color-text: #4A3728;
  --color-text-secondary: #8B7355;
  --color-text-muted: #B8A590;
  --color-text-white: #FFFFFF;

  /* Borders */
  --color-border: #EBDFD3;
  --color-border-light: #F5EDE4;

  /* Status */
  --color-success: #52C41A;
  --color-warning: #FAAD14;
  --color-error: #FF4D4F;
  --color-info: #1890FF;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-xxl: 48px;

  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --line-height-tight: 1.25;
  --line-height-normal: 1.6;
  --line-height-relaxed: 1.75;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(74, 55, 40, 0.06);
  --shadow-md: 0 4px 12px rgba(74, 55, 40, 0.08);
  --shadow-lg: 0 8px 24px rgba(74, 55, 40, 0.12);
  --shadow-xl: 0 12px 40px rgba(74, 55, 40, 0.16);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* Layout */
  --max-width: 480px;
  --header-height: 56px;
  --bottom-nav-height: 60px;
}

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

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

body {
  font-family: var(--font-family);
  font-size: var(--font-size-md);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-hover); }

img { max-width: 100%; height: auto; display: block; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
}

ul, ol { list-style: none; }

/* ====== Typography ====== */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-text);
}

/* ====== Layout Components ====== */
.page-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 var(--space-md);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border-light);
}

.page-header .back-btn {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--color-primary);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-medium);
  background: none;
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
}

.page-header .header-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
}

.page-header .header-action {
  color: var(--color-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-primary-light);
  border-radius: var(--radius-full);
}

.page-content {
  padding: var(--space-md);
  padding-bottom: calc(var(--bottom-nav-height) + var(--space-lg));
}

/* ====== Bottom Navigation ====== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-width);
  height: var(--bottom-nav-height);
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--color-border-light);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-xs) var(--space-sm);
  color: var(--color-text-muted);
  font-size: 0.78rem; /* 适老化：导航文字放大，保证可读性 */
  font-weight: var(--font-weight-medium);
  transition: color var(--transition-fast);
  background: none;
}

.bottom-nav .nav-item.active { color: var(--color-primary); }

/* 含固定底部导航栏的页面：内容预留安全间距，避免被 .bottom-nav 遮挡 */
/* 优先用 JS 给 body 打的 .has-bottom-nav 类（兼容不支持 :has() 的预览/webview 环境），并兜底 :has() */
body.has-bottom-nav,
body:has(.bottom-nav) {
  padding-bottom: calc(var(--bottom-nav-height) + var(--space-lg) + env(safe-area-inset-bottom));
}

.bottom-nav .nav-item .nav-icon {
  font-size: 1.35rem;
  line-height: 1;
  transition: transform var(--transition-fast);
}

.bottom-nav .nav-item:active .nav-icon { transform: scale(0.9); }

/* ====== Cards ====== */
.card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  border: 1px solid var(--color-border-light);
}

.card-warm {
  background: var(--color-bg-warm);
  border-color: transparent;
}

.card-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.card-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}

/* ====== Buttons ====== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px 24px;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  white-space: nowrap;
  line-height: 1.4;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: var(--color-text-white);
  box-shadow: 0 4px 14px rgba(232, 120, 106, 0.35);
}

.btn-primary:hover { box-shadow: 0 6px 20px rgba(232, 120, 106, 0.45); }

.btn-secondary {
  background: var(--color-secondary-light);
  color: var(--color-secondary-dark);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
}

.btn-block { display: flex; width: 100%; }

.btn-sm {
  padding: 8px 16px;
  font-size: var(--font-size-sm);
}

.btn-lg {
  padding: 14px 32px;
  font-size: var(--font-size-lg);
}

/* ====== Forms ====== */
.form-group { margin-bottom: var(--space-md); }

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  font-size: var(--font-size-md);
  background: var(--color-bg-input);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  transition: border-color var(--transition-fast);
}

.form-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.form-input::placeholder { color: var(--color-text-muted); }

.form-input.error { border-color: var(--color-error); }

.form-error {
  font-size: var(--font-size-xs);
  color: var(--color-error);
  margin-top: var(--space-xs);
}

.form-hint {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
}

/* ====== Tags & Badges ====== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  border-radius: var(--radius-full);
  line-height: 1.6;
}

.badge-primary { background: var(--color-primary-light); color: var(--color-primary-dark); }
.badge-secondary { background: var(--color-secondary-light); color: var(--color-secondary-dark); }
.badge-accent { background: var(--color-accent-light); color: var(--color-accent-dark); }
.badge-success { background: #E8F8E0; color: var(--color-success); }
.badge-warning { background: #FFF8E1; color: var(--color-warning); }
.badge-error { background: #FFF0F0; color: var(--color-error); }
.badge-info { background: #E8F4FF; color: var(--color-info); }
.badge-muted { background: #F0EBE4; color: var(--color-text-muted); }

/* ====== Carousel ====== */
.carousel {
  position: relative;
  width: 100%;
  height: 160px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-md);
}

.carousel-inner {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform var(--transition-normal);
}

.carousel-slide {
  min-width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.carousel-slide:nth-child(1) {
  background: linear-gradient(135deg, #FDE8E5, #F4BF4F);
}

.carousel-slide:nth-child(2) {
  background: linear-gradient(135deg, #E6F4F0, #5B9A8B);
}

.carousel-slide:nth-child(3) {
  background: linear-gradient(135deg, #FDE8E5, #E8786A);
}

.carousel-slide .slide-content {
  text-align: center;
  color: var(--color-text);
  padding: var(--space-lg);
}

.carousel-slide .slide-content h3 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-xs);
}

.carousel-slide .slide-content p {
  font-size: var(--font-size-sm);
  opacity: 0.8;
}

.carousel-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transition: all var(--transition-fast);
}

.carousel-dot.active {
  background: #fff;
  width: 24px;
  border-radius: var(--radius-full);
}

/* ====== Section Headers ====== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  margin-top: var(--space-lg);
}

.section-header h3 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
}

.section-header .more-link {
  font-size: var(--font-size-sm);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 2px;
}

/* ====== Service/Hot Team Cards ====== */
.team-scroll, .caregiver-scroll, .package-scroll {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--space-sm);
  scrollbar-width: none;
}

.team-scroll::-webkit-scrollbar,
.caregiver-scroll::-webkit-scrollbar,
.package-scroll::-webkit-scrollbar { display: none; }

.team-card {
  flex: 0 0 200px;
  scroll-snap-align: start;
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border-light);
}

.team-card .team-cover {
  height: 100px;
  background: linear-gradient(135deg, var(--color-primary-light), var(--color-accent-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.team-card .team-info {
  padding: var(--space-md);
}

.team-card .team-name {
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-md);
  margin-bottom: 4px;
}

.team-card .team-desc {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
}

.team-card .team-stats {
  display: flex;
  gap: var(--space-md);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* Caregiver Card */
.caregiver-card {
  flex: 0 0 140px;
  scroll-snap-align: start;
  text-align: center;
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border-light);
}

.caregiver-card .caregiver-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto var(--space-sm);
  background: linear-gradient(135deg, var(--color-primary-light), var(--color-accent-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border: 2px solid var(--color-primary-light);
}

.caregiver-card .caregiver-name {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  margin-bottom: 2px;
}

.caregiver-card .caregiver-role {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

.caregiver-card .caregiver-rating {
  color: var(--color-accent);
  font-size: var(--font-size-xs);
}

/* Package Card */
.package-card {
  flex: 0 0 240px;
  scroll-snap-align: start;
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border-light);
}

.package-card.featured {
  border: 2px solid var(--color-accent);
  position: relative;
}

.package-card.featured::before {
  content: '热门';
  position: absolute;
  top: -1px;
  right: var(--space-md);
  background: var(--color-accent);
  color: #fff;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  padding: 3px 10px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.package-card .package-name {
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-md);
  margin-bottom: var(--space-xs);
}

.package-card .package-price {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
}

.package-card .package-price span {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-normal);
}

.package-card .package-features {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}

.package-card .package-features li {
  padding: 3px 0;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.package-card .package-features li::before {
  content: '✓';
  color: var(--color-secondary);
  font-weight: var(--font-weight-bold);
}

/* ====== Order List ====== */
.order-item {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border-light);
}

.order-item .order-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.order-item .order-id {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-medium);
}

.order-item .order-info {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}

.order-item .order-info .service-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--color-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.order-item .order-info .service-details {
  flex: 1;
}

.order-item .order-info .service-name {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-md);
  margin-bottom: 2px;
}

.order-item .order-info .service-time {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.order-item .order-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-border-light);
}

.order-item .order-price {
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  font-size: var(--font-size-lg);
}

/* ====== Service Status ====== */
.status-timeline {
  padding: var(--space-md) 0;
}

.status-timeline .tl-item {
  display: flex;
  gap: var(--space-md);
  padding-bottom: var(--space-lg);
  position: relative;
}

.status-timeline .tl-item:last-child { padding-bottom: 0; }

.status-timeline .tl-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-border);
  flex-shrink: 0;
  margin-top: 4px;
  position: relative;
  z-index: 1;
}

.status-timeline .tl-dot.active {
  background: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-light);
}

.status-timeline .tl-dot.completed {
  background: var(--color-secondary);
}

.status-timeline .tl-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 20px;
  width: 2px;
  height: calc(100% - 4px);
  background: var(--color-border-light);
}

.status-timeline .tl-content .tl-title {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  margin-bottom: 2px;
}

.status-timeline .tl-content .tl-time {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* ====== Caregiver Info ====== */
.caregiver-profile {
  text-align: center;
  padding: var(--space-xl) var(--space-md);
}

.caregiver-profile .big-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto var(--space-md);
  background: linear-gradient(135deg, var(--color-primary-light), var(--color-accent-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  border: 3px solid var(--color-primary-light);
}

.caregiver-profile .big-name {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: 4px;
}

.caregiver-profile .big-title {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}

.caregiver-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin: var(--space-md) 0;
}

.info-item {
  background: var(--color-bg-warm);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
}

.info-item .info-value {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
}

.info-item .info-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* ====== Admin Dashboard ====== */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.stat-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border-light);
}

.stat-card .stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
}

.stat-card .stat-icon.orange { background: var(--color-primary-light); }
.stat-card .stat-icon.green { background: var(--color-secondary-light); }
.stat-card .stat-icon.blue { background: #E8F4FF; }
.stat-card .stat-icon.gold { background: var(--color-accent-light); }

.stat-card .stat-value {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
}

.stat-card .stat-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* Admin Table */
.admin-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.admin-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--color-bg-warm);
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-xs);
  white-space: nowrap;
}

.admin-table td {
  padding: 12px;
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: middle;
}

.admin-table tr:hover td { background: var(--color-bg-warm); }

/* ====== Modal / Overlay ====== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.overlay-content {
  background: var(--color-bg-card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: var(--max-width);
  max-height: 80vh;
  overflow-y: auto;
  padding: var(--space-lg);
  animation: slideUp var(--transition-normal);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* ====== Toast ====== */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-text);
  color: #fff;
  padding: 10px 24px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  z-index: 300;
  animation: fadeInDown var(--transition-fast);
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ====== 居中美化弹窗（替代系统 confirm / alert） ====== */
body.nb-modal-open { overflow: hidden; }

.nb-modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(74, 55, 40, 0.45);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
  animation: nbMaskFade var(--transition-fast) ease-out;
  -webkit-tap-highlight-color: transparent;
}
@keyframes nbMaskFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.nb-modal {
  width: 100%;
  max-width: 320px;
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  padding: 28px 24px 20px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(74, 55, 40, 0.30);
  animation: nbModalIn var(--transition-normal) cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
@keyframes nbModalIn {
  from { opacity: 0; transform: translateY(14px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.nb-modal-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 14px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}
.nb-modal-icon svg { width: 30px; height: 30px; }
.nb-modal-icon.warn { background: var(--color-primary-light); color: var(--color-primary-dark); }
.nb-modal-icon.danger { background: #FFECEC; color: #FF4D4F; }
.nb-modal-icon.info { background: var(--color-secondary-light); color: var(--color-secondary-dark); }
.nb-modal-icon.success { background: #EAF8E6; color: #52C41A; }

.nb-modal-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin-bottom: 8px;
  line-height: var(--line-height-tight);
}
.nb-modal-msg {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  line-height: var(--line-height-normal);
  margin-bottom: 22px;
  word-break: break-word;
  white-space: pre-wrap;
}
.nb-modal-actions {
  display: flex;
  gap: 12px;
}
.nb-modal-btn {
  flex: 1;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 0;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  font-family: inherit;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}
.nb-modal-btn:active { transform: scale(0.97); }
.nb-modal-cancel {
  background: var(--color-bg-warm);
  color: var(--color-text-secondary);
}
.nb-modal-cancel:hover { background: var(--color-border-light); }
.nb-modal-ok {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  box-shadow: 0 6px 18px rgba(232, 120, 106, 0.35);
}
.nb-modal-ok:hover { box-shadow: 0 8px 22px rgba(232, 120, 106, 0.45); }
.nb-modal-ok.nb-danger {
  background: linear-gradient(135deg, #FF7A7C, #FF4D4F);
  box-shadow: 0 6px 18px rgba(255, 77, 79, 0.35);
}
.nb-modal-ok.nb-danger:hover { box-shadow: 0 8px 22px rgba(255, 77, 79, 0.45); }

/* ====== Auth Pages ====== */
.auth-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: var(--space-xl);
}

.auth-page .auth-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.auth-page .auth-logo {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}

.auth-page .auth-title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-xs);
}

.auth-page .auth-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.auth-page .auth-form {
  flex: 1;
}

.auth-page .auth-footer {
  text-align: center;
  padding: var(--space-lg) 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.auth-page .auth-footer a {
  color: var(--color-primary);
  font-weight: var(--font-weight-semibold);
}

/* ====== Search Bar ====== */
.search-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--color-bg-input);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  margin-bottom: var(--space-md);
}

.search-bar input {
  flex: 1;
  background: transparent;
  font-size: var(--font-size-sm);
  color: var(--color-text);
}

.search-bar input::placeholder { color: var(--color-text-muted); }

/* ====== Work Log ====== */
.work-log-item {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border-light);
}

.work-log-item .log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.work-log-item .log-date {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.work-log-item .log-content {
  font-size: var(--font-size-sm);
  color: var(--color-text);
  line-height: var(--line-height-relaxed);
}

.work-log-item .log-images {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
  flex-wrap: wrap;
}

.work-log-item .log-image {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  background: var(--color-bg-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--color-text-muted);
}

/* ====== Upload Area ====== */
.upload-area {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  background: var(--color-bg-warm);
  margin-bottom: var(--space-md);
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.upload-area:hover { border-color: var(--color-primary); }

.upload-area .upload-icon {
  font-size: 2rem;
  margin-bottom: var(--space-sm);
  color: var(--color-text-muted);
}

.upload-area .upload-text {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

/* ====== Sidebar (Admin) ====== */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 220px;
  background: var(--color-text);
  color: #fff;
  padding: var(--space-lg) var(--space-md);
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  overflow-y: auto;
  z-index: 50;
}

.admin-sidebar .sidebar-logo {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  text-align: center;
}

.admin-sidebar .sidebar-menu .menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.7);
  font-size: var(--font-size-sm);
  margin-bottom: 4px;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.admin-sidebar .sidebar-menu .menu-item:hover,
.admin-sidebar .sidebar-menu .menu-item.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.admin-main {
  flex: 1;
  margin-left: 220px;
  padding: var(--space-lg);
  max-width: calc(100% - 220px);
}

/* ====== Responsive ====== */
@media (max-width: 768px) {
  .admin-sidebar {
    width: 100%;
    height: auto;
    position: relative;
    padding: var(--space-md);
  }
  .admin-sidebar .sidebar-menu {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
  }
  .admin-sidebar .sidebar-menu .menu-item { margin-bottom: 0; }

  .admin-main { margin-left: 0; max-width: 100%; }
}

/* ====== Utility ====== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--color-text-muted); }
.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-secondary); }
.font-bold { font-weight: var(--font-weight-bold); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ====== Payment ====== */
.payment-summary {
  background: var(--color-bg-warm);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  margin-bottom: var(--space-lg);
}

.payment-summary .amount {
  font-size: 2.5rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
}

.payment-summary .amount-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
}

.payment-methods {
  margin-bottom: var(--space-lg);
}

.payment-method {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--color-bg-card);
  border: 1.5px solid var(--color-border-light);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.payment-method.selected {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.payment-method .method-icon {
  font-size: 1.5rem;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: var(--space-md);
  background: var(--color-bg-warm);
  border-radius: var(--radius-full);
  padding: 3px;
}

.tab {
  flex: 1;
  text-align: center;
  padding: 8px 0;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab.active {
  background: var(--color-bg-card);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

/* ===== 暖郎/暖娘 性别便签 ===== */
.gender-tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
  border: 1px solid transparent;
}
.gender-tag.nan { background: #E6F0FF; color: #2F6FE0; border-color: #C5DBFF; } /* 暖郎 M */
.gender-tag.nv  { background: #FFE6EF; color: #E0457B; border-color: #FFC9DD; } /* 暖娘 F */
.gender-tag.unknown { background: #F0F0F0; color: #888; }
