/* ============================================
   君瑞口腔 - H5移动端共享样式
   ============================================ */

:root {
  --primary: #0EA5A4;
  --primary-dark: #0D8B8A;
  --primary-light: #E0F7F7;
  --primary-lighter: #F0FAFA;
  --text-dark: #1A2B3C;
  --text-secondary: #6B7C8C;
  --text-light: #9CA3AF;
  --bg-light: #F5FAFB;
  --bg-white: #FFFFFF;
  --error: #EF4444;
  --error-bg: #FEF2F2;
  --star: #F59E0B;
  --border: #E5E7EB;
  --border-light: #F3F4F6;
  --shadow: 0 2px 12px rgba(14, 165, 164, 0.08);
  --shadow-lg: 0 8px 24px rgba(14, 165, 164, 0.12);
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text-dark);
  background: var(--bg-light);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  max-width: 430px;
  margin: 0 auto;
  position: relative;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; font-family: inherit; }
input, select, textarea { font-family: inherit; outline: none; }

/* ---- 状态栏 ---- */
.status-bar {
  height: 44px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}
.status-bar .time { font-weight: 600; }
.status-bar .icons { display: flex; gap: 6px; align-items: center; font-size: 14px; }

/* ---- 顶部导航栏 ---- */
.top-nav {
  background: var(--primary);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.top-nav .logo {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.top-nav .logo .icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.top-nav .menu-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.top-nav .menu-btn span {
  width: 18px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}
.top-nav .back-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
}
.top-nav .title { color: #fff; font-size: 17px; font-weight: 600; }
.top-nav .placeholder { width: 36px; }

/* ---- Hero 卡片 ---- */
.hero-card-m {
  margin: 16px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  position: relative;
  overflow: hidden;
}
.hero-card-m::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}
.hero-card-m h1 {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}
.hero-card-m p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
  line-height: 1.6;
}
.hero-card-m .btn-group {
  display: flex;
  gap: 12px;
  position: relative;
  z-index: 1;
}

/* ---- 按钮 ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-light {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}
.btn-block { width: 100%; }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn:disabled { opacity: 0.6; }

/* ---- 区块标题 ---- */
.section-m {
  margin: 24px 16px;
}
.section-m .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.section-m .header h2 {
  font-size: 18px;
  font-weight: 700;
}
.section-m .header a {
  font-size: 13px;
  color: var(--primary);
}

/* ---- 服务网格 ---- */
.service-grid-m {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.service-item-m {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px 8px;
  text-align: center;
  transition: all 0.3s ease;
}
.service-item-m:active { transform: scale(0.96); }
.service-item-m .icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  font-size: 20px;
}
.service-item-m .name {
  font-size: 13px;
  font-weight: 500;
}
.service-item-m .price {
  font-size: 12px;
  color: var(--primary);
  margin-top: 2px;
}

/* ---- 专家卡片 ---- */
.doctor-list-m {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.doctor-list-m::-webkit-scrollbar { display: none; }
.doctor-card-m {
  flex-shrink: 0;
  width: 140px;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
}
.doctor-card-m .photo {
  width: 100%;
  height: 130px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary-lighter));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}
.doctor-card-m .info {
  padding: 12px;
}
.doctor-card-m .info .name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}
.doctor-card-m .info .title {
  font-size: 12px;
  color: var(--primary);
  margin-bottom: 4px;
}
.doctor-card-m .info .desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ---- 评价卡片 ---- */
.review-list-m {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.review-card-m {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
}
.review-card-m .stars {
  display: flex;
  gap: 2px;
  margin-bottom: 8px;
}
.review-card-m .stars span {
  color: var(--star);
  font-size: 14px;
}
.review-card-m .text {
  font-size: 13px;
  color: var(--text-dark);
  line-height: 1.6;
  margin-bottom: 12px;
}
.review-card-m .author {
  display: flex;
  align-items: center;
  gap: 8px;
}
.review-card-m .author .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}
.review-card-m .author .name { font-size: 13px; font-weight: 500; }
.review-card-m .author .date { font-size: 11px; color: var(--text-light); }

/* ---- CTA 区 ---- */
.cta-m {
  margin: 24px 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  text-align: center;
}
.cta-m h2 {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}
.cta-m p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 20px;
}

