:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #1c2734;
  --sub: #5d6b80;
  --muted: #8b97a8;
  --line: #e7edf5;
  --blue: #2f7cf6;
  --blue-deep: #1d6adf;
  --green: #16a34a;
  --shadow: 0 10px 28px rgba(37, 84, 158, 0.08);
  --radius: 18px;
  --tab: calc(58px + env(safe-area-inset-bottom));
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(circle at 12% 0%, #d9e8ff 0, transparent 28%),
    radial-gradient(circle at 100% 10%, #d7f4ea 0, transparent 24%),
    #d7e2f0;
}
button, input, select, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; }
button:active { transform: scale(0.985); }
a { color: var(--blue); }
img, svg { display: block; }
p { margin: 0 0 10px; }

.app {
  width: min(430px, 100%);
  height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7), 0 20px 60px rgba(24, 58, 110, 0.16);
}

.topbar {
  height: calc(48px + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex: none;
  background: rgba(244, 247, 251, 0.92);
  backdrop-filter: blur(10px);
}
.topbar h1 { margin: 0; font-size: 17px; font-weight: 700; }
.back, .icon-btn {
  position: absolute;
  left: 6px;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--text);
  display: grid;
  place-items: center;
}
.main { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.main::-webkit-scrollbar { width: 0; }

.tabbar {
  flex: none;
  height: var(--tab);
  padding-bottom: env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #fff;
  border-top: 1px solid var(--line);
}
.tab {
  border: 0;
  background: transparent;
  color: #98a2b3;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 0;
}
.tab svg { width: 23px; height: 23px; }
.tab.active { color: var(--blue); font-weight: 700; }

.home-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 0;
}
.logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(145deg, #59b2ff, #2f7cf6);
  box-shadow: 0 8px 16px rgba(47, 124, 246, 0.28);
}
.home-bar strong { display: block; font-size: 16px; }
.home-bar small { color: var(--muted); font-size: 12px; }

