/* =====================================================================
   医用耗材集采报量预测平台 · 全局样式（浅色主题）
   ===================================================================== */
:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #fafbfd;
  --border: #e4e8f0;
  --border-strong: #d3d9e4;
  --text: #1e2430;
  --text-2: #4b5563;
  --muted: #8892a4;
  --primary: #1668dc;
  --primary-dark: #0f52b0;
  --primary-light: #e8f1fe;
  --success: #12a150;
  --success-light: #e6f7ee;
  --warning: #d97706;
  --warning-light: #fef4e6;
  --danger: #e5484d;
  --danger-light: #fdecec;
  --info: #0d9488;
  --info-light: #e6f6f4;
  --up: #e5484d;      /* 涨 = 红（A股/国内习惯） */
  --down: #12a150;    /* 跌 = 绿 */
  --sidebar-w: 236px;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(22, 32, 50, .05);
  --shadow: 0 2px 10px rgba(22, 32, 50, .07);
  --shadow-lg: 0 8px 28px rgba(22, 32, 50, .12);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

/* ---------------- 布局 ---------------- */
.app { min-height: 100vh; }

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

.brand {
  height: 60px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.brand-logo {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #1668dc, #38bdf8);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
  flex-shrink: 0;
}
.brand-text { min-width: 0; }
.brand-title { font-size: 13.5px; font-weight: 700; letter-spacing: -.1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: 10.5px; color: var(--muted); letter-spacing: .4px; }

.nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px 20px;
}
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: #d8dde8; border-radius: 3px; }

.nav-group {
  margin-top: 12px;
  padding: 6px 8px 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .6px;
  color: var(--muted);
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  margin-bottom: 2px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 13.5px;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}
.nav-item .ico {
  width: 17px; height: 17px;
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  opacity: .85;
}
.nav-item .ico svg { width: 16px; height: 16px; }
.nav-badge {
  margin-left: auto;
  font-size: 11px;
  background: var(--danger);
  color: #fff;
  border-radius: 9px;
  padding: 1px 6px;
  font-weight: 600;
}

.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 60px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar h1 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -.2px;
}
.topbar .crumb {
  font-size: 12.5px;
  color: var(--muted);
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.hamburger {
  display: none;
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center; justify-content: center;
}

.user-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 4px 10px 4px 5px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  position: relative;
}
.user-avatar {
  width: 27px; height: 27px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1668dc, #38bdf8);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.user-name { font-size: 13px; font-weight: 500; }
.user-role { font-size: 11px; color: var(--muted); }

.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 5px;
  display: none;
}
.dropdown.open { display: block; }
.dropdown a, .dropdown button {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 0; background: none;
  font-size: 13px; font-family: inherit;
  color: var(--text-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
}
.dropdown a:hover, .dropdown button:hover { background: var(--surface-2); color: var(--text); }
.dropdown .sep { height: 1px; background: var(--border); margin: 4px 0; }

.content { padding: 20px 22px 40px; flex: 1; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  overflow: hidden;
}
.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.card-head h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
}
.card-head .sub { font-size: 12px; color: var(--muted); }
.card-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card-body { padding: 18px; }
.card-body.tight { padding: 12px 18px; }
.card-body.flush { padding: 0; }

/* ---------------- 栅格 ---------------- */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