/* ---- 底部导航 ---- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  background: #fff;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-around;
  padding: 8px 0 calc(8px + var(--safe-bottom));
  z-index: 100;
}
.bottom-nav .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 12px;
  border-radius: 8px;
}
.bottom-nav .nav-item .icon {
  font-size: 20px;
}
.bottom-nav .nav-item .label {
  font-size: 11px;
  color: var(--text-secondary);
}
.bottom-nav .nav-item.active .icon,
.bottom-nav .nav-item.active .label {
  color: var(--primary);
}

/* 底部占位（防止内容被导航遮挡） */
.bottom-nav-spacer {
  height: calc(64px + var(--safe-bottom));
}

/* ---- 表单 ---- */
.form-card-m {
  margin: 16px;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 20px 16px;
}
.form-group-m {
  margin-bottom: 16px;
}
.form-group-m label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
}
.form-group-m label .required { color: var(--error); }
.form-control-m {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
}
.form-control-m:focus {
  border-color: var(--primary);
}
.form-control-m.error {
  border-color: var(--error);
  background: var(--error-bg);
}
.form-error-m {
  font-size: 12px;
  color: var(--error);
  margin-top: 4px;
}
.form-agreement-m {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  margin: 16px 0;
}
.form-agreement-m input {
  width: 14px;
  height: 14px;
  margin-top: 2px;
  accent-color: var(--primary);
}
.form-agreement-m a { color: var(--primary); }

/* ---- 医生详情 ---- */
.doctor-profile-m {
  margin: 16px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary-lighter));
  border-radius: var(--radius-xl);
  padding: 24px;
  text-align: center;
}
.doctor-profile-m .avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin: 0 auto 12px;
}
.doctor-profile-m .name {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}
.doctor-profile-m .title {
  font-size: 14px;
  color: var(--primary);
  margin-bottom: 16px;
}
.doctor-profile-m .stats {
  display: flex;
  justify-content: center;
  gap: 24px;
}
.doctor-profile-m .stats .stat .num {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}
.doctor-profile-m .stats .stat .label {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ---- Tab 栏 ---- */
.tab-bar-m {
  display: flex;
  margin: 0 16px 16px;
  background: #fff;
  border-radius: var(--radius);
  padding: 4px;
  gap: 4px;
}
.tab-bar-m .tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 8px;
  transition: all 0.3s ease;
}
.tab-bar-m .tab.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

/* ---- 标签 ---- */
.tag-list-m {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 16px 16px;
}
.tag-m {
  padding: 6px 14px;
  border-radius: 16px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 500;
}

/* ---- 内容卡片 ---- */
.content-card-m {
  margin: 0 16px 16px;
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
}
.content-card-m h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}
.content-card-m p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ---- 侧边菜单 ---- */
.side-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 200;
  display: none;
}
.side-menu-overlay.show { display: flex; }
.side-menu-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 280px;
  max-width: 75%;
  height: 100%;
  background: #fff;
  padding: 60px 0 24px;
  display: flex;
  flex-direction: column;
}
.side-menu-panel .close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-secondary);
}
.side-menu-panel .menu-list {
  flex: 1;
  padding: 0 20px;
}
.side-menu-panel .menu-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  font-size: 16px;
  font-weight: 500;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-dark);
}
.side-menu-panel .menu-list a .icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.side-menu-panel .hotline {
  padding: 20px;
  border-top: 1px solid var(--border-light);
  text-align: center;
}
.side-menu-panel .hotline .label {
  font-size: 12px;
  color: var(--text-secondary);
}
.side-menu-panel .hotline .number {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
}

/* ---- 加载状态 ---- */
.loading-overlay-m {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 300;
}
.spinner-m {
  width: 44px;
  height: 44px;
  border: 4px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.loading-overlay-m p {
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-secondary);
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---- 成功弹窗 ---- */
.success-overlay-m {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 40px;
}
.success-modal {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 36px 28px 28px;
  text-align: center;
  width: 100%;
  max-width: 300px;
}
.success-modal .icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 32px;
  color: #fff;
}
.success-modal h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}
.success-modal p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.6;
}
