/* ===== 私人健康管家 · 企微侧边栏 ===== */
:root {
  --brand: #0b7a6b;
  --brand-deep: #075f54;
  --brand-soft: #e0f2ee;
  --bg: #f3f7f6;
  --card: #ffffff;
  --ink: #16302d;
  --ink-2: #5c6f6c;
  --ink-3: #8a9a97;
  --line: #e2eae8;
  --warn: #cf4444;
  --amber: #d9822b;
  --ok: #2e9e5b;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(22, 48, 45, 0.08), 0 4px 14px rgba(22, 48, 45, 0.05);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.55;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  padding-bottom: 12px;
}

button {
  font-family: inherit;
  cursor: pointer;
}

.hidden { display: none !important; }

/* ===== 顶部栏 ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 10px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
}

.brand-name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.2px;
}

.mode-tag {
  margin-left: auto;
  font-size: 11px;
  color: var(--brand-deep);
  background: var(--brand-soft);
  border: 1px solid #bfe2db;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}

.staff-bar {
  font-size: 12px;
  color: var(--brand-deep);
  background: var(--brand-soft);
  border: 1px dashed #bfe2db;
  border-radius: 8px;
  padding: 6px 10px;
  line-height: 1.5;
}

/* 搜索 */
.searchbox {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
  color: var(--ink-3);
}

.searchbox:focus-within {
  border-color: var(--brand);
  background: #fff;
}

.searchbox input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 10px 0;
  font-size: 14px;
  color: var(--ink);
}

.searchbox input::placeholder { color: var(--ink-3); }

.search-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 30;
  overflow: hidden;
}

.search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  width: 100%;
  border: none;
  background: #fff;
  text-align: left;
  font-size: 14px;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}

.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--brand-soft); }
.search-item .si-meta { font-size: 12px; color: var(--ink-2); }
.search-empty { padding: 14px 12px; color: var(--ink-3); font-size: 13px; }

/* ===== 客户切换 ===== */
.cust-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px 0;
}

.arrow {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-2);
}

.arrow:hover { color: var(--brand); border-color: var(--brand); }

.cust-switch-info {
  flex: 1;
  text-align: center;
  min-width: 0;
}

.cust-switch-name { font-weight: 700; font-size: 15px; }

.cust-switch-sub { font-size: 12px; color: var(--ink-3); }

/* ===== 健康座舱 Hero ===== */
.hero {
  position: relative;
  margin: 10px 14px 0;
  border-radius: 14px;
  background: linear-gradient(150deg, var(--brand) 0%, var(--brand-deep) 70%);
  color: #fff;
  padding: 14px 14px 0;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.hero-name { font-size: 19px; font-weight: 800; letter-spacing: 0.5px; }
.hero-meta { font-size: 12.5px; opacity: 0.88; margin-top: 2px; }

.plan-tag {
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.hero-tag {
  font-size: 12px;
  font-weight: 600;
  background: #fff;
  color: var(--brand-deep);
  padding: 3px 10px;
  border-radius: 999px;
}

.hero-tag.warn { color: var(--warn); }

.ecg {
  display: block;
  width: 100%;
  height: 44px;
  margin-top: 10px;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  opacity: 0.85;
  padding: 4px 2px 10px;
}

/* ===== Tab ===== */
.tabs {
  display: flex;
  gap: 6px;
  padding: 10px 14px 0;
}

.tab {
  flex: 1;
  height: 44px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
}

.tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.tab-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--warn);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ===== 视图与卡片 ===== */
.view {
  padding: 10px 14px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: 0 1px 2px rgba(22, 48, 45, 0.04);
}

.card-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.card-title-text { font-weight: 700; font-size: 14.5px; }
.card-title-note { font-size: 11.5px; color: var(--ink-3); }

/* 健康标签 */
.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.p-tag {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand-deep);
  background: var(--brand-soft);
  border: 1px solid #bfe2db;
  padding: 3px 10px;
  border-radius: 999px;
}

