/* ═══════════ 学生健康管理系统 · 清新健康医疗风 ═══════════ */
:root {
  --primary: #0E7C66;
  --primary-2: #12A085;
  --primary-3: #00509E;
  --bg: #F5F8F7;
  --bg-mint: #EAF3F0;
  --surface: #FFFFFF;
  --text: #1F2933;
  --text-2: #52606D;
  --text-3: #9AA5B1;
  --line: #E4EBE8;
  --ok: #2DA44E;
  --warn: #E3A008;
  --danger: #D93838;
  --info: #3E8FE0;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 2px 10px rgba(14, 124, 102, .06), 0 12px 32px rgba(14, 124, 102, .07);
  --shadow-hover: 0 4px 14px rgba(14, 124, 102, .10), 0 18px 44px rgba(14, 124, 102, .13);
  --font: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(18, 160, 133, .08), transparent 60%),
    radial-gradient(900px 420px at -10% 30%, rgba(0, 80, 158, .05), transparent 55%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #C7D6D1; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-2); }
::-webkit-scrollbar-track { background: transparent; }

/* ─────────── 通用组件 ─────────── */
.btn {
  font: inherit; font-weight: 500; cursor: pointer; border: none;
  border-radius: var(--radius-sm); padding: .58em 1.3em;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
  display: inline-flex; align-items: center; gap: .45em; justify-content: center;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; box-shadow: 0 4px 14px rgba(18, 160, 133, .35);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(18, 160, 133, .45); transform: translateY(-1px); }
.btn-primary:disabled { background: #B9CFC9; box-shadow: none; cursor: not-allowed; transform: none; }
.btn-ghost { background: transparent; color: var(--text-2); border: 1px solid var(--line); }
.btn-ghost:hover { color: var(--primary); border-color: var(--primary-2); background: rgba(18, 160, 133, .06); }
.btn-sm { padding: .35em .8em; font-size: .86rem; }
.btn-block { width: 100%; }

.card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.4rem 1.6rem;
  transition: transform .2s ease, box-shadow .25s ease;
  animation: rise .45s ease backwards;
}
.card:hover { box-shadow: var(--shadow-hover); }
.card:nth-child(2) { animation-delay: .06s; }
.card:nth-child(3) { animation-delay: .12s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.card-title { font-size: 1.06rem; font-weight: 700; margin-bottom: .8rem; display: flex; align-items: center; gap: .5em; }
.card-title::before { content: ''; width: 4px; height: 1.05em; border-radius: 3px; background: linear-gradient(var(--primary-2), var(--primary)); }
.card-hint { color: var(--text-2); font-size: .86rem; line-height: 1.65; margin-bottom: 1rem; }

.field { display: block; margin-bottom: .9rem; }
.field > span { display: block; font-size: .82rem; color: var(--text-2); margin-bottom: .3rem; font-weight: 500; }
.field input, .field select {
  width: 100%; font: inherit; color: var(--text);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: .5em .8em; background: #FBFDFC; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field select:focus {
  border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(18, 160, 133, .14);
}
.field-inline { display: inline-flex; flex-direction: column; margin-bottom: 0; }
.field-inline input, .field-inline select { width: 10.5em; }
.field-row { display: flex; gap: 1rem; align-items: flex-end; margin: .9rem 0; flex-wrap: wrap; }
.btn-row { display: flex; gap: .7rem; margin-top: .4rem; }
.btn-row-end { justify-content: flex-end; }

.form-err { background: #FCEFEF; color: var(--danger); border: 1px solid #F3CACA; border-radius: var(--radius-sm); padding: .5em .8em; font-size: .86rem; margin-bottom: .9rem; }
.badge { display: inline-block; padding: .18em .7em; border-radius: 999px; font-size: .78rem; font-weight: 500; }
.badge-warn { background: #FBF3DC; color: #9C6B00; }

.empty { color: var(--text-3); text-align: center; padding: 1.6rem 0; font-size: .9rem; }
.empty-hero { text-align: center; color: var(--text-3); padding: 4.5rem 0; }
.empty-hero svg { color: #BFD6D0; margin-bottom: 1rem; }
.empty-hero p { font-size: .95rem; }

.spinner { width: 1em; height: 1em; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; display: inline-block; animation: spin .8s linear infinite; vertical-align: -2px; }
.busy .spinner { border-color: rgba(18,160,133,.25); border-top-color: var(--primary-2); }
@keyframes spin { to { transform: rotate(360deg); } }
.busy { color: var(--text-2); font-size: .9rem; padding: .8rem 0 .2rem; }

.toast {
  position: fixed; left: 50%; bottom: 2.4rem; transform: translateX(-50%);
  background: #243B36; color: #fff; padding: .7em 1.4em; border-radius: 999px;
  font-size: .9rem; box-shadow: 0 10px 30px rgba(0,0,0,.25); z-index: 99;
  animation: rise .3s ease;
}
.toast.toast-err { background: #8C2F2F; }

/* ═══════════ 登录视图 ═══════════ */
.login-view {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(900px 500px at 80% 15%, rgba(255,255,255,.16), transparent 55%),
    radial-gradient(700px 500px at 12% 85%, rgba(0, 80, 158, .25), transparent 60%),
    linear-gradient(150deg, #0C6A57 0%, #12A085 55%, #0E7C66 100%);
  overflow: hidden;
}
.login-deco { position: absolute; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.16); animation: float 9s ease-in-out infinite; }
.login-deco-1 { width: 46vmin; height: 46vmin; right: -8vmin; top: -10vmin; }
.login-deco-2 { width: 30vmin; height: 30vmin; left: -6vmin; bottom: -8vmin; animation-delay: -4.5s; border-style: dashed; }
@keyframes float { 50% { transform: translateY(-2.2vmin); } }

.login-card {
  position: relative; width: 24.5rem; max-width: 92vw;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 22px; padding: 2.6rem 2.5rem 2rem;
  box-shadow: 0 30px 80px rgba(6, 60, 48, .35);
  animation: rise .55s ease backwards;
}
.login-mark { color: var(--primary-2); margin-bottom: .6rem; }
.login-title { font-size: 1.45rem; font-weight: 900; letter-spacing: .02em; }
.login-sub { color: var(--text-2); font-size: .84rem; margin: .35rem 0 1.7rem; }
.login-card .field input { padding: .62em .9em; }
.login-card .btn-primary { margin-top: .4rem; padding: .68em; font-size: 1rem; letter-spacing: .35em; text-indent: .35em; }
.login-foot { margin-top: 1.5rem; text-align: center; color: var(--text-3); font-size: .76rem; }

/* ═══════════ 顶栏 ═══════════ */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 2rem;
  padding: 0 1.6rem; height: 3.6rem;
  background: rgba(255,255,255,.86); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .55em; color: var(--primary); }
.brand-name { font-weight: 900; font-size: 1.02rem; color: var(--text); letter-spacing: .01em; }
.tabs { display: flex; gap: .3rem; flex: 1; }
.tab {
  font: inherit; font-weight: 500; color: var(--text-2); background: transparent;
  border: none; cursor: pointer; padding: .5em 1.1em; border-radius: 999px;
  transition: all .2s ease; position: relative;
}
.tab:hover { color: var(--primary); background: rgba(18,160,133,.08); }
.tab.active { color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 3px 10px rgba(18,160,133,.35); }
.user-menu { display: flex; align-items: center; gap: .6rem; }
.user-name { font-weight: 500; font-size: .9rem; }

.main { max-width: 1280px; margin: 0 auto; padding: 1.5rem 1.6rem 3rem; }
.view { display: none; }
.view.active { display: block; animation: fadein .35s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } }

/* ═══════════ 视图：数据导入 ═══════════ */
.grid-import { display: grid; grid-template-columns: 1.35fr 1fr; gap: 1.2rem; align-items: start; }
.report-card { grid-column: 1 / -1; }

.dropzone {
  border: 2px dashed #BBD6CF; border-radius: var(--radius);
  padding: 2.1rem 1rem; text-align: center; cursor: pointer;
  color: var(--text-2); background: linear-gradient(180deg, #FAFDFC, #F2F8F6);
  transition: all .22s ease; outline: none;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary-2); color: var(--primary);
  background: linear-gradient(180deg, #F1F9F7, #E7F4F0); transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(18,160,133,.14);
}
.dropzone svg { color: var(--primary-2); margin-bottom: .4rem; }
.dz-main { font-weight: 700; }
.dz-sub { font-size: .8rem; color: var(--text-3); margin-top: .25rem; }

.file-chip {
  display: inline-flex; align-items: center; gap: .6em; margin-top: .9rem;
  background: var(--bg-mint); border: 1px solid #CBE4DD; color: var(--primary);
  border-radius: 999px; padding: .35em .5em .35em 1em; font-size: .88rem; font-weight: 500;
}
.chip-x { border: none; background: rgba(14,124,102,.12); color: var(--primary); width: 1.5em; height: 1.5em; border-radius: 50%; cursor: pointer; font-size: .9em; line-height: 1; }
.chip-x:hover { background: var(--danger); color: #fff; }

.stat-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.stat-chip {
  flex: 1; min-width: 8.5rem; border-radius: var(--radius-sm); padding: .8rem 1rem;
  background: linear-gradient(160deg, #F4FAF8, #ECF5F2); border: 1px solid var(--line);
}
.stat-chip .num { font-size: 1.5rem; font-weight: 900; color: var(--primary); }
.stat-chip .lbl { font-size: .78rem; color: var(--text-2); }
.stat-chip.ok .num { color: var(--ok); }
.stat-chip.warn .num { color: var(--warn); }
.stat-chip.info .num { color: var(--info); }

.callout {
  background: #F0F8F5; border-left: 4px solid var(--primary-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: .7em 1em; font-size: .84rem; color: var(--text-2); line-height: 1.6;
}

.error-table { margin-top: 1rem; }
.error-table table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.error-table th, .error-table td { text-align: left; padding: .45em .7em; border-bottom: 1px solid var(--line); }
.error-table th { color: var(--text-2); font-weight: 500; background: #F7FBF9; }
.error-table tr { animation: rise .3s ease backwards; }
.error-table td:last-child { color: var(--danger); }

.backup-list { margin-top: 1rem; max-height: 15rem; overflow: auto; }
.backup-item {
  display: flex; align-items: center; gap: .8em; padding: .5em .2em;
  border-bottom: 1px dashed var(--line); font-size: .84rem;
}
.backup-item .bk-name { flex: 1; color: var(--text); font-family: Consolas, monospace; font-size: .8rem; }
.backup-item .bk-meta { color: var(--text-3); font-size: .76rem; }
.backup-item a { color: var(--primary-2); text-decoration: none; font-weight: 500; }
.backup-item a:hover { text-decoration: underline; }

/* ═══════════ 视图：数据总览 ═══════════ */
.summary-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; margin-bottom: 1.2rem; }
.summary-card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.1rem 1.4rem; position: relative; overflow: hidden;
  transition: transform .2s, box-shadow .25s; animation: rise .45s ease backwards;
}
.summary-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.summary-card::after {
  content: ''; position: absolute; right: -22px; top: -22px; width: 86px; height: 86px;
  border-radius: 50%; background: var(--accent, rgba(18,160,133,.10));
}
.summary-card .num { font-size: 1.7rem; font-weight: 900; color: var(--accent-c, var(--primary)); }
.summary-card .lbl { font-size: .8rem; color: var(--text-2); margin-top: .1rem; }

.grid-overview { display: grid; grid-template-columns: 16.5rem 1fr; gap: 1.2rem; align-items: start; }
.filter-panel { position: sticky; top: 4.6rem; }
.fg-label { font-size: .8rem; font-weight: 700; color: var(--text-2); margin: .7rem 0 .45rem; }
.chip-group { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip-scroll { max-height: 15rem; overflow: auto; padding: 2px; }
.chip {
  font: inherit; font-size: .8rem; cursor: pointer; user-select: none;
  border: 1.5px solid var(--line); background: #FBFDFC; color: var(--text-2);
  padding: .3em .85em; border-radius: 999px; transition: all .18s ease;
}
.chip:hover { border-color: var(--primary-2); color: var(--primary); }
.chip.on { background: linear-gradient(135deg, var(--primary), var(--primary-2)); border-color: transparent; color: #fff; box-shadow: 0 3px 8px rgba(18,160,133,.3); }

.table-wrap { overflow: auto; }
table.stu { width: 100%; border-collapse: collapse; font-size: .84rem; }
table.stu th {
  text-align: left; font-weight: 500; color: var(--text-2); white-space: nowrap;
  padding: .6em .75em; background: #F6FAF8; position: sticky; top: 0;
}
table.stu td { padding: .58em .75em; border-bottom: 1px solid #EFF4F2; white-space: nowrap; }
table.stu tbody tr { transition: background .15s; }
table.stu tbody tr:hover { background: #F3FAF7; }
.grade-badge { display: inline-block; min-width: 3.4em; text-align: center; padding: .14em .6em; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.gb-优秀 { background: #E5F5E9; color: #1E7C3A; }
.gb-良好 { background: #E7F1FB; color: #1D63A8; }
.gb-及格 { background: #FBF3DC; color: #9C6B00; }
.gb-不及格 { background: #FCEFEF; color: #B03030; }
.link-btn { border: none; background: none; color: var(--primary-2); cursor: pointer; font: inherit; font-size: .82rem; font-weight: 500; padding: 0; }
.link-btn:hover { text-decoration: underline; }

.pager { display: flex; align-items: center; justify-content: flex-end; gap: .8rem; padding-top: 1rem; font-size: .84rem; color: var(--text-2); }
.pager button { min-width: 2.1em; }

/* ═══════════ 视图：学生画像 ═══════════ */
.search-card { margin-bottom: 1.2rem; }
.search-row { display: flex; gap: .8rem; }
.search-row input { flex: 1; font: inherit; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: .55em .9em; outline: none; background: #FBFDFC; transition: all .2s; }
.search-row input:focus { border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(18,160,133,.14); }

.stu-head { display: flex; justify-content: space-between; align-items: center; gap: 2rem; flex-wrap: wrap; }
.stu-name { font-size: 1.5rem; font-weight: 900; }
.gender-badge { margin-left: .6em; font-size: .78rem; padding: .2em .8em; border-radius: 999px; font-weight: 700; vertical-align: .25em; }
.gender-badge.m { background: #E7F1FB; color: #1D63A8; }
.gender-badge.f { background: #FDECF2; color: #C2447E; }
.stu-meta { color: var(--text-2); font-size: .85rem; margin-top: .35rem; }
.timeline { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.timeline .yr { font-size: .74rem; color: var(--text-3); margin-right: -0.2rem; }

.chart { width: 100%; }
.chart-trend { height: 340px; }
.chart-half { height: 300px; }
.chart-card:hover { transform: none; }

.grid-profile, .grid-report { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin-top: 1.2rem; align-items: start; }
.kv-list { display: flex; flex-direction: column; gap: .55rem; }
.kv { display: flex; justify-content: space-between; align-items: baseline; font-size: .88rem; border-bottom: 1px dashed var(--line); padding-bottom: .5rem; }
.kv .k { color: var(--text-2); }
.kv .v { font-weight: 700; }
.kv .v.up { color: var(--ok); }
.kv .v.down { color: var(--danger); }

.sug-list { display: flex; flex-direction: column; gap: .8rem; }
.sug { display: flex; gap: .8rem; align-items: flex-start; }
.sug-icon {
  flex: none; width: 2.1em; height: 2.1em; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 1.05rem; margin-top: .1em;
}
.sug-praise .sug-icon { background: #E5F5E9; }
.sug-improve .sug-icon { background: #E7F1FB; }
.sug-note .sug-icon { background: #FBF3DC; }
.sug-warn .sug-icon { background: #FCEFEF; }
.sug .sug-title { font-weight: 700; font-size: .9rem; margin-bottom: .2rem; }
.sug .sug-text { color: var(--text-2); font-size: .84rem; line-height: 1.65; }

/* ═══════════ 视图：班级报告 ═══════════ */
.gender-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin: 1.2rem 0; align-items: start; }
.gender-panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.3rem 1.5rem; animation: rise .45s ease backwards; }
.gender-panel:hover { box-shadow: var(--shadow-hover); }
.gp-head { display: flex; align-items: center; gap: .7em; margin-bottom: .9rem; }
.gp-dot { width: 12px; height: 12px; border-radius: 50%; }
.gp-head h3 { font-size: 1.02rem; }
.gp-head .hint { color: var(--text-3); font-size: .76rem; }
.gp-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; margin-bottom: .9rem; }
.gp-stat { background: #F6FAF8; border-radius: var(--radius-sm); padding: .6rem .8rem; text-align: center; }
.gp-stat .num { font-size: 1.25rem; font-weight: 900; }
.gp-stat .lbl { font-size: .74rem; color: var(--text-2); }
.dist-bar { display: flex; height: 1.35rem; border-radius: 999px; overflow: hidden; font-size: .72rem; color: #fff; }
.dist-bar div { display: flex; align-items: center; justify-content: center; min-width: 0; transition: width .6s ease; }
.dist-legend { display: flex; gap: 1em; margin-top: .5rem; font-size: .76rem; color: var(--text-2); flex-wrap: wrap; }
.dist-legend i { display: inline-block; width: .8em; height: .8em; border-radius: 3px; margin-right: .3em; vertical-align: -1px; }

/* ═══════════ 手动录入 ═══════════ */
.entry-row { margin-top: .6rem; }
.form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .9rem; }
.confirm-msg { color: var(--text-2); font-size: .92rem; line-height: 1.7; margin-bottom: 1.2rem; }
.btn-danger { background: linear-gradient(135deg, #C0392B, #D93838); color: #fff; box-shadow: 0 4px 14px rgba(217,56,56,.3); }
.btn-danger:hover { box-shadow: 0 6px 18px rgba(217,56,56,.4); transform: translateY(-1px); }
.scatter-year { font-size: .8rem; font-weight: 400; color: var(--text-3); margin-left: .4em; }
.row-ops { white-space: nowrap; }
.op-sep { color: var(--text-3); margin: 0 .3em; }

/* ═══════════ 数据管理（左树右表） ═══════════ */
.grid-admin { display: grid; grid-template-columns: 300px 1fr; gap: 1.2rem; align-items: start; }
.tree-panel { position: sticky; top: 4.6rem; }
.tree-year-row { display: flex; gap: .5rem; align-items: center; margin-bottom: .6rem; }
.tree-year-row select { flex: 1; font: inherit; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: .45em .6em; background: #FBFDFC; }
.tree-add-row { display: flex; gap: .5rem; margin-bottom: .8rem; }
.tree-add-row input { flex: 1; min-width: 0; font: inherit; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: .4em .6em; }
.btn-icon { border: 1.5px solid var(--line); background: #fff; border-radius: var(--radius-sm); cursor: pointer; padding: .3em .55em; font-size: .9rem; transition: all .2s; }
.btn-icon:hover { border-color: var(--danger); background: #FCEFEF; }
.fg-label { font-size: .74rem; color: var(--text-3); margin-bottom: .4rem; letter-spacing: .06em; }

.tree { max-height: 60vh; overflow: auto; padding-right: 4px; }
.tree-node {
  display: flex; align-items: center; gap: .45em; font-weight: 700; font-size: .9rem;
  color: var(--text); padding: .45em .4em; cursor: default; user-select: none;
}
.node-caret { color: var(--primary-2); font-size: .7rem; }
.node-count { margin-left: auto; font-size: .72rem; font-weight: 500; color: var(--primary); background: rgba(18,160,133,.1); padding: .1em .6em; border-radius: 999px; }
.tree-leaves { margin: 0 0 .3em .9em; border-left: 2px solid var(--bg-mint); padding-left: .4rem; }
.tree-leaf {
  display: flex; align-items: center; gap: .5em; padding: .38em .55em; border-radius: 8px;
  cursor: pointer; transition: background .15s, color .15s; font-size: .88rem; color: var(--text-2);
}
.tree-leaf:hover { background: #F1F8F5; color: var(--primary); }
.tree-leaf.selected { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; font-weight: 500; box-shadow: 0 3px 8px rgba(18,160,133,.25); }
.tree-leaf.selected .node-count { color: #fff; background: rgba(255,255,255,.22); }
.leaf-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaf-ops { display: flex; align-items: center; gap: .25em; opacity: 0; transition: opacity .15s; }
.tree-leaf:hover .leaf-ops, .tree-leaf.selected .leaf-ops { opacity: 1; }
.leaf-btn { border: none; background: none; cursor: pointer; font-size: .8rem; padding: .1em; color: inherit; opacity: .75; }
.leaf-btn:hover { opacity: 1; transform: scale(1.15); }

.roster-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .9rem; flex-wrap: wrap; }
.crumb { font-size: .95rem; color: var(--text-2); }
.crumb b { color: var(--primary); }
table.stu thead th { position: static; }

.source-badge { display: inline-block; padding: .12em .6em; border-radius: 999px; font-size: .74rem; font-weight: 500; }
.sb-maintained { background: #E5F5E9; color: #1E7C3A; }
.sb-derived { background: #EDF1F4; color: #52606D; }
.sb-both { background: #E7F1FB; color: #1D63A8; }

.lookup-bar { border-radius: var(--radius-sm); padding: .55em .9em; font-size: .85rem; margin: -.2rem 0 .9rem; line-height: 1.6; animation: rise .25s ease; }
.lookup-bar.ok { background: #EDF7EF; border: 1px solid #BFE3C8; color: #1E7C3A; }
.lookup-bar.warn { background: #FBF3DC; border: 1px solid #EAD59A; color: #9C6B00; }

@media (max-width: 1000px) { .grid-admin { grid-template-columns: 1fr; } .tree-panel { position: static; } }

/* ═══════════ 弹窗 ═══════════ */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; }
.modal-mask { position: absolute; inset: 0; background: rgba(15, 40, 34, .45); backdrop-filter: blur(3px); }
.modal-card {
  position: relative; width: 24rem; max-width: 92vw;
  background: #fff; border-radius: 20px; padding: 1.7rem 1.9rem;
  box-shadow: 0 30px 80px rgba(0,0,0,.3); animation: rise .35s ease;
}

@media (max-width: 1000px) {
  .grid-import, .grid-overview, .grid-profile, .grid-report, .gender-cols { grid-template-columns: 1fr; }
  .summary-row { grid-template-columns: repeat(2, 1fr); }
  .topbar { flex-wrap: wrap; height: auto; padding: .6rem 1rem; }
  .tabs { order: 3; width: 100%; overflow-x: auto; }
  .filter-panel { position: static; }
}
