:root {
  --green-900: #063e33;
  --green-700: #0b7a62;
  --green-600: #0f8f72;
  --green-500: #16a37f;
  --mint-100: #e9f7f2;
  --mint-200: #d2efe5;
  --ink: #102420;
  --ink-2: #34504a;
  --muted: #6f867f;
  --muted-2: #93a49f;
  --line: #e6edeb;
  --line-strong: #d7e2df;
  --bg: #f2f6f5;
  --surface: #ffffff;
  --danger: #d34b4b;
  --danger-bg: #fdeeee;
  --warn: #c67a10;
  --warn-bg: #fdf4e3;
  --blue: #2f76c9;
  --blue-bg: #ebf3fc;
  --purple: #7a5ac8;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 36, 32, .04), 0 4px 12px rgba(16, 36, 32, .035);
  --shadow-md: 0 10px 30px rgba(16, 36, 32, .09);
  --shadow-lg: 0 24px 70px rgba(9, 40, 34, .18);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: #dce9e5;
  background-image:
    radial-gradient(circle at 12% 8%, rgba(22, 163, 127, .20), transparent 42%),
    radial-gradient(circle at 88% 88%, rgba(47, 118, 201, .14), transparent 45%),
    linear-gradient(160deg, #eaf4f1 0%, #e2ece9 45%, #e7efee 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.desktop-backdrop::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%230f8f72' fill-opacity='.035'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
  opacity: .8;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--green-700); }
svg { display: block; }

/* ---------- shell ---------- */
.app-shell {
  position: relative;
  width: 100%;
  max-width: 540px;
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}
@media (min-width: 720px) {
  body { padding: 22px 0; }
  .app-shell {
    height: calc(100dvh - 44px);
    max-width: 1120px;
    flex-direction: row;
    align-items: stretch;
    border-radius: 28px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, .8);
  }
}
@media (min-width: 1080px) {
  body { padding: 20px 26px; }
  .app-shell { max-width: 1300px; height: calc(100dvh - 40px); }
}
@media (min-width: 1500px) {
  .app-shell { max-width: 1460px; }
}
.boot-screen {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; color: var(--muted); background: var(--green-700);
}
.boot-logo { width: 78px; height: 78px; border-radius: 24px; background: rgba(255,255,255,.12); display: grid; place-items: center; animation: breathe 1.6s ease-in-out infinite; }
.boot-screen p { color: rgba(255,255,255,.72); font-size: 14px; letter-spacing: .04em; }
@keyframes breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }

