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

:root {
  --primary-blue: #4A90E2;
  --primary-purple: #7B6CF6;
  --accent-gold: #F5A623;
  --text-dark: #1E293B;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  --bg-page: #F1F5F9;
  --bg-card: #FFFFFF;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --radius: 14px;
  --nav-h: calc(56px + env(safe-area-inset-bottom, 0px));
  --header-h: 56px;
}

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

body {
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #E2E8F0;
  color: var(--text-dark);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
}

.hidden { display: none !important; }

.app {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg-page);
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.1);
  padding-bottom: var(--nav-h);
}

/* 状态栏 */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: max(6px, env(safe-area-inset-top, 6px)) 16px 4px;
  background: var(--bg-card);
  font-size: clamp(12px, 3.2vw, 14px);
  font-weight: 600;
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-dark);
}

/* 顶部导航 */
.header, .sub-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px 14px;
  background: var(--bg-card);
  min-height: var(--header-h);
}

.sub-header h2 {
  font-size: clamp(15px, 4vw, 17px);
  font-weight: 700;
  flex: 1;
  text-align: center;
}

.sub-back {
  background: none;
  border: none;
  color: var(--text-dark);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sub-back:active { background: #F1F5F9; }
.sub-spacer { width: 36px; }

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  flex-shrink: 0;
  width: clamp(108px, 30vw, 148px);
  height: clamp(30px, 8.5vw, 38px);
  overflow: hidden;
  display: flex;
  align-items: flex-start;
}

.logo-img {
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: top left;
  display: block;
}

.logo-text h1 {
  font-size: clamp(16px, 4.2vw, 18px);
  font-weight: 700;
  line-height: 1.2;
}

.logo-text p {
  font-size: clamp(10px, 2.8vw, 11px);
  color: var(--text-muted);
}

.notify-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
}

/* 页面切换 */
.page {
  display: none;
}

.page.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

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

/* Banner 轮播 */
.hero {
  margin: 0 clamp(8px, 3vw, 12px);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: var(--bg-card);
}

.banner-viewport {
  overflow: hidden;
  position: relative;
  height: clamp(180px, 48vw, 240px);
}

.banner-track {
  display: flex;
  height: 100%;
  will-change: transform;
}

.banner-slide {
  flex: 0 0 100%;
  position: relative;
  height: 100%;
}

.banner-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.05) 0%, rgba(30,41,59,0.55) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(12px, 4vw, 18px);
  color: white;
}

.hero-badge {
  display: inline-block;
  background: rgba(74, 144, 226, 0.9);
  font-size: clamp(10px, 2.6vw, 11px);
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 6px;
  width: fit-content;
  font-weight: 500;
}

.hero-overlay h2 {
  font-size: clamp(18px, 5vw, 22px);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 4px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.hero-overlay > p {
  font-size: clamp(12px, 3.2vw, 13px);
  opacity: 0.9;
  margin-bottom: 10px;
}

.hero-features {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(8px, 3vw, 16px);
}

.hero-feature {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: clamp(10px, 2.6vw, 11px);
}

.feature-icon {
  width: 18px;
  height: 18px;
  background: rgba(255,255,255,0.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.hero-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 10px 0;
  background: var(--bg-card);
}

.hero-dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #CBD5E1;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.3s;
}

.hero-dots .dot.active {
  background: var(--primary-blue);
  width: 18px;
  border-radius: 3px;
}

/* 数据统计 */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: clamp(8px, 3vw, 12px);
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: clamp(12px, 3.5vw, 16px) 6px;
  box-shadow: var(--shadow-sm);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 3px;
}

