/* ===================================================================
   医院专家管理系统 - 全局样式
   浅色主题 · 医疗蓝主色 · 卡片化布局
   =================================================================== */

:root {
  --brand: #1a6fd4;
  --brand-dark: #14559f;
  --brand-light: #e9f1fd;
  --brand-soft: #f2f7fe;
  --teal: #12a594;
  --teal-light: #e6f6f4;
  --amber: #d99406;
  --amber-light: #fdf4e3;
  --red: #d64545;
  --red-light: #fdecec;
  --green: #1a9c6b;
  --green-light: #e8f7f0;
  --violet: #7a5af8;
  --violet-light: #f0edfe;

  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #fafbfd;
  --text: #1c2b3a;
  --text-2: #5a6b80;
  --text-3: #8a99ad;
  --border: #e3e9f2;
  --border-strong: #d3dcea;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-xs: 0 1px 2px rgba(28, 43, 58, 0.05);
  --shadow-sm: 0 2px 8px rgba(28, 43, 58, 0.06);
  --shadow: 0 6px 20px rgba(28, 43, 58, 0.08);
  --shadow-lg: 0 16px 40px rgba(28, 43, 58, 0.14);
  --sidebar-w: 230px;
  --header-h: 64px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c8d3e0; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a9b7c9; }

/* ============================ 布局 ============================ */

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: #ffffff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 30;
}

.sidebar-brand {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand) 0%, #2f9be0 100%);
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 17px;
  box-shadow: 0 3px 10px rgba(26, 111, 212, 0.32);
  flex: 0 0 auto;
}
.brand-text { min-width: 0; }
.brand-title { font-size: 14.5px; font-weight: 650; letter-spacing: 0.2px; white-space: nowrap; }
.brand-sub { font-size: 10.5px; color: var(--text-3); letter-spacing: 0.6px; text-transform: uppercase; }

.sidebar-nav { padding: 14px 10px; flex: 1; overflow-y: auto; }
.nav-group-label {
  font-size: 11px; color: var(--text-3); font-weight: 600;
  letter-spacing: 0.8px; padding: 12px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 13.5px;
  margin-bottom: 2px;
  transition: background .15s, color .15s;
  cursor: pointer;
  border: none; background: none; width: 100%; text-align: left;
}
.nav-item svg { width: 17px; height: 17px; flex: 0 0 auto; opacity: .85; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active {
  background: var(--brand-light);
  color: var(--brand-dark);
  font-weight: 600;
}
.nav-item.active svg { opacity: 1; }
.nav-badge {
  margin-left: auto; font-size: 11px; padding: 1px 7px;
  border-radius: 20px; background: var(--surface-2); color: var(--text-3);
  border: 1px solid var(--border);
}
.nav-item.active .nav-badge { background: #fff; color: var(--brand); border-color: #cfe0f8; }

.sidebar-foot {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-3);
  flex: 0 0 auto;
}
.status-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); margin-right: 6px;
  box-shadow: 0 0 0 3px rgba(26, 156, 107, 0.15);
}

/* ---------------------------- 侧边栏用户区 ---------------------------- */

.sidebar-user { padding: 10px 12px 4px; flex: 0 0 auto; }

