/* ============================================================
   PRP 治疗平台 · 微信小程序高保真原型
   设计令牌 + 通用组件（蓝色医疗风 / 治疗跟踪感）
   ============================================================ */

:root {
  /* 色彩 */
  --primary: linear-gradient(90deg, #2e9bd9 0%, #2ee8cf 100%);
  --primary-dark: #2e9bd9;
  --primary-light: #E8F1FA;
  --primary-mid: #8FB4D9;
  --ink: #2e9bd9;          /* 主题蓝：大标题/深色头部 */
  --ink-2: #333;        /* 正文主文字 */
  --gray-1: #6B7A80;       /* 次级文字 */
  --gray-2: #9AA5B1;       /* 辅助文字 */
  --gray-3: #C4CDD3;       /* 占位/禁用 */
  --bg: #F4F7F7;           /* 页面背景 */
  --card: #FFFFFF;
  --line: #EBF0F0;         /* 分割线 */
  --accent: #F59E0B;       /* 待办/提醒橙 */
  --accent-light: #FEF3DF;
  --danger: #DC2626;       /* 应避免/风险 */
  --danger-light: #FDECEC;
  --blue-chip: #E8F1FA;
  --blue-chip-text: #2e9bd9;

  /* 尺寸 */
  --radius: 16px;
  --radius-s: 10px;
  --shadow: 0 2px 12px rgba(37, 115, 186, 0.06);
  --shadow-m: 0 6px 20px rgba(37, 115, 186, 0.10);
  --tabbar-h: 58px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.55;
}

body { max-width: 420px; margin: 0 auto; min-height: 100vh; position: relative; }

a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; }

