/* ===========================================================
   伤口智能分析系统 · 设计系统（青绿医疗风）
   设计令牌与 Ardot 原型一致
   =========================================================== */
:root {
  --primary: #1c806e;
  --primary-dark: #126154;
  --primary-soft: #e6f5f2;
  --bg: #f2f8fb;
  --surface: #ffffff;
  --text: #17293b;
  --muted: #64738c;
  --border: #d9e0ed;
  --warning: #f59e0a;
  --danger: #db2626;
  --success: #14803d;
  --info: #2663eb;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 6px 22px rgba(23, 41, 59, 0.08);
  --shadow-sm: 0 2px 8px rgba(23, 41, 59, 0.06);
  --sidebar-w: 232px;
  --topbar-h: 60px;
  --font: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font-family: inherit;
  cursor: pointer;
}
::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
::-webkit-scrollbar-thumb {
  background: #c6d2e0;
  border-radius: 6px;
}

/* ---------- 通用工具 ---------- */
.row {
  display: flex;
  align-items: center;
}
.col {
  display: flex;
  flex-direction: column;
}
.gap-8 {
  gap: 8px;
}
.gap-12 {
  gap: 12px;
}
.gap-16 {
  gap: 16px;
}
.between {
  justify-content: space-between;
}
.wrap {
  flex-wrap: wrap;
}
.muted {
  color: var(--muted);
}
.center {
  justify-content: center;
  align-items: center;
}
.grow {
  flex: 1;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
}
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.btn-ghost:hover {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: transparent;
}
.btn-danger {
  background: #fff;
  border-color: #f3c2c4;
  color: var(--danger);
}
.btn-danger:hover {
  background: #fdeced;
  border-color: var(--danger);
  color: var(--danger);
}
.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}
.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
select.input {
  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='%2364738c' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}
.label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  display: block;
}
.search-box {
  position: relative;
}
.search-box .input {
  padding-left: 38px;
}
.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad {
  padding: 20px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

/* ---------- 徽标 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}
.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge-success {
  background: #e7f6ec;
  color: var(--success);
}
.badge-warning {
  background: #fef3e2;
  color: var(--warning);
}
.badge-danger {
  background: #fdeced;
  color: var(--danger);
}
.badge-info {
  background: #e8f0fe;
  color: var(--info);
}
.badge-neutral {
  background: #eef1f6;
  color: var(--muted);
}
.badge-primary {
  background: var(--primary-soft);
  color: var(--primary);
}

/* 风险等级色 */
.risk-HIGH {
  background: #fdeced;
  color: var(--danger);
}
.risk-MID {
  background: #fef3e2;
  color: var(--warning);
}
.risk-LOW {
  background: #e7f6ec;
  color: var(--success);
}

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
.login-hero {
  background: linear-gradient(150deg, var(--primary) 0%, var(--primary-dark) 100%);
  position: relative;
  overflow: hidden;
  color: #fff;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-hero::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -120px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}
.login-hero::before {
  content: "";
  position: absolute;
  right: 60px;
  top: -80px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}
.login-hero h1 {
  font-size: 30px;
  margin: 18px 0 10px;
  line-height: 1.3;
}
.login-hero p {
  color: rgba(255, 255, 255, 0.82);
  max-width: 420px;
  font-size: 15px;
}
.login-feat {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 40px;
}
.login-feat .f {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
}
.login-feat .ic {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
  display: grid;
  place-items: center;
  font-size: 18px;
}
.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.login-card {
  width: 100%;
  max-width: 380px;
}
.login-card h2 {
  font-size: 22px;
  margin: 0 0 4px;
}
.login-card .sub {
  color: var(--muted);
  margin-bottom: 26px;
}
.wechat-btn {
  width: 100%;
  background: #07c160;
  color: #fff;
  border: none;
  padding: 13px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s;
}
.wechat-btn:hover {
  background: #06ad56;
}
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  margin: 22px 0;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.demo-accounts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.demo-acc {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}
.demo-acc:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

/* 头像 */
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  flex: none;
}
.avatar-sm {
  width: 30px;
  height: 30px;
  font-size: 12px;
}
.avatar-lg {
  width: 54px;
  height: 54px;
  font-size: 18px;
}

/* ---------- 后台布局 ---------- */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}
.sidebar {
  background: #0f3d39;
  color: rgba(255, 255, 255, 0.78);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 18px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}