/* ---------------- KPI ---------------- */
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.kpi .label { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 25px; font-weight: 700; letter-spacing: -.6px; margin-top: 6px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi .value .unit { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.kpi .foot { font-size: 12px; color: var(--muted); margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.kpi .bar {
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--primary);
}
.kpi.k-success .bar { background: var(--success); }
.kpi.k-warning .bar { background: var(--warning); }
.kpi.k-danger .bar { background: var(--danger); }
.kpi.k-info .bar { background: var(--info); }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  line-height: 1.4;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .13s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn:active { transform: translateY(1px); }
.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-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #c9353a; border-color: #c9353a; color: #fff; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #0d8340; border-color: #0d8340; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: 4px 9px; font-size: 12.5px; }
.btn-lg { padding: 9px 20px; font-size: 14px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn-group { display: inline-flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- 表单 ---------------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid.cols-1 { grid-template-columns: 1fr; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.span-2 { grid-column: span 2; }
.field.span-3 { grid-column: span 3; }
.field label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
}
.field label .req { color: var(--danger); margin-left: 2px; }
.field .hint { font-size: 11.5px; color: var(--muted); }
.field .err { font-size: 11.5px; color: var(--danger); }

input[type=text], input[type=password], input[type=number], input[type=date], input[type=month],
input[type=email], input[type=file], select, textarea {
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  width: 100%;
  transition: border-color .13s, box-shadow .13s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 104, 220, .12);
}
input[readonly], input[disabled], select[disabled], textarea[disabled] {
  background: #f5f7fa;
  color: var(--muted);
}
textarea { resize: vertical; min-height: 78px; line-height: 1.55; }
select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4.5L6 8.5L10 4.5' fill='none' stroke='%238892a4' stroke-width='1.4' stroke-linecap='round'/></svg>"); background-repeat: no-repeat; background-position: right 9px center; padding-right: 28px; }

.checkbox-line { display: flex; align-items: center; gap: 7px; font-size: 13.5px; padding-top: 4px; }
input[type=checkbox], input[type=radio] { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }

/* 筛选栏 */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.filters .field { min-width: 150px; flex: 0 0 auto; }
.filters .field.wide { min-width: 220px; }
.filters .spacer { flex: 1; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data th, table.data td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data th {
  background: var(--surface-2);
  font-weight: 600;
  font-size: 12.5px;
  color: var(--text-2);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
table.data tbody tr:hover { background: #f8fafd; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 12.5px; }
table.data td.center, table.data th.center { text-align: center; }
table.data td.nowrap, table.data th.nowrap { white-space: nowrap; }
table.data tfoot td { background: var(--surface-2); font-weight: 600; }
table.data .row-actions { display: flex; gap: 6px; white-space: nowrap; }
table.data.compact th, table.data.compact td { padding: 7px 10px; }

.empty {
  padding: 46px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}
.empty .big { font-size: 30px; margin-bottom: 8px; opacity: .45; }

/* ---------------- 标签 ---------------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  font-size: 11.5px;
  font-weight: 500;
  border-radius: 20px;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
  white-space: nowrap;
  line-height: 1.7;
}
.tag-primary { background: var(--primary-light); color: var(--primary-dark); border-color: #cfe1fb; }
.tag-success { background: var(--success-light); color: #0a7a3c; border-color: #c6ecd6; }
.tag-warning { background: var(--warning-light); color: #a35a05; border-color: #f7e2c0; }
.tag-danger  { background: var(--danger-light); color: #b93338; border-color: #f8d5d6; }
.tag-info    { background: var(--info-light); color: #0a6b62; border-color: #c9ece7; }
.tag-plain   { background: #f2f4f8; color: var(--muted); }

.up { color: var(--up); font-weight: 600; }
.down { color: var(--down); font-weight: 600; }
.flat { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.small { font-size: 12px; }
.mt0 { margin-top: 0; }
.mb0 { margin-bottom: 0; }
.mb8 { margin-bottom: 8px; }
.mb16 { margin-bottom: 16px; }
.mt16 { margin-top: 16px; }

/* ---------------- 分页 ---------------- */
.pager {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.pager .summary { font-size: 12.5px; color: var(--muted); }
.pager .pages { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.pager .pages a, .pager .pages span {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--text-2);
  background: #fff;
}
.pager .pages a:hover { border-color: var(--primary); color: var(--primary); }
.pager .pages .cur { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.pager .pages .dots { border: 0; background: none; color: var(--muted); }

/* ---------------- 提示条 ---------------- */
.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 14px;
  border: 1px solid transparent;
}
.alert-success { background: var(--success-light); color: #0a6b36; border-color: #c6ecd6; }
.alert-error   { background: var(--danger-light); color: #a72f34; border-color: #f8d5d6; }
.alert-warning { background: var(--warning-light); color: #94520a; border-color: #f7e2c0; }
.alert-info    { background: var(--primary-light); color: #10457f; border-color: #cfe1fb; }
.alert .close { margin-left: auto; cursor: pointer; opacity: .6; border: 0; background: none; font-size: 16px; line-height: 1; color: inherit; }
.alert .close:hover { opacity: 1; }

/* ---------------- 进度 ---------------- */
.progress {
  height: 8px;
  background: #eef1f6;
  border-radius: 5px;
  overflow: hidden;
}
.progress .bar {
  height: 100%;
  background: linear-gradient(90deg, #1668dc, #38bdf8);
  border-radius: 5px;
  transition: width .3s;
}
.progress.thin { height: 5px; }
.progress .bar.success { background: linear-gradient(90deg, #12a150, #34d399); }
.progress .bar.warning { background: linear-gradient(90deg, #d97706, #fbbf24); }
.progress .bar.danger  { background: linear-gradient(90deg, #e5484d, #f87171); }

/* ---------------- 图表 ---------------- */
.chart { width: 100%; height: 300px; }
.chart-sm { height: 230px; }
.chart-lg { height: 380px; }
.chart-xl { height: 440px; }

/* ---------------- 登录页 ---------------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1100px 520px at 12% -8%, #dbeafe 0%, transparent 62%),
    radial-gradient(900px 460px at 92% 108%, #d1fae5 0%, transparent 60%),
    #eef2f9;
  padding: 24px;
}
.login-box {
  width: 100%;
  max-width: 940px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(22, 32, 50, .13);
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  overflow: hidden;
  min-height: 520px;
}
.login-intro {
  padding: 44px 40px;
  background: linear-gradient(150deg, #0f52b0 0%, #1668dc 45%, #2b8ae6 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
}
.login-intro h2 { font-size: 23px; margin: 0 0 8px; letter-spacing: -.3px; line-height: 1.35; }
.login-intro .lead { font-size: 13px; opacity: .88; line-height: 1.75; margin-bottom: 22px; }
.login-points { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.login-points li { display: flex; gap: 10px; font-size: 13px; line-height: 1.65; opacity: .95; }
.login-points .dot {
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; flex-shrink: 0; margin-top: 1px; font-weight: 600;
}
.login-foot { margin-top: auto; font-size: 11.5px; opacity: .68; padding-top: 24px; }
.login-form { padding: 44px 40px; display: flex; flex-direction: column; justify-content: center; }
.login-form h3 { font-size: 19px; margin: 0 0 4px; }
.login-form .sub { font-size: 12.5px; color: var(--muted); margin-bottom: 24px; }
.login-form .field { margin-bottom: 15px; }
.login-form input { padding: 10px 12px; font-size: 14px; }
.demo-accounts {
  margin-top: 22px;
  border-top: 1px dashed var(--border);
  padding-top: 14px;
}
.demo-accounts .title { font-size: 11.5px; color: var(--muted); margin-bottom: 8px; }
.demo-accounts .list { display: flex; flex-wrap: wrap; gap: 6px; }
.demo-accounts .acc {
  font-size: 11.5px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface-2);
  cursor: pointer;
  color: var(--text-2);
  font-family: var(--mono);
}
.demo-accounts .acc:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

/* ---------------- Toast ---------------- */
#toast-box {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 9px;
  pointer-events: none;
}
.toast {
  min-width: 230px;
  max-width: 400px;
  padding: 11px 15px;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  color: var(--text);
  pointer-events: auto;
  animation: toastIn .2s ease;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast .t-title { font-weight: 600; margin-bottom: 2px; }
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* ---------------- 模态 ---------------- */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(20, 28, 42, .45);
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-mask.open { display: flex; }
.modal {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  animation: modalIn .18s ease;
}
.modal.wide { max-width: 880px; }
.modal.xwide { max-width: 1200px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-head {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-head h3 { margin: 0; font-size: 15px; }
.modal-head .close {
  margin-left: auto; border: 0; background: none;
  font-size: 20px; line-height: 1; cursor: pointer; color: var(--muted);
}
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-foot {
  padding: 13px 20px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 9px;
  background: var(--surface-2);
}

/* ---------------- 步骤条 ---------------- */
.steps { display: flex; align-items: center; gap: 0; padding: 4px 0; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 9px; }
.step .num {
  width: 26px; height: 26px; border-radius: 50%;
  background: #eef1f6; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 600; flex-shrink: 0;
}
.step .txt { font-size: 12.5px; color: var(--muted); }
.step.done .num { background: var(--success-light); color: var(--success); }
.step.done .txt { color: var(--text-2); }
.step.active .num { background: var(--primary); color: #fff; }
.step.active .txt { color: var(--primary); font-weight: 600; }
.step-line { flex: 1; height: 1px; background: var(--border); margin: 0 12px; min-width: 22px; }

/* ---------------- 描述列表 ---------------- */
.desc { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.desc .item { display: flex; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); min-height: 40px; }
.desc .item .k { width: 130px; flex-shrink: 0; background: var(--surface-2); padding: 9px 12px; font-size: 12.5px; color: var(--text-2); }
.desc .item .v { padding: 9px 12px; font-size: 13px; flex: 1; word-break: break-all; }
.desc.cols-1 { grid-template-columns: 1fr; }

/* ---------------- 标签页 ---------------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); padding: 0 18px; overflow-x: auto; }
.tabs a {
  padding: 10px 15px;
  font-size: 13.5px;
  color: var(--text-2);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tabs a:hover { color: var(--primary); }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ---------------- 其他 ---------------- */
.split-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
.split-3-2 { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; }
.legend-row { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend-row .k { display: inline-flex; align-items: center; gap: 5px; }
.legend-row .sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.scroll-y { max-height: 420px; overflow-y: auto; }
.scroll-y::-webkit-scrollbar { width: 7px; height: 7px; }
.scroll-y::-webkit-scrollbar-thumb { background: #d8dde8; border-radius: 4px; }

.help-box {
  background: var(--primary-light);
  border: 1px solid #cfe1fb;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.75;
  color: #10457f;
}
.help-box b { color: #0b3664; }

.code-block {
  background: #1e2430;
  color: #d6deeb;
  font-family: var(--mono);
  font-size: 12px;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  line-height: 1.65;
  white-space: pre;
}

/* 加载遮罩 */
#loading-mask {
  position: fixed; inset: 0;
  background: rgba(255,255,255,.72);
  z-index: 9800;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
}
#loading-mask.open { display: flex; }
#loading-mask .spinner {
  width: 34px; height: 34px;
  border: 3px solid #d8e0ee;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#loading-mask .txt { font-size: 13px; color: var(--text-2); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1200px) {
  .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-2, .split-3-2 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .hamburger { display: flex; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; }
  .field.span-2, .field.span-3 { grid-column: span 1; }
  .login-box { grid-template-columns: 1fr; max-width: 460px; }
  .login-intro { display: none; }
  .desc { grid-template-columns: 1fr; }
  .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media print {
  .sidebar, .topbar, .filters, .pager, .btn-group { display: none !important; }
  .main { margin-left: 0; }
  .card { box-shadow: none; border-color: #ccc; }
}
