/* 活档案 v0 —— 深海军蓝 + 医疗青（参谋长系列 UI 标准） */
:root {
  --navy: #0b2545;
  --navy-2: #13315c;
  --teal: #1f9e8f;
  --teal-2: #2bb6a4;
  --ink: #1a2332;
  --muted: #6b7a90;
  --line: #e3e9f0;
  --bg: #f5f8fb;
  --card: #ffffff;
  --warn: #c0392b;
  --shadow: 0 2px 14px rgba(11, 37, 69, 0.08);
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--teal); }

.topbar {
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .logo { font-weight: 700; font-size: 18px; letter-spacing: 1px; }
.topbar .tag { font-size: 12px; opacity: 0.7; }
.topbar .back { cursor: pointer; opacity: 0.85; font-size: 20px; }
.topbar .spacer { flex: 1; }
.provider-pill {
  font-size: 11px; background: rgba(255,255,255,0.15); padding: 3px 9px; border-radius: 20px;
}

.wrap { max-width: 680px; margin: 0 auto; padding: 16px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}
.card h3 { margin: 0 0 10px; font-size: 15px; color: var(--navy); }

h2.section { font-size: 16px; color: var(--navy); margin: 18px 4px 8px; }

button, .btn {
  font: inherit; cursor: pointer; border: none; border-radius: 10px;
  padding: 11px 16px; background: var(--teal); color: #fff; font-weight: 600;
  transition: filter .15s; display: inline-flex; align-items: center; gap: 6px;
}
button:hover, .btn:hover { filter: brightness(1.05); }
button.ghost, .btn.ghost { background: #eef3f8; color: var(--navy); }
button.full { width: 100%; justify-content: center; }
button:disabled { opacity: .5; cursor: not-allowed; }

input, textarea, select {
  font: inherit; width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 12px; background: #fff; color: var(--ink); margin-bottom: 10px;
}
textarea { min-height: 120px; resize: vertical; }
label.fld { display: block; font-size: 13px; color: var(--muted); margin: 0 0 4px; }

.subject-item {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  padding: 14px 16px; border-radius: var(--radius); background: var(--card);
  box-shadow: var(--shadow); margin-bottom: 10px;
}
.avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--teal), var(--teal-2));
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.subject-item .name { font-weight: 600; }
.subject-item .sub { font-size: 12px; color: var(--muted); }