.stat-icon {
  width: clamp(30px, 8vw, 36px);
  height: clamp(30px, 8vw, 36px);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon.blue { background: #EFF6FF; color: var(--primary-blue); }
.stat-icon.purple { background: #F5F3FF; color: var(--primary-purple); }
.stat-icon.pink { background: #FDF2F8; color: #EC4899; }
.stat-icon.teal { background: #ECFEFF; color: #06B6D4; }

.stat-item strong {
  font-size: clamp(12px, 3.2vw, 14px);
  font-weight: 700;
  color: var(--primary-blue);
}

.stat-item span {
  font-size: clamp(9px, 2.4vw, 10px);
  color: var(--text-muted);
  line-height: 1.3;
}

/* 通用区块 */
.section {
  margin: clamp(8px, 3vw, 12px);
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: clamp(12px, 3.5vw, 16px);
  box-shadow: var(--shadow-sm);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-header h3 {
  font-size: clamp(14px, 3.8vw, 16px);
  font-weight: 700;
}

.section-link {
  font-size: clamp(11px, 2.8vw, 12px);
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
}

.section-link:active { color: var(--primary-blue); }

/* 合作医院轮播 */
.hospital-viewport {
  overflow: hidden;
  margin: 0 -4px;
}

.hospital-track {
  display: flex;
  gap: 14px;
  will-change: transform;
}

.hospital-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  width: clamp(60px, 16vw, 72px);
}

.hospital-logo {
  width: clamp(48px, 13vw, 56px);
  height: clamp(48px, 13vw, 56px);
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #F1F5F9;
}

.hospital-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hospital-item span {
  font-size: clamp(9px, 2.4vw, 10px);
  color: var(--text-muted);
  text-align: center;
  line-height: 1.3;
}

/* 服务网格 */
.services-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.services-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.service-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  color: var(--text-dark);
  padding: 6px 2px;
  border-radius: 10px;
}

.service-item:active { background: #F8FAFC; }

.service-icon {
  width: clamp(38px, 10vw, 44px);
  height: clamp(38px, 10vw, 44px);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.si-blue { background: #EEF2FF; color: #5B6CF6; }
.si-green { background: #F0FDF4; color: #22C55E; }
.si-orange { background: #FFF7ED; color: #F97316; }
.si-purple { background: #F5F3FF; color: #8B5CF6; }
.si-cyan { background: #ECFEFF; color: #06B6D4; }
.si-pink { background: #FDF2F8; color: #EC4899; }

.service-item span {
  font-size: clamp(11px, 2.8vw, 12px);
  font-weight: 500;
}

.service-promo {
  --promo-bg: none;
  --promo-overlay-opacity: 0.75;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  padding: clamp(14px, 4vw, 20px) clamp(12px, 3.5vw, 16px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: white;
  background-image: var(--promo-bg);
  background-size: cover;
  background-position: center;
}

.service-promo::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, #8A7BFF 0%, #7B6CF6 50%, #6B5CE7 100%);
  opacity: var(--promo-overlay-opacity);
  z-index: 0;
}

.service-promo h4,
.service-promo .promo-btn {
  position: relative;
  z-index: 1;
}

.service-promo h4 {
  font-size: clamp(13px, 3.5vw, 15px);
  font-weight: 600;
  line-height: 1.5;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.promo-btn {
  display: inline-block;
  margin-top: 12px;
  background: rgba(255,255,255,0.25);
  color: white;
  text-decoration: none;
  font-size: clamp(11px, 2.8vw, 12px);
  padding: 6px 14px;
  border-radius: 20px;
  width: fit-content;
}

.promo-btn:active { background: rgba(255,255,255,0.4); }

/* 陪护团队预览 */
.team-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

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

.team-card {
  flex-shrink: 0;
  width: clamp(170px, 46vw, 200px);
  background: #F8FAFC;
  border-radius: 12px;
  padding: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.team-card img {
  width: clamp(48px, 13vw, 56px);
  height: clamp(48px, 13vw, 56px);
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

.team-info h4 {
  font-size: clamp(13px, 3.4vw, 14px);
  font-weight: 600;
}

.team-info p {
  font-size: clamp(10px, 2.6vw, 11px);
  color: var(--text-muted);
  margin: 2px 0;
}

.team-rating {
  font-size: clamp(11px, 2.8vw, 12px);
  font-weight: 600;
}

.team-rating .star { color: var(--accent-gold); }

.rating-count {
  font-weight: 400;
  color: var(--text-muted);
  font-size: clamp(10px, 2.6vw, 11px);
}

/* 评价预览 */
.reviews-section { margin-bottom: 16px; }

.review-full-card {
  background: linear-gradient(135deg, #F8FAFC 0%, #EFF6FF 100%);
  border-radius: 12px;
  padding: clamp(14px, 4vw, 18px);
}

.review-full-card.featured {
  position: relative;
}

.review-full-card.featured::before {
  content: "\201C";
  font-size: 48px;
  color: var(--primary-blue);
  opacity: 0.25;
  position: absolute;
  top: 4px;
  left: 12px;
  font-family: Georgia, serif;
  line-height: 1;
}

.rfc-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.rfc-stars {
  color: var(--accent-gold);
  font-size: clamp(12px, 3.2vw, 14px);
  letter-spacing: 1px;
}

.rfc-date {
  font-size: clamp(10px, 2.6vw, 11px);
  color: var(--text-light);
}

.rfc-text {
  font-size: clamp(13px, 3.4vw, 14px);
  line-height: 1.7;
  padding-top: 4px;
}

.review-full-card.featured .rfc-text { padding-top: 16px; }

.rfc-photos {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.rfc-photos::-webkit-scrollbar { display: none; }

.rfc-photos img {
  width: clamp(100px, 28vw, 120px);
  height: clamp(66px, 18vw, 80px);
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.rfc-author {
  font-size: clamp(11px, 2.8vw, 12px);
  color: var(--text-muted);
  margin-top: 10px;
  text-align: right;
}

/* 照片墙（瀑布流） */
.photo-wall {
  column-count: 2;
  column-gap: clamp(8px, 2.5vw, 10px);
  padding: clamp(8px, 3vw, 12px);
}

.wall-item {
  break-inside: avoid;
  margin-bottom: clamp(8px, 2.5vw, 10px);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.wall-item img {
  width: 100%;
  display: block;
}

.wall-caption {
  display: block;
  padding: 8px 10px;
  font-size: clamp(11px, 2.8vw, 12px);
  color: var(--text-muted);
  background: var(--bg-card);
}

/* 陪护师列表页 */
.card-list {
  padding: clamp(8px, 3vw, 12px);
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 2.5vw, 10px);
}

.caregiver-full-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: clamp(12px, 3.5vw, 16px);
  display: flex;
  gap: clamp(10px, 3vw, 14px);
  box-shadow: var(--shadow-sm);
}

.cfc-avatar {
  width: clamp(64px, 18vw, 80px);
  height: clamp(64px, 18vw, 80px);
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
}

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

.cfc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cfc-head h4 {
  font-size: clamp(15px, 4vw, 16px);
  font-weight: 700;
}

.cfc-rating {
  font-size: clamp(13px, 3.4vw, 14px);
  font-weight: 600;
  color: var(--accent-gold);
}

.cfc-meta {
  font-size: clamp(11px, 2.8vw, 12px);
  color: var(--text-muted);
  margin: 4px 0;
}

.cfc-intro {
  font-size: clamp(12px, 3.2vw, 13px);
  color: var(--text-dark);
  line-height: 1.6;
}

.cfc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag {
  font-size: clamp(10px, 2.6vw, 11px);
  background: #EEF2FF;
  color: var(--primary-purple);
  padding: 3px 8px;
  border-radius: 20px;
}

/* 关于我们 */
.about-content {
  padding: clamp(8px, 3vw, 12px);
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 2.5vw, 10px);
}

.about-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: clamp(14px, 4vw, 18px);
  box-shadow: var(--shadow-sm);
}

.about-card h3 {
  font-size: clamp(15px, 4vw, 16px);
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--primary-purple);
}

.about-card p {
  font-size: clamp(13px, 3.4vw, 14px);
  color: var(--text-dark);
  line-height: 1.8;
  margin-bottom: 8px;
}

.about-card ul {
  list-style: none;
  padding: 0;
}

.about-card li {
  font-size: clamp(13px, 3.4vw, 14px);
  padding: 6px 0;
  color: var(--text-dark);
  border-bottom: 1px solid #F1F5F9;
}

.about-card li:last-child { border-bottom: none; }

.about-highlight {
  color: var(--primary-purple);
  font-weight: 700;
  background: linear-gradient(180deg, transparent 60%, rgba(123, 108, 246, 0.15) 60%);
}

/* 底部导航 */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  padding: 6px 0 calc(8px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #E2E8F0;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  color: var(--text-light);
  font-size: clamp(9px, 2.4vw, 10px);
  flex: 1;
  padding: 4px 0;
  -webkit-tap-highlight-color: transparent;
}

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

.nav-item.consult {
  position: relative;
  top: clamp(-12px, -3.5vw, -16px);
}

.consult-btn {
  width: clamp(46px, 12vw, 52px);
  height: clamp(46px, 12vw, 52px);
  border-radius: 50%;
  background: linear-gradient(135deg, #8A7BFF, #6B5CE7);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(107, 92, 231, 0.45);
}

.nav-item.consult span {
  color: var(--primary-purple);
  font-weight: 500;
}

/* 咨询弹窗 */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.modal.open {
  pointer-events: auto;
  opacity: 1;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.modal-sheet {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border-radius: 20px 20px 0 0;
  padding: clamp(20px, 5vw, 28px) clamp(20px, 5vw, 24px) calc(24px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  transform: translateY(100%);
  transition: transform 0.35s ease;
}

.modal.open .modal-sheet {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: #F1F5F9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-sheet h3 {
  font-size: clamp(17px, 4.5vw, 18px);
  font-weight: 700;
  margin-bottom: 20px;
}

.consult-qrcode-wrap {
  width: clamp(140px, 38vw, 180px);
  height: clamp(140px, 38vw, 180px);
  margin: 0 auto 12px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #F1F5F9;
  background: #F8FAFC;
}

.consult-qrcode-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.consult-hint {
  font-size: clamp(12px, 3.2vw, 13px);
  color: var(--text-muted);
  margin-bottom: 16px;
}

.consult-phone-wrap {
  background: linear-gradient(135deg, #EEF2FF, #F5F3FF);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
}

.consult-label {
  display: block;
  font-size: clamp(11px, 2.8vw, 12px);
  color: var(--text-muted);
  margin-bottom: 4px;
}

.consult-phone {
  font-size: clamp(22px, 6vw, 26px);
  font-weight: 700;
  color: var(--primary-purple);
  text-decoration: none;
  letter-spacing: 1px;
}

.consult-worktime {
  font-size: clamp(11px, 2.8vw, 12px);
  color: var(--text-light);
}

.consult-edit-tip {
  font-size: clamp(10px, 2.4vw, 11px);
  color: #CBD5E1;
  margin-top: 14px;
}

/* 响应式 */
@media (min-width: 481px) {
  body { padding: 16px 0; }
}

@media (max-width: 340px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-item {
    flex-direction: row;
    text-align: left;
    gap: 8px;
    justify-content: flex-start;
    padding: 0 8px;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .service-promo { min-height: 120px; }
}

@media (min-width: 400px) {
  .photo-wall { column-count: 2; }
}