/* ---------- 微信状态栏 + 胶囊 ---------- */
.statusbar {
  height: 44px; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 14px; font-weight: 600; color: var(--ink-2);
  position: relative; z-index: 5;
}
.statusbar.on-dark { color: #fff; }
.statusbar .sb-icons { display: flex; align-items: center; gap: 6px; }
.statusbar svg { display: block; }

.navbar {
  height: 46px; display: flex; align-items: center; justify-content: center;
  position: relative; padding: 0 16px; z-index: 5;
}
.navbar .nav-title { font-size: 16px; font-weight: 600; color: var(--ink-2); }
.navbar.on-dark .nav-title { color: #fff; }
.navbar .nav-back {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  color: var(--ink-2);
}
.navbar.on-dark .nav-back { color: #fff; }
.capsule {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center;
  border: 1px solid rgba(37, 115, 186, 0.15); border-radius: 16px;
  background: rgba(255, 255, 255, 0.6);
  height: 30px; overflow: hidden;
}
.capsule.on-dark { border-color: rgba(255,255,255,0.35); background: rgba(255,255,255,0.12); }
.capsule span {
  width: 42px; height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--ink-2); font-size: 15px;
}
.capsule.on-dark span { color: #fff; }
.capsule span + span { border-left: 1px solid rgba(37, 115, 186, 0.12); }
.capsule.on-dark span + span { border-color: rgba(255,255,255,0.25); }

/* ---------- 页面容器 ---------- */
.page { padding:0 12px  calc(var(--tabbar-h) + 28px) 12px }
.page.no-tab { padding-bottom: 40px; }

/* ---------- 底部 TabBar ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 420px; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  background: #fff; border-top: 1px solid var(--line);
  display: flex; z-index: 50;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--gray-2); font-size: 10.5px; position: relative;
}
.tabbar a.active { color: var(--blue-chip-text); }
.tabbar a .badge {
  position: absolute; top: 6px; left: calc(50% + 8px);
  min-width: 15px; height: 15px; padding: 0 4px;
  background: var(--accent); color: #fff; border-radius: 8px;
  font-size: 9.5px; display: flex; align-items: center; justify-content: center;
  font-weight: 600;
}
.tabbar a .dot {
  position: absolute; top: 9px; left: calc(50% + 10px);
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
}

/* ---------- 卡片 ---------- */
.card {
  display: block;
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px;
}
.card-title { font-size: 16px; font-weight: 700; color: var(--ink-2); margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }
.card-title .more { font-size: 12.5px; color: var(--gray-2); font-weight: 400; display: flex; align-items: center; gap: 2px; }

/* ---------- 标签 chip ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11.5px; padding: 2.5px 9px; border-radius: 20px;
  background: var(--primary-light); color: var(--primary-dark); font-weight: 500;
  white-space: nowrap;
}
.chip.blue { background: var(--blue-chip); color: var(--blue-chip-text); }
.chip.orange { background: var(--accent-light); color: #B45309; }
.chip.red { background: var(--danger-light); color: var(--danger); }
.chip.gray { background: #EFF3F4; color: var(--gray-1); }
.chip.outline { background: #fff; border: 1px solid var(--gray-3); color: var(--gray-1); }
.chip.lg { font-size: 13px; padding: 7px 14px; }

/* 可选中 chip 组（表单用） */
.chip-group { display: flex; flex-wrap: wrap; gap: 9px; }
.chip-group .chip.lg { cursor: pointer; border: 1px solid transparent; }
.chip-group .chip.lg.selected { background: var(--primary); color: #fff; font-weight: 600; }
.chip-group .chip.lg.selectable { background: #fff; border: 1px solid var(--gray-3); color: var(--ink-2); }

/* ---------- 按钮 ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  height: 48px; border-radius: 24px; font-size: 15.5px; font-weight: 600;
  background: var(--primary); color: #fff; border: none; width: 100%;
  box-shadow: 0 6px 16px rgba(37, 115, 186, 0.28);
}
.btn.plain { background: #fff; color: var(--primary-dark); border: 1px solid var(--primary-mid); box-shadow: none; }
.btn.ghost { background: transparent; color: var(--gray-1); box-shadow: none; height: 40px; font-size: 14px; font-weight: 500; }
.btn.sm { height: 34px; font-size: 13px; border-radius: 17px; width: 75px; padding: 0 16px; box-shadow: none; }
.btn:disabled, .btn.disabled { background: var(--gray-3); box-shadow: none; color: #fff; }

/* ---------- 表单 ---------- */
.form-group { margin-bottom: 18px; }
.form-label { font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; display: flex; align-items: baseline; gap: 6px; }
.form-label .req { color: var(--danger); }
.form-label .tip { font-size: 11.5px; color: var(--gray-2); font-weight: 400; }
.form-input, .form-textarea {
  width: 100%; border: 1px solid var(--line); background: #FAFBFB;
  border-radius: var(--radius-s); padding: 12px 14px; font-size: 14.5px;
  color: var(--ink-2); outline: none; font-family: inherit;
}
.form-input:focus, .form-textarea:focus { border-color: var(--primary-mid); background: #fff; }
.form-input::placeholder, .form-textarea::placeholder { color: var(--gray-3); }
.form-textarea { min-height: 110px; resize: none; }

/* 上传占位 */
.upload-box {
  border: 1.5px dashed var(--gray-3); border-radius: var(--radius-s);
  background: #FAFBFB; min-height: 90px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; color: var(--gray-2); font-size: 12.5px; padding: 14px;
}
.upload-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.upload-grid .upload-box { aspect-ratio: 1; min-height: 0; }
.upload-grid .thumb {
  aspect-ratio: 1; border-radius: var(--radius-s); overflow: hidden; position: relative;
  background-image: linear-gradient(90deg, #2e9bd9 0%, #2ee8cf 100%);
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px;
}

/* ---------- 提示条 ---------- */
.notice {
  display: flex; gap: 8px; align-items: flex-start;
  background: var(--primary-light); color: var(--primary-dark);
  border-radius: var(--radius-s); padding: 10px 12px; font-size: 12.5px;
  margin-bottom: 14px; line-height: 1.5;
}
.notice.orange { background: var(--accent-light); color: #92600A; }
.notice.red { background: var(--danger-light); color: var(--danger); }
.notice.gray { background: #EFF3F4; color: var(--gray-1); }
.notice svg { flex-shrink: 0; margin-top: 1px; }

/* ---------- 列表行（我的页等） ---------- */
.cell-list { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 14px; }
.cell {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  font-size: 14.5px; color: var(--ink-2); position: relative;
}
.cell + .cell { border-top: 1px solid var(--line); }
/* 独立使用时（非 .cell 内）也能正确居中和圆角 */
.cell-icon {
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px; flex-shrink: 0;
}
.cell .cell-icon {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-light); color: var(--primary-dark);
}
.cell .cell-main { flex: 1; }
.cell .cell-sub { font-size: 12px; color: var(--gray-2); margin-top: 1px; }
.cell .cell-extra { color: var(--gray-2); font-size: 13px; display: flex; align-items: center; gap: 4px; }
.cell .cell-badge {
  background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 600;
  border-radius: 9px; min-width: 17px; height: 17px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ---------- 文章/内容卡片 ---------- */
.article-card {
  display: block; background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 15px 16px; margin-bottom: 12px;
}
.article-card .ac-head { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.article-card .ac-title { font-size: 15.5px; font-weight: 600; color: var(--ink-2); line-height: 1.45; }
.article-card .ac-summary {
  font-size: 13px; color: var(--gray-1); margin-top: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.article-card .ac-meta { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--gray-2); }
.article-card .ac-meta .spacer { flex: 1; }
.article-card .ac-fav { color: var(--gray-3); display: flex; align-items: center; gap: 3px; }
.article-card .ac-fav.faved { color: var(--accent); }

/* 横向图文卡片 */
.h-card { display: flex; gap: 12px; }
.h-card .h-thumb {
  width: 108px; height: 78px; border-radius: var(--radius-s); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.92);
  font-size: 12px; font-weight: 600; position: relative; overflow: hidden;
}
.h-card .h-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---------- 分类横滑 tab ---------- */
.cat-tabs {
  display: flex; gap: 22px; overflow-x: auto; padding: 4px 2px 10px;
  scrollbar-width: none; margin-bottom: 6px;
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tabs a {
  white-space: nowrap; font-size: 14.5px; color: var(--gray-1);
  padding-bottom: 5px; position: relative; font-weight: 500;
}
.cat-tabs a.active { color: var(--ink); font-weight: 700; }
.cat-tabs a.active::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%);
  bottom: 0; width: 20px; height: 3px; border-radius: 2px; background: var(--primary);
}

/* ---------- 搜索框 ---------- */
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border-radius: 22px; padding: 0 14px; height: 40px;
  box-shadow: var(--shadow); color: var(--gray-2); font-size: 13.5px;
  margin-bottom: 14px;
}

/* ---------- 宫格 ---------- */
.grid-menu { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px 4px; }
.grid-menu a { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 8px 0; font-size: 12px; color: var(--ink-2); position: relative; }
.grid-menu .g-icon {
  width: 46px; height: 46px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
}
.grid-menu .g-badge {
  position: absolute; top: 2px; left: calc(50% + 12px);
  min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px;
  background: var(--accent); color: #fff; font-size: 9.5px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- 时间线 ---------- */
.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px;
  width: 2px; background: var(--line); border-radius: 1px;
}
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item:last-child { padding-bottom: 2px; }
.tl-item::before {
  content: ""; position: absolute; left: -21px; top: 4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 3px solid var(--gray-3);
}
.tl-item.done::before { border-color: var(--primary); background: var(--primary); }
.tl-item.current::before { border-color: var(--accent); background: #fff; }
.tl-item .tl-title { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.tl-item.done .tl-title { color: var(--ink-2); }
.tl-item.pending .tl-title { color: var(--gray-2); font-weight: 500; }
.tl-item .tl-time { font-size: 11.5px; color: var(--gray-2); margin-top: 2px; }
.tl-item .tl-desc { font-size: 12.5px; color: var(--gray-1); margin-top: 4px; background: #F8FAFA; border-radius: 8px; padding: 8px 10px; }

/* ---------- 进度条 ---------- */
.progress { height: 8px; background: #E7EEEE; border-radius: 4px; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 4px; background-image: linear-gradient(90deg, #2e9bd9 0%, #2ee8cf 100%); }

/* ---------- 步骤指示器 ---------- */
.steps { display: flex; align-items: center; justify-content: center; gap: 0; padding: 6px 0 16px; }
.steps .step { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--gray-2); }
.steps .step .s-num {
  width: 22px; height: 22px; border-radius: 50%; background: #E4EBEB; color: var(--gray-1);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}
.steps .step.active { color: var(--primary-dark); font-weight: 600; }
.steps .step.active .s-num { background: var(--primary); color: #fff; }
.steps .s-line { width: 42px; height: 2px; background: #E4EBEB; margin: 0 10px; border-radius: 1px; }

/* ---------- 头像 ---------- */
.avatar {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background-image: linear-gradient(90deg, #2e9bd9 0%, #2ee8cf 100%);
  color: #fff; font-size: 19px; font-weight: 600;
}
.avatar.sm { width: 38px; height: 38px; font-size: 14px; }
.avatar.lg { width: 64px; height: 64px; font-size: 23px; }

/* ---------- 封面占位（渐变） ---------- */
.cover {
  border-radius: var(--radius-s); position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.95); font-weight: 600;
}
.cover.c1 { background-image: linear-gradient(90deg, #2e9bd9 0%, #2ee8cf 100%); }
.cover.c2 { background-image: linear-gradient(90deg, #2e9bd9 0%, #2ee8cf 100%); }
.cover.c3 { background-image: linear-gradient(90deg, #2e9bd9 0%, #2ee8cf 100%); }
.cover.c4 { background-image: linear-gradient(90deg, #2e9bd9 0%, #2ee8cf 100%); }
.cover.c5 { background-image: linear-gradient(90deg, #2e9bd9 0%, #2ee8cf 100%); }
.cover .play {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.28); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
}
.cover .duration {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(0,0,0,0.5); color: #fff; font-size: 10.5px;
  padding: 2px 7px; border-radius: 9px; font-weight: 500;
}

/* ---------- 工具类 ---------- */
.row { display: flex; align-items: center; }
.gap6 { gap: 6px; } .gap8 { gap: 8px; } .gap10 { gap: 10px; }
.flex1 { flex: 1; min-width: 0; }
.mt6 { margin-top: 6px; } .mt10 { margin-top: 10px; } .mt14 { margin-top: 14px; } .mt18 { margin-top: 18px; }
.mb10 { margin-bottom: 10px; } .mb14 { margin-bottom: 14px; }
.t-sub { font-size: 12.5px; color: var(--gray-2); }
.t-main { font-size: 14.5px; color: var(--ink-2); }
.t-title { font-size: 15.5px; font-weight: 600; color: var(--ink-2); }
.t-num { font-variant-numeric: tabular-nums; font-weight: 700; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.section-gap { height: 4px; }