.hero {
  margin: 14px 16px 0;
  padding: 18px;
  min-height: 138px;
  border-radius: 20px;
  color: #fff;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  background:
    radial-gradient(circle at 90% 20%, rgba(255, 255, 255, 0.28), transparent 26%),
    linear-gradient(135deg, #6cbcff 0%, #3b8cf8 48%, #2b6fe6 100%);
  box-shadow: 0 14px 30px rgba(47, 124, 246, 0.25);
}
.hero h2 { margin: 0; font-size: 28px; letter-spacing: 0.5px; }
.hero .sub { margin: 2px 0 0; font-size: 20px; font-weight: 700; }
.hero .desc { margin: 10px 0 0; font-size: 12px; opacity: 0.95; }
.hero-side {
  align-self: center;
  min-width: 112px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  text-align: right;
  font-size: 13px;
  line-height: 1.7;
}
.hero-side b { display: block; font-size: 14px; }

.greet, .card, .tool, .article, .fn, .choice, .option, .dept, .med-item, .record, .help-item {
  background: #fff;
  box-shadow: var(--shadow);
}
.greet {
  margin: 12px 16px 0;
  border-radius: 16px;
  padding: 14px;
}
.greet-hi { font-size: 18px; font-weight: 750; display: flex; align-items: center; gap: 8px; }
.greet-row { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; }
.chip, .person-btn, .text-btn {
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: #f3f6fb;
  color: #415066;
  font-size: 13px;
}
.person-btn { background: #f3f8ff; color: var(--blue); border: 1px solid #d9e6ff; }

.section-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 16px 10px;
  font-weight: 800;
  font-size: 17px;
}
.section-h span { display: flex; align-items: center; gap: 8px; }
.section-h span::before {
  content: "";
  width: 4px;
  height: 16px;
  border-radius: 4px;
  background: var(--blue);
}
.section-h button { border: 0; background: transparent; color: var(--muted); font-size: 13px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px; }
.svc {
  position: relative;
  height: 108px;
  border: 0;
  border-radius: 16px;
  text-align: left;
  padding: 14px 12px;
  overflow: hidden;
  font-size: 16px;
  font-weight: 800;
  color: #1e293b;
}
.svc small { display: block; margin-top: 4px; font-size: 12px; font-weight: 500; color: var(--sub); }
.svc svg { position: absolute; right: 0; bottom: 0; width: 86px; height: 72px; }
.svc-blue { background: linear-gradient(160deg, #eef6ff, #dcecff); }
.svc-green { background: linear-gradient(160deg, #edfbf3, #daf7e8); }
.svc-purple { background: linear-gradient(160deg, #f6f0ff, #ebe3ff); }
.svc-peach { background: linear-gradient(160deg, #fff6ee, #ffe8d6); }
.svc-yellow { background: linear-gradient(160deg, #fffbeb, #fff1c2); }
.svc-mint { background: linear-gradient(160deg, #f0fffb, #d9f8f1); }

.tool {
  border: 0;
  border-radius: 16px;
  padding: 14px 12px;
  display: flex;
  gap: 10px;
  text-align: left;
  align-items: center;
}
.tool b, .fn b, .article b { display: block; font-size: 15px; }
.tool small, .fn small, .article small, .muted { color: var(--muted); font-size: 12px; }
.tico {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex: none;
}
.tico svg { width: 22px; height: 22px; }
.t-blue { background: #e8f1ff; color: #2f7cf6; }
.t-green { background: #e7f8ee; color: #16a34a; }
.t-orange { background: #fff1e6; color: #f97316; }
.t-purple { background: #f3e8ff; color: #7c3aed; }
.t-rose { background: #ffe8ef; color: #e11d48; }
.t-cyan { background: #e5f8ff; color: #0891b2; }

.article {
  width: calc(100% - 32px);
  margin: 0 16px 10px;
  border: 0;
  border-radius: 16px;
  padding: 12px;
  display: flex;
  gap: 12px;
  text-align: left;
}
.cover {
  width: 108px;
  height: 80px;
  border-radius: 12px;
  flex: none;
  color: #fff;
  display: flex;
  align-items: flex-end;
  padding: 8px;
  font-size: 12px;
  font-weight: 700;
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.tag {
  background: #f3f7ff;
  color: #3b6cb5;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
}
.tag.soft { background: #f4f6f8; color: #64748b; }

.hero-side b,
.hero-side span { display: block; }
.care-banner {
  flex: none;
  margin: 0 12px 8px;
  background: #fff6ea;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  box-shadow: 0 8px 20px rgba(234, 149, 62, 0.16);
  color: #9a5b16;
  font-size: 14px;
}
.care-banner button { border: 0; background: transparent; color: #d97706; font-weight: 700; }
.care-banner .x { margin-left: auto; color: #c4a27a; font-size: 18px; }

.page { padding: 8px 16px 24px; }
.lead { text-align: center; margin-bottom: 16px; }
.lead h2 { margin: 6px 0; font-size: 26px; }
.lead p { color: var(--sub); margin: 0; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice {
  border: 0;
  border-radius: 20px;
  padding: 18px 14px 14px;
  text-align: center;
  position: relative;
}
.choice .bubble {
  width: 64px;
  height: 64px;
  margin: 0 auto 10px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
}
.choice .bubble svg, .bell svg { width: 28px; height: 28px; }
.tag { font-style: normal; }
.badge { font-style: normal; }
.btn-row .btn { flex: 1; width: auto; }
.strip span:last-child { margin-left: auto; color: #c5ceda; }
.choice b { display: block; font-size: 16px; }
.choice small { color: var(--muted); }
.go {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: #fff;
  font-size: 16px;
}
.strip {
  width: 100%;
  margin-top: 12px;
  border: 0;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}
.strip b { display: block; font-size: 16px; }
.strip small { display: block; color: var(--muted); font-size: 12px; }
.dots { margin-top: 14px; }
.dots div { display: flex; gap: 8px; margin: 8px 0; font-size: 13px; color: var(--sub); }
.dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; }

.option {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 14px;
  margin: 8px 0;
  text-align: left;
  font-size: 15px;
}
.progress { height: 6px; background: #e6eef8; border-radius: 99px; overflow: hidden; margin: 8px 0 14px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, #67b2ff, #2f7cf6); }

.urgency { border-radius: 16px; padding: 14px; color: #fff; margin-bottom: 12px; }
.urgency.urgent, .urgency.crisis { background: linear-gradient(135deg, #fb7185, #e11d48); }
.urgency.soon { background: linear-gradient(135deg, #fdba74, #f97316); }
.urgency.routine { background: linear-gradient(135deg, #60a5fa, #2f7cf6); }
.urgency b { font-size: 20px; display: block; }
.list { margin: 8px 0 0; padding-left: 18px; }
.list li { margin: 6px 0; }

.btn, .btn-row button {
  border: 0;
  border-radius: 12px;
  padding: 13px 14px;
  font-weight: 750;
  font-size: 16px;
}
.btn { width: 100%; background: linear-gradient(135deg, #59a4ff, #2f7cf6); color: #fff; margin-top: 10px; }
.btn.ghost { background: #fff; color: var(--blue); border: 1px solid #d5e4ff; }
.btn.soft { background: #eef5ff; color: var(--blue); }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { margin-top: 0; }

.field { margin: 12px 0; }
.field label, .legend { display: block; font-size: 13px; color: var(--sub); margin-bottom: 6px; }
.field input, .field select, .field textarea, .composer input {
  width: 100%;
  border: 1px solid #e3eaf3;
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  font-size: 16px;
  outline: none;
}
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field textarea:focus, .composer input:focus { border-color: #8eb7ff; }
.seg { display: flex; gap: 6px; background: #eef2f7; padding: 4px; border-radius: 12px; }
.seg label { flex: 1; position: relative; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; text-align: center; padding: 8px; border-radius: 10px; }
.seg input:checked + span { background: #fff; color: var(--blue); font-weight: 750; box-shadow: 0 2px 8px rgba(20, 40, 80, 0.06); }

.mine-top {
  padding: 16px 16px 0;
  background:
    radial-gradient(circle at 90% 0, rgba(255, 255, 255, 0.35), transparent 28%),
    linear-gradient(#eaf3ff, #f4f7fb 88%);
}
.mine-top h1 { text-align: center; font-size: 18px; margin: 4px 0 14px; }
.profile {
  background: linear-gradient(145deg, #63b0ff, #2f78f4 55%, #2a6ae8);
  color: #fff;
  border-radius: 22px;
  padding: 16px;
  box-shadow: 0 16px 30px rgba(47, 120, 244, 0.28);
}
.profile-row { display: flex; gap: 12px; align-items: center; }
.avatar {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  position: relative;
  flex: none;
}
.avatar svg { width: 46px; height: 46px; }
.name-line { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 800; }
.badge { font-size: 11px; background: #e9fff2; color: #16a34a; border-radius: 999px; padding: 2px 7px; font-weight: 700; }
.bell { margin-left: auto; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.16); color: #fff; position: relative; }
.bell i {
  position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; background: #ff5a5a; border-radius: 50%;
}
.meta { margin-top: 6px; opacity: 0.95; font-size: 13px; display: flex; gap: 12px; }
.profile-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.pbtn { border: 0; background: #fff; color: var(--blue); border-radius: 12px; padding: 10px; font-weight: 750; }
.pbtn.line { background: rgba(255, 255, 255, 0.16); color: #fff; }

.health {
  margin: 12px 16px 0;
  position: relative;
  background: #fff;
  border-radius: 20px;
  padding: 14px 16px 16px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 126px 1fr;
  gap: 8px;
  align-items: center;
}
.health .health-head { grid-column: 1 / -1; margin: 0; }
.ring-wrap { position: relative; width: 116px; height: 116px; margin: 0 auto; }
.ring { width: 116px; height: 116px; }
.ring-bg, .ring-fg { fill: none; stroke-width: 10; }
.ring-bg { stroke: #e8f8ee; }
.ring-fg { stroke-linecap: round; transform: rotate(-90deg); transform-origin: 60px 60px; }
.ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-label b { font-size: 28px; line-height: 1; }
.ring-label span { font-size: 12px; color: var(--muted); }
.stat { display: flex; gap: 8px; align-items: center; background: #f7fafc; border-radius: 12px; padding: 8px; margin: 6px 0; }
.stat b { display: block; font-size: 14px; }
.stat small { color: var(--muted); }
.health-head { display: flex; justify-content: space-between; margin: 18px 16px 0; font-size: 13px; color: var(--muted); }
.health-head b { color: var(--text); font-size: 16px; }

.fn { border: 0; border-radius: 16px; padding: 12px; display: flex; gap: 8px; align-items: center; text-align: left; }
.fn .chev { margin-left: auto; color: #c5ceda; font-size: 20px; }
.row-link {
  width: calc(100% - 32px);
  margin: 10px 16px;
  border: 0;
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  box-shadow: var(--shadow);
}

.guide-bg {
  background:
    radial-gradient(circle at 100% 0, #d7ebff 0 150px, transparent 151px),
    radial-gradient(circle at 0 100%, #d8f6ef 0 170px, transparent 171px);
  min-height: 100%;
}

.search { margin-bottom: 8px; }
.med-item, .record, .dept, .help-item {
  width: 100%;
  border: 0;
  border-radius: 16px;
  padding: 14px;
  margin: 8px 0;
  text-align: left;
}
.med-item b, .record b, .dept b { display: block; }
.level-tag { font-size: 12px; border-radius: 999px; padding: 2px 8px; color: #fff; }
.level-tag.urgent, .level-tag.crisis { background: #e11d48; }
.level-tag.soon { background: #f97316; }
.level-tag.routine { background: #2f7cf6; }

.chat-log { padding: 12px 16px 8px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 86%; padding: 10px 12px; border-radius: 14px; font-size: 14px; white-space: pre-wrap; }
.bubble.bot { background: #fff; box-shadow: var(--shadow); border-top-left-radius: 4px; }
.bubble.user { margin-left: auto; background: #2f7cf6; color: #fff; border-top-right-radius: 4px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 16px 10px; }
.chips button {
  border: 0;
  background: #fff;
  color: #34527a;
  border-radius: 999px;
  padding: 8px 12px;
  white-space: nowrap;
  box-shadow: var(--shadow);
  font-size: 12px;
}
.composer {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  background: #fff;
  border-top: 1px solid var(--line);
}
.composer input { flex: 1; }
.composer button { border: 0; background: var(--blue); color: #fff; border-radius: 12px; padding: 0 14px; font-weight: 700; }
.calls { margin-top: 8px; }
.call {
  display: inline-block;
  margin: 0 8px 0 0;
  background: #fff1f2;
  color: #e11d48;
  text-decoration: none;
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 750;
}

.band { border-radius: 12px; padding: 10px 12px; margin-top: 8px; font-size: 14px; }
.band.ok { background: #ecfdf3; color: #166534; }
.band.mid { background: #eff6ff; color: #1d4ed8; }
.band.warn { background: #fff7ed; color: #c2410c; }
.band.bad { background: #fff1f2; color: #be123c; }
.q-block { background: #fff; border-radius: 16px; padding: 12px; margin: 10px 0; box-shadow: var(--shadow); }
.q-block legend { font-size: 14px; font-weight: 700; padding: 0 4px; }
.q-block label { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; font-size: 14px; }
.checkline { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.checkline button.mini, .mini {
  border: 0;
  background: #eef5ff;
  color: var(--blue);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
}
.mini.warn { background: #fff1f2; color: #e11d48; }
.empty { text-align: center; color: var(--muted); padding: 28px 10px; }
.disclaimer { color: #8b97a8; font-size: 12px; line-height: 1.6; margin: 16px 16px 8px; }
.toast {
  position: absolute;
  left: 50%;
  bottom: calc(var(--tab) + 12px);
  transform: translateX(-50%);
  background: rgba(22, 28, 36, 0.88);
  color: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  z-index: 5;
  max-width: 86%;
  text-align: center;
}
.hl { color: var(--green); font-weight: 800; }
.hl.mid { color: #d97706; }
.hl.bad { color: #e11d48; }

fieldset { border: 0; margin: 0; padding: 0; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid #8eb7ff; outline-offset: 2px; }

body.care { --muted: #334155; --text: #0f172a; --sub: #1e293b; }
body.care .app { font-size: 18px; }
body.care .topbar h1, body.care .mine-top h1 { font-size: 22px; }
body.care .tool small, body.care .fn small, body.care .disclaimer { font-size: 15px; color: #334155; }
body.care .tab { font-size: 14px; }
body.care .svc { height: 124px; font-size: 18px; }
body.care .option, body.care .btn, body.care .chip, body.care .person-btn { min-height: 48px; }

@media (max-width: 520px) {
  body { background: var(--bg); }
  .app { width: 100%; box-shadow: none; }
}
@media (min-width: 521px) {
  body { display: flex; }
  .app { height: min(920px, calc(100dvh - 28px)); margin: 14px auto; border-radius: 28px; }
}
