:root {
  --brand: #0f766e;
  --brand-dark: #0b5d57;
  --brand-soft: #e6f4f1;
  --brand-line: #c9e5df;
  --ink: #16241f;
  --ink-2: #43554f;
  --muted: #71837d;
  --line: #e2e8e5;
  --bg: #f4f7f5;
  --card: #ffffff;
  --danger: #c0392b;
  --danger-soft: #fdeceb;
  --warn: #b5731a;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 40, 34, .05), 0 8px 24px rgba(16, 40, 34, .05);
  --shadow-lg: 0 18px 48px rgba(16, 40, 34, .16);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Source Han Sans SC", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: .2px; }

/* ---------------- 登录页 ---------------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
}
.login-brand {
  position: relative;
  padding: 64px 56px;
  color: #eaf6f3;
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(120, 220, 190, .30), transparent 60%),
    radial-gradient(700px 500px at 0% 100%, rgba(20, 120, 110, .55), transparent 62%),
    linear-gradient(150deg, #0d3f3a 0%, #0f665e 55%, #11796e 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.login-brand::after {
  content: "";
  position: absolute;
  right: -120px; bottom: -120px;
  width: 420px; height: 420px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: 0 0 0 40px rgba(255, 255, 255, .05), 0 0 0 90px rgba(255, 255, 255, .04);
}
.brand-mark { display: flex; align-items: center; gap: 12px; font-size: 17px; letter-spacing: 1px; }
.logo-chip {
  width: 36px; height: 36px; border-radius: 10px; background: #fff;
  display: grid; place-items: center; flex: 0 0 auto;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .16);
}
.logo-chip img { width: 30px; height: 30px; object-fit: contain; display: block; }
.login-brand .logo-chip { width: 44px; height: 44px; border-radius: 12px; }
.login-brand .logo-chip img { width: 36px; height: 36px; }
.brand-mark .dot {
  width: 34px; height: 34px; border-radius: 10px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .3);
  display: grid; place-items: center;
  font-weight: 700;
}
.login-brand h1 { font-size: 38px; line-height: 1.28; margin-bottom: 18px; }
.login-brand p.sub { font-size: 15.5px; color: rgba(234, 246, 243, .8); max-width: 430px; margin: 0; }
.feature-list { list-style: none; padding: 0; margin: 34px 0 0; display: grid; gap: 12px; }
.feature-list li { display: flex; gap: 10px; font-size: 14.5px; color: rgba(234, 246, 243, .92); }
.feature-list li::before { content: "·"; color: #7fe0c7; font-weight: 700; }
.brand-foot { font-size: 12.5px; color: rgba(234, 246, 243, .55); position: relative; z-index: 1; }

.login-form-side { display: grid; place-items: center; padding: 40px 24px; background: var(--card); }
.login-card { width: 100%; max-width: 372px; }
.login-card h2 { font-size: 24px; margin-bottom: 6px; }
.login-card .hint { color: var(--muted); font-size: 13.5px; margin: 0 0 28px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13.5px; color: var(--ink-2); margin-bottom: 7px; font-weight: 500; }
.field label .req { color: var(--danger); margin-left: 3px; }
.input, .select, .textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdfc;
  font-size: 15px;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .12);
}
.textarea { resize: vertical; min-height: 84px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 14.5px;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--brand-line); background: var(--brand-soft); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 500; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-danger { color: var(--danger); border-color: #f0d3cf; background: #fff; }
.btn-danger:hover { background: var(--danger-soft); border-color: #e9bdb6; }
.btn-warn { color: #b45309; border-color: #f3ddb9; background: #fffdf8; }
.btn-warn:hover { background: #fdf3e3; border-color: #eccf9f; }
.btn-ok { color: var(--brand-dark); border-color: var(--brand-line); background: var(--brand-soft); }
.btn-ok:hover { background: #dff3ec; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--brand-soft); border-color: transparent; }
.btn-sm { padding: 6px 11px; font-size: 13.5px; border-radius: 8px; }
.btn-block { width: 100%; padding: 12px; font-size: 15.5px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.login-error {
  display: none;
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid #f3cfca;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 13.5px;
  margin-bottom: 14px;
}
.login-error.show { display: block; }
.login-help { margin-top: 18px; font-size: 12.8px; color: var(--muted); text-align: center; }

.mobile-brand { display: none; align-items: center; gap: 10px; margin-bottom: 20px; }
.mobile-brand .logo-chip { width: 42px; height: 42px; border-radius: 12px; }
.mobile-brand img { width: 30px; height: 30px; object-fit: contain; }
.mobile-brand > div { display: flex; flex-direction: column; line-height: 1.35; }
.mobile-brand strong { font-size: 16px; color: var(--ink); }
.mobile-brand span { font-size: 11.5px; color: var(--muted); }

.login-tip {
  margin-top: 22px; padding: 12px 14px; border-radius: 10px;
  background: #f7faf9; border: 1px dashed var(--line);
  font-size: 12.8px; color: var(--muted); line-height: 1.7;
}
.login-tip b { color: var(--ink-2); font-weight: 600; }

/* ---------------- 应用骨架 ---------------- */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.menu-btn {
  display: none; flex: 0 0 auto;
  width: 38px; height: 38px; padding: 9px 9px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer;
}
.menu-btn span { display: block; height: 2px; border-radius: 2px; background: var(--ink-2); margin: 3px 0; }
.menu-btn:active { background: var(--brand-soft); }
.sidebar-mask { display: none; }
.fab { display: none; }
.desk-only { }

.sidebar {
  background: #0d3f3a;
  color: #d6ece7;
  padding: 22px 16px;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
}
.side-logo { display: flex; align-items: center; gap: 10px; padding: 0 8px 22px; }
.side-logo .dot {
  width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, .14);
  display: grid; place-items: center; font-weight: 700; color: #eafaf6; font-size: 15px;
}
.side-logo .txt strong { display: block; font-size: 15px; color: #f2fbf8; letter-spacing: .4px; }
.side-logo .txt span { font-size: 10.5px; color: rgba(214, 236, 231, .6); letter-spacing: .2px; white-space: nowrap; }
.nav { display: grid; gap: 4px; margin-top: 8px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 9px;
  color: rgba(226, 244, 239, .82); font-size: 14.5px;
}
.nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav a.active {
  background: rgba(255, 255, 255, .14); color: #fff; font-weight: 500;
  box-shadow: inset 3px 0 0 #7fe0c7;
}
.nav .ico { width: 18px; text-align: center; opacity: .9; }
.side-foot { margin-top: auto; font-size: 12px; color: rgba(214, 236, 231, .45); padding: 12px 8px 0; border-top: 1px solid rgba(255, 255, 255, .08); }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 62px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px; position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 17.5px; }
.topbar .crumb { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.user-box { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-weight: 600; font-size: 14px;
  border: 1px solid var(--brand-line);
}
.user-meta { text-align: right; line-height: 1.35; }
.user-meta strong { font-size: 14px; display: block; }
.user-meta span { font-size: 12px; color: var(--muted); }
.content { padding: 24px 26px 48px; max-width: 1400px; width: 100%; }

/* ---------------- 卡片 / 统计 ---------------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { padding: 16px 18px; }
.stat .label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 27px; font-weight: 650; margin-top: 4px; letter-spacing: .5px; }
.stat .value small { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.stat.hl { background: linear-gradient(135deg, #f2fbf8, #e8f5f1); border-color: var(--brand-line); }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar .grow { flex: 1; }
.search-box { position: relative; min-width: 210px; flex: 1; max-width: 300px; }
.search-box .input { padding-left: 34px; }
.search-box .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; }
.filters .select { width: auto; min-width: 116px; padding: 9px 28px 9px 11px; font-size: 14px; }
.filters .input { width: 128px; padding: 9px 10px; font-size: 13.5px; }
.filters .btn { padding: 8px 12px; }

/* 展示方式切换 */
.view-toggle { display: flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; }
.view-toggle button {
  border: none; background: none; padding: 7px 13px; cursor: pointer;
  color: var(--muted); font-size: 13.5px; line-height: 1.2;
}
.view-toggle button + button { border-left: 1px solid var(--line); }
.view-toggle button:hover { background: var(--brand-soft); }
.view-toggle button.active { background: var(--brand-soft); color: var(--brand-dark); }

/* 患者大图模式 */
.patient-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 14px; padding: 16px;
}
.patient-tile {
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: #fff; cursor: pointer; display: flex; flex-direction: column;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.patient-tile:hover { border-color: var(--brand-line); box-shadow: 0 8px 22px rgba(16, 40, 34, .09); transform: translateY(-1px); }
.patient-tile .cover { position: relative; aspect-ratio: 4 / 3; background: #eef2f0; overflow: hidden; }
.patient-tile .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.patient-tile .no-cover {
  height: 100%; display: grid; place-items: center; color: #9db0aa; font-size: 12.5px;
  background: repeating-linear-gradient(45deg, #f4f8f6, #f4f8f6 10px, #eef4f1 10px, #eef4f1 20px);
}
.patient-tile .cnt {
  position: absolute; right: 8px; bottom: 8px; background: rgba(8, 34, 29, .72); color: #eafaf6;
  font-size: 11.5px; padding: 2px 8px; border-radius: 999px; backdrop-filter: blur(4px);
}
.patient-tile .body { padding: 11px 13px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.patient-tile .nm { font-size: 16px; font-weight: 600; display: flex; align-items: baseline; gap: 8px; }
.patient-tile .nm small { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.patient-tile .meta { font-size: 13px; color: var(--ink-2); display: flex; gap: 10px; flex-wrap: wrap; }
.patient-tile .meta .k { color: var(--muted); }
.patient-tile .rm { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.patient-tile .acts { display: flex; gap: 6px; margin-top: auto; padding-top: 8px; }
.patient-tile .acts .btn { padding: 4px 9px; font-size: 12.5px; border-radius: 7px; }

tr.row-off td { color: var(--muted); background: #fbfbfa; }
tr.row-off .cell-name { text-decoration: none; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table thead th {
  text-align: left; font-weight: 500; color: var(--muted); font-size: 13px;
  padding: 12px 13px; background: #fafcfb; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table tbody td { padding: 12px 13px; border-bottom: 1px solid #eef2f0; vertical-align: middle; white-space: nowrap; }
.table tbody td .cell-sub { white-space: nowrap; }
.table tbody tr:hover { background: #fbfdfc; }
.table tbody tr:last-child td { border-bottom: none; }
.cell-name { font-weight: 550; }
.cell-sub { font-size: 12.5px; color: var(--muted); }
.thumb {
  width: 72px; height: 54px; border-radius: 7px; object-fit: cover;
  background: #eef2f0; border: 1px solid var(--line); display: block;
}
.thumb-empty {
  width: 72px; height: 54px; border-radius: 7px; border: 1px dashed var(--line);
  display: grid; place-items: center; color: var(--muted); font-size: 11px; background: #fafcfb;
}
.badge {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  padding: 2px 9px; border-radius: 999px; font-size: 12.5px;
  background: var(--brand-soft); color: var(--brand-dark); border: 1px solid var(--brand-line);
}
.badge.gray { background: #f4f6f5; color: var(--ink-2); border-color: var(--line); }
.badge.warn { background: #fdf5e8; color: var(--warn); border-color: #f3e2c4; }
.actions { display: flex; gap: 2px; justify-content: flex-end; }
.table th:last-child, .table td:last-child { padding-right: 16px; }
.empty { text-align: center; padding: 54px 20px; color: var(--muted); }
.empty .big { font-size: 34px; opacity: .45; margin-bottom: 8px; }

.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid #eef2f0; }
.pager .info { font-size: 13px; color: var(--muted); }
.pager .pages { display: flex; gap: 6px; }
.page-btn {
  min-width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; font-size: 13.5px; color: var(--ink-2);
}
.page-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.page-btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------------- 弹窗 ---------------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(11, 32, 27, .46);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 24px;
  backdrop-filter: blur(2px);
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 620px; max-height: 92vh; display: flex; flex-direction: column;
  animation: pop .16s ease-out;
}
.modal.wide { max-width: 860px; }
@keyframes pop { from { transform: translateY(8px) scale(.99); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { font-size: 17px; }
.modal-head .close { border: none; background: none; font-size: 22px; color: var(--muted); cursor: pointer; line-height: 1; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }

/* ---------------- 上传 ---------------- */
.dropzone {
  border: 1.5px dashed var(--brand-line); border-radius: 12px;
  padding: 24px; text-align: center; background: #f8fcfa; cursor: pointer;
  transition: all .15s;
}
.dropzone:hover, .dropzone.drag { background: var(--brand-soft); border-color: var(--brand); }
.dropzone .ico { font-size: 24px; color: var(--brand); }
.dropzone .t1 { font-size: 14.5px; margin-top: 6px; }
.dropzone .t2 { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.upload-list { margin-top: 12px; display: grid; gap: 8px; }
.upload-item { display: flex; gap: 10px; align-items: center; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fbfdfc; }
.upload-item .ph {
  width: 62px; height: 46px; border-radius: 6px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 11.5px; color: var(--brand-dark);
  background: var(--brand-soft); border: 1px solid var(--brand-line);
}
.upload-item .meta { flex: 1; min-width: 0; }
.upload-item .name { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item .sub { font-size: 12px; color: var(--muted); }
.progress { height: 4px; background: #e7eeeb; border-radius: 99px; overflow: hidden; margin-top: 5px; }
.progress > i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }

/* ---------------- 患者详情 ---------------- */
.detail-card { overflow: hidden; }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px; }
.detail-head .who { display: flex; gap: 14px; align-items: center; }
.detail-head .avatar { width: 46px; height: 46px; font-size: 18px; border-radius: 12px; }
.detail-head h2 { font-size: 21px; }
.detail-head .meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.info-grid { display: grid; grid-template-columns: repeat(var(--info-cols, 4), 1fr); gap: 1px; background: #eef2f0; border-top: 1px solid #eef2f0; }
.info-item.span-2 { grid-column: span 2; }
.info-item { background: #fff; padding: 14px 18px; }
.info-item .k { font-size: 12.5px; color: var(--muted); }
.info-item .v { font-size: 14.5px; margin-top: 3px; word-break: break-all; }
.info-item .v.empty-v { color: #b3c0bb; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 12px; }
.section-title h3 { font-size: 16.5px; }
.section-title .count { font-size: 13px; color: var(--muted); margin-left: 8px; font-weight: 400; }

.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px; }
.video-card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  cursor: pointer; transition: all .16s; position: relative;
}
.video-card:hover { border-color: var(--brand-line); box-shadow: 0 8px 22px rgba(16, 40, 34, .09); transform: translateY(-1px); }
.video-card .cover { position: relative; aspect-ratio: 4 / 3; background: #0d3f3a; }
.video-card .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-card .cover .no-cover { display: grid; place-items: center; height: 100%; color: rgba(255, 255, 255, .5); font-size: 12.5px; }
.video-card .play {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: linear-gradient(180deg, rgba(6, 30, 26, .05), rgba(6, 30, 26, .32));
}
.video-card .play i {
  width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .92);
  display: grid; place-items: center; color: var(--brand-dark); font-style: normal; font-size: 15px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
}
.video-card .dur {
  position: absolute; right: 8px; bottom: 8px; background: rgba(0, 0, 0, .62);
  color: #fff; font-size: 11.5px; padding: 1px 6px; border-radius: 5px;
}
.video-card .info { padding: 10px 12px; }
.video-card .info .n { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-card .info .s { font-size: 12px; color: var(--muted); margin-top: 2px; display: flex; justify-content: space-between; gap: 8px; }
.video-card .tools { position: absolute; top: 7px; right: 7px; display: none; gap: 5px; }
.video-card:hover .tools { display: flex; }
.video-card .tool {
  background: rgba(255, 255, 255, .92); border: none; border-radius: 7px;
  padding: 2px 8px; font-size: 11.5px; color: var(--ink-2); cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .14); backdrop-filter: blur(4px);
}
.video-card .tool:hover { background: #fff; }
.video-card .tool.del-tool { color: var(--danger); }
.video-card .rm {
  margin-top: 5px; font-size: 12px; color: var(--ink-2);
  background: #f5faf8; border: 1px solid #e6f2ee; border-radius: 6px; padding: 3px 7px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 播放器 */
.player-mask { position: fixed; inset: 0; background: rgba(6, 20, 17, .8); z-index: 120; display: none; align-items: center; justify-content: center; padding: 24px; }
.player-mask.show { display: flex; }
.player-box { width: min(1080px, 100%); background: #0b1a17; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-lg); }
.player-box video { width: 100%; max-height: 76vh; display: block; background: #000; }
.player-bar { display: flex; align-items: center; justify-content: space-between; padding: 11px 16px; color: #d8e9e4; font-size: 13.5px; gap: 12px; }
.player-bar .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-bar a { color: #8fe3cb; }
.player-bar .close { background: none; border: 1px solid rgba(255,255,255,.25); color: #d8e9e4; border-radius: 8px; padding: 4px 10px; cursor: pointer; }

/* ---------------- 后台 tabs ---------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs button {
  background: none; border: none; padding: 11px 16px; font-size: 14.5px; color: var(--ink-2);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 550; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.check {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: #fbfdfc;
}
.check:hover { border-color: var(--brand-line); background: #f7fcfa; }
.check input { margin-top: 3px; accent-color: var(--brand); width: 16px; height: 16px; }
.check .t { font-size: 14px; }
.check .d { font-size: 12px; color: var(--muted); }
.check.locked { opacity: .72; cursor: not-allowed; background: #f6f8f7; }
.notice {
  display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px;
  background: #f5faf8; border: 1px solid var(--brand-line); color: var(--ink-2);
  font-size: 13.2px; line-height: 1.65; margin-bottom: 16px;
}
.notice .i { color: var(--brand); }
.hr { height: 1px; background: var(--line); margin: 18px 0; }
.help { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* Toast */
.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 300; display: grid; gap: 8px; }
.toast {
  background: #12261f; color: #eaf6f2; padding: 10px 18px; border-radius: 10px;
  font-size: 14px; box-shadow: var(--shadow-lg); animation: pop .18s ease-out;
  max-width: 76vw;
}
.toast.err { background: #4a1712; }
.toast.ok { background: #0d4b3f; }

.skeleton { background: linear-gradient(90deg, #eef2f0 25%, #f6f9f7 37%, #eef2f0 63%); background-size: 400% 100%; animation: sk 1.2s infinite; border-radius: 6px; }
@keyframes sk { from { background-position: 100% 50%; } to { background-position: 0 50%; } }

@media (max-width: 1420px) {
  .search-box { min-width: 170px; max-width: 210px; }
  .filters .select { min-width: 104px; font-size: 13.5px; }
  .filters .input { width: 116px; }
  .view-toggle button { padding: 6px 9px; }
  .toolbar .btn-primary { padding: 9px 12px; font-size: 14px; }
}

@media (max-width: 1080px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .login-wrap { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .mobile-brand { display: flex; }
  .login-form-side { padding: 32px 22px; }
}

/* ---------------- 手机端（≤900px） ---------------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; height: 100dvh; width: 258px;
    transform: translateX(-100%); transition: transform .22s ease; z-index: 200;
  }
  .sidebar.open { transform: none; box-shadow: 0 12px 40px rgba(0, 0, 0, .35); }
  .sidebar-mask {
    display: block; position: fixed; inset: 0; z-index: 150;
    background: rgba(6, 24, 20, .46); opacity: 0; pointer-events: none; transition: opacity .2s;
  }
  .sidebar-mask.show { opacity: 1; pointer-events: auto; }
  .menu-btn { display: block; }
  .login-form-side { place-items: start center; padding-top: 12vh; }
  .fab {
    display: flex; align-items: center; justify-content: center;
    position: fixed; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom));
    width: 56px; height: 56px; border-radius: 50%; border: none;
    background: var(--brand); color: #fff; font-size: 26px; line-height: 1;
    box-shadow: 0 8px 24px rgba(13, 90, 80, .35); z-index: 90; cursor: pointer;
  }
  .fab:active { background: var(--brand-dark); }
  .toolbar #newBtn { display: none; }
  .desk-only { display: none; }
  .content { padding-bottom: 96px; }

  .topbar { height: 58px; padding: 0 12px; gap: 8px; }
  .topbar-title { flex: 1; min-width: 0; }
  .topbar h1 { font-size: 16px; }
  .topbar .crumb { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .user-meta span { display: none; }
  .user-box { gap: 8px; }
  .content { padding: 14px 12px 44px; }

  .stat-row { gap: 10px; }
  .stat { padding: 12px 14px; }
  .stat .label { font-size: 12px; }
  .stat .value { font-size: 22px; }

  .toolbar { gap: 8px; }
  .search-box { max-width: none; min-width: 0; width: 100%; }
  .filters { width: 100%; gap: 8px; }
  .filters .select, .filters .input { flex: 1 1 44%; width: auto; min-width: 0; font-size: 16px; }
  .filters .btn { flex: 1 1 0; font-size: 14px; }
  .view-toggle { display: none; }

  .patient-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 12px; }
  .patient-tile .body { padding: 9px 10px 10px; gap: 3px; }
  .patient-tile .nm { font-size: 15px; }
  .patient-tile .nm small { display: none; }
  .patient-tile .meta { font-size: 12px; gap: 6px; }
  .patient-tile .rm { display: none; }
  .patient-tile .acts { flex-wrap: nowrap; gap: 4px; }
  .patient-tile .acts .btn { padding: 5px 7px; font-size: 12px; }

  .table-wrap { -webkit-overflow-scrolling: touch; }

  .detail-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .info-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .info-item { padding: 11px 14px; }
  .section-title { flex-wrap: wrap; gap: 8px; }
  .video-grid { grid-template-columns: 1fr; }
  .video-card .tools { display: flex; }  /* 手机没有 hover，常显操作 */

  .modal-mask { padding: 0; align-items: flex-end; }
  .modal { max-width: none; width: 100%; max-height: 92dvh; border-radius: 16px 16px 0 0; }
  .modal-head, .modal-body, .modal-foot { padding-left: 16px; padding-right: 16px; }
  .modal-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .form-grid { grid-template-columns: 1fr; }
  .input, .select, .textarea { font-size: 16px; padding: 12px 13px; }  /* 防 iOS 聚焦缩放 */

  .dropzone { padding: 26px 14px; }
  .dropzone .t1 { font-size: 15px; }

  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tabs button { white-space: nowrap; }

  .player-mask { padding: 0; }
  .player-box { border-radius: 0; }
  .player-bar { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
}