.su-info {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.su-text { min-width: 0; flex: 1; }
.su-name {
  font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.su-role { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.su-out {
  flex: 0 0 auto;
  border: 1px solid var(--border-strong);
  background: #fff; color: var(--text-2);
  font-size: 11.5px; font-family: inherit;
  padding: 3px 9px; border-radius: 6px; cursor: pointer;
  transition: color .16s, border-color .16s, background .16s;
}
.su-out:hover { color: var(--red); border-color: #f0c2c2; background: var(--red-light); }
.su-out:disabled { opacity: .55; cursor: default; }
/* 侧栏里作为链接使用时要去掉下划线，并允许「非危险」样式 */
a.su-out { text-decoration: none; text-align: center; }
.su-out.is-plain:hover { color: var(--brand); border-color: #bcd6f5; background: var(--brand-soft); }
.su-acts { display: flex; gap: 6px; margin-top: 6px; }
.su-acts .su-out { flex: 1; }

/* ---------------------------- 迷你列表（最近维护等） ---------------------------- */

.mini-list { display: grid; gap: 2px; }
.mini-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: inherit; text-decoration: none;
  transition: background .15s;
}
.mini-item:hover { background: var(--brand-soft); }
.mini-text { min-width: 0; flex: 1; }
.mini-title {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 7px;
}
.mini-sub {
  font-size: 12px; color: var(--text-3); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mini-go { color: var(--text-3); font-size: 17px; line-height: 1; }

/* ---------------------------- 进度条（相片补录） ---------------------------- */

.meter-wrap { padding: 4px 2px; }
.meter-top { display: flex; align-items: baseline; gap: 10px; margin-bottom: 9px; }
.meter-num { font-size: 26px; font-weight: 680; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }
.meter-num em { font-size: 14px; font-weight: 500; font-style: normal; color: var(--text-3); }
.meter-pct { margin-left: auto; font-size: 13px; font-weight: 650; color: var(--brand); }
.meter-bar { height: 9px; border-radius: 5px; background: #eef2f7; overflow: hidden; }
.meter-bar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--brand), var(--teal)); transition: width .6s cubic-bezier(.22, 1, .36, 1); }
.meter-foot {
  display: flex; flex-wrap: wrap; gap: 6px 22px;
  margin-top: 11px; font-size: 12.5px; color: var(--text-2);
}
.meter-foot b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }

/* ---------------------------- 我的档案（自助维护） ---------------------------- */

.profile-head-card {
  display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap;
}
.self-banner {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  border: 1px solid #d6e6fb;
  font-size: 13px; color: var(--text-2);
  line-height: 1.75;
}
.self-banner.is-warn { background: var(--amber-light); border-color: #f2dfb4; color: #8a5d02; }
.self-banner b { color: var(--text); }
.self-banner .ico { flex: 0 0 auto; font-weight: 700; color: var(--brand); }
.self-banner.is-warn .ico { color: var(--amber); }

.form-actions {
  display: flex; align-items: center; gap: 10px;
  padding-top: 14px; margin-top: 4px;
  border-top: 1px dashed var(--border);
}
.form-actions .spacer { flex: 1; }
.form-actions .tip { font-size: 12.5px; color: var(--text-3); }
.hint-line { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.counter { font-variant-numeric: tabular-nums; color: var(--text-3); }

/* ---------------------------- 独立居中页（改密） ---------------------------- */

.login-card.is-narrow { max-width: 460px; grid-template-columns: 1fr; }

/* ---------------------------- 长文本展示 ---------------------------- */

.rich-text {
  font-size: 13.5px;
  line-height: 2;
  color: var(--text-2);
  word-break: break-word;
  white-space: normal;
}

.su-login {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 11px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 12.5px; font-weight: 600;
  color: var(--brand); text-decoration: none;
  background: var(--brand-soft);
  transition: background .16s, border-color .16s;
}
.su-login svg { width: 15px; height: 15px; flex: 0 0 auto; }
.su-login:hover { background: var(--brand-light); border-color: #bcd6f5; }

/* ---------------------------- 登录页 ---------------------------- */

.login-shell {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 32px 20px;
  background:
    radial-gradient(1100px 520px at 12% -8%, #eaf2fe 0%, rgba(234, 242, 254, 0) 62%),
    radial-gradient(900px 460px at 92% 6%, #e7f6f4 0%, rgba(231, 246, 244, 0) 58%),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 940px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: grid; grid-template-columns: 1.05fr .95fr;
  overflow: hidden;
}
.login-brand { padding: 42px 40px; color: #fff; position: relative;
  background: linear-gradient(150deg, #1a6fd4 0%, #1657a8 52%, #12a594 100%); }
.login-brand .mark {
  width: 52px; height: 52px; border-radius: 15px;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .3);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700; margin-bottom: 22px;
}
.login-brand h1 { font-size: 24px; font-weight: 700; letter-spacing: .4px; }
.login-brand .en {
  font-size: 11.5px; letter-spacing: 2.4px; opacity: .72;
  margin-top: 7px; text-transform: uppercase;
}
.login-brand p { font-size: 13.5px; line-height: 1.95; opacity: .9; margin-top: 22px; }
.login-brand ul { list-style: none; margin-top: 26px; display: grid; gap: 11px; }
.login-brand li { font-size: 13px; display: flex; align-items: center; gap: 9px; opacity: .95; }
.login-brand li::before {
  content: '✓'; flex: 0 0 auto;
  width: 17px; height: 17px; border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 700;
}
.login-form { padding: 44px 40px; display: flex; flex-direction: column; justify-content: center; }
.login-form h2 { font-size: 19px; font-weight: 700; color: var(--text); }
.login-form .sub { font-size: 13px; color: var(--text-3); margin-top: 6px; margin-bottom: 26px; }
.login-form .field { margin-bottom: 16px; }
.login-form .btn-login {
  width: 100%; justify-content: center; height: 42px;
  font-size: 14.5px; font-weight: 600; margin-top: 6px;
}
.login-err {
  display: none; align-items: center; gap: 8px;
  background: var(--red-light); border: 1px solid #f2cccc; color: #a92f2f;
  font-size: 12.5px; padding: 9px 12px; border-radius: var(--radius-sm);
  margin-bottom: 16px; line-height: 1.6;
}
.login-err.show { display: flex; }
.login-tip { font-size: 12px; color: var(--text-3); margin-top: 18px; text-align: center; line-height: 1.8; }
.login-tip a { color: var(--brand); text-decoration: none; }
.login-tip a:hover { text-decoration: underline; }

@media (max-width: 820px) {
  .login-card { grid-template-columns: 1fr; }
  .login-brand { padding: 30px 26px; }
  .login-brand ul { display: none; }
  .login-form { padding: 30px 26px; }
}

.main-area {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 26px;
  position: sticky; top: 0; z-index: 20;
}
.topbar-title { font-size: 17px; font-weight: 650; letter-spacing: 0.2px; }
.topbar-sub { font-size: 12.5px; color: var(--text-3); margin-top: 1px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.page { padding: 22px 26px 40px; flex: 1; }
.page-section + .page-section { margin-top: 20px; }

/* ============================ 卡片 ============================ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 14.5px; font-weight: 650; }
.card-desc { font-size: 12px; color: var(--text-3); }
.card-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 18px; }
.card-body.tight { padding: 12px; }
.card-body.flush { padding: 0; }

/* 指标卡 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.stat-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.stat-card::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--brand); opacity: .9;
}
.stat-card.is-teal::after { background: var(--teal); }
.stat-card.is-amber::after { background: var(--amber); }
.stat-card.is-red::after { background: var(--red); }
.stat-card.is-green::after { background: var(--green); }
.stat-card.is-violet::after { background: var(--violet); }

.stat-label {
  font-size: 12.5px; color: var(--text-2);
  display: flex; align-items: center; gap: 6px;
}
.stat-value {
  font-size: 27px; font-weight: 680; letter-spacing: -0.5px;
  line-height: 1.25; margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.stat-value .unit { font-size: 13px; font-weight: 500; color: var(--text-3); margin-left: 3px; }
.stat-foot { font-size: 12px; color: var(--text-3); margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.trend-up { color: var(--green); font-weight: 600; }
.trend-down { color: var(--red); font-weight: 600; }

/* ============================ 表格 ============================ */

.table-wrap { overflow-x: auto; }
table.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
}
table.data-table th {
  background: var(--surface-2);
  color: var(--text-2);
  font-weight: 600;
  font-size: 12.5px;
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
table.data-table th.sortable { cursor: pointer; user-select: none; }
table.data-table th.sortable:hover { color: var(--brand); }
table.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #eef2f7;
  vertical-align: middle;
}
table.data-table tbody tr:hover td { background: var(--brand-soft); }
table.data-table tbody tr:last-child td { border-bottom: none; }
table.data-table td.num, table.data-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data-table td.center, table.data-table th.center { text-align: center; }
table.data-table.compact th { padding: 8px 12px; }
table.data-table.compact td { padding: 8px 12px; }

.cell-main { font-weight: 600; }
.cell-sub { font-size: 12px; color: var(--text-3); margin-top: 1px; }

/* 可编辑单元格 */
.editable {
  cursor: text;
  border-radius: 6px;
  padding: 3px 7px;
  margin: -3px -7px;
  border: 1px dashed transparent;
  display: inline-block;
  min-width: 42px;
  transition: background .15s, border-color .15s;
  font-variant-numeric: tabular-nums;
}
.editable:hover { background: var(--brand-light); border-color: #b9d4f7; }
.editable.editing { padding: 2px 6px; border: 1px solid var(--brand); background: #fff; outline: none; }
tr.row-dirty td { background: #fffaf0 !important; }

/* ============================ 徽章与标签 ============================ */

.badge-soft {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.7;
  white-space: nowrap;
}
.badge-soft.is-gray { background: #eef1f6; color: #5a6b80; }
.badge-soft.is-blue { background: var(--brand-light); color: var(--brand-dark); }
.badge-soft.is-teal { background: var(--teal-light); color: #0c7a6d; }
.badge-soft.is-green { background: var(--green-light); color: #10724e; }
.badge-soft.is-amber { background: var(--amber-light); color: #9a6a03; }
.badge-soft.is-red { background: var(--red-light); color: #a92f2f; }
.badge-soft.is-violet { background: var(--violet-light); color: #5a3fd0; }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 5px;
  font-size: 11.5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  margin: 0 4px 4px 0;
}

.score-pill {
  display: inline-block;
  min-width: 52px;
  text-align: center;
  padding: 3px 9px;
  border-radius: 7px;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
  font-size: 13.5px;
}

.rank-badge {
  display: inline-grid; place-items: center;
  width: 24px; height: 24px; border-radius: 7px;
  font-size: 12px; font-weight: 700;
  background: #eef1f6; color: var(--text-2);
}
.rank-badge.top1 { background: linear-gradient(135deg, #f5b93b, #e8930c); color: #fff; }
.rank-badge.top2 { background: linear-gradient(135deg, #b8c4d4, #8e9db2); color: #fff; }
.rank-badge.top3 { background: linear-gradient(135deg, #dfa172, #c07c46); color: #fff; }

/* ============================ 表单与按钮 ============================ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 550;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1.5;
}
.btn:hover { border-color: #b9c8db; background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(26, 111, 212, .25); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-danger { background: #fff; border-color: #f0c4c4; color: var(--red); }
.btn-danger:hover { background: var(--red-light); border-color: #e5a8a8; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: 4px 10px; font-size: 12.5px; border-radius: 6px; }
.btn-sm svg { width: 13px; height: 13px; }
.btn-icon { padding: 6px; width: 30px; height: 30px; }
.btn-icon svg { width: 15px; height: 15px; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 16px; }
.form-grid .col-span-2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.field label .req { color: var(--red); margin-left: 2px; }
.field .hint { font-size: 11.5px; color: var(--text-3); }
.input, .select, .textarea {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(26, 111, 212, .12);
}
.textarea { resize: vertical; min-height: 78px; line-height: 1.65; }
.select { 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='%235a6b80' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px; }

.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--radius) var(--radius) 0 0;
}
.toolbar .spacer { flex: 1; }
.toolbar .input, .toolbar .select { width: auto; min-width: 130px; padding: 6px 10px; font-size: 13px; }
.search-input { position: relative; }
.search-input .input { padding-left: 31px; min-width: 210px; }
.search-input svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--text-3); }

.filter-chip {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-strong);
  background: #fff;
  font-size: 12.5px;
  cursor: pointer;
  color: var(--text-2);
  transition: all .15s;
  font-family: inherit;
}
.filter-chip:hover { border-color: #b9c8db; }
.filter-chip.active { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 600; }

/* ============================ 分页 ============================ */

.pagination {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 18px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-2);
  flex-wrap: wrap;
}
.pagination .info { margin-right: auto; font-size: 12.5px; color: var(--text-3); }
.page-btn {
  min-width: 30px; height: 30px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
  font-family: inherit;
  transition: all .15s;
}
.page-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.page-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.page-btn:disabled { opacity: .45; cursor: not-allowed; }

/* ============================ 空态 / 加载 ============================ */

.empty-state {
  padding: 54px 20px;
  text-align: center;
  color: var(--text-3);
}
.empty-state .icon { font-size: 34px; opacity: .35; margin-bottom: 8px; }
.empty-state .title { font-size: 14px; color: var(--text-2); font-weight: 600; margin-bottom: 4px; }
.empty-state .desc { font-size: 12.5px; }

.skeleton {
  background: linear-gradient(90deg, #eef2f7 25%, #f6f8fb 37%, #eef2f7 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
  border-radius: 6px;
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================ 图表容器 ============================ */

.chart { width: 100%; }
.chart-sm { height: 220px; }
.chart-md { height: 280px; }
.chart-lg { height: 340px; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
/* 未登录时逐月绩效表被裁掉，剩下的单卡片占满整行，避免右侧留出空洞 */
.grid-2-1.is-single { grid-template-columns: 1fr; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; }
@media (max-width: 1080px) {
  .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
}

/* ============================ 弹窗 ============================ */

.modal-mask {
  position: fixed; inset: 0;
  background: rgba(22, 34, 48, .42);
  backdrop-filter: blur(3px);
  z-index: 100;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 780px;
  animation: slideUp .22s cubic-bezier(.22, 1, .36, 1);
  margin: auto 0;
}
.modal-box.narrow { max-width: 460px; }
@keyframes slideUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex; align-items: center;
  padding: 17px 22px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 650; }
.modal-close {
  margin-left: auto;
  border: none; background: none; cursor: pointer;
  color: var(--text-3); font-size: 20px; line-height: 1;
  width: 30px; height: 30px; border-radius: 7px;
  transition: all .15s;
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-body { padding: 20px 22px; max-height: 62vh; overflow-y: auto; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 15px 22px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ============================ 提示条 ============================ */

.toast-wrap {
  position: fixed; top: 20px; right: 20px; z-index: 200;
  display: flex; flex-direction: column; gap: 9px;
  pointer-events: none;
}
.toast {
  min-width: 230px; max-width: 380px;
  padding: 11px 15px;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  box-shadow: var(--shadow);
  font-size: 13.5px;
  display: flex; align-items: flex-start; gap: 9px;
  animation: toastIn .25s cubic-bezier(.22, 1, .36, 1);
  pointer-events: auto;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: none; } }
.toast.is-success { border-left-color: var(--green); }
.toast.is-error { border-left-color: var(--red); }
.toast.is-warn { border-left-color: var(--amber); }
.toast .t-icon { font-size: 15px; line-height: 1.4; }
.toast .t-body { flex: 1; }
.toast .t-title { font-weight: 600; }
.toast .t-desc { font-size: 12.5px; color: var(--text-3); margin-top: 1px; }

/* ============================ 专家卡片 ============================ */

.expert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }

.avatar {
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-weight: 650;
  flex: 0 0 auto;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}
/* 有相片时：姓名色块作为底衬，相片覆盖其上；相片加载失败自动回落到色块 */
.avatar.has-photo { background: var(--border-strong); }
.avatar > img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  z-index: 1;
}
.avatar .avatar-fallback { position: relative; z-index: 0; }
.avatar-lg { width: 72px; height: 72px; font-size: 26px; }
.avatar-md { width: 44px; height: 44px; font-size: 16px; }
.avatar-sm { width: 32px; height: 32px; font-size: 13px; }
.avatar-xl { width: 104px; height: 104px; font-size: 34px; }
/* 详情页证件照：竖版圆角矩形更贴近医院展示习惯 */
.avatar-portrait { border-radius: var(--radius); width: 116px; height: 150px; font-size: 34px; }
.avatar.has-photo.avatar-portrait img { object-position: center top; }

.profile-head {
  display: flex; gap: 18px; align-items: flex-start;
}
.profile-name { font-size: 22px; font-weight: 680; letter-spacing: -0.3px; }
.profile-meta { font-size: 13px; color: var(--text-2); margin-top: 3px; }
.profile-tags { margin-top: 10px; }

.info-list { display: grid; gap: 11px; }
.info-row { display: flex; gap: 12px; font-size: 13.5px; align-items: flex-start; }
.info-row .k { flex: 0 0 82px; color: var(--text-3); font-size: 12.5px; padding-top: 1px; }
.info-row .v { flex: 1; color: var(--text); word-break: break-word; }

.dim-bar { margin-bottom: 13px; }
.dim-bar:last-child { margin-bottom: 0; }
.dim-bar-head { display: flex; font-size: 12.5px; margin-bottom: 5px; }
.dim-bar-head .n { color: var(--text-2); font-weight: 600; }
.dim-bar-head .v { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 650; }
.dim-bar-head .w { color: var(--text-3); margin-left: 8px; font-weight: 400; font-size: 11.5px; }
.dim-bar-track { height: 7px; border-radius: 4px; background: #eef2f7; overflow: hidden; }
.dim-bar-fill { height: 100%; border-radius: 4px; transition: width .5s cubic-bezier(.22, 1, .36, 1); }

/* ============================ 建议列表 ============================ */

.suggest-item {
  display: flex; gap: 12px;
  padding: 14px 0;
  border-bottom: 1px dashed var(--border);
}
.suggest-item:last-child { border-bottom: none; padding-bottom: 0; }
.suggest-item:first-child { padding-top: 0; }
.suggest-level {
  flex: 0 0 4px; border-radius: 3px; align-self: stretch; min-height: 40px;
}
.suggest-level.high { background: var(--red); }
.suggest-level.mid { background: var(--amber); }
.suggest-level.low { background: var(--green); }
.suggest-body { flex: 1; min-width: 0; }
.suggest-title { font-size: 13.8px; font-weight: 650; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.suggest-text { font-size: 13px; color: var(--text-2); margin-top: 5px; line-height: 1.75; }
.suggest-metric {
  font-size: 12px; font-variant-numeric: tabular-nums;
  color: var(--text-2); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 6px; padding: 1px 8px;
}

/* ============================ 对比表 ============================ */

table.compare-table th:first-child, table.compare-table td:first-child {
  position: sticky; left: 0; background: #fff; z-index: 2;
  border-right: 1px solid var(--border);
}
table.compare-table thead th:first-child { background: var(--surface-2); }
table.compare-table .win { color: var(--green); font-weight: 680; }
table.compare-table .dim-row-title { color: var(--text-2); font-size: 12.5px; font-weight: 600; }

/* ============================ 分隔与工具类 ============================ */

.section-title {
  font-size: 12px; font-weight: 700; color: var(--text-3);
  letter-spacing: 1px; text-transform: uppercase;
  margin: 0 0 10px;
}
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.mono { font-variant-numeric: tabular-nums; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; } .mb-20 { margin-bottom: 20px; }
.flex { display: flex; } .flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; }
.gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.wrap { flex-wrap: wrap; }
.hidden { display: none !important; }

/* ============================ 标签页 ============================ */

.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
  overflow-x: auto;
}
.tab-btn {
  padding: 10px 17px;
  border: none;
  background: none;
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-family: inherit;
  font-weight: 550;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 650; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn .2s ease; }

/* 复选框列表（专家对比选择器） */
.check-list {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px;
  background: var(--surface-2);
}
.check-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13.5px;
  transition: background .15s;
}
.check-item:hover { background: #fff; }
.check-item input { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }
.check-item.selected { background: var(--brand-light); color: var(--brand-dark); font-weight: 600; }

/* 权重编辑行 */
.weight-row {
  display: grid;
  grid-template-columns: 1fr 78px 64px;
  gap: 12px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px dashed var(--border);
}
.weight-row:last-child { border-bottom: none; }
.weight-name { font-size: 13.5px; font-weight: 600; }
.weight-desc { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.weight-row .input { width: 100%; padding: 6px 9px; text-align: right; }
.weight-share { font-size: 12.5px; color: var(--text-2); text-align: right; font-variant-numeric: tabular-nums; }

.config-explain { font-size: 12.5px; color: var(--text-2); line-height: 2.1; }
.config-explain code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

/* ============================ 专家展示墙 ============================ */

.wall-stats {
  display: flex; flex-wrap: wrap; gap: 10px 26px;
  padding: 12px 16px;
  border-top: 1px dashed var(--border);
  font-size: 13px; color: var(--text-2);
}
.wall-stats b { color: var(--text); font-size: 16px; font-weight: 680; margin-right: 3px; font-variant-numeric: tabular-nums; }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-2);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12.5px;
  cursor: pointer;
  transition: all .15s;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

.dept-block { margin-bottom: 22px; }
.dept-block-head {
  display: flex; align-items: center; gap: 10px;
  margin: 0 4px 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--brand-light);
}
.dept-block-name { font-size: 16px; font-weight: 680; letter-spacing: -0.2px; }
.dept-block-meta { font-size: 12.5px; color: var(--text-3); margin-left: auto; font-variant-numeric: tabular-nums; }

.wall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 14px;
}

.wall-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: transform .18s, box-shadow .18s, border-color .18s;
  display: flex; flex-direction: column;
}
.wall-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }

.wall-photo {
  position: relative;
  aspect-ratio: 3 / 4;
  background: var(--surface-2);
  overflow: hidden;
}
.wall-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }
.wall-photo .photo-fallback {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 34px; font-weight: 650; color: #fff; letter-spacing: 1px;
}
.wall-photo .photo-fallback small { display: block; font-size: 11px; font-weight: 500; opacity: .82; letter-spacing: 0; margin-top: 4px; }

.wall-body { padding: 9px 11px 11px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.wall-name { font-size: 15px; font-weight: 680; letter-spacing: -0.2px; display: flex; align-items: center; gap: 6px; }
.wall-title { font-size: 12.5px; color: var(--brand-dark); background: var(--brand-light); border-radius: 5px; padding: 2px 7px; align-self: flex-start; font-weight: 600; }
.wall-position { font-size: 12px; color: var(--amber); background: var(--amber-light); border-radius: 5px; padding: 2px 7px; align-self: flex-start; }
.wall-spec {
  font-size: 12px; color: var(--text-2); line-height: 1.65;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.wall-link {
  margin-top: auto; font-size: 12.5px; color: var(--brand); text-decoration: none; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
}
.wall-link:hover { text-decoration: underline; }

.wall-tag-legacy {
  font-size: 10.5px; font-weight: 600; color: var(--violet); background: var(--violet-light);
  border-radius: 4px; padding: 1px 5px;
}

/* 打印：门诊墙 A3 横向一览表 */
@media print {
  @page { size: A3 landscape; margin: 10mm; }
  .sidebar, .topbar, .no-print, .sidebar-foot, .sidebar-user, .toast-wrap { display: none !important; }
  .app-shell { display: block; }
  .main-area { margin-left: 0 !important; }
  .page { padding: 0 !important; }
  body { background: #fff; }
  .print-title { display: block !important; }
  .dept-block { break-inside: auto; margin-bottom: 12px; }
  .dept-block-head { break-after: avoid; }
  .wall-grid { grid-template-columns: repeat(6, 1fr); gap: 8px; }
  .wall-card { break-inside: avoid; box-shadow: none; border-color: #cbd5e1; }
  .wall-card:hover { transform: none; }
  .wall-spec { -webkit-line-clamp: 2; }
  .wall-link { display: none; }
}
.print-title { display: none; text-align: center; margin-bottom: 10px; }
.print-title h1 { font-size: 22px; font-weight: 700; letter-spacing: 2px; }
.print-title p { font-size: 12px; color: var(--text-3); margin-top: 4px; }

/* ============================ 响应式 ============================ */

@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-100%); transition: transform .25s; width: 230px; flex-basis: 230px; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .main-area { margin-left: 0; }
  .page { padding: 16px; }
  .topbar { padding: 0 16px; }
}