/* ---------- desktop rail ---------- */
.rail { display: none; }
@media (min-width: 720px) {
  .rail {
    display: flex; flex-direction: column; width: 272px; flex-shrink: 0;
    background: linear-gradient(170deg, #0b7a62 0%, #064b3e 100%);
    color: #fff; padding: 28px 18px 22px; justify-content: flex-start;
    border-radius: 28px 0 0 28px; position: relative; overflow: hidden;
  }
  .rail::after {
    content: ""; position: absolute; width: 300px; height: 300px; border-radius: 50%;
    border: 50px solid rgba(255,255,255,.045); right: -150px; top: -90px;
  }
  .rail::before {
    content: ""; position: absolute; width: 200px; height: 200px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.09), transparent 70%);
    left: -70px; bottom: 90px;
  }
  .rail-brand {
    display: flex; align-items: center; gap: 11px; font-weight: 700; font-size: 16.5px;
    letter-spacing: .02em; padding: 0 8px; position: relative; z-index: 1;
  }
  .rail-mark { width: 38px; height: 38px; border-radius: 12px; background: rgba(255,255,255,.15); display: grid; place-items: center; }
  .rail-tagline { margin: 10px 8px 0; font-size: 11.5px; color: rgba(255,255,255,.52); letter-spacing: .06em; position: relative; z-index: 1; }

  .rail-nav { margin-top: 30px; display: flex; flex-direction: column; gap: 4px; position: relative; z-index: 1; }
  .rail-item {
    display: flex; align-items: center; gap: 11px; width: 100%; padding: 11px 12px;
    border: 0; border-radius: 12px; background: transparent; color: rgba(255,255,255,.7);
    font-size: 13.5px; font-weight: 550; text-align: left; transition: background .18s, color .18s;
  }
  .rail-item svg { flex-shrink: 0; opacity: .9; }
  .rail-item.active { background: rgba(255,255,255,.16); color: #fff; font-weight: 650; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
  .rail-badge {
    margin-left: auto; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
    background: #f2685c; color: #fff; font-size: 10px; font-style: normal; font-weight: 650;
    line-height: 19px; text-align: center;
  }

  .rail-spacer { flex: 1; min-height: 18px; }
  .rail-member { position: relative; z-index: 1; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 16px; padding: 14px; }
  .rail-member .rm-label { font-size: 10.5px; color: rgba(255,255,255,.5); margin-bottom: 9px; letter-spacing: .08em; }
  .rail-member .rm-name { font-size: 14.5px; font-weight: 650; display: flex; align-items: center; gap: 9px; }
  .rail-member .rm-relation { font-size: 10px; padding: 2px 7px; border-radius: 6px; background: rgba(255,255,255,.13); color: rgba(255,255,255,.78); font-weight: 500; }
  .rail-member .rm-meta { margin-top: 7px; font-size: 11px; color: rgba(255,255,255,.55); }
  .rail-foot { font-size: 10.5px; color: rgba(255,255,255,.38); line-height: 1.7; margin-top: 16px; padding: 0 4px; position: relative; z-index: 1; }
}

.main-panel {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  position: relative; overflow: hidden;
  background: var(--bg);
}
@media (max-width: 719px) { .main-panel { width: 100%; } }

/* ---------- topbar ---------- */
.topbar {
  flex-shrink: 0; padding: 14px 18px 10px; background: rgba(242, 246, 245, .92);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  position: relative; z-index: 20;
}
.topbar-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand-mini { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand-mini .mark {
  width: 32px; height: 32px; border-radius: 10px; background: var(--green-700);
  display: grid; place-items: center; flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(11,122,98,.22);
}
.brand-mini h1 { font-size: 16px; margin: 0; font-weight: 700; letter-spacing: .01em; line-height: 1.2; }
.brand-mini p { font-size: 10.5px; margin: 2px 0 0; color: var(--muted); letter-spacing: .04em; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--surface); display: grid; place-items: center; color: var(--ink-2);
  transition: .18s ease; position: relative;
}
.icon-btn:active { transform: scale(.94); background: var(--mint-100); }
.icon-btn .dot { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); border: 1.5px solid #fff; }

