/* 家庭健康档案 · 手机优先（VIEW-06：≥16px 字号、≥44px 触控区、360px 不横向溢出） */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: #f6f7f9; color: #1c232b;
  font: 17px/1.65 -apple-system, "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
}
.wrap { max-width: 680px; margin: 0 auto; padding: 14px 14px 80px; }
a { color: #0b6b57; text-decoration: none; }
h1 { font-size: 24px; line-height: 1.35; margin: 6px 0 10px; }
h2 { font-size: 19px; margin: 22px 0 8px; }
h3 { font-size: 17px; margin: 16px 0 6px; }
p { margin: 6px 0; }
.muted { color: #6b7683; font-size: 15px; }
.small { font-size: 14px; }

/* 顶栏与导航 */
.topbar { position: sticky; top: 0; z-index: 20; background: #0e7a62; color: #fff; }
.topbar .wrap { padding: 10px 14px 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.topbar a { color: #fff; opacity: .85; padding: 6px 10px; border-radius: 8px; }
.topbar a.on { background: rgba(255,255,255,.18); opacity: 1; }
.topbar .brand { font-weight: 700; margin-right: auto; opacity: 1; }

/* 卡片 */
.card { background: #fff; border-radius: 12px; padding: 14px; margin: 10px 0; box-shadow: 0 1px 3px rgba(16,24,40,.07); }
.card.warn { border-left: 4px solid #d97706; background: #fffbeb; }
.card.danger { border-left: 4px solid #dc2626; background: #fef2f2; }
.card.ok { border-left: 4px solid #16a34a; background: #f0fdf4; }

/* 按钮 */
button, .btn {
  display: inline-block; min-height: 44px; padding: 9px 18px; border-radius: 10px; border: 1px solid #0e7a62;
  background: #0e7a62; color: #fff; font-size: 17px; font-weight: 600; cursor: pointer; text-align: center;
}
.btn.ghost { background: #fff; color: #0e7a62; }
.btn.gray { background: #eef1f4; color: #374151; border-color: #d5dae0; }
.btn.red { background: #dc2626; border-color: #dc2626; }
.btn.big { display: block; width: 100%; margin: 12px 0; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 0 0 auto; }
.grow { flex: 1 1 auto !important; min-width: 0; }

/* 表单 */
label { display: block; font-size: 15px; color: #414c58; margin: 12px 0 4px; font-weight: 600; }
input[type=text], input[type=password], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; font-size: 17px; border: 1px solid #c9d1d9; border-radius: 10px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #0e7a62; outline-offset: 1px; }
.pin-input { font-size: 30px !important; letter-spacing: 14px; text-align: center; font-family: ui-monospace, monospace; }
fieldset { border: none; margin: 0; padding: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { width: 22px; height: 22px; margin-top: 3px; flex: none; }
.check span { font-size: 15px; line-height: 1.55; }
.err { color: #b91c1c; font-size: 15px; margin: 8px 0; font-weight: 600; }

/* 徽标 */
.badge { display: inline-block; font-size: 13px; padding: 2px 9px; border-radius: 999px; background: #e6eef9; color: #2456a6; font-weight: 600; vertical-align: middle; }
.badge.low { background: #fef3c7; color: #92400e; }
.badge.high { background: #fee2e2; color: #991b1b; }
.badge.ok { background: #dcfce7; color: #166534; }

/* 首页 */
.month { font-size: 15px; font-weight: 700; color: #6b7683; margin: 18px 0 4px; }
.visit-card { display: block; background: #fff; border-radius: 12px; padding: 14px; margin: 10px 0; box-shadow: 0 1px 3px rgba(16,24,40,.07); color: inherit; }
.visit-card .t { font-weight: 700; font-size: 18px; }
.visit-card .meta { color: #6b7683; font-size: 14px; margin-top: 3px; }
.pending-item { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid #f0f2f5; }
.pending-item:last-child { border-bottom: none; }

/* 筛选条 */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.filters select, .filters input { width: auto; min-width: 80px; flex: 1 1 auto; }

/* 审阅 */
.doc-item { background: #fff; border-radius: 12px; padding: 10px; margin: 8px 0; display: flex; gap: 10px; border: 1px solid #e7ebef; }
.doc-item.flagged { border-color: #f59e0b; background: #fffdf5; }
.doc-item.conflict { border-color: #ef4444; background: #fff7f7; }
.doc-thumb { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; background: #edf0f3; flex: none; cursor: zoom-in; }
.doc-body { flex: 1 1 auto; min-width: 0; }
.doc-body select { min-height: 40px; font-size: 15px; padding: 6px 8px; }
.doc-title { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.doc-actions button, .doc-actions .btn { min-height: 38px; padding: 6px 12px; font-size: 14px; }
.conflict-item { padding: 10px 0; border-bottom: 1px dashed #eee; }
.conflict-item:last-child { border-bottom: none; }

/* 详情页 */
.detail-title { font-size: 25px; line-height: 1.4; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; font-size: 16px; }
.kv dt { color: #6b7683; }
.kv dd { margin: 0; }
.summary-block { border: 1px solid #e7ebef; border-radius: 10px; margin: 8px 0; }
.summary-block summary { font-weight: 700; padding: 10px 12px; cursor: pointer; }
.summary-block .bd { padding: 0 12px 10px; }
.cat-anchor { position: sticky; top: 52px; background: #f6f7f9; z-index: 5; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin: 8px 0; }
.gallery img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 10px; background: #edf0f3; cursor: zoom-in; }
.disclaimer { background: #eef6f4; border: 1px solid #cfe4de; color: #2f5d51; border-radius: 10px; padding: 10px 12px; font-size: 14px; margin: 14px 0; }

/* 上传进度 */
.up-item { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid #f1f3f5; font-size: 15px; }
.up-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-bar { height: 6px; background: #e7ebef; border-radius: 3px; overflow: hidden; flex: 2 1 80px; }
.up-bar i { display: block; height: 100%; background: #0e7a62; width: 0; transition: width .2s; }
.up-st { flex: none; font-size: 13px; color: #6b7683; width: 68px; text-align: right; }

/* 搜索结果 */
.result .snip { font-size: 15px; color: #4b5563; margin-top: 4px; }
mark { background: #fde68a; padding: 0 2px; border-radius: 3px; }

/* 灯箱 */
#lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 100; display: none; }
#lightbox.open { display: flex; flex-direction: column; }
#lightbox img { flex: 1; min-height: 0; width: 100%; object-fit: contain; touch-action: none; }
#lightbox .lb-bar { display: flex; gap: 10px; justify-content: center; padding: 10px; flex: none; }
#lightbox .lb-bar button { background: #374151; border-color: #4b5563; }

/* 表格（管理页） */
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid #edf0f3; vertical-align: top; }
th { color: #6b7683; font-size: 13px; }
td .btn, td button { min-height: 34px; padding: 4px 10px; font-size: 13px; margin: 2px 4px 2px 0; }
.stat { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat .card { margin: 0; text-align: center; }
.stat .n { font-size: 26px; font-weight: 800; }
code.ip { background: #f1f3f5; padding: 1px 5px; border-radius: 5px; font-size: 12px; }
.linkbox { background: #fff; border: 1px dashed #0e7a62; border-radius: 10px; padding: 12px; word-break: break-all; font-family: ui-monospace, monospace; font-size: 15px; user-select: all; -webkit-user-select: all; }
