/* =========================================================
   家康 · 家庭健康档案  样式表
   移动优先，桌面端自动扩展
   ========================================================= */

:root {
  --bg: #f3f7f6;
  --bg-soft: #eaf2f0;
  --surface: #ffffff;
  --text: #12231f;
  --text-2: #435953;
  --muted: #7b8f89;
  --line: #e3ebe8;
  --brand: #0e9f8a;
  --brand-dark: #0a7f6e;
  --brand-soft: #e5f6f2;
  --brand-softer: #f2fbf9;
  --danger: #d9534f;
  --danger-soft: #fdeceb;
  --shadow-sm: 0 1px 2px rgba(15, 45, 38, .05);
  --shadow-md: 0 2px 8px rgba(15, 45, 38, .06), 0 12px 32px rgba(15, 45, 38, .07);
  --shadow-lg: 0 24px 60px rgba(9, 40, 34, .18);
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 26px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
}

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

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.no-scroll { overflow: hidden; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
h1, h2, h3, h4, p { margin: 0; }
.hidden { display: none !important; }

/* ---------------- 品牌 ---------------- */
.brand { display: flex; align-items: center; gap: 12px; }

.brand-mark {
  width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #12b39b, #0a7f6e);
  box-shadow: 0 6px 16px rgba(14, 159, 138, .3);
}
.brand-mark-sm { width: 26px; height: 26px; border-radius: 9px; box-shadow: none; }
.brand-text h1 { font-size: 21px; font-weight: 700; letter-spacing: .5px; }
.brand-text p { font-size: 13px; color: var(--muted); margin-top: 1px; }

/* ---------------- 登录页 ---------------- */
.auth {
  min-height: 100%;
  display: grid; place-items: center;
  padding: 32px 18px calc(32px + var(--safe-b));
  background:
    radial-gradient(900px 520px at 12% -8%, #d8f2ec 0%, transparent 60%),
    radial-gradient(700px 480px at 105% 10%, #e4f0fb 0%, transparent 62%),
    var(--bg);
}
.auth-inner { width: 100%; max-width: 400px; }
.auth-inner > .brand { justify-content: center; margin-bottom: 22px; }

.auth-card {
  background: var(--surface);
  border: 1px solid rgba(227, 235, 232, .9);
  border-radius: var(--r-xl);
  padding: 22px 22px 20px;
  box-shadow: var(--shadow-md);
}

.auth-foot {
  text-align: center; font-size: 12px; color: #93a6a0; margin-top: 18px;
}
.auth-tip { margin-top: 14px; font-size: 12.5px; color: var(--muted); text-align: center; }

/* 分段控件 */
.seg {
  position: relative; display: grid; grid-template-columns: 1fr 1fr;
  background: var(--bg-soft); border-radius: 12px; padding: 4px; margin-bottom: 20px;
}
.seg-btn {
  position: relative; z-index: 1; padding: 9px 0; font-size: 14.5px; font-weight: 600;
  color: var(--muted); border-radius: 9px; transition: color .18s;
}
.seg-btn.is-active { color: var(--brand-dark); }
.seg-thumb {
  position: absolute; top: 4px; left: 4px; width: calc(50% - 4px); height: calc(100% - 8px);
  background: var(--surface); border-radius: 9px; box-shadow: var(--shadow-sm);
  transition: transform .22s cubic-bezier(.4, .1, .2, 1);
}
.seg[data-mode="register"] .seg-thumb { transform: translateX(100%); }

/* 表单 */
.field { display: block; margin-bottom: 14px; }
.field-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }

input[type="text"], input[type="tel"], input[type="password"], input[type="date"],
input[type="search"], select, textarea {
  width: 100%; padding: 12px 13px;
  background-color: #fbfdfc;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  font-size: 15px; color: var(--text);
  transition: border-color .16s, box-shadow .16s, background .16s;
  outline: none;
  appearance: none;
}
input::placeholder, textarea::placeholder { color: #a9bab5; }
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  background-color: #fff;
  box-shadow: 0 0 0 3.5px rgba(14, 159, 138, .12);
}
textarea { resize: vertical; min-height: 96px; line-height: 1.6; }

/* 下拉框箭头 */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%237b8f89' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 12px;
  padding-right: 32px;
}
select:disabled { opacity: .62; cursor: default; }

.pwd { position: relative; display: block; }
.pwd input { padding-right: 62px; }
.pwd-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  padding: 6px 10px; font-size: 12.5px; font-weight: 600; color: var(--brand-dark);
  border-radius: 8px;
}
.pwd-toggle:hover { background: var(--brand-soft); }

