/* ====== 体检预约 H5 样式 - 真实医院风格 ====== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  font-size: 14px; line-height: 1.5; color: #333;
  background: #f6f7f9; min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
input, select, textarea, button { font: inherit; color: inherit; outline: none; border: none; background: none; }
button { cursor: pointer; }

:root {
  --primary: #00a19d;
  --primary-dark: #007a76;
  --primary-light: #e6f7f6;
  --accent: #ff6b35;
  --accent-light: #fff0eb;
  --gold: #ff9500;
  --bg: #f6f7f9;
  --card: #ffffff;
  --line: #eee;
  --muted: #999;
  --text2: #666;
  --danger: #e53935;
  --success: #43a047;
  --warning: #fb8c00;
}

/* ====== 容器 ====== */
.wrap { max-width: 720px; margin: 0 auto; padding: 0 12px; }
.card { background: var(--card); border-radius: 12px; }
.card + .card { margin-top: 10px; }
.pad { padding: 14px; }

/* ====== 顶部栏（详情页用） ====== */
.topbar {
  background: #fff; color: #333;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.topbar .hospital-name { font-size: 16px; font-weight: 600; }
.topbar .hospital-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ====== 首页顶部大图轮播 ====== */
.hero-banner { position: relative; width: 100%; padding-top: 46%; overflow: hidden; }
.hero-banner .slides { position: absolute; inset: 0; }
.hero-banner .slide { position: absolute; inset: 0; display: none; }
.hero-banner .slide:first-child { display: block; }
.hero-banner .slide img { width: 100%; height: 100%; object-fit: cover; }
.hero-banner .slide .placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; font-size: 16px;
}
.hero-banner .dots {
  position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px;
}
.hero-banner .dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.6); }
.hero-banner .dot.active { background: #fff; width: 14px; border-radius: 3px; }

/* ====== 医院信息卡片 ====== */
.hospital-card {
  background: #fff; margin: -28px 12px 0; border-radius: 12px;
  padding: 14px; position: relative; z-index: 10;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.hospital-card .hd { display: flex; gap: 12px; }
.hospital-card .logo {
  width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary-light); display: flex; align-items: center; justify-content: center;
  font-size: 20px; overflow: hidden;
}
.hospital-card .logo img { width: 100%; height: 100%; object-fit: cover; }
.hospital-card .title { font-size: 16px; font-weight: 700; color: #222; line-height: 1.3; }
.hospital-card .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.hospital-card .tag {
  font-size: 11px; padding: 1px 6px; border-radius: 4px;
  display: inline-flex; align-items: center; gap: 3px;
}
.hospital-card .tag.primary { background: var(--primary-light); color: var(--primary-dark); }
.hospital-card .tag.gray { background: #f5f5f5; color: var(--text2); }
.hospital-card .tag.gold { background: #fff8e6; color: #c77f00; }
.hospital-card .addr { font-size: 12px; color: var(--muted); margin-top: 8px; display: flex; gap: 4px; }
.hospital-card .addr::before { content: '📍'; }

/* ====== 快捷入口 ====== */
.quick-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  margin: 10px 12px 0; background: #fff; border-radius: 12px; padding: 12px 6px;
}
.quick-grid a { text-align: center; }
.quick-grid .icon {
  width: 44px; height: 44px; border-radius: 50%; margin: 0 auto;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  background: var(--primary-light); color: var(--primary);
}
.quick-grid .label { font-size: 12px; color: var(--text2); margin-top: 6px; }

/* ====== 公告条 ====== */
.notice-strip {
  margin: 10px 12px 0; background: #fff; border-radius: 10px; padding: 10px 12px;
  display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text2);
}
.notice-strip .speaker { color: var(--primary); font-size: 14px; flex-shrink: 0; }
.notice-strip .text { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.notice-strip a { color: var(--primary); flex-shrink: 0; font-size: 12px; }

/* ====== 横向分类标签 ====== */
.cat-scroll {
  display: flex; gap: 8px; overflow-x: auto; padding: 12px 12px 6px;
  scrollbar-width: none; -ms-overflow-style: none;
}
.cat-scroll::-webkit-scrollbar { display: none; }
.cat-item {
  flex-shrink: 0; min-width: 72px; text-align: center; padding: 10px 12px;
  background: #fff; border-radius: 10px; border: 1px solid transparent;
}
.cat-item.active { background: var(--primary-light); border-color: var(--primary); }
.cat-item .name { font-size: 13px; font-weight: 600; color: #333; }
.cat-item.active .name { color: var(--primary-dark); }
.cat-item .price { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* ====== 筛选排序栏 ====== */
.filter-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px 4px; font-size: 13px;
}
.filter-row .left { display: flex; gap: 14px; color: var(--text2); }
.filter-row .left span { cursor: pointer; position: relative; }
.filter-row .left span.active { color: var(--primary); font-weight: 600; }
.filter-row .left span::after {
  content: ''; position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%);
  width: 0; height: 2px; background: var(--primary); transition: width .2s;
}
.filter-row .left span.active::after { width: 100%; }
.filter-row .right { display: flex; gap: 10px; color: var(--muted); }
.filter-row .right span { cursor: pointer; }
.filter-row .right span.active { color: var(--primary); }

/* ====== 列表标题 ====== */
.section-title {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 14px 6px; font-weight: 700; font-size: 15px;
}
.section-title .hint { font-size: 12px; color: var(--muted); font-weight: 400; }

/* ====== 套餐列表 ====== */
.package-list { padding: 0 12px 12px; }
.pkg-card {
  background: #fff; border-radius: 12px; padding: 12px; margin-bottom: 10px;
  display: flex; gap: 12px; position: relative; overflow: hidden;
  border: 1px solid #f0f0f0;
}
.pkg-card:active { background: #fafafa; }
.pkg-card .rank {
  position: absolute; top: 0; left: 0; background: linear-gradient(135deg, #ff9500, #ff6b35);
  color: #fff; font-size: 10px; padding: 2px 8px 2px 6px;
  border-bottom-right-radius: 10px; font-weight: 600;
}
.pkg-card .thumb {
  width: 90px; height: 90px; border-radius: 8px; flex-shrink: 0;
  background: var(--primary-light); overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.pkg-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.pkg-card .thumb .ph { font-size: 28px; }
.pkg-card .info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; }
.pkg-card .badge-row { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 5px; }
.badge {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 1px 6px; border-radius: 4px; font-size: 10px;
  background: #f0f0f0; color: var(--text2);
}
.badge.featured { background: #fff3e0; color: var(--gold); }
.badge.gender-male { background: #e3f2fd; color: #1565c0; }
.badge.gender-female { background: #fce4ec; color: #c62828; }
.badge.gender-all { background: #e8f5e9; color: #2e7d32; }
.badge.addable { background: var(--accent-light); color: var(--accent); }
.pkg-card .name { font-size: 15px; font-weight: 700; line-height: 1.3; color: #222; }
.pkg-card .items {
  font-size: 12px; color: var(--muted); margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pkg-card .meta-row {
  display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); margin-top: 5px;
}
.pkg-card .meta-row span { display: inline-flex; align-items: center; gap: 2px; }
.pkg-card .bottom { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 8px; }
.pkg-card .price-wrap { display: flex; flex-direction: column; gap: 2px; }
.pkg-card .price { color: var(--accent); font-size: 18px; font-weight: 700; }
.pkg-card .price small { font-size: 11px; font-weight: 400; color: var(--muted); }
.pkg-card .discount { font-size: 11px; color: #ff6b35; background: #fff5f0; padding: 1px 6px; border-radius: 4px; display: inline-block; width: fit-content; }
.pkg-card .market-price { font-size: 11px; color: #999; text-decoration: line-through; }
.pkg-card .popularity { font-size: 11px; color: var(--muted); }
.pkg-card .btn-book {
  background: var(--primary); color: #fff; font-size: 13px; padding: 7px 16px;
  border-radius: 18px; font-weight: 500;
}

/* ====== 按钮 ====== */
.btn {
  display: inline-block; background: var(--primary); color: #fff;
  padding: 10px 18px; border-radius: 20px; font-weight: 500; font-size: 14px;
  text-align: center; user-select: none;
}
.btn:active { opacity: 0.85; }
.btn.block { display: block; width: 100%; }
.btn.disabled, .btn[disabled] { background: #ccc; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn.danger { background: var(--danger); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.outline { background: transparent; color: var(--muted); border: 1px solid #ddd; }
.btn.accent { background: var(--accent); }

/* ====== 表单 ====== */
.form-group { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.form-group:last-child { border-bottom: 0; }
.form-group label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; font-size: 15px; padding: 4px 0; background: transparent;
}
.form-group textarea { min-height: 56px; resize: vertical; }

/* ====== 分段选择 ====== */
.segment { display: flex; gap: 6px; flex-wrap: wrap; }
.segment .seg {
  flex: 1; min-width: 56px; padding: 7px 6px; border-radius: 8px;
  background: #f5f5f5; text-align: center; font-size: 13px; cursor: pointer;
  border: 1px solid transparent;
}
.segment .seg.active { background: var(--primary-light); color: var(--primary); border-color: var(--primary); font-weight: 600; }
.segment .seg.disabled { color: #ccc; background: #fafafa; cursor: not-allowed; }

/* ====== 套餐详情价格 ====== */
.detail-price { font-size: 24px; font-weight: 700; color: var(--accent); display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.detail-price .detail-market { font-size: 12px; color: #999; font-weight: 400; text-decoration: line-through; }
.detail-discount { font-size: 12px; color: #ff6b35; background: #fff5f0; padding: 2px 8px; border-radius: 4px; display: inline-block; width: fit-content; margin-top: 4px; }

/* ====== 底部操作栏 ====== */
.footer-fixed {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff; padding: 8px 14px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); z-index: 50; max-width: 720px; margin: 0 auto;
}
.footer-fixed .row { display: flex; align-items: center; gap: 10px; }
.footer-fixed .price { color: var(--accent); font-size: 18px; font-weight: 700; }
.footer-fixed .footer-price-wrap { flex: 1; display: flex; flex-direction: column; }
.footer-fixed .footer-market { font-size: 11px; color: #999; text-decoration: line-through; }
.footer-fixed .btn { padding: 10px 20px; flex: 0 0 auto; border-radius: 20px; }
.placeholder-fp { height: 70px; }

/* ====== 预约记录卡片 ====== */
.cell { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; font-size: 13px; }
.cell + .cell { border-top: 1px solid var(--line); }
.cell .label { color: var(--muted); font-size: 12px; }

.status-tag { padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; }
.status-tag.pending { background: #fff3e0; color: var(--warning); }
.status-tag.confirmed { background: #e8f5e9; color: var(--success); }
.status-tag.rejected { background: #ffebee; color: var(--danger); }
.status-tag.completed { background: #e3f2fd; color: #1565c0; }
.status-tag.cancelled { background: #f5f5f5; color: #999; }

/* ====== 工具类 ====== */
.text-muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-small { font-size: 12px; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; }

/* ====== Toast ====== */
.toast {
  position: fixed; bottom: 20%; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.75); color: #fff; padding: 8px 16px; border-radius: 6px;
  font-size: 13px; z-index: 1000; opacity: 0; transition: opacity 0.2s; max-width: 80%;
}
.toast.show { opacity: 1; }

/* ====== 加载 ====== */
.loading {
  display: inline-block; width: 16px; height: 16px; border: 2px solid #fff;
  border-top-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ====== 套餐详情 ====== */
.pkg-hero {
  background: #fff; padding-bottom: 14px;
}
.pkg-hero .cover {
  width: 100%; padding-top: 46%; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #fff0eb, #e6f7f6);
}
.pkg-hero .cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pkg-hero .cover .ph {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 48px; color: var(--primary);
}
.pkg-hero .quick-title {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-light); color: var(--accent); font-size: 12px;
  padding: 3px 10px; border-radius: 4px; margin: 12px 14px 8px;
}
.pkg-hero .pkg-title { font-size: 18px; font-weight: 700; padding: 0 14px; line-height: 1.4; }
.pkg-hero .pkg-subtitle { font-size: 13px; color: var(--text2); padding: 6px 14px 0; }
.pkg-hero .tag-row { display: flex; gap: 8px; padding: 10px 14px 0; flex-wrap: wrap; }
.pkg-hero .tag-row .tag {
  font-size: 12px; color: var(--primary-dark); background: var(--primary-light);
  padding: 3px 10px; border-radius: 4px;
}

.detail-section { background: #fff; margin-top: 10px; }
.detail-section .sec-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 14px 10px; font-weight: 700; font-size: 15px;
}
.detail-section .sec-hd .hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.item-list { padding: 0 14px 10px; }
.item-list .it {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text2);
  margin-right: 12px; margin-bottom: 6px;
}
.item-list .it::before { content: '✓'; color: var(--success); font-weight: 700; }

.hospital-time {
  display: flex; gap: 12px; padding: 12px 14px; align-items: center;
}
.hospital-time .logo { width: 44px; height: 44px; border-radius: 50%; background: var(--primary-light); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.hospital-time .info { flex: 1; min-width: 0; }
.hospital-time .name { font-size: 14px; font-weight: 600; }
.hospital-time .meta { font-size: 12px; color: var(--muted); margin-top: 3px; }

.promise-row {
  display: flex; justify-content: space-around; padding: 12px 14px;
  font-size: 12px; color: var(--text2);
}
.promise-row span { display: inline-flex; align-items: center; gap: 4px; }
.promise-row span::before { content: '✓'; color: var(--success); }

.date-scroll {
  display: flex; gap: 8px; overflow-x: auto; padding: 0 14px 14px;
  scrollbar-width: none; -ms-overflow-style: none;
}
.date-scroll::-webkit-scrollbar { display: none; }
.date-cell {
  flex-shrink: 0; min-width: 66px; text-align: center; padding: 10px 8px;
  border-radius: 10px; background: #f6f7f9; border: 1px solid transparent; cursor: pointer;
}
.date-cell.active { background: var(--primary-light); border-color: var(--primary); }
.date-cell.disabled { color: #ccc; background: #fafafa; cursor: not-allowed; }
.date-cell .week { font-size: 12px; }
.date-cell .day { font-size: 13px; font-weight: 600; margin-top: 2px; }
.date-cell .state { font-size: 10px; color: var(--muted); margin-top: 2px; }
.date-cell.active .state { color: var(--primary-dark); }

/* ====== 预约须知列表 ====== */
.notice-card { padding: 14px; }
.notice-card .nt-title { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.notice-card .nt-body { font-size: 13px; color: var(--text2); line-height: 1.7; white-space: pre-wrap; }
.notice-card + .notice-card { border-top: 1px solid var(--line); }

/* ====== 空状态 ====== */
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); font-size: 13px; }