.sb-brand .logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--primary);
  display: grid;
  place-items: center;
  font-size: 18px;
}
.sb-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.sb-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
}
.sb-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.sb-link.active {
  background: var(--primary);
  color: #fff;
}
.sb-link .ic {
  width: 20px;
  text-align: center;
  font-size: 16px;
}
.sb-foot {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sb-foot .meta {
  flex: 1;
  min-width: 0;
}
.sb-foot .nm {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-foot .rl {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
}
.sb-foot-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}
.topbar .crumb {
  color: var(--muted);
  font-size: 13px;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.user-widget {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}
.user-widget:hover { background: var(--primary-soft); }
.uw-meta { line-height: 1.25; min-width: 0; }
.uw-name { font-size: 14px; font-weight: 600; color: var(--text); }
.uw-sub { font-size: 12px; color: var(--muted); white-space: nowrap; }
.uw-caret { font-size: 11px; color: var(--muted); transition: transform 0.15s; }
.user-widget.open .uw-caret { transform: rotate(180deg); }
.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 170px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 35, 50, 0.16);
  padding: 6px;
  display: none;
  z-index: 30;
}
.user-widget:hover .user-menu,
.user-widget.open .user-menu { display: block; }
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}
.user-menu-item:hover { background: var(--primary-soft); color: var(--primary); }
.umi-ic { width: 18px; text-align: center; font-size: 15px; }
.content {
  padding: 24px 26px 40px;
  flex: 1;
}

/* ---------- 统计卡 ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}
.stat {
  padding: 18px 20px;
}
.stat .top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.stat .ic {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 20px;
}
.stat .num {
  font-size: 28px;
  font-weight: 700;
  margin-top: 10px;
  letter-spacing: -0.5px;
}
.stat .cap {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

/* ---------- 表格 ---------- */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table th {
  text-align: left;
  padding: 12px 16px;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  background: #fafcfe;
}
.table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tr:last-child td {
  border-bottom: none;
}
.table tbody tr:hover {
  background: #fafcfe;
}
.cell-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 48px 0;
}

/* ---------- 工具栏 ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.toolbar .spacer {
  flex: 1;
}
.tabs {
  display: inline-flex;
  background: #eef3f7;
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
}
.tabs .tab {
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border: none;
  background: transparent;
}
.tabs .tab.active {
  background: #fff;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* ---------- 详情页 ---------- */
.detail-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.detail-head .meta {
  flex: 1;
}
.detail-head h2 {
  margin: 0 0 2px;
  font-size: 19px;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.field {
  padding: 12px 14px;
  background: #fafcfe;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.field .k {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 3px;
}
.field .v {
  font-weight: 500;
}

/* AI 结论卡 */
.ai-result {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.ai-bar {
  height: 8px;
  background: #eef1f6;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}
.ai-bar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--info));
}
.score-num {
  font-size: 34px;
  font-weight: 700;
  color: var(--primary);
}

