/* ==========================================================
   颐养云 · 养老管理平台 —— 设计系统
   ========================================================== */
:root {
  --brand: #0E9C8B;
  --brand-2: #12B5A2;
  --brand-deep: #08383B;
  --brand-deep-2: #0B474B;
  --brand-soft: #E7F6F3;
  --ink: #14292D;
  --ink-2: #4C6469;
  --ink-3: #82989C;
  --line: #E3EDEC;
  --line-2: #EFF5F4;
  --bg: #F2F6F6;
  --card: #FFFFFF;
  --warm: #E2913C;
  --warm-soft: #FCF2E4;
  --danger: #D44B4B;
  --danger-soft: #FBECEC;
  --warn: #CF941F;
  --warn-soft: #FBF3E1;
  --ok: #2A9560;
  --ok-soft: #E9F6EF;
  --info: #3B7FD1;
  --info-soft: #EAF1FB;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(10, 48, 52, .04), 0 10px 28px -18px rgba(10, 48, 52, .22);
  --shadow-lg: 0 24px 60px -24px rgba(8, 40, 44, .32);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3, h4, p { margin: 0; }
::selection { background: #BEEAE3; }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #C9D9D7; border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #A9C2BF; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================ 启动态 ============================ */
.boot { height: 100vh; display: grid; place-content: center; justify-items: center; gap: 16px; color: var(--ink-3); }
.boot-mark {
  width: 42px; height: 42px; border-radius: 13px;
  background: conic-gradient(from 0deg, var(--brand), var(--brand-2), var(--brand));
  animation: spin 1.1s linear infinite;
  mask: radial-gradient(farthest-side, transparent 62%, #000 64%);
  -webkit-mask: radial-gradient(farthest-side, transparent 62%, #000 64%);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================ 登录 ============================ */
.login {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr;
}
.login-side {
  position: relative; overflow: hidden; padding: 56px 60px;
  background: radial-gradient(120% 120% at 12% 8%, #12605F 0%, #08383B 46%, #062A2D 100%);
  color: #EAF7F5; display: flex; flex-direction: column; justify-content: space-between;
}
.login-side::before {
  content: ""; position: absolute; inset: -30% -20% auto auto; width: 560px; height: 560px;
  border-radius: 50%; border: 1px solid rgba(255,255,255,.09);
  box-shadow: 0 0 0 70px rgba(255,255,255,.028), 0 0 0 150px rgba(255,255,255,.02);
}
.login-side::after {
  content: ""; position: absolute; left: -80px; bottom: -120px; width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(18,181,162,.32), transparent 68%);
}
.login-logo { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.login-logo .mark {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--brand-2), var(--brand)); box-shadow: 0 8px 22px -8px rgba(18,181,162,.9);
}
.login-logo .mark svg { width: 22px; height: 22px; }
.login-logo b { font-size: 17px; letter-spacing: .5px; }
.login-logo span { font-size: 12px; color: #8FC4C0; display: block; letter-spacing: 2px; font-weight: 400; }
.login-hero { position: relative; z-index: 1; max-width: 470px; }
.login-hero h1 { font-size: 34px; line-height: 1.32; font-weight: 650; letter-spacing: -.5px; }
.login-hero h1 em { font-style: normal; color: #6FE0CD; }
.login-hero p { margin-top: 16px; color: #9FC6C3; font-size: 14px; line-height: 1.9; }
.login-feats { margin-top: 34px; display: grid; gap: 14px; }
.login-feat { display: flex; gap: 12px; align-items: flex-start; font-size: 13px; color: #C6E2DF; }
.login-feat i {
  flex: none; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center;
  background: rgba(18,181,162,.16); border: 1px solid rgba(18,181,162,.34); margin-top: 1px;
}
.login-feat i svg { width: 13px; height: 13px; stroke: #58D6C2; }
.login-foot { position: relative; z-index: 1; font-size: 12px; color: #7BA9A6; display: flex; gap: 18px; }
.login-main { display: grid; place-items: center; padding: 40px; background: #fff; }
.login-card { width: 100%; max-width: 372px; }
.login-card h2 { font-size: 23px; font-weight: 650; letter-spacing: -.3px; }
.login-card > p { color: var(--ink-3); margin-top: 6px; font-size: 13px; }
.login-form { margin-top: 30px; display: grid; gap: 16px; }
.field label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 7px; font-weight: 500; }
.field .wrap { position: relative; }
.field .wrap svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; stroke: var(--ink-3); }
.field input {
  width: 100%; height: 44px; padding: 0 14px 0 38px; border: 1px solid var(--line);
  border-radius: 10px; background: #FAFCFC; font-size: 14px; color: var(--ink); outline: none; transition: .16s;
}
.field input:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(14,156,139,.12); }
.btn-login {
  height: 46px; border: 0; border-radius: 10px; cursor: pointer; font-size: 15px; font-weight: 600; color: #fff;
  background: linear-gradient(120deg, var(--brand), #0C8A7C); box-shadow: 0 12px 24px -12px rgba(14,156,139,.8);
  transition: .18s; letter-spacing: .5px;
}
.btn-login:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-login:disabled { opacity: .65; cursor: wait; transform: none; }
.login-err { color: var(--danger); font-size: 12.5px; min-height: 18px; margin-top: -4px; }
.login-accounts { margin-top: 26px; border-top: 1px dashed var(--line); padding-top: 18px; }
.login-accounts b { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.acc-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.acc {
  flex: 1 1 0; min-width: 100px; border: 1px solid var(--line); background: #fff; border-radius: 9px;
  padding: 8px 10px; cursor: pointer; text-align: left; transition: .15s;
}
.acc:hover { border-color: var(--brand); background: var(--brand-soft); }
.acc b { display: block; font-size: 12.5px; color: var(--ink); font-weight: 600; }
.acc span { font-size: 11px; color: var(--ink-3); }

/* ============================ 布局 ============================ */
.app { display: grid; grid-template-columns: 226px 1fr; min-height: 100vh; }

.side {
  background: linear-gradient(180deg, #0A4044 0%, #08383B 42%, #062B2E 100%);
  color: #D4E7E5; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.side-brand { display: flex; align-items: center; gap: 11px; padding: 20px 18px 18px; }
.side-brand .mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--brand-2), var(--brand)); flex: none;
  box-shadow: 0 8px 20px -10px rgba(18,181,162,.95);
}
.side-brand .mark svg { width: 19px; height: 19px; }
.side-brand b { font-size: 15px; color: #fff; display: block; line-height: 1.2; letter-spacing: .4px; }
.side-brand span { font-size: 10.5px; color: #7FAFAB; letter-spacing: 1.6px; }
.side-org {
  margin: 0 14px 10px; padding: 9px 11px; border-radius: 9px; background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.07); display: flex; align-items: center; gap: 8px;
}
.side-org svg { width: 14px; height: 14px; stroke: #6FCFC0; flex: none; }
.side-org span { font-size: 11.5px; color: #B9D6D3; line-height: 1.35; }

.nav { flex: 1; overflow-y: auto; padding: 6px 10px 16px; }
.nav::-webkit-scrollbar { width: 6px; }
.nav-group { margin-top: 14px; }
.nav-group:first-child { margin-top: 2px; }
.nav-group + .nav-group { border-top: 1px solid rgba(255,255,255,.07); padding-top: 4px; }
.nav-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 10.5px; color: #7FB3AE; letter-spacing: 1.4px; padding: 8px 10px 6px; font-weight: 600;
}
.nav-dot { width: 6px; height: 6px; border-radius: 50%; background: #5F918E; flex: none; }
.nav-group[data-tone="inst"] .nav-dot { background: #2ED3B7; box-shadow: 0 0 0 3px rgba(46,211,183,.16); }
.nav-group[data-tone="home"] .nav-dot { background: #F2A63B; box-shadow: 0 0 0 3px rgba(242,166,59,.18); }
.nav-group[data-tone="sys"] .nav-dot { background: #7FA0C8; box-shadow: 0 0 0 3px rgba(127,160,200,.14); }
.nav-count {
  margin-left: auto; font-size: 9.5px; font-weight: 600; color: #6E9E9B; letter-spacing: 0;
  min-width: 16px; height: 15px; padding: 0 5px; border-radius: 8px; background: rgba(255,255,255,.06);
  display: grid; place-items: center;
}
/* 居家业务线用暖色标记选中态，与机构的青绿一眼分开 */
.nav-group[data-tone="home"] .nav-item.active { background: linear-gradient(90deg, rgba(242,166,59,.20), rgba(242,166,59,.05)); }
.nav-group[data-tone="home"] .nav-item.active svg { stroke: #F7C46C; }
.nav-group[data-tone="home"] .nav-item.active::before { background: #F2A63B; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px;
  color: #B6D2CF; cursor: pointer; font-size: 13px; transition: .14s; position: relative; user-select: none;
}
.nav-item svg { width: 16px; height: 16px; stroke: #7FAFAB; flex: none; transition: .14s; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #EAF7F5; }
.nav-item:hover svg { stroke: #A9DCD4; }
.nav-item.active { background: linear-gradient(90deg, rgba(18,181,162,.22), rgba(18,181,162,.06)); color: #fff; font-weight: 500; }
.nav-item.active svg { stroke: #5BDCC8; }
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--brand-2);
}
.nav-badge {
  margin-left: auto; min-width: 19px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: #C4444A; color: #fff; font-size: 10.5px; font-weight: 600; display: grid; place-items: center;
}
.side-foot { padding: 12px 14px 16px; border-top: 1px solid rgba(255,255,255,.06); font-size: 11px; color: #6E9E9B; }
.side-foot .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #4ED0A8; margin-right: 6px; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 62px; background: rgba(255,255,255,.86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px;
  padding: 0 26px; position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 16.5px; font-weight: 650; letter-spacing: -.2px; }
/* 业务线标记：机构 / 居家 / 平台，与侧栏分区同色 */
.biz-chip { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; flex: none; letter-spacing: .3px; }
.biz-chip[data-tone="inst"] { background: rgba(14,156,139,.10); color: #0B7F71; }
.biz-chip[data-tone="home"] { background: rgba(226,142,30,.13); color: #B9701A; }
.biz-chip[data-tone="sys"] { background: rgba(84,120,168,.12); color: #476289; }
.topbar .sub { font-size: 12px; color: var(--ink-3); border-left: 1px solid var(--line); padding-left: 12px; margin-left: 2px; }
.topbar .spacer { flex: 1; }
.topbar .today { font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.topbar .today b { color: var(--ink-2); font-weight: 600; }
.user-chip {
  display: flex; align-items: center; gap: 9px; padding: 5px 10px 5px 5px; border-radius: 22px;
  border: 1px solid var(--line); cursor: pointer; transition: .15s; background: #fff;
}
.user-chip:hover { border-color: #C7DEDB; box-shadow: var(--shadow); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-size: 12.5px; font-weight: 600; flex: none; background: linear-gradient(140deg, #12B5A2, #0B7F73);
}
.user-chip .meta b { display: block; font-size: 12.5px; font-weight: 600; line-height: 1.2; }
.user-chip .meta span { font-size: 10.5px; color: var(--ink-3); }

.readonly-pill {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px;
  border-radius: 7px; background: #FFF6E3; color: #96660A; border: 1px solid #EEDCB4;
  font-size: 11.5px; font-weight: 600; flex: none;
}
.readonly-bar {
  display: flex; align-items: center; gap: 7px; margin: 14px 26px -6px;
  padding: 9px 13px; border-radius: 10px; background: #FFFBF0;
  border: 1px solid #F0E1BE; color: #8A6410; font-size: 12.5px; line-height: 1.5;
}
.view { padding: 22px 26px 40px; min-width: 0; }

/* ============================ 通用组件 ============================ */
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); min-width: 0;
}
.card-head {
  display: flex; align-items: center; gap: 10px; padding: 15px 18px 12px;
}
.card-head h3 { font-size: 14px; font-weight: 650; letter-spacing: -.1px; }
.card-head .desc { font-size: 11.5px; color: var(--ink-3); margin-left: 2px; }
.card-head .spacer { flex: 1; }
.card-body { padding: 0 18px 18px; }
.card-body.tight { padding: 0 0 6px; }
.card-body.flush { padding: 0 0 0; }

.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; position: relative; overflow: hidden; }
.kpi .label { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.kpi .label svg { width: 14px; height: 14px; stroke: var(--ink-3); }
.kpi .value { font-size: 26px; font-weight: 680; letter-spacing: -1px; line-height: 1.25; font-variant-numeric: tabular-nums; }
.kpi .value small { font-size: 13px; font-weight: 500; color: var(--ink-3); margin-left: 3px; letter-spacing: 0; }
.kpi .foot { font-size: 11.5px; color: var(--ink-3); display: flex; align-items: center; gap: 5px; }
.kpi .delta { font-weight: 600; }
.kpi .delta.up { color: var(--ok); }
.kpi .delta.down { color: var(--danger); }
.kpi .bg-icon {
  position: absolute; right: -6px; bottom: -10px; width: 62px; height: 62px; opacity: .055;
}
.kpi .bg-icon svg { width: 100%; height: 100%; stroke: var(--brand-deep); }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.seg { display: inline-flex; background: #EDF3F2; border-radius: 9px; padding: 3px; gap: 2px; }
.seg button {
  border: 0; background: transparent; padding: 5px 12px; border-radius: 7px; font-size: 12.5px;
  color: var(--ink-2); cursor: pointer; transition: .14s; white-space: nowrap;
}
.seg button.on { background: #fff; color: var(--brand); font-weight: 600; box-shadow: 0 1px 3px rgba(10,48,52,.1); }
.seg button:hover:not(.on) { color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 9px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-size: 13px; cursor: pointer;
  transition: .15s; white-space: nowrap; font-weight: 500;
}
.btn svg { width: 14px; height: 14px; stroke: currentColor; }
.btn:hover { border-color: #C4DBD8; color: var(--ink); background: #FBFDFD; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 8px 18px -10px rgba(14,156,139,.8); }
.btn.primary:hover { background: #0C8A7C; border-color: #0C8A7C; color: #fff; }
.btn.ghost { background: transparent; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn.danger { color: var(--danger); border-color: #F0D3D3; }
.btn.danger:hover { background: var(--danger-soft); border-color: #E4B6B6; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.input, select.input {
  height: 34px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff;
  font-size: 13px; color: var(--ink); outline: none; transition: .15s; font-family: inherit;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14,156,139,.1); }
select.input { padding-right: 26px; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2382989C' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; }
.search { position: relative; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; stroke: var(--ink-3); }
.search input { padding-left: 31px; width: 210px; }

.tag {
  display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 8px; border-radius: 6px;
  font-size: 11.5px; font-weight: 500; white-space: nowrap; background: #EFF4F4; color: var(--ink-2);
  border: 1px solid transparent;
}
.tag.ok { background: var(--ok-soft); color: #1F7A4C; }
.tag.warn { background: var(--warn-soft); color: #A2761A; }
.tag.danger { background: var(--danger-soft); color: #B23A3A; }
.tag.info { background: var(--info-soft); color: #2C66AE; }
.tag.muted { background: #F1F5F5; color: var(--ink-3); }
.tag.brand { background: var(--brand-soft); color: #0A7C6E; }
.tag .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* ============================ 表格 ============================ */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl thead th {
  text-align: left; font-weight: 500; font-size: 11.5px; color: var(--ink-3); letter-spacing: .3px;
  padding: 9px 12px; background: #F7FAFA; border-bottom: 1px solid var(--line); white-space: nowrap;
  position: sticky; top: 0; z-index: 2;
}
.tbl thead th:first-child { border-top-left-radius: 9px; }
.tbl thead th:last-child { border-top-right-radius: 9px; }
.tbl tbody td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); color: var(--ink-2); vertical-align: middle; }
.tbl tbody tr { transition: background .12s; cursor: default; }
.tbl tbody tr:hover { background: #F7FBFB; }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .strong { color: var(--ink); font-weight: 600; }
.tbl .num { font-variant-numeric: tabular-nums; }
.tbl .muted { color: var(--ink-3); }
.tbl .nowrap { white-space: nowrap; }
.tbl .right { text-align: right; }
.tbl .center { text-align: center; }

.person { display: flex; align-items: center; gap: 9px; }
.person .avatar { width: 28px; height: 28px; font-size: 11.5px; }
.person .meta b { display: block; font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.person .meta span { font-size: 11px; color: var(--ink-3); }

.empty { padding: 48px 20px; text-align: center; color: var(--ink-3); font-size: 13px; }
.empty svg { width: 38px; height: 38px; stroke: #C7D8D6; margin-bottom: 8px; }

.pager { display: flex; align-items: center; gap: 8px; padding: 12px 18px; color: var(--ink-3); font-size: 12.5px; }
.pager .spacer { flex: 1; }
.pager button {
  min-width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--line); background: #fff;
  color: var(--ink-2); cursor: pointer; font-size: 12.5px; padding: 0 8px;
}
.pager button.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.pager button:disabled { opacity: .45; cursor: not-allowed; }

/* ============================ 图表 ============================ */
svg.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.chart-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 6px; }

.donut-wrap { display: flex; align-items: center; gap: 18px; }
.donut-legend { flex: 1; display: grid; gap: 9px; }
.donut-legend .row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.donut-legend .row i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.donut-legend .row b { margin-left: auto; color: var(--ink); font-variant-numeric: tabular-nums; }
.donut-legend .row span { color: var(--ink-3); font-size: 11.5px; width: 38px; text-align: right; }

.hbar { display: grid; gap: 13px; }
.hbar .row { display: grid; grid-template-columns: 100px 1fr 50px; align-items: center; gap: 10px; font-size: 12.5px; }
.hbar .row .name { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .row .track { display: block; height: 7px; border-radius: 4px; background: #EEF4F3; overflow: hidden; }
.hbar .row .fill { display: block; height: 100%; border-radius: 4px; transition: width .5s ease; }
.hbar .row .val { text-align: right; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ============================ 告警流 / 时间线 ============================ */
.feed { display: grid; }
.feed-item { display: flex; gap: 11px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.feed-item:last-child { border-bottom: 0; }
.feed-dot { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.feed-dot svg { width: 14px; height: 14px; }
.feed-dot.danger { background: var(--danger-soft); } .feed-dot.danger svg { stroke: var(--danger); }
.feed-dot.warn { background: var(--warn-soft); } .feed-dot.warn svg { stroke: var(--warn); }
.feed-dot.info { background: var(--info-soft); } .feed-dot.info svg { stroke: var(--info); }
.feed-dot.ok { background: var(--ok-soft); } .feed-dot.ok svg { stroke: var(--ok); }
.feed-main { flex: 1; min-width: 0; }
.feed-main .t { font-size: 12.8px; color: var(--ink); line-height: 1.4; }
.feed-main .t b { font-weight: 600; }
.feed-main .m { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; }
.feed-time { font-size: 11px; color: var(--ink-3); white-space: nowrap; }

.timeline { display: grid; gap: 0; position: relative; padding-left: 20px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 16px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -19px; top: 5px; width: 9px; height: 9px; border-radius: 50%;
  background: #fff; border: 2px solid var(--brand);
}
.tl-item .tl-t { font-size: 12.8px; color: var(--ink); }
.tl-item .tl-m { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }

/* ============================ 房态 ============================ */
.floor-plan { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.room {
  border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: #fff; transition: .16s;
}
.room:hover { border-color: #BFD9D5; box-shadow: var(--shadow); }
.room-head {
  display: flex; align-items: center; justify-content: space-between; padding: 8px 10px;
  background: #F7FAFA; border-bottom: 1px solid var(--line-2); font-size: 12px;
}
.room-head b { font-weight: 600; color: var(--ink); font-size: 12.5px; letter-spacing: .2px; }
.room-head span { font-size: 10.5px; color: var(--ink-3); }
.beds { padding: 8px; display: grid; gap: 6px; }
.bed {
  display: flex; align-items: center; gap: 7px; padding: 7px 9px; border-radius: 8px; cursor: pointer;
  border: 1px solid transparent; transition: .14s; font-size: 12px; background: #F8FBFB;
}
.bed:hover { border-color: var(--brand); background: var(--brand-soft); }
.bed .dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.bed.occupied { background: #F0F8F6; } .bed.occupied .dot { background: var(--brand); }
.bed.vacant { background: #F6F9F9; } .bed.vacant .dot { background: #9DB4B2; }
.bed.maintenance { background: var(--warn-soft); } .bed.maintenance .dot { background: var(--warn); }
.bed.reserved { background: var(--info-soft); } .bed.reserved .dot { background: var(--info); }
.bed .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.bed .nm b { color: var(--ink); font-weight: 600; }
.bed .tag { height: 18px; font-size: 10.5px; padding: 0 6px; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; }

/* ============================ 抽屉 / 弹窗 ============================ */
.mask {
  position: fixed; inset: 0; background: rgba(10, 40, 44, .34); backdrop-filter: blur(2px);
  z-index: 60; animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 560px; max-width: 94vw; background: #fff;
  z-index: 61; display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
  animation: slideIn .24s cubic-bezier(.32,.72,.28,1);
}
@keyframes slideIn { from { transform: translateX(28px); opacity: .6; } }
.drawer-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: 12px; }
.drawer-head h3 { font-size: 16px; font-weight: 650; }
.drawer-head .sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 22px 28px; }
.drawer-foot { padding: 13px 22px; border-top: 1px solid var(--line); display: flex; gap: 9px; justify-content: flex-end; background: #FCFDFD; }
.icon-btn {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: #fff;
  display: grid; place-items: center; cursor: pointer; transition: .14s; flex: none;
}
.icon-btn:hover { background: #F4F8F8; border-color: #C9DEDB; }
.icon-btn svg { width: 14px; height: 14px; stroke: var(--ink-2); }

.modal {
  position: fixed; z-index: 61; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 520px; max-width: 94vw; max-height: 88vh; background: #fff; border-radius: 16px;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: pop .2s cubic-bezier(.32,.72,.28,1);
}
@keyframes pop { from { transform: translate(-50%, -48%) scale(.985); opacity: .5; } }
.modal-head { padding: 18px 22px 12px; display: flex; align-items: center; gap: 10px; }
.modal-head h3 { font-size: 15.5px; font-weight: 650; flex: 1; }
.modal-body { padding: 4px 22px 6px; overflow-y: auto; }
.modal-foot { padding: 14px 22px 18px; display: flex; gap: 9px; justify-content: flex-end; }

.form-grid { display: grid; gap: 14px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; font-weight: 500; }
.form-grid label em { color: var(--danger); font-style: normal; margin-left: 2px; }
.form-grid .input, .form-grid textarea { width: 100%; }
.form-grid textarea {
  min-height: 74px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px;
  font-family: inherit; font-size: 13px; resize: vertical; outline: none; color: var(--ink);
}
.form-grid textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14,156,139,.1); }
.hint { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }

/* 评分滑块 */
.range-row { display: grid; grid-template-columns: 1fr 46px; gap: 10px; align-items: center; }
input[type="range"] { -webkit-appearance: none; width: 100%; height: 5px; border-radius: 3px; background: #E6EFEE; outline: none; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--brand);
  border: 3px solid #fff; box-shadow: 0 1px 4px rgba(10,48,52,.28); cursor: pointer;
}
.score-badge { text-align: right; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }

/* ============================ 其它 ============================ */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button {
  border: 0; background: transparent; padding: 9px 13px; font-size: 13px; color: var(--ink-3);
  cursor: pointer; position: relative; font-weight: 500;
}
.tabs button.on { color: var(--brand); }
.tabs button.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--brand); border-radius: 2px; }

.kv { display: grid; grid-template-columns: 86px 1fr; gap: 9px 12px; font-size: 13px; }
.kv dt { color: var(--ink-3); font-size: 12.5px; }
.kv dd { margin: 0; color: var(--ink); }

/* 详情明细行 */
.detail-sec { font-size: 12.5px; color: var(--ink-3); margin: 18px 0 4px; }
.detail-sec:first-child { margin-top: 0; }
.detail-row {
  display: flex; gap: 10px; align-items: center; padding: 9px 0;
  border-bottom: 1px dashed #EEF5F4; font-size: 12.8px;
}
.detail-row:last-child { border-bottom: 0; }
.detail-row .dr-left { flex: none; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.detail-row .dr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.detail-row .dr-main b { font-size: 12.8px; font-weight: 600; color: var(--ink); }
.detail-row .dr-main span { font-size: 11.5px; color: var(--ink-3); }
.detail-row .dr-right { flex: none; display: flex; gap: 5px; align-items: center; }

.link { color: var(--brand); cursor: pointer; }
.link:hover { text-decoration: underline; text-underline-offset: 2px; }
tr.clickable:hover > td { background: #F7FBFB; }
.org-row:hover { background: #F3F9F8; }

.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #FBFDFD;
}
.stat .l { font-size: 11.5px; color: var(--ink-3); }
.stat .v { font-size: 18px; font-weight: 650; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }

.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; }
.toast {
  background: #123A3E; color: #EAF7F5; padding: 9px 16px; border-radius: 9px; font-size: 13px;
  box-shadow: 0 14px 34px -16px rgba(8,40,44,.7); animation: toastIn .22s ease; display: flex; align-items: center; gap: 8px;
}
.toast.ok { background: #14624F; }
.toast.err { background: #7E2A2A; }
.toast.warn { background: #6B4A12; }
@keyframes toastIn { from { transform: translateY(-8px); opacity: 0; } }

.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.note-box {
  background: var(--brand-soft); border: 1px solid #CFEAE4; border-radius: 10px; padding: 10px 12px;
  font-size: 12.5px; color: #0A6B60; line-height: 1.6;
}
.warn-box {
  background: var(--warn-soft); border: 1px solid #F0E0BC; border-radius: 10px; padding: 10px 12px;
  font-size: 12.5px; color: #94661A; line-height: 1.6;
}
.progress-line { height: 6px; border-radius: 3px; background: #EEF4F3; overflow: hidden; }
.progress-line > i { display: block; height: 100%; border-radius: 3px; background: var(--brand); }

.only-mobile { display: none; }

/* ============================ 移动端结构件 ============================ */
.side-mask {
  position: fixed; inset: 0; z-index: 54; background: rgba(8, 30, 33, .46);
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.side-mask.on { opacity: 1; pointer-events: auto; }
.login-mbrand { display: none; }
.side-close { display: none; }
body.layered { overflow: hidden; }

/* ==========================================================================
   设备接入 / 设备状态
   ========================================================================== */
.dv-cell { min-width: 0; }
.dv-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.dv-sn { font-size: 11px; color: var(--ink-3); font-family: var(--mono); margin-top: 2px; }
.dv-bat { margin-left: 6px; font-size: 11.5px; color: var(--ink-3); }
.dv-bat.low { color: var(--danger); font-weight: 600; }

.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.brand-card { border: 1px solid var(--line); border-radius: 11px; padding: 10px 11px; cursor: pointer; transition: .15s; background: #fff; }
.brand-card:hover { border-color: var(--brand); box-shadow: 0 8px 22px -16px rgba(14,156,139,.75); transform: translateY(-1px); }
.brand-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.brand-top b { font-size: 13px; }
.tier { font-size: 10px; color: var(--ink-3); background: #F1F5F5; border-radius: 5px; padding: 1px 5px; flex: none; }
.tier.top { color: #8A5A00; background: var(--warm-soft); }
.tier.plat { color: #2A5FA8; background: var(--info-soft); }
.brand-en { font-size: 10.5px; color: var(--ink-3); margin-top: 2px; letter-spacing: .2px; }
.brand-cats { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.brand-cats span { font-size: 10.5px; color: var(--ink-2); background: #F4F8F8; border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
.brand-foot { font-size: 10.5px; color: var(--ink-3); margin-top: 7px; line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cred-chip { display: inline-block; font-size: 11px; color: var(--ink-2); background: #F4F8F8; border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; margin: 2px 4px 2px 0; }
.cred-chip.gen { color: #0A6B60; background: var(--brand-soft); border-color: #CFEAE4; }

.sync-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--ink-3); background: #F6FAFA; border: 1px dashed var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; }
.sync-strip > svg { stroke: var(--brand); flex: none; }
.sync-chip { font-size: 11.5px; color: #0A6B60; background: #fff; border: 1px solid #CFEAE4; border-radius: 6px; padding: 2px 7px; }

.metric-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin: 4px 0 6px; }
.metric-cell { border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; background: #FBFDFD; }
.metric-cell span { display: block; font-size: 11.5px; color: var(--ink-3); }
.metric-cell b { font-size: 16px; font-weight: 650; letter-spacing: -.3px; }
.metric-cell b i { font-size: 11px; font-style: normal; color: var(--ink-3); margin-left: 2px; font-weight: 400; }
.metric-cell.bad { border-color: #F0D3D3; background: var(--danger-soft); }
.metric-cell.bad b { color: var(--danger); }

.ev-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--ok); flex: none; }
.ev-dot.bad { background: var(--danger); }
.ev-dot.warn { background: var(--warn); }

.drawer-actions { display: flex; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }

.check-list { display: flex; flex-direction: column; }
.check-row { display: flex; align-items: center; gap: 9px; padding: 9px 10px; font-size: 12.5px; }
.check-row + .check-row { border-top: 1px dashed var(--line-2); }
.check-row .ck { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); flex: none; }
.check-row .ck svg { stroke: var(--ok); }
.check-row.bad .ck { background: var(--danger-soft); }
.check-row.bad .ck svg { stroke: var(--danger); }
.check-row b { width: 76px; flex: none; font-weight: 600; }
.check-row .cd { color: var(--ink-2); }

.cred-table { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cred-row { display: flex; align-items: center; gap: 10px; padding: 9px 11px; background: #fff; }
.cred-row + .cred-row { border-top: 1px solid var(--line-2); }
.cred-row .cl { width: 118px; flex: none; font-size: 12px; color: var(--ink-2); }
.cred-row .cv { flex: 1; min-width: 0; font-family: var(--mono); font-size: 10.5px; color: var(--ink); background: #F7FAFA; border-radius: 6px; padding: 4px 7px; overflow-x: auto; white-space: nowrap; }
.cred-row .icon-btn { flex: none; }
.req { color: var(--danger); font-style: normal; margin-left: 2px; }
.code-block { background: #0E2A2E; color: #BFEDE6; border-radius: 10px; padding: 12px; font-family: var(--mono); font-size: 11px; line-height: 1.65; overflow-x: auto; margin: 0; white-space: pre-wrap; word-break: break-all; }

.wiz-step { display: flex; align-items: center; gap: 8px; margin: 18px 0 12px; font-size: 13px; }
.wiz-step:first-child { margin-top: 0; }
.wiz-step .num { width: 20px; height: 20px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 11.5px; display: grid; place-items: center; font-weight: 600; flex: none; }
.wiz-step b { font-weight: 650; }
.wiz-step .hint { margin: 0; font-size: 11.5px; color: var(--ink-3); }
.gen-box { height: 34px; display: flex; align-items: center; gap: 6px; padding: 0 11px; border: 1px dashed var(--line); border-radius: 9px; background: #F7FAFA; color: var(--ink-3); font-size: 12px; }
.gen-box svg { stroke: var(--brand); }
.fhint { font-size: 11px; color: var(--ink-3); margin-top: 4px; line-height: 1.45; }

.ok-banner { display: flex; gap: 10px; align-items: center; padding: 11px 13px; border-radius: 11px; background: var(--ok-soft); border: 1px solid #C9E9DA; margin-bottom: 14px; }
.ok-banner svg { stroke: var(--ok); flex: none; }
.ok-banner b { display: block; font-size: 13.5px; }
.ok-banner span { font-size: 11.5px; color: var(--ink-2); }
.steps-list { margin: 8px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--ink-2); line-height: 1.9; }

.dev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: 10px; }
.dev-card { border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; background: #fff; cursor: pointer; transition: .15s; }
.dev-card:hover { border-color: var(--brand); box-shadow: 0 10px 26px -18px rgba(14,156,139,.7); transform: translateY(-1px); }
.dev-card.bad { border-color: #F0D3D3; background: linear-gradient(180deg, var(--danger-soft), #fff 46%); }
.dev-card.warn { border-color: #F0E2C4; background: linear-gradient(180deg, var(--warn-soft), #fff 46%); }
.dev-card.off { opacity: .62; }
.dev-top { display: flex; align-items: flex-start; gap: 8px; }
.dev-ic { width: 26px; height: 26px; border-radius: 8px; background: var(--brand-soft); display: grid; place-items: center; flex: none; }
.dev-ic svg { stroke: var(--brand); }
.dev-title { flex: 1; min-width: 0; }
.dev-title b { display: block; font-size: 12.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dev-title span { display: block; font-size: 10.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dev-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; margin-top: 5px; }
.dev-dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(42,149,96,.13); }
.dev-dot.bad { background: var(--danger); box-shadow: 0 0 0 3px rgba(212,75,75,.14); }
.dev-dot.warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(207,148,31,.14); }
.dev-meta { display: flex; gap: 6px; flex-wrap: wrap; font-size: 10.5px; color: var(--ink-3); margin: 7px 0 0; }
.dev-meta .proto { color: #2A5FA8; }
.dev-metrics { display: flex; gap: 6px; flex-wrap: wrap; margin: 9px 0 8px; }
.dev-metrics .dm { display: flex; flex-direction: column; background: #F8FBFB; border: 1px solid var(--line-2); border-radius: 7px; padding: 4px 7px; min-width: 56px; }
.dev-metrics .dm i { font-size: 10px; color: var(--ink-3); font-style: normal; }
.dev-metrics .dm b { font-size: 12px; font-weight: 600; }
.dev-metrics .dm.muted { color: var(--ink-3); }
.dev-foot { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--ink-3); border-top: 1px dashed var(--line-2); padding-top: 7px; }
.dev-batbar { width: 34px; height: 4px; border-radius: 3px; background: #E9F0EF; overflow: hidden; }
.dev-batbar i { display: block; height: 100%; }
.dev-ago { flex: none; }
.group-bar { width: 96px; height: 5px; border-radius: 3px; background: #E9F0EF; overflow: hidden; flex: none; align-self: center; }
.group-bar i { display: block; height: 100%; background: var(--brand); border-radius: 3px; }

.ev-list { display: flex; flex-direction: column; }
.ev-row { display: flex; align-items: center; gap: 9px; padding: 8px 2px; font-size: 12px; }
.ev-row + .ev-row { border-top: 1px dashed var(--line-2); }
.ev-time { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); flex: none; width: 76px; }
.ev-text { flex: 1; min-width: 0; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-dev { color: var(--ink-3); font-size: 11px; flex: none; max-width: 38%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cat-foot { margin-top: 10px; border-top: 1px dashed var(--line-2); padding-top: 8px; }
.cat-row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; padding: 3px 0; }
.cat-row span { flex: 1; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-row b { font-weight: 600; }
.cat-row i { font-style: normal; font-size: 10.5px; padding: 1px 5px; border-radius: 5px; }
.cat-row i.bad { color: var(--danger); background: var(--danger-soft); }
.cat-row i.warn { color: #8A5A00; background: var(--warn-soft); }
.g3-1 { grid-template-columns: 2fr 1fr; }


/* ==========================================================================
   响应式：1400 宽屏 → 1180 小笔记本 → 960 平板 → 760 手机 → 420 小屏
   ========================================================================== */

@media (max-width: 1400px) {
  .g6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .floor-plan { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------------------------- 平板 ---------------------------- */
@media (max-width: 960px) {
  .only-mobile { display: grid; }

  /* 侧栏改为抽屉，带遮罩与关闭按钮 */
  .app { grid-template-columns: 1fr; }
  .side {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 55; width: 268px;
    transform: translateX(-102%); transition: transform .24s cubic-bezier(.32, .72, .28, 1);
    box-shadow: 0 0 46px rgba(4, 24, 26, .55); padding-top: env(safe-area-inset-top);
  }
  .side.open { transform: none; }
  .side-close {
    display: grid; margin-left: auto; flex: none;
    background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .12);
  }
  .side-close:hover { background: rgba(255, 255, 255, .13); }
  .side-close svg { stroke: #CFE6E3; }
  .nav-item { padding: 11.5px 11px; font-size: 13.5px; }
  .nav-title { padding-top: 10px; }

  /* 登录页：隐藏左栏，改用卡片内品牌头 */
  .login { grid-template-columns: 1fr; }
  .login-side { display: none; }
  .login-main { padding: 44px 24px 32px; place-items: start center; }
  .login-mbrand { display: flex; align-items: center; gap: 11px; margin-bottom: 24px; }
  .login-mbrand .mark {
    width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none;
    background: linear-gradient(140deg, var(--brand-2), var(--brand));
    box-shadow: 0 8px 20px -10px rgba(18, 181, 162, .9);
  }
  .login-mbrand .mark svg { width: 21px; height: 21px; }
  .login-mbrand b { font-size: 16px; letter-spacing: .5px; }
  .login-mbrand span { display: block; font-size: 10.5px; color: var(--ink-3); letter-spacing: 1.8px; }

  .view { padding: 16px 16px 36px; }
  .topbar { padding: 0 14px; gap: 10px; height: 58px; }
  .topbar .sub, .topbar .today { display: none; }
  .biz-chip { display: none; }
  .readonly-bar { margin: 12px 14px -2px; }

  .g2, .g3 { grid-template-columns: 1fr; }
  .g4, .g6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .floor-plan { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* 页面里有内联 grid-template-columns（量表+结论、名册+班次），窄屏必须强制单列 */
  .grid.g2, .grid.g3 { grid-template-columns: 1fr !important; }
  .grid.g4, .grid.g6 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

/* ---------------------------- 手机 ---------------------------- */
@media (max-width: 760px) {
  body { font-size: 13.5px; }
  .view { padding: 12px 12px calc(30px + env(safe-area-inset-bottom)); }
  .grid { gap: 12px; }
  .topbar { height: 54px; padding: 0 12px; }
  .topbar h1 { font-size: 15.5px; }
  .user-chip { padding: 3px; border-color: transparent; background: transparent; }
  .user-chip:hover { box-shadow: none; border-color: transparent; }
  .readonly-bar { margin: 10px 12px 0; padding: 8px 11px; font-size: 12px; align-items: flex-start; }
  .readonly-bar svg { margin-top: 2px; flex: none; }

  .card-head { padding: 13px 14px 10px; flex-wrap: wrap; }
  .card-head .desc { font-size: 11px; }
  .card-body { padding: 0 14px 14px; }

  .kpi { padding: 13px 14px; }
  .kpi .label { font-size: 11.5px; }
  .kpi .value { font-size: 22px; }
  .kpi .value small { font-size: 11.5px; }
  .kpi .bg-icon { width: 48px; height: 48px; }

  /* 触控友好尺寸 */
  .btn { height: 38px; padding: 0 13px; font-size: 13px; }
  .btn.sm { height: 34px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
  .icon-btn { width: 34px; height: 34px; }
  .input, select.input { height: 40px; font-size: 14px; }
  .seg { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
  .seg button { padding: 7px 13px; font-size: 12.5px; }
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { padding: 9px 11px; white-space: nowrap; }
  .pager { padding: 10px 12px; gap: 6px; flex-wrap: wrap; font-size: 12px; }
  .pager button { min-width: 34px; height: 34px; }

  .toolbar { gap: 8px; margin-bottom: 12px; }
  .toolbar .spacer { display: none; }
  .toolbar .search { flex: 1 1 100%; }
  .search input { width: 100%; }
  .toolbar > .btn { flex: 1; justify-content: center; }
  .toolbar > span:not(.spacer) { flex: 1 1 100%; line-height: 1.5; }

  .donut-wrap { gap: 12px; }
  .hbar .row { grid-template-columns: 74px 1fr 44px; gap: 8px; font-size: 12px; }
  .feed-time { font-size: 10.5px; }
  .stat-row { gap: 8px; }
  .stat { padding: 8px 10px; }
  .stat .v { font-size: 16px; }
  .kv { grid-template-columns: 78px 1fr !important; font-size: 12.8px; gap: 8px 10px; }
  .detail-row { gap: 8px; }
  .detail-row .dr-main b { font-size: 12.5px; }
  .detail-row .dr-left { width: 60px !important; font-size: 11.5px; }

  /* 抽屉整屏 */
  .drawer { width: 100vw; max-width: 100vw; box-shadow: none; }
  .drawer-head { padding: 14px 16px; }
  .drawer-head h3 { font-size: 15.5px; }
  .drawer-body { padding: 14px 16px calc(24px + env(safe-area-inset-bottom)); }
  .drawer-foot { padding: 10px 14px calc(12px + env(safe-area-inset-bottom)); gap: 8px; flex-wrap: wrap; }
  .drawer-foot .btn { flex: 1 1 40%; justify-content: center; }

  /* 弹窗改底部弹出 */
  .modal {
    top: auto; bottom: 0; left: 0; right: 0; transform: none;
    width: 100% !important; max-width: 100vw; max-height: 92vh;
    border-radius: 16px 16px 0 0;
    animation: sheetUp .24s cubic-bezier(.32, .72, .28, 1);
  }
  .modal-head { padding: 15px 16px 10px; }
  .modal-body { padding: 2px 16px 4px; }
  .modal-foot { padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); gap: 8px; flex-wrap: wrap; }
  .modal-foot .btn { flex: 1 1 40%; justify-content: center; }
  .form-grid.two { grid-template-columns: 1fr; }

  .floor-plan { grid-template-columns: 1fr; }
  .room-head { padding: 8px 12px; }
  .bed { padding: 9px 10px; font-size: 12.5px; }

  .toast-wrap { left: 12px; right: 12px; transform: none; }
  .toast { font-size: 13px; padding: 10px 14px; }
  .empty { padding: 34px 16px; }
}

/* 表格卡片化：decorateTables() 会给每个 td 打上 data-label */
@media (max-width: 760px) {
  .table-wrap { overflow: visible; }
  table.tbl-stack { display: block; }
  table.tbl-stack thead { display: none; }
  table.tbl-stack tbody { display: grid; gap: 10px; }
  table.tbl-stack tbody tr {
    display: block; padding: 3px 0; border: 1px solid var(--line);
    border-radius: 12px; background: #fff;
  }
  table.tbl-stack tbody tr:hover { background: #fff; }
  table.tbl-stack tbody td {
    display: flex; align-items: flex-start; gap: 10px; padding: 7px 12px;
    border-bottom: 1px dashed var(--line-2); text-align: left;
  }
  table.tbl-stack tbody tr td:last-child { border-bottom: 0; }
  table.tbl-stack tbody td::before {
    content: attr(data-label); flex: none; width: 68px; padding-top: 2px;
    font-size: 11.5px; color: var(--ink-3); line-height: 1.45;
  }
  table.tbl-stack tbody td:not([data-label])::before { display: none; }
  table.tbl-stack tbody td:empty { display: none; }
  table.tbl-stack .nowrap { white-space: normal; }
  table.tbl-stack tbody td .person { flex: 1; min-width: 0; }
  table.tbl-stack tbody td > * { min-width: 0; }
  .card-body.tight table.tbl-stack tbody,
  .card-body.flush table.tbl-stack tbody { padding: 0 8px 8px; }
}

@keyframes sheetUp { from { transform: translateY(28px); opacity: .45; } }

/* ---------------------------- 小屏手机 ---------------------------- */
@media (max-width: 420px) {
  .user-chip .meta { display: none; }
  .kpi .value { font-size: 20px; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-main { padding: 34px 18px 28px; }
  .login-accounts .acc { min-width: 88px; padding: 7px 9px; }
  .card-head h3 { font-size: 13.5px; }
  table.tbl-stack tbody td::before { width: 58px; }
}

/* 设备相关页面的窄屏适配 */
@media (max-width: 960px) {
  .g3-1 { grid-template-columns: 1fr; }
  .group-bar { display: none; }
}
@media (max-width: 760px) {
  .brand-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dev-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wiz-step { flex-wrap: wrap; }
  .wiz-step .hint { flex: 1 1 100%; padding-left: 28px; }
  .cred-row .cl { width: 82px; font-size: 11.5px; }
  .cred-row .cv { font-size: 10px; }
  .ev-dev { display: none; }
  .ev-time { width: 58px; }
  .check-row { flex-wrap: wrap; }
  .check-row .cd { flex: 1 1 100%; padding-left: 29px; font-size: 11.5px; }
  .drawer-actions { flex-direction: column; }
  .drawer-actions .btn { width: 100%; justify-content: center; }
  .code-block { font-size: 10px; }
}
@media (max-width: 420px) {
  .brand-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: 1fr; }
}

/* ==========================================================
   居家养老
   ========================================================== */
.pill-note { font-size: 12px; color: var(--ink-2); background: var(--bg); border-radius: 20px; padding: 3px 10px; }

/* 紧急呼叫队列 */
.sos-list { display: grid; gap: 9px; }
.sos-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: 11px; background: #fff;
}
.sos-row.urgent { border-color: #F0C9C9; background: #FFF8F8; }
.sos-lv { flex: none; }
.sos-main { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.sos-main b { font-size: 13.5px; font-weight: 600; }
.sos-main span { font-size: 11.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sos-time { flex: none; width: 84px; text-align: right; font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; display: grid; gap: 2px; }
.sos-time i { font-style: normal; font-size: 11px; color: var(--ink-3); }
.sos-st { flex: none; }
.sos-act { flex: none; display: flex; gap: 6px; }

/* 服务站负载 */
.station-row { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.station-row:last-child { border-bottom: none; padding-bottom: 0; }
.st-top { display: flex; align-items: center; gap: 8px; }
.st-top b { font-size: 13px; font-weight: 600; flex: 1; }
.st-top .score { font-size: 12px; font-weight: 700; color: var(--warn); }
.st-meta { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.st-bar { height: 5px; border-radius: 3px; background: var(--line-2); margin: 7px 0 5px; overflow: hidden; }
.st-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 3px; }
.st-foot { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-3); }

/* 服务质量 */
.qual-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.qual {
  background: var(--bg); border-radius: 11px; padding: 11px 12px;
  display: grid; gap: 3px;
}
.qual span { font-size: 11.5px; color: var(--ink-3); }
.qual b { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.qual b.ok { color: var(--ok); }
.qual b.warn { color: var(--warn); }

/* 家庭床位 */
.bed-strip {
  display: flex; flex-wrap: wrap; gap: 10px 18px; padding: 11px 13px;
  background: var(--brand-soft); border-radius: 11px; font-size: 12.5px; color: var(--ink-2);
}
.bed-strip b { color: var(--brand-deep); }
.reno-box { border: 1px solid var(--line); border-radius: 11px; padding: 12px 13px; }
.reno-items { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.reno-chip {
  font-size: 12px; padding: 4px 10px; border-radius: 20px;
  background: var(--brand-soft); color: var(--brand-deep); border: 1px solid #CFE9E4;
}
.reno-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 14px; font-size: 12.5px; color: var(--ink-2); }
.reno-meta b { color: var(--ink); font-weight: 600; }

/* 探访超期预警 */
.warn-list { display: grid; gap: 8px; }
.warn-row {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px;
  border: 1px solid #F2E2C4; border-radius: 10px; background: #fff;
}
.warn-name { flex: none; width: 132px; display: grid; gap: 2px; }
.warn-name b { font-size: 13px; }
.warn-name i { font-style: normal; font-size: 11.5px; color: var(--ink-3); }
.warn-meta { flex: 1 1 auto; min-width: 0; font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 1180px) {
  .sos-row { flex-wrap: wrap; }
  .sos-main { flex: 1 1 100%; order: -1; }
  .sos-time { width: auto; text-align: left; flex: 1; }
}
@media (max-width: 960px) {
  .qual-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .reno-meta { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .sos-row { gap: 8px; padding: 10px; }
  .sos-act { width: 100%; }
  .sos-act .btn { flex: 1; justify-content: center; }
  .qual-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .warn-row { flex-wrap: wrap; gap: 6px; }
  .warn-name { width: 100%; }
  .warn-meta { flex: 1 1 100%; white-space: normal; }
  .warn-row .btn { width: 100%; justify-content: center; }
  .bed-strip { gap: 6px 12px; font-size: 12px; }
}