.form-error {
  min-height: 18px; font-size: 12.5px; color: var(--danger);
  margin: -4px 0 8px; opacity: 0; transition: opacity .18s;
}
.form-error.show { opacity: 1; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 18px; border-radius: 12px; font-size: 15px; font-weight: 600;
  transition: transform .12s, background .16s, box-shadow .16s, opacity .16s;
  white-space: nowrap;
}
.btn:active { transform: scale(.985); }
.btn[disabled] { opacity: .6; pointer-events: none; }
.btn-primary {
  background: linear-gradient(180deg, #12ab94, var(--brand-dark));
  color: #fff; box-shadow: 0 4px 14px rgba(14, 159, 138, .28);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(14, 159, 138, .34); }
.btn-ghost { background: var(--bg-soft); color: var(--text-2); }
.btn-ghost:hover { background: #e2ece9; }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: #fbdcdb; }
.btn-block { width: 100%; padding: 13px 18px; font-size: 15.5px; }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 10px; }

.icon-btn {
  padding: 6px 11px; border-radius: 9px; font-size: 13px; color: var(--text-2);
  background: var(--bg-soft); font-weight: 600;
}
.icon-btn:hover { background: #e2ece9; }

/* ---------------- 顶栏 ---------------- */
.app { min-height: 100%; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px 8px; max-width: 900px; margin: 0 auto; width: 100%;
}
.logo { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; letter-spacing: .4px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.user-phone { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* 成员条 */
.member-bar {
  display: flex; align-items: center; gap: 8px;
  max-width: 900px; margin: 0 auto; width: 100%;
  padding: 2px 16px 10px;
}
.member-scroll {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 2px 0; flex: 1; scroll-behavior: smooth;
}
.member-scroll::-webkit-scrollbar { display: none; }

.member-chip {
  display: flex; align-items: center; gap: 8px; flex: 0 0 auto;
  padding: 6px 13px 6px 6px; border-radius: 999px;
  background: var(--bg-soft); border: 1.5px solid transparent;
  transition: background .16s, border-color .16s, transform .12s;
}
.member-chip:hover { background: #e2ece9; }
.member-chip:active { transform: scale(.97); }
.member-chip.is-active {
  background: var(--brand-soft); border-color: rgba(14, 159, 138, .38);
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 13.5px; font-weight: 700; color: #fff;
  background: linear-gradient(145deg, #7fc8bb, #4ea99b);
}
.avatar.male { background: linear-gradient(145deg, #7cb3e8, #4c8fd1); }
.avatar.female { background: linear-gradient(145deg, #efa3bc, #d9768f); }
.chip-name { font-size: 13.5px; font-weight: 600; }
.chip-rel { font-size: 11.5px; color: var(--muted); }
.member-chip.is-active .chip-name { color: var(--brand-dark); }

.member-add {
  flex: 0 0 auto; display: flex; align-items: center; gap: 4px;
  padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  color: var(--brand-dark); background: var(--brand-soft);
  border: 1.5px dashed rgba(14, 159, 138, .35);
}
.member-add .plus { font-size: 15px; line-height: 1; }
.member-add:hover { background: #d9f1eb; }

/* ---------------- 内容区 ---------------- */
.content {
  flex: 1; width: 100%; max-width: 900px; margin: 0 auto;
  padding: 16px 16px calc(104px + var(--safe-b));
}

.member-hero {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 16px; margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.hero-avatar {
  width: 52px; height: 52px; border-radius: 16px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 20px; font-weight: 700; color: #fff;
  background: linear-gradient(145deg, #7fc8bb, #4ea99b);
}
.hero-avatar.male { background: linear-gradient(145deg, #7cb3e8, #4c8fd1); }
.hero-avatar.female { background: linear-gradient(145deg, #efa3bc, #d9768f); }
.hero-main { flex: 1; min-width: 0; }
.hero-name { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.tag {
  font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 6px;
  background: var(--brand-soft); color: var(--brand-dark);
}
.hero-sub {
  font-size: 12.5px; color: var(--muted); margin-top: 3px;
  display: flex; flex-wrap: wrap; gap: 1px 9px;
}
.hero-sub span { white-space: nowrap; }
.hero-actions { display: flex; gap: 6px; }

.month-head {
  display: flex; align-items: center; gap: 10px;
  margin: 20px 0 10px; font-size: 12.5px; font-weight: 700; color: var(--muted);
  letter-spacing: .4px;
}
.month-head::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.timeline { position: relative; display: flex; flex-direction: column; gap: 10px; }

.rec-card {
  position: relative;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 14px 15px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .18s, transform .18s, border-color .18s;
}
.rec-card:hover { box-shadow: var(--shadow-md); border-color: #d5e4e0; transform: translateY(-1px); }
.rec-card::before {
  content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--brand); opacity: .75;
}
.rec-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.rec-item { font-size: 15.5px; font-weight: 700; line-height: 1.4; }
.rec-date {
  flex: 0 0 auto; font-size: 12px; font-weight: 600; color: var(--brand-dark);
  background: var(--brand-softer); padding: 3px 9px; border-radius: 8px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.rec-meta { font-size: 12.5px; color: var(--muted); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 10px; }
.rec-note {
  margin-top: 8px; font-size: 13.5px; color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* 异常项：列表里用红色突出，无异常时整块不渲染 */
.rec-abnormal {
  margin-top: 9px; padding: 8px 10px;
  background: var(--danger-soft); border-radius: 9px;
  border-left: 3px solid var(--danger);
  display: flex; align-items: flex-start; gap: 7px;
  font-size: 13px; line-height: 1.5; color: #b8423e;
}
.abn-badge {
  flex: 0 0 auto; margin-top: 1px; padding: 1px 6px; border-radius: 5px;
  background: var(--danger); color: #fff;
  font-size: 10.5px; font-weight: 700; letter-spacing: .5px; line-height: 1.5;
}
.abn-text {
  min-width: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  word-break: break-word; white-space: pre-wrap;
}
.thumbs { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.thumb {
  width: 54px; height: 54px; border-radius: 9px; overflow: hidden;
  border: 1px solid var(--line); background: var(--bg-soft);
  display: grid; place-items: center; flex: 0 0 auto;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-pdf {
  width: auto; padding: 0 10px; gap: 5px; display: flex; align-items: center;
  font-size: 11.5px; font-weight: 600; color: var(--danger);
  background: var(--danger-soft); border-color: #f8d7d5;
  max-width: 130px;
}
.thumb-pdf span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb-more {
  font-size: 12px; font-weight: 600; color: var(--muted); background: var(--bg-soft);
}

/* 空状态 */
.empty {
  text-align: center; padding: 44px 20px;
  background: var(--surface); border: 1px dashed #d7e4e0; border-radius: var(--r-lg);
}
.empty-icon {
  width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 20px;
  display: grid; place-items: center; background: var(--brand-softer); color: var(--brand);
}
.empty h3 { font-size: 15.5px; font-weight: 700; }
.empty p { font-size: 13px; color: var(--muted); margin: 6px 0 16px; }

/* FAB */
.fab {
  position: fixed; right: 18px; bottom: calc(20px + var(--safe-b)); z-index: 25;
  display: flex; align-items: center; gap: 8px;
  padding: 14px 20px 14px 16px; border-radius: 999px;
  background: linear-gradient(180deg, #12ab94, var(--brand-dark));
  color: #fff; font-size: 14.5px; font-weight: 600;
  box-shadow: 0 10px 28px rgba(10, 127, 110, .34);
  transition: transform .14s, box-shadow .16s;
}
.fab:hover { box-shadow: 0 14px 34px rgba(10, 127, 110, .4); }
.fab:active { transform: scale(.96); }

/* ---------------- 弹层 ---------------- */
.overlay {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(11, 32, 27, .42);
  backdrop-filter: blur(2px);
  animation: fade .18s ease;
}
.overlay[hidden] { display: none; }

.sheet {
  position: fixed; z-index: 41; left: 0; right: 0; bottom: 0;
  max-height: 90vh; display: flex; flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--shadow-lg);
  animation: slideUp .26s cubic-bezier(.32, .72, 0, 1);
  padding-bottom: var(--safe-b);
}
.sheet[hidden] { display: none; }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 12px; border-bottom: 1px solid var(--line); flex: 0 0 auto;
}
.sheet-head h2 { font-size: 16.5px; font-weight: 700; }
.sheet-close {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  color: var(--muted); background: var(--bg-soft); font-size: 14px;
}
.sheet-close:hover { background: #e2ece9; color: var(--text-2); }
.sheet-body { padding: 16px 18px calc(22px + var(--safe-b)); overflow-y: auto; -webkit-overflow-scrolling: touch; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }

/* 表单行 */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.birth-row { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 8px; }
.seg-inline { display: flex; gap: 8px; }
.gender-btn {
  flex: 1; padding: 10px 0; border-radius: 11px; font-size: 14px; font-weight: 600;
  background: #fbfdfc; border: 1.5px solid var(--line); color: var(--text-2);
  transition: all .16s;
}
.gender-btn.is-active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); }

.item-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: -4px 0 14px; }
.item-chip {
  padding: 6px 11px; border-radius: 999px; font-size: 12.5px;
  background: var(--bg-soft); color: var(--text-2); font-weight: 500;
  border: 1px solid transparent;
}
.item-chip:hover { background: var(--brand-soft); color: var(--brand-dark); border-color: rgba(14, 159, 138, .3); }

/* 上传 */
.upload-zone { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 2px; border-radius: 12px; transition: box-shadow .16s, background .16s; }
.upload-zone.is-dragover {
  background: var(--brand-softer);
  box-shadow: 0 0 0 2px var(--brand), 0 0 0 7px rgba(14, 159, 138, .12);
}
.upload-btn {
  width: 84px; height: 84px; border-radius: 12px; flex: 0 0 auto;
  border: 1.5px dashed #cfe0db; background: #fbfdfc;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; color: var(--muted);
  font-size: 11.5px; text-align: center; line-height: 1.2; white-space: nowrap;
  transition: all .16s;
}
.upload-btn:hover { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-softer); }

/* 拖拽投放提示区 */
.drop-hint {
  flex: 1 1 132px; min-width: 118px; min-height: 84px;
  border: 1.5px dashed #cfe0db; border-radius: 12px;
  background: #fbfdfc; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; padding: 8px 6px;
  font-size: 11.5px; line-height: 1.2; text-align: center; white-space: nowrap;
  cursor: pointer; transition: all .16s;
}
.drop-hint[hidden] { display: none; }
.drop-hint:hover { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-softer); }
.drop-hint.is-hot {
  border-style: solid; border-color: var(--brand);
  background: #fff; color: var(--brand-dark); font-weight: 600;
  transform: scale(1.03); box-shadow: 0 4px 14px rgba(14, 159, 138, .18);
}

.file-item {
  position: relative; width: 84px; height: 84px; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); background: var(--bg-soft);
}
.file-item img { width: 100%; height: 100%; object-fit: cover; }
.file-item .file-pdf {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: 10.5px; color: var(--danger); font-weight: 600; padding: 6px 5px;
  text-align: center; word-break: break-all;
}
.file-pdf-name {
  max-width: 100%; font-size: 9.5px; font-weight: 500; line-height: 1.25; color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.file-remove {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(18, 35, 31, .62); color: #fff; font-size: 11px;
  display: grid; place-items: center; backdrop-filter: blur(2px);
}

/* 编辑时移除的已有附件：先淡化标记，点 ↺ 可以反悔 */
.file-item.is-removed { border-style: dashed; border-color: #f0c4c2; }
.file-item.is-removed img,
.file-item.is-removed .file-pdf { opacity: .28; filter: grayscale(1); }
.file-removed {
  position: absolute; left: 0; right: 0; bottom: 0;
  text-align: center; font-size: 10px; font-weight: 700; letter-spacing: .3px;
  background: rgba(18, 35, 31, .66); color: #fff; padding: 2px 0;
}
.file-undo {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: 12px; line-height: 1;
  display: grid; place-items: center; box-shadow: 0 1px 4px rgba(10, 127, 110, .4);
}

.form-hint { font-size: 11.5px; color: var(--muted); margin-top: 7px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 20px; }
.sheet-actions .btn { flex: 1; }

/* 详情 */
.detail-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.detail-title { font-size: 19px; font-weight: 700; line-height: 1.35; }
.detail-sub { font-size: 13px; color: var(--muted); margin-top: 5px; }
.detail-block { margin-top: 16px; }
.detail-label {
  font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: .6px; margin-bottom: 6px;
}
.detail-note { font-size: 14px; color: var(--text-2); white-space: pre-wrap; word-break: break-word; }
.detail-abnormal {
  padding: 10px 12px; border-radius: 10px;
  background: var(--danger-soft); border-left: 3px solid var(--danger);
  font-size: 14px; font-weight: 600; color: #b8423e;
  white-space: pre-wrap; word-break: break-word; line-height: 1.6;
}

/* 表单里的异常项输入框：比检查内容矮一些 */
.abn-input { min-height: 62px; }
.abn-input::placeholder { color: #b8c6c2; }
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 9px; }
.att {
  border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: var(--bg-soft);
  display: flex; flex-direction: column;
}
.att-img {
  aspect-ratio: 1; width: 100%; object-fit: contain; display: block;
  background: #f6faf8;
}
.att-file {
  aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; color: var(--danger); font-size: 11px; font-weight: 600; padding: 8px; text-align: center;
}
.att-name {
  font-size: 11px; color: var(--muted); padding: 6px 7px; border-top: 1px solid var(--line);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--surface);
}
.detail-foot {
  margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.detail-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.detail-created { font-size: 11.5px; color: var(--muted); }

/* 图片查看器（滚轮 / 双指缩放 + 拖动） */
.lightbox {
  position: fixed; inset: 0; z-index: 60;
  background: #05100d;
  display: flex; flex-direction: column;
  animation: fade .18s ease;
  overscroll-behavior: contain;
}
.lightbox[hidden] { display: none; }

.viewer-toolbar {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 10px;
  color: #cfe0db; font-size: 12px;
}
.viewer-hint { opacity: .68; letter-spacing: .2px; }
.viewer-actions { display: flex; align-items: center; gap: 7px; }
.viewer-btn {
  min-width: 34px; height: 34px; padding: 0 9px;
  border-radius: 10px; background: rgba(255, 255, 255, .13);
  color: #f2fbf9; font-size: 15px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; transition: background .15s, transform .1s;
}
.viewer-btn:hover { background: rgba(255, 255, 255, .22); }
.viewer-btn:active { transform: scale(.94); }
.viewer-wide { font-size: 12.5px; padding: 0 12px; }

@media (max-width: 599px) {
  .viewer-hint { display: none; }
  .viewer-toolbar { justify-content: flex-end; padding-left: 12px; padding-right: 12px; }
  .viewer-btn { min-width: 38px; height: 38px; }
}

.viewer-stage {
  flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; padding: 4px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  touch-action: none; cursor: grab;
}
.viewer-stage.is-grabbing { cursor: grabbing; }
.viewer-stage img {
  max-width: 100%; max-height: 100%;
  /* 图片是 flex 子项，默认 flex-shrink:1 会把放大的宽度压回容器宽度，
     浏览器仍按缩小尺寸栅格化 —— 必须禁止收缩。 */
  flex: 0 0 auto;
  border-radius: 8px; box-shadow: var(--shadow-lg);
  transform-origin: center center;
  /* 不要加 will-change: transform：它会让浏览器按缩小后的位图缓存一层，
     放大时只是把位图拉大，图片就糊了。这里靠实时改 width 触发重绘。 */
  user-select: none; -webkit-user-select: none; -webkit-user-drag: none;
  image-rendering: auto;
}

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(88px + var(--safe-b)); transform: translateX(-50%);
  z-index: 70; padding: 11px 18px; border-radius: 12px;
  background: rgba(18, 35, 31, .92); color: #fff; font-size: 13.5px; font-weight: 500;
  box-shadow: var(--shadow-md); max-width: 84vw; text-align: center;
  animation: toastIn .2s ease;
}
.toast[hidden] { display: none; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* 加载骨架 */
.loading { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 40px 0; color: var(--muted); font-size: 13px; }
.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--brand);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- 桌面端 ---------------- */
@media (min-width: 760px) {
  body { font-size: 15px; }
  .topbar-inner, .member-bar { max-width: 900px; padding-left: 24px; padding-right: 24px; }
  .content { padding: 24px 24px 110px; }

  .sheet {
    left: 50%; right: auto; bottom: auto; top: 50%;
    transform: translate(-50%, -50%);
    width: min(540px, calc(100vw - 48px));
    max-height: 84vh;
    border-radius: var(--r-xl);
    animation: popIn .2s cubic-bezier(.32, .72, 0, 1);
  }
  .sheet-body { padding-bottom: 24px; }
  @keyframes popIn { from { opacity: 0; transform: translate(-50%, -48%) scale(.97); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

  .auth-inner { max-width: 420px; }
  .auth-card { padding: 26px 26px 22px; }

  .fab { right: max(20px, calc(50vw - 538px)); bottom: 32px; padding: 12px 18px 12px 14px; }
  .rec-card { padding: 16px 18px; }
  .timeline { gap: 12px; }
}

@media (min-width: 1100px) {
  .member-hero { padding: 18px 20px; }
  .hero-avatar { width: 56px; height: 56px; }
}

/* ---------------- 补充：确认框 / 附件 / 空成员 ---------------- */
.chip-empty { font-size: 13px; color: var(--muted); padding: 8px 4px; }

.confirm-wrap {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center; padding: 24px;
  background: rgba(11, 32, 27, .46);
  backdrop-filter: blur(3px);
  animation: fade .16s ease;
}
.confirm-card {
  width: min(340px, 100%);
  background: var(--surface); border-radius: var(--r-lg);
  padding: 22px 20px 18px; box-shadow: var(--shadow-lg);
  animation: popIn2 .18s cubic-bezier(.32, .72, 0, 1);
}
.confirm-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.confirm-card p { font-size: 13.5px; color: var(--text-2); line-height: 1.6; }
.confirm-actions { display: flex; gap: 10px; margin-top: 20px; }
.confirm-actions .btn { flex: 1; padding: 10px 14px; font-size: 14px; }
@keyframes popIn2 { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: scale(1); } }

.att { padding: 0; text-align: left; text-decoration: none; color: inherit; cursor: pointer; }
.att:hover { border-color: #cfe0db; box-shadow: var(--shadow-sm); }
.att-file { background: var(--danger-soft); }
