/* ── Care Platform UI ─────────────────────────────────────────────── */
:root {
  --bg: #f4f7f6;
  --panel: #ffffff;
  --line: #e3eae7;
  --ink: #22333b;
  --muted: #7c8a86;
  --brand: #0e8f7e;
  --brand-dark: #0b6f62;
  --brand-soft: #e2f3f0;
  --accent: #f0a44b;
  --danger: #d64550;
  --ok: #2e9e5b;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(20, 40, 35, 0.08), 0 4px 14px rgba(20, 40, 35, 0.06);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.55;
}
button { font: inherit; cursor: pointer; }
input, select, textarea {
  font: inherit; color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
h1, h2, h3 { line-height: 1.3; }

/* ── login ── */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0b6f62 0%, #0e8f7e 55%, #3aa08a 100%);
}
.login-card {
  width: 400px; background: var(--panel); border-radius: 16px; padding: 34px 32px;
  box-shadow: 0 20px 60px rgba(0, 30, 25, 0.35);
}
.login-card .logo { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.login-card .logo .mark {
  width: 38px; height: 38px; border-radius: 10px; background: var(--brand);
  color: #fff; display: grid; place-items: center; font-size: 20px; font-weight: 700;
}
.login-card h1 { font-size: 19px; }
.login-card .sub { color: var(--muted); font-size: 12.5px; margin-bottom: 22px; }
.login-card label { display: block; font-size: 12.5px; color: var(--muted); margin: 12px 0 5px; }
.login-card input { width: 100%; padding: 10px 12px; }
.login-card .btn-main { width: 100%; margin-top: 18px; padding: 11px; font-size: 15px; }
.demo-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.demo-chips button {
  border: 1px dashed var(--line); background: #fafcfa; border-radius: 8px;
  padding: 8px 6px; font-size: 12px; color: var(--ink); text-align: left;
}
.demo-chips button:hover { border-color: var(--brand); background: var(--brand-soft); }
.demo-chips b { display: block; font-size: 12px; }
.demo-chips span { color: var(--muted); font-size: 11px; }
.login-err { color: var(--danger); font-size: 12.5px; margin-top: 10px; min-height: 16px; }

/* ── app shell ── */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; background: #10312b; color: #cfe5df; flex-shrink: 0;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .brand .mark { width: 34px; height: 34px; border-radius: 9px; background: var(--brand); color:#fff; display:grid; place-items:center; font-weight:700; font-size:17px; }
.sidebar .brand b { color: #fff; font-size: 15px; display: block; }
.sidebar .brand span { font-size: 11px; color: #8fb3ab; }
.nav { padding: 10px 8px; flex: 1; }
.nav button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: 0; color: #cfe5df; padding: 10px 12px; border-radius: 8px;
  font-size: 13.5px; text-align: left; margin-bottom: 2px;
}
.nav button:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav button.active { background: var(--brand); color: #fff; font-weight: 600; }
.sidebar .me { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; }
.sidebar .me b { color: #fff; display: block; font-size: 13px; }
.sidebar .me .role-tag { margin-top: 6px; display: inline-block; }
.sidebar .me button { margin-top: 8px; background: rgba(255,255,255,.1); color: #fff; border: 0; border-radius: 6px; padding: 5px 12px; font-size: 12px; }

.main { flex: 1; padding: 26px 30px; max-width: 1200px; }
.page-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; }
.page-head h2 { font-size: 20px; }
.page-head .desc { color: var(--muted); font-size: 13px; }

/* ── generic blocks ── */
.card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px; }
.card h3 { font-size: 15px; margin-bottom: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.stat .n { font-size: 26px; font-weight: 700; color: var(--brand-dark); }
.stat .t { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid #eef3f1; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }

.tag { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; }
.tag.ok { background: #e4f4e9; color: #22703f; }
.tag.warn { background: #fdf0dd; color: #96601a; }
.tag.mut { background: #eef1f0; color: #67736f; }
.tag.brand { background: var(--brand-soft); color: var(--brand-dark); }
.tag.danger { background: #fbe4e6; color: #a02c36; }

.btn {
  background: var(--brand); color: #fff; border: 0; border-radius: 8px;
  padding: 7px 14px; font-size: 13px;
}
.btn:hover { background: var(--brand-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: none; border: 1px solid var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn.danger { background: var(--danger); }

.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-top: 10px; }
.form-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.form-row input, .form-row select { min-width: 130px; }

.empty { color: var(--muted); text-align: center; padding: 28px 0; font-size: 13px; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #10312b; color: #fff; padding: 10px 20px; border-radius: 10px;
  font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.25); z-index: 99;
  animation: pop .18s ease;
}
.toast.err { background: var(--danger); }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ── recipients ── */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.person { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; cursor: pointer; border: 1.5px solid transparent; }
.person:hover { border-color: var(--brand); }
.person .avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); display: grid; place-items: center; font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.person b { font-size: 15px; }
.person .meta { color: var(--muted); font-size: 12.5px; margin-top: 4px; }

.tabs { display: flex; gap: 4px; border-bottom: 1.5px solid var(--line); margin-bottom: 16px; }
.tabs button { background: none; border: 0; padding: 9px 16px; font-size: 13.5px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1.5px; }
.tabs button.active { color: var(--brand-dark); border-color: var(--brand); font-weight: 600; }

.kv { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 24px; font-size: 13.5px; }
.kv .k { color: var(--muted); font-size: 12.5px; }
.kv .v { margin-bottom: 6px; }

.tl { list-style: none; }
.tl li { position: relative; padding: 0 0 16px 22px; }
.tl li::before { content: ""; position: absolute; left: 6px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.tl li::after { content: ""; position: absolute; left: 9.5px; top: 16px; bottom: 0; width: 1.5px; background: var(--line); }
.tl li:last-child::after { display: none; }
.tl .when { color: var(--muted); font-size: 12px; }
.tl .what b { font-size: 13.5px; }

.score-row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.score-bar { height: 6px; background: #eef3f1; border-radius: 99px; overflow: hidden; margin: 4px 0 8px; }
.score-bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }

/* ── chat ── */
.chat-layout { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
.chat-list { max-height: 480px; overflow: auto; }
.chat-list .item { padding: 12px; border-radius: 10px; cursor: pointer; margin-bottom: 6px; border: 1.5px solid transparent; }
.chat-list .item:hover { background: var(--brand-soft); }
.chat-list .item.active { background: var(--brand-soft); border-color: var(--brand); }
.chat-list .item b { font-size: 13.5px; }
.chat-list .item .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.chat-thread { display: flex; flex-direction: column; }
.chat-msgs { flex: 1; max-height: 380px; overflow: auto; padding: 6px 2px 12px; }
.msg { max-width: 72%; padding: 8px 12px; border-radius: 12px; margin-bottom: 8px; font-size: 13.5px; }
.msg .who { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.msg.them { background: #eef1f0; border-top-left-radius: 4px; }
.msg.me { background: var(--brand); color: #fff; margin-left: auto; border-top-right-radius: 4px; }
.msg.me .who { color: rgba(255,255,255,.75); }
.chat-input { display: flex; gap: 8px; }
.chat-input input { flex: 1; }

/* ── 产品橱窗 ── */
.vendor-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  background: linear-gradient(120deg, #0b6f62 0%, #0e8f7e 70%, #3aa08a 100%);
  border-radius: var(--radius); color: #fff; padding: 20px 24px; margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.vendor-hero h3 { font-size: 18px; margin-bottom: 6px; }
.vendor-hero p { font-size: 12.5px; opacity: .92; max-width: 640px; }
.vh-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 10px; font-size: 12px; opacity: .85; }
.vh-count { text-align: center; flex-shrink: 0; background: rgba(255,255,255,.14); border-radius: 14px; padding: 12px 20px; }
.vh-count b { font-size: 26px; display: block; }
.vh-count span { font-size: 12px; opacity: .85; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 20px; }
.product-card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.pc-img { background: #fff; border-bottom: 1px solid var(--line); height: 210px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pc-img img { max-width: 100%; max-height: 210px; object-fit: contain; }
.pc-fallback { width: 100%; height: 100%; display: grid; place-items: center; font-size: 40px; color: var(--brand); background: var(--brand-soft); }
.pc-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; position: relative; z-index: 1; background: #fff; }
.pc-body b { font-size: 14.5px; line-height: 1.4; }
.pc-tags { margin: 8px 0; display: flex; flex-wrap: wrap; gap: 4px; }
.pc-body p { font-size: 12.5px; color: var(--muted); flex: 1; }
.pc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.pc-price { color: var(--brand-dark); font-weight: 700; font-size: 14px; }

@media (max-width: 900px) {
  .sidebar { width: 190px; }
  .sidebar .brand b, .sidebar .brand span { display: none; }
  .main { padding: 18px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .chat-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .sidebar { width: 60px; }
  .sidebar .brand b, .sidebar .brand span, .nav button span.lbl, .sidebar .me b, .sidebar .me .role-tag { display: none; }
  .sidebar .me { padding: 10px; }
  .sidebar .me button { width: 100%; font-size: 11px; }
}