.tabs { display: flex; gap: 4px; margin: 4px 0 14px; background: #eaf0f6; padding: 4px; border-radius: 12px; }
.tabs button {
  flex: 1; background: transparent; color: var(--muted); padding: 9px; font-size: 13px; border-radius: 9px;
}
.tabs button.active { background: #fff; color: var(--navy); box-shadow: 0 1px 4px rgba(0,0,0,.06); }

/* 分类卡片 */
.cat-group { margin-bottom: 14px; }
.cat-head { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-weight: 600; color: var(--navy); font-size: 14px; }
.cat-dot { width: 9px; height: 9px; border-radius: 50%; }
.item {
  border-left: 3px solid var(--line); padding: 8px 0 8px 12px; margin-bottom: 6px;
}
.item .t { font-weight: 600; }
.item .d { font-size: 13px; color: var(--muted); }
.item .q { font-size: 12px; color: #9aa7b8; font-style: italic; margin-top: 2px; }
.badge { font-size: 10px; padding: 1px 7px; border-radius: 10px; background: #eef3f8; color: var(--teal); margin-left: 6px; }
.badge.warn { background: #fdecea; color: var(--warn); }

.event-block { border-top: 1px dashed var(--line); padding-top: 12px; margin-top: 12px; }
.event-block:first-child { border-top: none; }
.event-meta { font-size: 12px; color: var(--muted); margin-bottom: 8px; }

.task-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.task-row .label { flex: 1; font-weight: 600; }
.task-row input { width: 90px; margin: 0; }
.task-row .unit { font-size: 12px; color: var(--muted); width: 38px; }
.task-row button { padding: 8px 12px; }

.log-row { font-size: 13px; padding: 5px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; }
.log-row .time { color: var(--muted); width: 92px; flex: none; }

.chat-msg { padding: 10px 12px; border-radius: 12px; margin-bottom: 8px; max-width: 88%; white-space: pre-wrap; }
.chat-msg.me { background: var(--navy); color: #fff; margin-left: auto; }
.chat-msg.ai { background: #eef3f8; color: var(--ink); }

.redline {
  font-size: 12px; color: var(--warn); background: #fdecea; border-radius: 10px;
  padding: 8px 12px; margin-bottom: 12px;
}
.step { padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.step:last-child { border-bottom: none; }
.step.done { color: var(--teal); font-weight: 600; }
.step.active { color: var(--navy); font-weight: 600; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.muted { color: var(--muted); font-size: 13px; }
.spin { display: inline-block; animation: sp 1s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 24px;
  box-shadow: var(--shadow); z-index: 50; font-size: 14px;
}
.hdr-actions { display: flex; flex-direction: column; gap: 6px; }
button.sm, .btn.sm { padding: 8px 10px; font-size: 12px; }
.mlabel { font-size: 12px; color: var(--muted); margin: 12px 0 4px; }
.mrow { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.mbtns { display: flex; gap: 6px; flex: none; }
.mbtns button { padding: 6px 12px; font-size: 13px; }

.room { background: var(--bg); border-radius: 12px; padding: 12px; min-height: 280px; max-height: 52vh; overflow-y: auto; margin-bottom: 10px; }
.rmsg { margin-bottom: 10px; max-width: 80%; }
.rmsg.mine { margin-left: auto; text-align: right; }
.rname { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.rbubble { display: inline-block; padding: 8px 12px; border-radius: 12px; background: #fff; box-shadow: var(--shadow); text-align: left; white-space: pre-wrap; }
.rmsg.mine .rbubble { background: var(--teal); color: #fff; }
.room-input { display: flex; gap: 8px; }
.room-input input { margin: 0; }

.tabs button { font-size: 12px; padding: 9px 4px; }

.cap-row { display: flex; gap: 8px; }
.cap-row .btn { flex: 1; justify-content: center; cursor: pointer; font-size: 14px; }
.media-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.media-item { background: var(--card); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.media-item img, .media-item video { width: 100%; height: 150px; object-fit: cover; display: block; background: #000; }
.media-meta { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px; font-size: 12px; color: var(--muted); }
.media-meta .del { color: var(--warn); cursor: pointer; }
.pickitem { cursor: pointer; }
.pickitem.on { outline: 3px solid var(--teal); outline-offset: -3px; }

.trial-banner { background: #fff7e6; border: 1px solid #ffe1a8; color: #8a5a00; font-size: 13px; cursor: pointer; }
.trial-banner .link { color: var(--teal); font-weight: 600; white-space: nowrap; }

.toolbar { display: flex; gap: 8px; padding: 12px; }
.toolbar button { flex: 1; font-size: 13px; padding: 10px 6px; }

.overlay {
  position: fixed; inset: 0; background: rgba(11,37,69,.45); z-index: 60;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  background: var(--card); width: 100%; max-width: 680px; border-radius: 18px 18px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 24px rgba(11,37,69,.18);
  animation: slideup .2s ease;
}
@keyframes slideup { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet h3 { margin: 0 0 10px; color: var(--navy); }
ol.guide { margin: 8px 0; padding-left: 20px; }
ol.guide li { margin: 6px 0; }

.share-box { display: flex; gap: 8px; align-items: center; }
.share-box input { margin: 0; }
.mic { background: var(--teal-2); }
.mic.rec { background: var(--warn); animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100%{ filter: brightness(1);} 50%{ filter: brightness(1.25);} }
