/* 患者端小程序"模拟器"样式：手机壳 + 微信绿点缀（复用 style.css 的 CSS 变量与 badge/timeline 体系） */
:root { --wx-green: #07c160; --wx-green-soft: #e6f7ec; }

body.patient {
  margin: 0; background: #dfe4ea; min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink); padding: 14px 0 28px;
}
.demo-hint { font-size: 12px; color: #6b7785; }
.demo-hint a { color: var(--primary); text-decoration: none; }

/* 手机壳 */
.phone {
  width: 390px; height: min(820px, calc(100vh - 60px));
  background: var(--card); border-radius: 40px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.30), 0 0 0 10px #11161c, 0 0 0 11px #2b3340;
  display: flex; flex-direction: column; position: relative;
}
.statusbar { height: 30px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; font-size: 12px; font-weight: 600; color: var(--ink); }
.statusbar .icons { letter-spacing: 1px; }
/* 微信小程序胶囊头 */
.capsule { height: 42px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; position: relative; border-bottom: 1px solid var(--line); background: var(--card); }
.capsule .title { font-size: 15px; font-weight: 600; }
.capsule .caps { position: absolute; right: 12px; top: 9px; width: 78px; height: 26px; border: 1px solid var(--line); border-radius: 14px; display: flex; align-items: center; justify-content: space-around; color: var(--muted); font-size: 14px; }
.capsule .caps span { line-height: 1; }
.capsule .back { position: absolute; left: 14px; top: 9px; font-size: 18px; color: var(--ink); cursor: pointer; background: none; border: none; }

/* 屏幕滚动区 */
.screen { flex: 1; overflow-y: auto; background: var(--bg); padding: 12px; }
.screen::-webkit-scrollbar { width: 0; }

/* 底部 Tab */
.tabbar { height: 56px; flex-shrink: 0; display: flex; border-top: 1px solid var(--line); background: var(--card); }
.tabbar button { flex: 1; background: none; border: none; cursor: pointer; font-size: 11px; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.tabbar button .ic { font-size: 18px; line-height: 1; }
.tabbar button.active { color: var(--wx-green); }
.tabbar.hidden { display: none; }

/* 通用卡片/控件 */
.p-card { background: var(--card); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); margin-bottom: 12px; }
.p-card.flat { box-shadow: none; border: 1px solid var(--line); }
.p-title { font-size: 14px; font-weight: 600; margin: 14px 2px 8px; display: flex; align-items: center; gap: 6px; }
.p-title:first-child { margin-top: 2px; }
.muted { color: var(--muted); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hint { font-size: 12px; color: var(--muted); }

/* 微信绿主按钮 */
.wx-btn { width: 100%; background: var(--wx-green); color: #fff; border: none; border-radius: 10px; padding: 12px; font-size: 15px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }
.wx-btn:active { opacity: .9; }
.wx-btn.ghost { background: var(--wx-green-soft); color: #0a8a47; }
.wx-btn:disabled { background: #cbd5e1; cursor: default; }
.btn-line { width: 100%; background: var(--card); color: var(--primary); border: 1px solid var(--line); border-radius: 10px; padding: 11px; font-size: 14px; cursor: pointer; }

/* 表单 */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.field input, .field select, .field textarea { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; background: #fff; color: var(--ink); box-sizing: border-box; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 7px 14px; border-radius: 20px; border: 1px solid var(--line); background: #fff; font-size: 13px; cursor: pointer; color: var(--ink); }
.chip.on { background: var(--wx-green); color: #fff; border-color: var(--wx-green); }

/* 登录页 */
.login-wrap { padding: 30px 22px; text-align: center; height: 100%; display: flex; flex-direction: column; }
.logo { width: 68px; height: 68px; border-radius: 20px; background: linear-gradient(135deg, #0e7490, #22a3b8); margin: 28px auto 14px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 30px; }
.login-wrap h2 { margin: 0 0 4px; font-size: 20px; }
.login-sub { color: var(--muted); font-size: 13px; margin-bottom: 28px; }
.login-foot { margin-top: auto; font-size: 11px; color: var(--muted); line-height: 1.6; }

/* 复查倒计时大卡 */
.countdown { border-radius: 16px; padding: 18px; color: #fff; background: linear-gradient(120deg, #0e7490, #155e75); margin-bottom: 12px; }
.countdown.overdue { background: linear-gradient(120deg, #b91c1c, #7f1d1d); }
.countdown.none { background: linear-gradient(120deg, #475569, #334155); }
.countdown .big { font-size: 34px; font-weight: 800; line-height: 1.1; }
.countdown .big small { font-size: 14px; font-weight: 500; opacity: .9; }
.countdown .meta { font-size: 13px; opacity: .92; margin-top: 6px; }
.countdown .wx-btn { margin-top: 14px; background: #fff; color: #0a6f53; }

/* 宫格快捷入口 */
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.grid4 .cell { background: var(--card); border-radius: 12px; padding: 12px 4px; text-align: center; box-shadow: var(--shadow); cursor: pointer; }
.grid4 .cell .ic { font-size: 22px; }
.grid4 .cell .lb { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* 列表行 */
.line-item { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.line-item:last-child { border-bottom: none; }
.line-item .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* 结果弹层（绑定/预约成功 + 订阅引导） */
.sheet-mask { position: absolute; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: flex-end; z-index: 20; }
.sheet { background: #fff; width: 100%; border-radius: 18px 18px 0 0; padding: 22px 18px 18px; animation: up .2s ease; }
@keyframes up { from { transform: translateY(40px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
.sheet .ok-ic { width: 54px; height: 54px; border-radius: 50%; background: var(--wx-green-soft); color: var(--wx-green); display: flex; align-items: center; justify-content: center; font-size: 30px; margin: 0 auto 10px; }
.sheet h3 { text-align: center; margin: 0 0 4px; }
.sheet .sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 14px; }
/* 仿微信订阅授权卡 */
.sub-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 14px; }
.sub-card .sc-h { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.sub-opt { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 14px; }
.sub-opt input { width: 16px; height: 16px; accent-color: var(--wx-green); }

/* 授权/合规行 */
.consent-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
.consent-row:last-child { border-bottom: none; }
.consent-row .cr-l { font-size: 14px; }
.consent-row .cr-l .d { font-size: 12px; color: var(--muted); margin-top: 2px; max-width: 210px; }
/* 简易开关 */
.switch { width: 44px; height: 24px; border-radius: 14px; background: #cbd5e1; position: relative; cursor: pointer; flex-shrink: 0; transition: background .15s; }
.switch.on { background: var(--wx-green); }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch.on::after { left: 22px; }

/* 二维码占位（纯 CSS 棋盘） */
.qr { width: 150px; height: 150px; margin: 8px auto; border-radius: 10px; background-color: #fff; padding: 8px; border: 1px solid var(--line);
  background-image:
    linear-gradient(45deg, #11161c 25%, transparent 25%, transparent 75%, #11161c 75%),
    linear-gradient(45deg, #11161c 25%, transparent 25%, transparent 75%, #11161c 75%);
  background-size: 20px 20px; background-position: 0 0, 10px 10px; }
.loading-p { padding: 40px; text-align: center; color: var(--muted); }
.toast { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); background: rgba(0,0,0,.78); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px; z-index: 30; }