/* ---------- 模态框 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 30, 45, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
  animation: fade 0.15s ease;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
.modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  animation: pop 0.18s ease;
}
@keyframes pop {
  from {
    transform: translateY(12px) scale(0.98);
    opacity: 0;
  }
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 {
  margin: 0;
  font-size: 16px;
}
.modal-body {
  padding: 22px;
  overflow-y: auto;
}
.modal-foot {
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.reuse-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
  max-height: 320px;
  overflow: auto;
}
.reuse-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.reuse-item:hover { border-color: var(--primary); }
.reuse-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.reuse-name { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.reuse-name .mono { font-size: 12px; }
.x-btn {
  border: none;
  background: transparent;
  font-size: 22px;
  color: var(--muted);
  line-height: 1;
  padding: 0 4px;
}
.x-btn:hover {
  color: var(--text);
}

/* 用户搜索结果 */
.user-results {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 230px;
  overflow-y: auto;
}
.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.user-row:last-child {
  border-bottom: none;
}
.user-row:hover {
  background: var(--primary-soft);
}
.user-row.selected {
  background: var(--primary-soft);
  box-shadow: inset 3px 0 0 var(--primary);
}
.user-row .wx {
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Toast ---------- */
#toast-root {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.toast {
  background: #17293b;
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  animation: toastIn 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.ok {
  background: var(--success);
}
.toast.err {
  background: var(--danger);
}
@keyframes toastIn {
  from {
    transform: translateY(-10px);
    opacity: 0;
  }
}

/* ---------- 移动端 /m ---------- */
.phone {
  max-width: 420px;
  margin: 0 auto;
  background: var(--surface);
  min-height: 100vh;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.phone-top {
  background: linear-gradient(150deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 22px 20px 26px;
}
.phone-top .hi {
  font-size: 13px;
  opacity: 0.85;
}
.phone-top .nm {
  font-size: 20px;
  font-weight: 700;
  margin-top: 2px;
}
.m-quick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 18px 16px;
}
.m-quick .q {
  background: var(--bg);
  border-radius: 12px;
  padding: 14px 8px;
  text-align: center;
  cursor: pointer;
}
.m-quick .q .ic {
  font-size: 22px;
}
.m-quick .q .t {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
.m-sec {
  padding: 6px 16px 20px;
}
.m-sec h4 {
  margin: 14px 0 10px;
  font-size: 14px;
}
.m-patient {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 10px;
}
.m-patient .meta {
  flex: 1;
  min-width: 0;
}
.m-patient .nm {
  font-weight: 600;
}
.m-patient .sub {
  font-size: 12px;
  color: var(--muted);
}

/* ---------- 原型 1:1 补充样式 ---------- */
.mono {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
}
.delta {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
}
.delta.up {
  color: var(--success);
}
.delta.down {
  color: var(--success);
}
.chart-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.4fr;
  gap: 20px;
  margin-bottom: 20px;
}
.donut-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
}
.donut-wrap svg {
  flex-shrink: 0;
}
.legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}
.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.legend-row .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.legend-row b {
  margin-left: auto;
  color: var(--primary);
}
.chip {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  margin-right: 6px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}
.switch input {
  display: none;
}
.switch .slider {
  position: absolute;
  inset: 0;
  background: #d9e0ed;
  border-radius: 999px;
  transition: 0.2s;
}
.switch .slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  left: 3px;
  transition: 0.2s;
}
.switch input:checked + .slider {
  background: var(--primary);
}
.switch input:checked + .slider::before {
  transform: translateX(18px);
}
.detail-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 20px;
  align-items: start;
}
.img-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.img-tile {
  aspect-ratio: 1;
  background: var(--primary-soft);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
}
.img-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.img-tile.placeholder {
  border: 2px dashed #c6d2e0;
  background: #f7faf9;
}
.oplog-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
}
.oplog-item:last-child {
  border-bottom: none;
}
.opdot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--info);
  margin-top: 6px;
  flex-shrink: 0;
}
.opdot[data-role="DOCTOR"] {
  background: var(--success);
}
.opdot[data-role="PATIENT"] {
  background: var(--primary);
}
.opdot[data-role="OPERATOR"] {
  background: var(--info);
}
.opdot[data-role="SYSTEM"] {
  background: var(--warning);
}
.med-card {
  background: var(--primary-soft);
  border-color: var(--primary);
}
.kv-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}
.kv-row:last-child {
  border-bottom: none;
}
.link-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.link-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
}
.link-list li:last-child {
  border-bottom: none;
}
.link-list li a {
  color: var(--primary);
}
.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 20px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .login-wrap {
    grid-template-columns: 1fr;
  }
  .login-hero {
    display: none;
  }
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .chart-grid {
    grid-template-columns: 1fr;
  }
  .detail-grid-2 {
    grid-template-columns: 1fr;
  }
  .donut-wrap {
    flex-direction: column;
  }
}