/* ---------- scroll area ---------- */
.screen { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 18px 24px; scroll-behavior: smooth; opacity: 1; }
.screen::-webkit-scrollbar { width: 0; }
.view-enter { animation: viewIn .3s cubic-bezier(.2,.8,.2,1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- bottom nav ---------- */
.tabbar {
  flex-shrink: 0; display: flex; align-items: stretch; justify-content: space-around;
  background: rgba(255,255,255,.94); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line); padding: 6px 6px calc(6px + var(--safe-b));
  position: relative; z-index: 30;
}
.tab {
  flex: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center;
  gap: 3px; padding: 6px 0 4px; color: var(--muted-2); font-size: 10.5px; border-radius: 12px;
  transition: color .18s; position: relative;
}
.tab svg { width: 22px; height: 22px; stroke-width: 1.8; }
.tab.active { color: var(--green-700); font-weight: 650; }
.tab.active::after {
  content: ""; position: absolute; bottom: -1px; width: 18px; height: 2.5px; border-radius: 2px; background: var(--green-600);
}
.tab .tab-badge {
  position: absolute; top: 2px; left: 50%; margin-left: 3px; min-width: 15px; height: 15px;
  background: var(--danger); color: #fff; border-radius: 8px; font-size: 9px; line-height: 15px;
  padding: 0 4px; font-weight: 600; border: 1.5px solid #fff;
}

/* ---------- generic ---------- */
.page-title { margin: 14px 0 4px; font-size: 23px; font-weight: 760; letter-spacing: -.01em; }
.page-sub { margin: 0 0 16px; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.section { margin-top: 22px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.section-head h2 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: .01em; }
.section-head .more { border: 0; background: none; color: var(--muted); font-size: 11.5px; display: flex; align-items: center; gap: 2px; padding: 2px 0; }
.section-head .more:active { color: var(--green-700); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 16px; }
.card + .card { margin-top: 10px; }
.row { display: flex; align-items: center; gap: 12px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.tiny { font-size: 11px; }
.small { font-size: 12px; }
.strong { font-weight: 650; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt4 { margin-top: 4px; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.hidden { display: none !important; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: 12px; padding: 10px 16px; font-size: 13.5px;
  font-weight: 650; background: var(--mint-100); color: var(--green-700);
  transition: transform .15s ease, background .18s, opacity .18s; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--green-700); color: #fff; box-shadow: 0 6px 16px rgba(11,122,98,.20); }
.btn-primary:active { background: var(--green-900); }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink-2); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-sm { padding: 7px 11px; font-size: 12px; border-radius: 10px; }
.btn-lg { width: 100%; padding: 14px; font-size: 15px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn .spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.text-btn { border: 0; background: none; color: var(--green-700); font-size: 12.5px; font-weight: 600; padding: 4px; display: inline-flex; align-items: center; gap: 3px; }

/* chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 6px 12px; font-size: 12px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px;
  transition: .18s;
}
.chip:active { transform: scale(.96); }
.chip.active { background: var(--green-700); color: #fff; border-color: var(--green-700); }
.chip .cdot { width: 6px; height: 6px; border-radius: 50%; background: var(--green-500); }
.chip.active .cdot { background: #fff; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 7px; font-size: 10.5px; font-weight: 650; line-height: 1.4; white-space: nowrap; }
.badge-green { background: var(--mint-100); color: var(--green-700); }
.badge-red { background: var(--danger-bg); color: var(--danger); }
.badge-amber { background: var(--warn-bg); color: var(--warn); }
.badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-gray { background: #f1f4f3; color: var(--muted); }
.badge-purple { background: #f2eeff; color: var(--purple); }

/* member switch */
.member-bar { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.member-scroll { display: flex; gap: 8px; overflow-x: auto; flex: 1; padding-bottom: 3px; scrollbar-width: none; }
.member-scroll::-webkit-scrollbar { display: none; }
.member-pill {
  flex-shrink: 0; display: flex; align-items: center; gap: 7px; padding: 6px 12px 6px 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-size: 12px; color: var(--ink-2);
}
.member-pill.active { border-color: var(--green-600); background: #f5fdfa; color: var(--green-700); font-weight: 650; box-shadow: 0 2px 8px rgba(15,143,114,.10); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: #fff; background: var(--green-600); flex-shrink: 0;
}
.avatar.lg { width: 52px; height: 52px; font-size: 18px; border-radius: 16px; }
.avatar.xl { width: 64px; height: 64px; font-size: 23px; border-radius: 20px; }
.member-add-pill { border-style: dashed; color: var(--muted); background: transparent; padding: 6px 12px 6px 10px; }

/* hero */
.hero {
  position: relative; overflow: hidden; border-radius: var(--radius-xl); padding: 20px 18px;
  background: linear-gradient(135deg, #0b7a62 0%, #0c6a57 55%, #085247 100%);
  color: #fff; box-shadow: 0 12px 28px rgba(10,90,72,.22);
}
.hero::after {
  content: ""; position: absolute; right: -46px; top: -56px; width: 170px; height: 170px;
  border-radius: 50%; border: 30px solid rgba(255,255,255,.07);
}
.hero::before {
  content: ""; position: absolute; right: 24px; bottom: -40px; width: 110px; height: 110px;
  border-radius: 50%; background: rgba(255,255,255,.05);
}
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: relative; z-index: 1; }
.hero-greet { font-size: 19px; font-weight: 700; letter-spacing: .01em; }
.hero-date { font-size: 11.5px; color: rgba(255,255,255,.62); margin-top: 4px; }
.hero-avatar { width: 46px; height: 46px; border-radius: 15px; background: rgba(255,255,255,.16); display: grid; place-items: center; font-size: 17px; font-weight: 700; border: 1px solid rgba(255,255,255,.18); }
.hero-stats { display: flex; gap: 0; margin-top: 18px; position: relative; z-index: 1; }
.hero-stat { flex: 1; padding-right: 10px; }
.hero-stat + .hero-stat { border-left: 1px solid rgba(255,255,255,.14); padding-left: 14px; }
.hero-stat b { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.hero-stat span { display: block; font-size: 10.5px; color: rgba(255,255,255,.6); margin-top: 3px; }
.hero-stat em { font-style: normal; font-size: 10px; margin-left: 4px; color: rgba(255,255,255,.55); }
.hero-note { margin-top: 14px; position: relative; z-index: 1; display: flex; align-items: center; gap: 6px; font-size: 11px; color: rgba(255,255,255,.7); line-height: 1.5; }

/* quick grid */
.quick-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }
.quick-ico.green { background: var(--mint-100); color: var(--green-700); }
.quick-ico.blue { background: var(--blue-bg); color: var(--blue); }
.quick-ico.amber { background: var(--warn-bg); color: var(--warn); }
.quick-ico.purple { background: #f2eeff; color: var(--purple); }

/* tasks */
.task {
  display: flex; align-items: flex-start; gap: 11px; padding: 13px 14px;
  border-bottom: 1px solid #eef3f1; background: var(--surface);
}
.task:last-child { border-bottom: 0; }
.task-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.task-ico.med { background: var(--mint-100); color: var(--green-700); }
.task-ico.visit { background: var(--blue-bg); color: var(--blue); }
.task-ico.exam { background: var(--warn-bg); color: var(--warn); }
.task-main { flex: 1; min-width: 0; }
.task-title { font-size: 13.5px; font-weight: 600; line-height: 1.4; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.task-meta { font-size: 11px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.task-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.task-side { flex-shrink: 0; text-align: right; }
.task-time { font-size: 12px; font-weight: 650; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.task.is-done { opacity: .62; }
.task.is-done .task-title { text-decoration: line-through; text-decoration-color: var(--muted-2); }

/* list */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.list-item { display: flex; align-items: center; gap: 12px; padding: 14px 15px; border-bottom: 1px solid #eef3f1; background: none; width: 100%; text-align: left; }
.list-item:last-child { border-bottom: 0; }
.list-item:active { background: #f7fbfa; }
.li-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; background: var(--mint-100); color: var(--green-700); }
.li-title { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.li-sub { font-size: 11px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.chev { color: var(--muted-2); flex-shrink: 0; }

/* stats / alerts */
.alert-card {
  display: flex; gap: 10px; padding: 13px 14px; border-radius: var(--radius);
  background: var(--danger-bg); border: 1px solid #f6dede; color: #7d2e2e;
}
.alert-card.warn { background: var(--warn-bg); border-color: #f6e7c8; color: #79510c; }
.alert-card.info { background: var(--blue-bg); border-color: #dbe9fa; color: #21578f; }
.alert-card b { font-size: 12.5px; display: block; }
.alert-card p { margin: 3px 0 0; font-size: 11px; line-height: 1.5; opacity: .82; }

/* metric cards */
.metric-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (max-width: 480px) { .grid-2 { grid-template-columns: 1fr; } }
.metric-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.metric-label { font-size: 11px; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.metric-value { font-size: 26px; font-weight: 750; letter-spacing: -.03em; margin-top: 8px; line-height: 1; font-variant-numeric: tabular-nums; }
.metric-value small { font-size: 11px; font-weight: 500; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.metric-foot { margin-top: 8px; font-size: 10.5px; color: var(--muted-2); display: flex; align-items: center; gap: 4px; }
.metric-value.high { color: var(--danger); }
.metric-value.low { color: var(--blue); }

/* ---------- home layout ---------- */
.home-cols { display: block; }
@media (min-width: 1000px) {
  .home-cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 26px; align-items: start; }
}
.focus-card {
  position: relative; overflow: hidden; margin-top: 12px; padding: 18px;
  border-radius: var(--radius-xl); color: #fff;
  background: linear-gradient(135deg, #0b7a62 0%, #0a6354 58%, #084c41 100%);
  box-shadow: 0 12px 28px rgba(10, 90, 72, .22);
}
.focus-card::after {
  content: ""; position: absolute; right: -46px; top: -58px; width: 170px; height: 170px;
  border-radius: 50%; border: 30px solid rgba(255,255,255,.06);
}
.focus-card::before {
  content: ""; position: absolute; right: 40px; bottom: -52px; width: 120px; height: 120px;
  border-radius: 50%; background: rgba(255,255,255,.04);
}
.focus-top { position: relative; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.focus-greet { font-size: 19px; font-weight: 700; letter-spacing: .01em; }
.focus-date { font-size: 11.5px; color: rgba(255,255,255,.62); margin-top: 4px; }
.focus-tag {
  flex-shrink: 0; font-size: 10.5px; padding: 4px 10px; border-radius: 999px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); color: rgba(255,255,255,.88);
}
.focus-body { position: relative; z-index: 1; display: flex; align-items: center; gap: 16px; margin-top: 16px; }
.focus-ring { position: relative; width: 84px; height: 84px; flex-shrink: 0; }
.focus-ring svg { width: 84px; height: 84px; }
.focus-ring-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.focus-ring-in b { font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.focus-ring-in span { font-size: 9.5px; color: rgba(255,255,255,.58); margin-top: 1px; }
.focus-info { min-width: 0; }
.focus-info-label { font-size: 10px; letter-spacing: .14em; color: rgba(255,255,255,.5); }
.focus-info-title { font-size: 15px; font-weight: 650; line-height: 1.35; margin-top: 4px; }
.focus-info-meta { font-size: 11.5px; color: rgba(255,255,255,.66); line-height: 1.5; margin-top: 4px; }
.focus-stats { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.focus-stat {
  display: flex; align-items: baseline; gap: 6px; padding: 8px 10px; border-radius: 12px;
  border: 1px solid rgba(255,255,255,.13); background: rgba(255,255,255,.07);
  color: #fff; text-align: left; transition: background .18s;
}
.focus-stat:active { background: rgba(255,255,255,.15); }
.focus-stat b { font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.focus-stat span { font-size: 10.5px; color: rgba(255,255,255,.62); }
.alert-stack { display: flex; flex-direction: column; gap: 8px; }
.quick-bar {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; padding: 12px 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.quick-item {
  display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 5px 2px;
  border: 0; background: none; border-radius: 12px; font-size: 11px; color: var(--ink-2); transition: background .18s;
}
.quick-item:active { background: #f4faf8; }
@media (min-width: 1000px) {
  .quick-item { flex-direction: row; justify-content: center; gap: 9px; font-size: 12px; }
  .home-col-side .metric-grid { grid-template-columns: 1fr; }
}
.head-count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 19px; height: 19px;
  padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--mint-100);
  color: var(--green-700); font-size: 10.5px; font-weight: 700; vertical-align: 1px;
}

/* trend chart */
.chart-wrap { padding: 8px 0 0; }
.chart-svg { width: 100%; height: auto; overflow: visible; }
.chart-legend { display: flex; gap: 14px; font-size: 10.5px; color: var(--muted); margin-top: 4px; flex-wrap: wrap; }
.chart-legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }

/* table */
.table { width: 100%; border-collapse: collapse; font-size: 12px; }
.table th { text-align: left; font-size: 10.5px; color: var(--muted); font-weight: 500; padding: 9px 10px; background: #f7faf9; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid #eef3f1; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { font-variant-numeric: tabular-nums; font-weight: 600; }
.table .num.high { color: var(--danger); }
.table .num.low { color: var(--blue); }

/* forms */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 11.5px; color: var(--ink-2); font-weight: 600; margin-bottom: 6px; }
.field label .req { color: var(--danger); margin-left: 2px; }
.field label .opt { color: var(--muted-2); font-weight: 400; margin-left: 4px; font-size: 10.5px; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 11px; padding: 10px 12px;
  background: #fbfdfc; font-size: 13.5px; outline: none; transition: border .18s, box-shadow .18s;
  appearance: none; -webkit-appearance: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(22,163,127,.10); background: #fff; }
.textarea { min-height: 72px; resize: vertical; line-height: 1.6; }
.select { background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236f867f' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 30px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.hint { font-size: 10.5px; color: var(--muted-2); line-height: 1.55; margin-top: 5px; }
.radio { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.radio input { width: 16px; height: 16px; accent-color: var(--green-500); }
.form-section { margin: 20px 0 10px; font-size: 12px; font-weight: 700; color: var(--ink-2); display: flex; align-items: center; gap: 7px; }
.form-section::before { content: ""; width: 3px; height: 12px; border-radius: 2px; background: var(--green-600); }

/* segmented */
.seg { display: flex; background: #eef3f1; border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { flex: 1; border: 0; background: none; border-radius: 9px; padding: 7px 4px; font-size: 12px; color: var(--muted); font-weight: 500; }
.seg button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); font-weight: 650; }

/* modal */
.modal-mask {
  position: fixed; inset: 0; background: rgba(9, 28, 24, .42); backdrop-filter: blur(3px);
  z-index: 100; display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .2s ease;
}
@media (min-width: 720px) { .modal-mask { align-items: center; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface); width: 100%; max-width: 540px; max-height: 92dvh;
  border-radius: 22px 22px 0 0; display: flex; flex-direction: column;
  animation: sheetUp .3s cubic-bezier(.2,.9,.25,1); box-shadow: var(--shadow-lg);
}
@media (min-width: 720px) { .modal { border-radius: 22px; max-height: 86dvh; } }
@keyframes sheetUp { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 18px 12px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.modal-head p { margin: 3px 0 0; font-size: 11px; color: var(--muted); }
.modal-close { width: 30px; height: 30px; border-radius: 9px; border: 0; background: #f2f5f4; color: var(--muted); display: grid; place-items: center; }
.modal-body { padding: 16px 18px; overflow-y: auto; flex: 1; }
.modal-foot { padding: 12px 18px calc(14px + var(--safe-b)); border-top: 1px solid var(--line); display: flex; gap: 10px; flex-shrink: 0; background: var(--surface); }
.modal-foot .btn { flex: 1; }

/* toast */
.toast-root { position: fixed; left: 50%; bottom: calc(88px + var(--safe-b)); transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(90vw, 420px); }
.toast {
  background: rgba(16, 36, 32, .92); color: #fff; padding: 10px 16px; border-radius: 12px;
  font-size: 12.5px; box-shadow: var(--shadow-md); animation: toastIn .25s ease; max-width: 100%;
  display: flex; align-items: center; gap: 7px; line-height: 1.45;
}
.toast.ok { background: rgba(11, 122, 98, .95); }
.toast.err { background: rgba(180, 52, 52, .95); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* upload */
.dropzone {
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius-lg); padding: 26px 18px;
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  background: #fafdfc; cursor: pointer; transition: .18s;
  user-select: none; -webkit-user-select: none;
  touch-action: manipulation;       /* 移动端点按立即触发，消除 300ms 延迟 */
  -webkit-tap-highlight-color: transparent;
}
/* 真正隐藏的文件输入：不用 hidden 属性（兼容性差），改为 display:none；
   通过 dropzone label 的 for 属性触发，手机与桌面都稳定。 */
.dz-hidden-input { display: none; }
.dropzone:active, .dropzone.drag { border-color: var(--green-500); background: var(--mint-100); }
.dropzone .dz-ico { width: 46px; height: 46px; border-radius: 14px; background: #fff; display: grid; place-items: center; color: var(--green-700); box-shadow: var(--shadow-sm); }
.dropzone b { font-size: 13px; }
.dropzone span { font-size: 11px; color: var(--muted-2); line-height: 1.5; }
.file-pill { display: flex; align-items: center; gap: 9px; background: var(--mint-100); border-radius: 11px; padding: 9px 11px; font-size: 12px; }
.file-pill .file-name { flex: 1; min-width: 0; }
.file-pill .file-size { color: var(--muted); font-size: 10.5px; }
.preview-img { width: 100%; max-height: 240px; object-fit: contain; border-radius: 12px; background: #f4f7f6; margin-top: 10px; }

/* OCR table */
.ocr-row { background: #fbfdfc; border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 8px; }
.ocr-row .or-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.ocr-row .or-name { font-size: 12.5px; font-weight: 650; flex: 1; min-width: 0; }
.ocr-mini { display: grid; grid-template-columns: 1.2fr .7fr .9fr 1.4fr; gap: 6px; }
.ocr-mini .input { padding: 7px 8px; font-size: 12px; border-radius: 8px; }
.ocr-mini label { font-size: 9px; color: var(--muted-2); display: block; margin-bottom: 3px; }
@media (max-width: 380px) { .ocr-mini { grid-template-columns: 1fr 1fr; } }

/* member page */
.profile-hero { display: flex; align-items: center; gap: 14px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); box-shadow: var(--shadow-sm); }
.profile-hero h2 { margin: 0; font-size: 19px; font-weight: 730; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.profile-hero p { margin: 5px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.profile-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: #eef3f1; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); }
.kv { background: var(--surface); padding: 12px 14px; }
.kv span { display: block; font-size: 10.5px; color: var(--muted); margin-bottom: 4px; }
.kv b { font-size: 12.5px; font-weight: 600; line-height: 1.5; }
.pref-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 15px; border-bottom: 1px solid #eef3f1; }
.pref-row:last-child { border-bottom: 0; }
.pref-row .pr-main { flex: 1; }
.pref-row b { font-size: 13px; display: block; }
.pref-row span { font-size: 10.5px; color: var(--muted); margin-top: 2px; display: block; line-height: 1.5; }

/* switch */
.switch { width: 42px; height: 25px; border-radius: 999px; background: #dbe5e2; border: 0; position: relative; flex-shrink: 0; transition: .2s; padding: 0; }
.switch::after { content: ""; position: absolute; width: 19px; height: 19px; border-radius: 50%; background: #fff; top: 3px; left: 3px; box-shadow: 0 1px 3px rgba(0,0,0,.16); transition: .2s; }
.switch.on { background: var(--green-600); }
.switch.on::after { transform: translateX(17px); }

/* empty */
.empty { text-align: center; padding: 30px 16px; }
.empty .e-ico { width: 54px; height: 54px; border-radius: 16px; background: #f2f6f5; display: grid; place-items: center; margin: 0 auto 12px; color: var(--muted-2); }
.empty b { font-size: 13px; display: block; }
.empty p { margin: 5px 0 12px; font-size: 11px; color: var(--muted); line-height: 1.6; }

/* misc */
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.progress { height: 6px; background: #edf3f1; border-radius: 4px; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 4px; background: var(--green-500); }
.privacy-note { display: flex; gap: 9px; background: #f4f8f7; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; font-size: 10.5px; color: var(--muted); line-height: 1.6; }
.privacy-note svg { flex-shrink: 0; margin-top: 1px; color: var(--green-700); }
.step-tabs { display: flex; align-items: center; gap: 6px; margin: 2px 0 16px; }
.step { flex: 1; display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted-2); }
.step i { width: 20px; height: 20px; border-radius: 50%; background: #e8eeec; color: var(--muted); display: grid; place-items: center; font-size: 10px; font-style: normal; font-weight: 700; flex-shrink: 0; }
.step.active { color: var(--green-700); font-weight: 600; }
.step.active i { background: var(--green-600); color: #fff; }
.step + .step::before { content: ""; height: 1px; background: var(--line-strong); width: 12px; flex-shrink: 0; }
@media (max-width: 400px) { .step span { display: none; } .step { flex: 0 0 auto; } .step + .step::before { width: 22px; } }

.summary-hero { padding: 22px 18px; border-radius: var(--radius-xl); background: linear-gradient(135deg, #0b7a62, #0a5d4c); color: #fff; }
.summary-hero h2 { margin: 0 0 6px; font-size: 20px; }
.summary-hero p { margin: 0; font-size: 11.5px; color: rgba(255,255,255,.7); line-height: 1.6; }

@media (max-width: 360px) {
  .screen { padding-left: 14px; padding-right: 14px; }
  .quick-text b { font-size: 12px; }
  .metric-grid { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- desktop refinement（宽屏排版） ---------- */
/* 品牌信息由左侧导航承担，桌面顶栏改为页面标题 + 日期 */
.topbar-title { display: none; }

@media (min-width: 900px) {
  .tabbar { display: none; }
  .brand-mini { display: none; }
  .topbar {
    padding: 18px 34px 12px;
    background: rgba(255, 255, 255, .72);
    border-bottom: 1px solid var(--line);
  }
  .topbar-title { display: block; min-width: 0; }
  .topbar-title h1 { margin: 0; font-size: 19px; font-weight: 720; letter-spacing: -.01em; }
  .topbar-title p { margin: 3px 0 0; font-size: 11.5px; color: var(--muted); letter-spacing: .01em; }

  .screen { padding: 10px 34px 36px; }
  .screen::-webkit-scrollbar { width: 8px; }
  .screen::-webkit-scrollbar-thumb { background: #cbdad5; border-radius: 8px; }
  .screen::-webkit-scrollbar-thumb:hover { background: #b0c6c0; }
  .screen::-webkit-scrollbar-track { background: transparent; }

  .page-title { font-size: 27px; margin: 12px 0 6px; letter-spacing: -.02em; }
  .page-sub { font-size: 13px; max-width: 760px; line-height: 1.65; }
  .section { margin-top: 26px; }
  .section-head h2 { font-size: 15.5px; }

  .card-pad { padding: 20px; }
  .card + .card { margin-top: 12px; }
  .metric-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
  .focus-stats { grid-template-columns: repeat(4, 1fr); }
  .field-row { gap: 14px; }

  .modal { max-width: 660px; }
  .modal-body { padding: 20px 24px; }
  .modal-head { padding: 20px 24px 14px; }
  .modal-foot { padding: 14px 24px calc(16px + var(--safe-b)); }
  .toast-root { bottom: 28px; }
}

@media (min-width: 1180px) {
  .page-title { font-size: 28px; }
}

/* 宽屏下把长列表拆成两列独立卡片，避免每行右侧大片空白 */
@media (min-width: 1000px) {
  .list.cols-2 {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    background: transparent; border: 0; border-radius: 0; box-shadow: none; overflow: visible;
  }
  .list.cols-2 .list-item {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 14px 16px;
  }
}

/* 仅在鼠标设备启用悬停反馈，触屏不会出现“粘住”的高亮 */
@media (hover: hover) and (pointer: fine) {
  .list-item:hover { background: #f7fbfa; }
  .card:hover { border-color: #dbe8e4; box-shadow: 0 8px 26px rgba(16, 36, 32, .07); }
  .quick-item:hover { background: #f4faf8; }
  .btn:hover { filter: brightness(.98); }
  .icon-btn:hover { background: var(--mint-100); border-color: var(--line-strong); }
  .rail-item:hover { background: rgba(255, 255, 255, .09); color: #fff; }
  .rail-item.active:hover { background: rgba(255, 255, 255, .18); }
}