.p-tag.warn {
  color: #a83232;
  background: #fdecec;
  border-color: #f3c6c6;
}

.note-block {
  margin-top: 10px;
  background: #fbf8f0;
  border: 1px solid #efe4c8;
  border-radius: 10px;
  padding: 10px 12px;
}

.note-block .note-head {
  font-size: 12px;
  font-weight: 700;
  color: var(--amber);
  margin-bottom: 4px;
}

.note-block ul {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* 用药 */
.med-list { display: flex; flex-direction: column; gap: 8px; }

.med-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.med-item .med-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.med-name { font-weight: 700; font-size: 13.5px; }

.med-state {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.med-state.ok { color: var(--ok); background: #e7f6ec; }
.med-state.warn { color: var(--warn); background: #fdecec; }

.med-row {
  display: flex;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-2);
  flex-wrap: wrap;
}

.med-row .k { color: var(--ink-3); }

.med-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--bg);
  overflow: hidden;
}

.med-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--brand);
}

.med-bar i.warn { background: var(--amber); }

/* 体检 */
.exam-list { display: flex; flex-direction: column; gap: 8px; }

.exam-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}

.exam-item .exam-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
}

.exam-item .exam-date { font-size: 11.5px; color: var(--ink-3); font-weight: 400; }

.exam-rows { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }

.exam-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-2);
}

.exam-row .v.abn { color: var(--warn); font-weight: 700; }

/* 服务动态 */
.activity-list { display: flex; flex-direction: column; gap: 8px; }

.activity-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
}

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  margin-top: 6px;
  flex: 0 0 8px;
}

.activity-item.done .activity-dot { background: var(--ink-3); }
.activity-item .a-main { flex: 1; min-width: 0; }
.activity-item .a-time { font-size: 11.5px; color: var(--ink-3); }

/* ===== 快捷回复 ===== */
.reply-cats {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.reply-cats button {
  flex: 0 0 auto;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 600;
}

.reply-cats button.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.reply-list { display: flex; flex-direction: column; gap: 8px; }

.reply-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13.5px;
  color: var(--ink);
  text-align: left;
  width: 100%;
  min-height: 44px;
  line-height: 1.6;
}

.reply-item:hover { border-color: var(--brand); background: var(--brand-soft); }

.copy-tip {
  font-size: 12px;
  color: var(--ink-3);
  text-align: center;
  padding: 4px 0 8px;
}

/* ===== 待办提醒 ===== */
.remind-summary {
  display: flex;
  gap: 8px;
}

.remind-summary .rs-item {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}

.remind-summary .rs-num { font-size: 20px; font-weight: 800; color: var(--brand-deep); }
.remind-summary .rs-num.warn { color: var(--warn); }
.remind-summary .rs-label { font-size: 11.5px; color: var(--ink-2); }

.remind-list { display: flex; flex-direction: column; gap: 8px; }

.remind-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.remind-item.done { opacity: 0.55; }
.remind-item.done .r-text { text-decoration: line-through; }

.r-type {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}

.r-type.med { color: var(--brand-deep); background: var(--brand-soft); }
.r-type.expire { color: var(--warn); background: #fdecec; }
.r-type.review { color: var(--amber); background: #fbf3e4; }
.r-type.plan { color: #4a5fc1; background: #eaeefb; }

.r-body { flex: 1; min-width: 0; }
.r-title { font-size: 13.5px; font-weight: 600; }
.r-time { font-size: 12px; color: var(--ink-2); margin-top: 2px; }

.r-done {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--ink-2);
}

.r-done:hover { border-color: var(--ok); color: var(--ok); }

/* ===== 底部 ===== */
.foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px 4px;
  font-size: 11px;
  color: var(--ink-3);
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(10px);
  background: rgba(22, 48, 45, 0.92);
  color: #fff;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .toast { transition: none; }
}