/* ===== 加载骨架 / 错误态 / 代码块（新增） ===== */
.skeleton-wrap { display: flex; flex-direction: column; gap: 16px; padding: 4px; }
.skeleton {
  background: linear-gradient(90deg, #eef3f8 25%, #e2eaf2 37%, #eef3f8 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.3s ease infinite;
  border-radius: var(--radius-sm);
}
.skeleton-line { height: 18px; margin: 6px 0; }
.skeleton-card { height: 120px; }
@keyframes skeleton-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}
.error-card {
  text-align: center;
  padding: 56px 20px;
}
.error-card .error-ic { font-size: 40px; }
.error-card h3 { margin: 12px 0 8px; }
.error-card .muted { margin-bottom: 18px; max-width: 420px; margin-left: auto; margin-right: auto; }
.code-block {
  background: #0f172a;
  color: #e2e8f0;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 260px;
  overflow: auto;
  font-family: ui-monospace, Menlo, Consolas, "Courier New", monospace;
  margin: 0;
}

/* ===== 伤口图片库 / lightbox（新增） ===== */
.gallery-toolbar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.gt-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.gt-kw { flex: 1; min-width: 240px; }
.gt-date { display: flex; align-items: center; gap: 6px; }
.gt-date .input { width: 140px; }
.gt-sort { display: flex; align-items: center; gap: 6px; }
.gt-sort .input { width: auto; }
.gallery-stats { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.gallery-stats b { color: var(--text); }
.gallery-stats .dot { color: var(--border); }
.gs-hint { margin-left: auto; font-size: 12px; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 16px; }
.gallery-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; transition: transform .18s, box-shadow .18s, border-color .18s; }
.gallery-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--primary); }
.gc-thumb { position: relative; aspect-ratio: 4 / 3; background: var(--primary-soft); overflow: hidden; }
.gc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gc-risk { position: absolute; top: 8px; right: 8px; font-size: 11px; color: #fff; padding: 2px 8px; border-radius: 20px; font-weight: 600; }
.gc-risk-high { background: var(--danger); }
.gc-risk-mid { background: var(--warning); }
.gc-risk-low { background: var(--success); }
.gc-meta { padding: 10px 12px; }
.gc-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gc-name { font-weight: 600; font-size: 13px; }
.gc-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.gallery-empty { grid-column: 1 / -1; text-align: center; padding: 56px 20px; color: var(--muted); }
.gallery-empty .ge-ic { font-size: 44px; margin-bottom: 10px; }
.gallery-empty p { margin: 4px 0; }

/* 患者详情页图片汇总：列更窄、方形缩略 */
.pg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.pg-card .gc-thumb { aspect-ratio: 1 / 1; }

/* lightbox 全屏大图预览 */
.lightbox { position: fixed; inset: 0; z-index: 9999; background: rgba(8, 16, 28, .88); display: flex; align-items: center; justify-content: center; padding: 32px; }
.lb-content { display: flex; align-items: center; gap: 24px; max-width: 96vw; max-height: 92vh; }
.lb-img { max-width: 72vw; max-height: 86vh; object-fit: contain; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.lb-meta { color: #e8edf3; min-width: 220px; max-width: 320px; }
.lb-title { font-size: 16px; font-weight: 600; color: #fff; }
.lb-title .muted { color: #8a97a8; }
.lb-sub { font-size: 13px; color: #9aa6b6; margin-top: 6px; }
.lb-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.lb-link { display: inline-block; margin-top: 8px; color: #5ec6b3; font-size: 13px; }
.lb-link:hover { color: #7fd6c4; text-decoration: underline; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; border: none; font-size: 26px; line-height: 1; display: flex; align-items: center; justify-content: center; transition: background .15s; }
.lb-nav:hover { background: rgba(255,255,255,.28); }
.lb-prev { left: 24px; }
.lb-next { right: 24px; }
.lb-close { position: absolute; top: 22px; right: 24px; width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; border: none; font-size: 20px; }
.lb-close:hover { background: rgba(255,255,255,.28); }
.lb-count { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); color: #cfd6e0; font-size: 13px; }
@media (max-width: 760px) {
  .lb-content { flex-direction: column; gap: 12px; }
  .lb-img { max-width: 92vw; max-height: 60vh; }
  .lb-meta { max-width: 92vw; }
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
}
