/* 三七心育校园心理健康服务平台 V1.0 | 文件: styles/main.css | 全局样式与界面主题 */
/* ============================================================
   三七心育 · 校园心理健康服务平台 · 设计系统（优化润色版）
   保留「沉静蓝绿 + 暖砂」专业温暖调性，
   借鉴心航成长台画布的精致工艺：
   · 更大圆角（16/12）           · 主色柔影（蓝绿调 tint）
   · 渐变品牌标                  · 标题强调条
   · 更克制的留白与字号层级       · 输入框浅色底 + 1.5px 描边
   ============================================================ */

:root {
  /* 主色：沉静、可信赖（保留蓝绿识别） */
  --c-primary: #4F8AA8;
  --c-primary-d: #3E6E89;
  --c-primary-l: #EAF3F7;
  --c-primary-grad: linear-gradient(135deg, #4F8AA8 0%, #6FA9C4 100%);
  /* 辅助：生长的绿 */
  --c-green: #4FA67E;
  --c-green-l: #E9F5EF;
  --c-green-grad: linear-gradient(135deg, #4FA67E 0%, #6FBE96 100%);
  /* 暖色：关怀的温度 */
  --c-warm: #CE9A63;
  --c-warm-l: #FAF1E5;
  --c-coral: #C77E6B;

  /* 语义中性 */
  --c-bg: #F3F6F8;
  --c-surface: #FFFFFF;
  --c-surface-2: #FAFCFD;
  --c-text: #25323D;
  --c-text-soft: #5A6E7D;
  --c-text-mute: #92A1AE;
  --c-border: #E7EDF1;
  --c-border-soft: #EFF3F6;

  /* 风险等级（辅助参考，非诊断） */
  --r-normal: #4FA67E;
  --r-normal-bg: #E9F5EF;
  --r-watch: #CE9A63;
  --r-watch-bg: #FAF1E5;
  --r-alert: #D9824F;
  --r-alert-bg: #FBEEE3;
  --r-crisis: #C75B5B;
  --r-crisis-bg: #F9E6E6;

  /* 圆角（画布工艺：更大更亲和） */
  --radius: 16px;
  --radius-sm: 12px;
  /* 柔影：主色蓝绿调 tint，低透明度，现代通透 */
  --shadow: 0 2px 14px rgba(79, 138, 168, 0.08);
  --shadow-md: 0 10px 30px rgba(79, 138, 168, 0.14);
  --shadow-glow: 0 8px 24px rgba(79, 138, 168, 0.22);

  --sidebar-w: 256px;
  --font: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--c-bg);
  color: var(--c-text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--c-primary-l); color: var(--c-primary-d); }

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #31566A 0%, #294A5C 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 40;
  transition: transform 0.25s ease;
  box-shadow: 4px 0 24px rgba(52, 92, 115, 0.18);
}
.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }

/* ---------- 品牌区 ---------- */
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px 16px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, #6FA9C4 0%, #4F8AA8 100%);
  display: grid; place-items: center; flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(79, 138, 168, 0.4);
}
.brand-text strong { display: block; font-size: 16px; letter-spacing: 1px; font-weight: 800; }
.brand-text span { display: block; font-size: 11px; opacity: 0.7; margin-top: 2px; }

/* ---------- 导航 ---------- */
.nav { padding: 2px 12px 10px; flex: 1; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center;
  padding: 8px 11px; margin: 2px 0;
  border-radius: 8px;
  color: rgba(255,255,255,0.76);
  text-decoration: none; font-size: 13.5px; font-weight: 500;
  transition: all 0.15s; cursor: pointer; position: relative;
}
.nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-item.active { background: rgba(255,255,255,0.13); color: #fff; font-weight: 700; }
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: #A9D4E8;
}

.sidebar-foot { padding: 14px 16px 18px; }
.care-card {
  background: rgba(255,255,255,0.09);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 12px;
  color: rgba(255,255,255,0.88);
  border: 1px solid rgba(255,255,255,0.08);
}
.care-card p { font-style: italic; margin-bottom: 6px; line-height: 1.5; }
.care-card span { opacity: 0.7; font-size: 11px; }
.privacy-tag { font-size: 10px; opacity: 0.55; margin-top: 10px; text-align: center; }

/* ---------- 顶栏 ---------- */
.topbar {
  height: 60px; background: rgba(255,255,255,0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; gap: 14px;
  padding: 0 24px; position: sticky; top: 0; z-index: 30;
}
.page-title-wrap { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.system-badge {
  display: inline-flex; align-items: center;
  font-size: 12px; font-weight: 600; color: #fff;
  padding: 5px 12px; border-radius: 14px;
  letter-spacing: 0.3px; white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.page-title { font-size: 19px; font-weight: 700; flex: 1; letter-spacing: 0.3px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.semester { font-size: 12px; color: var(--c-primary-d); background: var(--c-primary-l); padding: 5px 13px; border-radius: 20px; font-weight: 600; }
.role-tag { font-size: 12px; color: var(--c-text-mute); }
.menu-toggle { display: none; background: none; border: none; font-size: 20px; color: var(--c-text); cursor: pointer; }

/* ---------- 顶栏：总览快捷入口（在主导航最上方） ---------- */
.nav-overview {
  margin: 6px 12px 12px; padding: 11px 12px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  font-weight: 600;
  color: #fff;
}
.nav-overview:hover { background: rgba(255,255,255,0.22); }

/* ---------- 五层工作架构导航 ---------- */
.nav-group { margin: 5px 0 10px; padding-left: 8px; border-left: 1px solid rgba(255,255,255,0.12); }
.nav-group-title {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 9px 5px;
  font-size: 11px; font-weight: 600;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.4px;
  text-transform: none;
  margin-bottom: 2px;
}
.nav-group-dot { display: none; }
.nav-group-level { color: #A9D4E8; font-size: 10px; font-weight: 800; letter-spacing: 0.5px; }
.nav-group-label { color: rgba(255,255,255,0.9); font-size: 12px; font-weight: 700; letter-spacing: 0.5px; }
.nav-group-items { padding: 1px 0 1px 5px; }
.nav-group-items .nav-item {
  font-size: 13px; padding: 7px 10px; margin: 1px 0;
}
.nav-group-governance {
  padding: 3px 4px 5px 9px;
  border: 1px solid rgba(255,255,255,0.11);
  border-radius: 9px;
  background: rgba(255,255,255,0.04);
}

/* ---------- 七大子系统卡片（仪表盘） ---------- */
.system-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px; margin-top: 16px;
}
.system-card {
  --card-color: var(--c-primary);
  position: relative;
  background: var(--c-surface);
  border-radius: var(--radius);
  padding: 20px 20px 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--c-border-soft);
  border-top: 3px solid var(--card-color);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}
.system-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.system-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.system-card-ico {
  width: 40px; height: 40px; border-radius: 10px;
  background: color-mix(in srgb, var(--card-color) 12%, white);
  display: grid; place-items: center;
  font-size: 22px;
}
.system-card-title {
  font-size: 14.5px; font-weight: 700; color: var(--card-color);
  letter-spacing: 0.4px; line-height: 1.4;
}
.system-card-desc {
  font-size: 12.5px; color: var(--c-text-soft); line-height: 1.7;
  min-height: 42px; margin: 6px 0 12px;
}
.system-card-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.system-card-pill {
  font-size: 11px; padding: 3px 9px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--card-color) 8%, white);
  color: var(--card-color);
  border: 1px solid color-mix(in srgb, var(--card-color) 22%, white);
}
.system-card-foot {
  display: flex; align-items: center; justify-content: flex-end;
  font-size: 12px; color: var(--card-color); font-weight: 600;
  padding-top: 8px;
  border-top: 1px dashed var(--c-border);
}
.system-card-foot-text { letter-spacing: 0.5px; }

/* ---------- 管理与支持圈 ---------- */
.role-mandate {
  display: grid;
  grid-template-columns: minmax(190px, 0.8fr) minmax(220px, 1fr) minmax(220px, 1fr);
  gap: 0;
  margin: 16px 0 20px;
  background: #FFFFFF;
  border: 1px solid #DDE7EC;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.role-mandate-title, .role-mandate-item { padding: 16px 18px; }
.role-mandate-title { background: #F0F6F8; }
.role-mandate-kicker, .role-mandate-item > span {
  display: block; color: var(--c-text-mute); font-size: 10px; font-weight: 700;
  letter-spacing: 0.8px; margin-bottom: 4px;
}
.role-mandate-title strong { color: #2F566A; font-size: 14px; }
.role-mandate-item { border-left: 1px solid var(--c-border); }
.role-mandate-item p { color: var(--c-text-soft); font-size: 12px; line-height: 1.65; }
.role-mandate-note {
  grid-column: 1 / -1; padding: 8px 18px; background: #FAFCFD;
  border-top: 1px solid var(--c-border); color: var(--c-text-soft); font-size: 11px;
}

.support-circle {
  background: linear-gradient(135deg, #FFFFFF 0%, #F6FAFC 100%);
  border: 1px solid #DDE9EF;
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow);
}

/* ---------- 专业标准中心 ---------- */
.standard-role-card {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 28px;
  margin-top: 16px; padding: 22px 24px; border: 1px solid #DCE7EC;
  border-radius: 16px; background: linear-gradient(135deg, #FFFFFF 0%, #F4F8FA 100%);
  box-shadow: var(--shadow);
}
.standard-role-card h2 { color: #2E566A; font-size: 20px; margin: 2px 0 7px; }
.standard-role-card p { color: var(--c-text-soft); font-size: 12.5px; line-height: 1.75; }
.standard-boundary {
  flex: 0 0 320px; padding: 13px 15px; border-left: 3px solid #CE9A63;
  background: #FBF7F1; border-radius: 0 10px 10px 0;
}
.standard-boundary span { color: #99693D; font-size: 10px; font-weight: 800; letter-spacing: 1px; }
.standard-flow {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px; margin-top: 16px;
}
.standard-step {
  display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px;
  padding: 16px; background: #FFFFFF; border: 1px solid var(--c-border);
  border-radius: 12px; box-shadow: var(--shadow);
}
.standard-step-no { color: #6C94A7; font-size: 11px; font-weight: 800; letter-spacing: 0.6px; }
.standard-step h3 { color: #304B5B; font-size: 13.5px; margin-bottom: 3px; }
.standard-step p { color: var(--c-text-soft); font-size: 11.5px; line-height: 1.55; }
.standard-output { margin-top: 8px; color: #4D7385; font-size: 11px; line-height: 1.6; }
.standard-matrix { overflow-x: auto; }
.standard-quality h3 { color: #355A6D; font-size: 14px; margin-bottom: 10px; }
.standard-quality ul { margin: 0; padding-left: 18px; }
.standard-quality li { color: var(--c-text-soft); font-size: 12px; margin: 5px 0; }

/* ---------- 一生一导师关怀 ---------- */
.mentor-boundary {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px; overflow: hidden; border: 1px solid #DDE7EC;
  border-radius: 14px; background: #DDE7EC; box-shadow: var(--shadow);
}
.mentor-boundary-item { padding: 16px 18px; background: #FFFFFF; }
.mentor-boundary-item strong { color: #355B6D; font-size: 12px; }
.mentor-boundary-item p { color: var(--c-text-soft); font-size: 11.5px; line-height: 1.7; margin-top: 5px; }
.mentor-student-card { padding: 16px; }
.mentor-student-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.mentor-student-head strong { color: #2F4C5C; font-size: 14px; }
.mentor-student-foot {
  display: flex; justify-content: space-between; gap: 8px; margin-top: 12px;
  padding-top: 9px; border-top: 1px solid var(--c-border);
  color: var(--c-text-mute); font-size: 10.5px;
}

@media (max-width: 1050px) {
  .role-mandate { grid-template-columns: 1fr 1fr; }
  .role-mandate-title { grid-column: 1 / -1; }
  .standard-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .role-mandate { grid-template-columns: 1fr; }
  .role-mandate-title, .role-mandate-item { grid-column: 1; border-left: 0; border-top: 1px solid var(--c-border); }
  .role-mandate-title { border-top: 0; }
  .standard-role-card { flex-direction: column; }
  .standard-boundary { flex-basis: auto; width: 100%; }
  .standard-flow { grid-template-columns: 1fr; }
  .mentor-boundary { grid-template-columns: 1fr; }
}
.support-circle-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 24px; margin-bottom: 20px;
}
.eyebrow {
  color: var(--c-primary-d); font-size: 11px; font-weight: 800;
  letter-spacing: 1.2px; margin-bottom: 5px;
}
.support-circle h2, .section-heading h2, .admin-governance-panel h2 {
  font-size: 20px; line-height: 1.35; color: #233845;
}
.support-circle-head p, .section-heading p, .admin-governance-panel p {
  color: var(--c-text-soft); font-size: 12.5px; margin-top: 6px; line-height: 1.7;
}
.support-principle {
  flex: 0 0 280px; padding: 12px 14px; border-radius: 10px;
  background: #EAF3F7; color: #315D73; font-size: 12px; font-weight: 700;
}
.support-layer-grid {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px;
}
.support-layer {
  min-height: 150px; padding: 14px 13px; border: 1px solid var(--c-border);
  border-radius: 12px; background: #fff;
}
.support-layer-no {
  display: block; font-size: 11px; color: var(--c-primary); font-weight: 800;
  letter-spacing: 1px; margin-bottom: 9px;
}
.support-layer strong { display: block; font-size: 13px; color: #2E4654; margin-bottom: 6px; }
.support-layer p { font-size: 11.5px; color: var(--c-text-soft); line-height: 1.65; }
.section-heading {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin: 28px 0 12px;
}
.section-heading h2 { font-size: 17px; }
.section-heading p { margin-top: 3px; }
.admin-governance-panel {
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  margin-top: 18px; padding: 20px 22px; border: 1px solid #D9E1E7;
  border-left: 4px solid #6D7890; border-radius: 14px; background: #F8FAFB;
}
.admin-governance-panel h2 { font-size: 17px; }

@media (max-width: 1080px) {
  .support-layer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .support-circle-head, .admin-governance-panel { flex-direction: column; }
  .support-principle { flex-basis: auto; width: 100%; }
  .support-layer-grid { grid-template-columns: 1fr; }
}

/* ---------- 内容区 ---------- */
.content { padding: 24px; flex: 1; max-width: 1320px; width: 100%; animation: sqxyFadeIn 0.18s ease; }

/* 路由切换 / 登录浮层淡入，让各环节更丝滑 */
@keyframes sqxyFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes sqxyFadeOut { from { opacity: 1; } to { opacity: 0; } }
.login-screen .login-card { animation: sqxyFadeIn 0.25s ease; }
/* 身份切换/登录进出场：整屏淡入，避免生硬闪断 */
.login-screen.fade-in { animation: sqxyFadeIn 0.28s ease; }
.app.fade-in { animation: sqxyFadeIn 0.3s ease; }
#view.fade-in { animation: sqxyFadeIn 0.22s ease; }

/* 切换身份：居中弹框淡入 + 卡片缩放 */
@keyframes roleSwitchIn { from { background-color: rgba(15,28,40,0); } to { background-color: rgba(15,28,40,0.55); } }
@keyframes roleSwitchScale { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
#roleSwitchOverlay .role-tile:hover { border-color: #4F8AA8 !important; background: #F0F6FA !important; }

/* ---------- 通用组件 ---------- */
.card {
  background: var(--c-surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px;
  border: 1px solid var(--c-border-soft);
  transition: box-shadow 0.2s ease;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.card-title { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-title::before { content: ''; width: 4px; height: 17px; border-radius: 2px; background: var(--c-primary); display: inline-block; }
.card-sub { font-size: 12px; color: var(--c-text-mute); margin-top: 2px; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1080px) { .grid-4 { grid-template-columns: repeat(2,1fr);} .grid-3{grid-template-columns:repeat(2,1fr);} }
@media (max-width: 720px) { .grid-2,.grid-3,.grid-4 { grid-template-columns: 1fr; } }

/* 指标卡 */
.stat {
  background: var(--c-surface); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); border: 1px solid var(--c-border-soft);
  display: flex; flex-direction: column; gap: 6px;
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}
.stat:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-label { font-size: 12px; color: var(--c-text-soft); font-weight: 500; }
.stat-val { font-size: 28px; font-weight: 700; color: var(--c-text); line-height: 1.1; }
.stat-val small { font-size: 14px; font-weight: 500; color: var(--c-text-mute); }
.stat-trend { font-size: 11px; color: var(--c-green); font-weight: 600; }
.stat-ico { display: none; }
.si-blue { background: var(--c-primary-l); color: var(--c-primary); }
.si-green { background: var(--c-green-l); color: var(--c-green); }
.si-warm { background: var(--c-warm-l); color: var(--c-warm); }
.si-coral { background: #F8E7E1; color: var(--c-coral); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 18px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--c-border); background: var(--c-surface);
  color: var(--c-text); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all 0.15s; font-family: inherit;
}
.btn:hover { border-color: var(--c-primary); color: var(--c-primary); }
.btn-primary { background: var(--c-primary); border-color: var(--c-primary); color: #fff; box-shadow: 0 4px 12px rgba(79, 138, 168, 0.25); }
.btn-primary:hover { background: var(--c-primary-d); border-color: var(--c-primary-d); color: #fff; }
.btn-warm { background: var(--c-warm); border-color: var(--c-warm); color: #fff; }
.btn-warm:hover { filter: brightness(0.95); color: #fff; }
.btn-sm { padding: 0 14px; min-height: 34px; font-size: 12px; border-radius: 10px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--c-primary); padding: 6px 10px; font-weight: 600; }
.btn-ghost:hover { background: var(--c-primary-l); }

/* 表格 */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; padding: 11px 13px; color: var(--c-text-soft); font-weight: 700; border-bottom: 2px solid var(--c-border); white-space: nowrap; }
.tbl td { padding: 11px 13px; border-bottom: 1px solid var(--c-border-soft); }
.tbl tr:hover td { background: var(--c-surface-2); }
.tbl .mono { font-family: ui-monospace, monospace; color: var(--c-text-soft); }

/* 标签 */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 11px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.tag-normal { background: var(--r-normal-bg); color: var(--r-normal); }
.tag-watch { background: var(--r-watch-bg); color: #a9783f; }
.tag-alert { background: var(--r-alert-bg); color: var(--r-alert); }
.tag-crisis { background: var(--r-crisis-bg); color: var(--r-crisis); }
.tag-info { background: var(--c-primary-l); color: var(--c-primary); }
.tag-warm { background: var(--c-warm-l); color: var(--c-warm); }

/* 风险等级点 */
.r-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.r-normal .r-dot, .r-dot-normal { background: var(--r-normal); }
.r-watch .r-dot, .r-dot-watch { background: var(--r-watch); }
.r-alert .r-dot, .r-dot-alert { background: var(--r-alert); }
.r-crisis .r-dot, .r-dot-crisis { background: var(--r-crisis); }

/* 表单 */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--c-text-soft); margin-bottom: 6px; font-weight: 600; }
.field .req { color: var(--r-crisis); }
.input, .select, .textarea {
  width: 100%; padding: 10px 13px; border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm); font-size: 13px; font-family: inherit;
  background: #FAFCFD; color: var(--c-text); transition: border 0.15s, background 0.15s;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--c-primary); background: #fff; box-shadow: 0 0 0 3px var(--c-primary-l); }
.textarea { resize: vertical; min-height: 80px; }

/* 选项组（量表） */
.opt-group { display: flex; flex-direction: column; gap: 6px; }
.opt-row { display: flex; gap: 8px; flex-wrap: wrap; }
.opt-chip {
  padding: 8px 15px; border: 1.5px solid var(--c-border); border-radius: 20px;
  font-size: 13px; cursor: pointer; transition: all 0.12s; background: #FAFCFD; font-weight: 500;
}
.opt-chip:hover { border-color: var(--c-primary); }
.opt-chip.sel { background: var(--c-primary); color: #fff; border-color: var(--c-primary); font-weight: 600; }

/* 图表 */
.chart, .chart-donut { display: block; max-width: 100%; height: auto; }
.chart-axis { font-size: 11px; fill: var(--c-text-mute); }
.chart-val { font-size: 11px; fill: var(--c-text-soft); font-weight: 600; }
.chart-donut-val { font-size: 26px; font-weight: 700; fill: var(--c-text); }
.chart-donut-label { font-size: 11px; fill: var(--c-text-mute); }
.chart-ring-val { font-size: 15px; font-weight: 700; fill: var(--c-text); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 10px; justify-content: center; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--c-text-soft); }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend-line { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }

/* 时间轴 */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 4px; bottom: 4px; width: 2px; background: var(--c-border); }
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item::before { content: ''; position: absolute; left: -19px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--c-surface); border: 2px solid var(--c-primary); }
.tl-date { font-size: 12px; color: var(--c-text-mute); }
.tl-body { font-size: 13px; margin-top: 2px; }

/* 进度条 */
.progress { height: 8px; background: var(--c-border-soft); border-radius: 6px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--c-green); border-radius: 6px; transition: width 0.4s; }

/* 看板列 */
.kanban { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
@media (max-width: 1080px){ .kanban{ grid-template-columns: repeat(2,1fr);} }
@media (max-width: 640px){ .kanban{ grid-template-columns: 1fr;} }
.k-col { background: var(--c-surface-2); border-radius: var(--radius); padding: 12px; border: 1px solid var(--c-border-soft); }
.k-col-h { font-size: 13px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.k-card { background: var(--c-surface); border: 1px solid var(--c-border-soft); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 8px; box-shadow: var(--shadow); cursor: pointer; transition: transform 0.12s, box-shadow 0.12s; }
.k-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* 提示框 */
.note { border-left: 3px solid var(--c-primary); background: var(--c-primary-l); padding: 12px 14px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 13px; color: var(--c-text-soft); }
.note-warm { border-color: var(--c-warm); background: var(--c-warm-l); }
.note-warn { border-color: var(--r-crisis); background: var(--r-crisis-bg); color: #9c4444; }
.note strong { color: var(--c-text); }

/* 步骤条 */
.steps { display: flex; gap: 0; margin-bottom: 18px; flex-wrap: wrap; }
.step { flex: 1; min-width: 100px; text-align: center; position: relative; padding-top: 28px; font-size: 12px; color: var(--c-text-mute); }
.step::before { content: attr(data-n); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 24px; height: 24px; border-radius: 50%; background: var(--c-border); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.step.done::before { background: var(--c-green); }
.step.active::before { background: var(--c-primary); box-shadow: 0 0 0 4px var(--c-primary-l); }
.step span { display: block; }

/* 浮层/弹窗 */
.overlay { position: fixed; inset: 0; background: rgba(37, 50, 61, 0.42); z-index: 50; backdrop-filter: blur(2px); }
.modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); background: var(--c-surface); border-radius: var(--radius); box-shadow: var(--shadow-md); z-index: 60; width: min(640px, 92vw); max-height: 86vh; overflow-y: auto; padding: 24px; }
.modal-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-h h3 { font-size: 18px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 22px; color: var(--c-text-mute); cursor: pointer; line-height: 1; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* Toast */
.toast-wrap { position: fixed; top: 76px; right: 24px; z-index: 70; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--c-text); color: #fff; padding: 11px 18px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; box-shadow: var(--shadow-md); animation: tin 0.25s ease; }
.toast.ok { background: var(--c-green); }
.toast.warn { background: var(--r-crisis); }
@keyframes tin { from { opacity: 0; transform: translateX(20px); } }

/* 杂项 */
.muted { color: var(--c-text-mute); }
.soft { color: var(--c-text-soft); }
.center { text-align: center; }
.right { text-align: right; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt20 { margin-top: 20px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; }
.flex { display: flex; } .between { justify-content: space-between; } .aic { align-items: center; } .gap8{gap:8px;} .gap12{gap:12px;}
.wrap { flex-wrap: wrap; }
.hidden { display: none !important; }
.empty { text-align: center; padding: 40px 20px; color: var(--c-text-mute); font-size: 13px; }
hr.sep { border: none; border-top: 1px solid var(--c-border-soft); margin: 16px 0; }
.section-title { font-size: 14px; font-weight: 700; color: var(--c-text); margin: 4px 0 12px; display: flex; align-items: center; gap: 8px; }
.section-title::before { content: ''; width: 4px; height: 15px; background: var(--c-primary); border-radius: 2px; }

/* 打印 */
@media print {
  .sidebar, .topbar, .btn, .menu-toggle { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  body { background: #fff; }
}

/* 响应式侧栏 */
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); box-shadow: 4px 0 24px rgba(0,0,0,0.28); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-toggle { display: block; }
  .content { padding: 16px; }
  /* 抽屉打开时的遮罩 */
  body.sidebar-open::after {
    content: ''; position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 35;
  }
  .topbar-right { gap: 8px; }
  .semester { display: none; }
}

/* 窄屏顶栏：学期标签收起，AI 按钮与角色紧凑 */
@media (max-width: 560px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .page-title { font-size: 16px; }
  .system-badge { font-size: 11px; padding: 4px 10px; }
  .ai-tool-btn { font-size: 11px; padding: 5px 9px; }
  .role-tag { font-size: 10px; }
  .content { padding: 12px; }
  .brand-text span { display: none; }
  .care-card, .privacy-tag { display: none; }
  .sidebar { width: 84%; max-width: 300px; }
}

/* =====================================================================
   B：登录屏（B 阶段 · 真实角色鉴权）—— 全屏遮罩 + 居中卡片
   必须用 position:fixed; inset:0; 否则会被文档流挤压
   ===================================================================== */
.login-screen {
  position: fixed; inset: 0; z-index: 999;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(1200px 600px at 20% 10%, rgba(111, 169, 196, 0.18) 0%, transparent 60%),
    radial-gradient(1000px 500px at 80% 90%, rgba(79, 138, 168, 0.18) 0%, transparent 55%),
    linear-gradient(135deg, #eaf2f6 0%, #f6f8fb 100%);
  padding: 20px;
}
.login-screen[hidden] { display: none !important; }
.login-screen .login-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 18px 60px rgba(52, 92, 115, 0.18), 0 2px 8px rgba(52, 92, 115, 0.06);
  padding: 30px 34px 26px;
  width: 100%;
  max-width: 460px;
  border: 1px solid rgba(79, 138, 168, 0.12);
}
.login-screen .login-brand {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 14px; margin-bottom: 14px;
  border-bottom: 1px solid #eef2f5;
}
.login-screen .login-roles {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 8px 0 14px;
}
.login-screen .login-role {
  border: 1px solid #d3dde3;
  background: #fff;
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 13px;
  color: #345C73;
  transition: all 0.15s;
}
.login-screen .login-role:hover { border-color: #4F8AA8; color: #4F8AA8; }
.login-screen .login-role.active {
  background: linear-gradient(135deg, #4F8AA8, #3E6E89);
  color: #fff;
  border-color: #3E6E89;
  box-shadow: 0 4px 12px rgba(79, 138, 168, 0.3);
}
.login-screen .login-field { margin-top: 14px; }
.login-screen .login-field label {
  display: block;
  font-size: 12px;
  color: #7d8a93;
  margin-bottom: 6px;
  font-weight: 500;
}
.login-screen .login-err {
  color: #b04848;
  font-size: 12px;
  min-height: 18px;
  margin: 8px 0 4px;
}
.login-screen .login-btn {
  width: 100%;
  margin-top: 4px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
}
.login-screen .login-hint { line-height: 1.6; }
.filing-link {
  color: #7d8a93;
  font-size: 12px;
  text-align: center;
}
.filing-link a,
.site-footer a {
  color: inherit;
  text-decoration: none;
}
.filing-link a:hover,
.site-footer a:hover { text-decoration: underline; }
.filing-link-login { margin-top: 12px; }
.site-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 14px 24px 20px;
  color: #7d8a93;
  font-size: 12px;
}
.login-screen .care-card {
  margin-top: 18px;
  padding: 12px 14px;
  background: rgba(79, 138, 168, 0.06);
  border: 1px dashed rgba(79, 138, 168, 0.25);
  border-radius: 10px;
  font-size: 11px;
  color: #5a6873;
  font-style: italic;
  line-height: 1.6;
}

@media (max-width: 560px) {
  .login-screen .login-card { padding: 22px 20px; }
  .login-screen .login-role { padding: 6px 11px; font-size: 12px; }
}

/* =====================================================================
   顶栏辅助操作
   ===================================================================== */
.ai-tool-btn {
  border: 1px solid #DDE5EA;
  background: #FFFFFF;
  color: #526875;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s;
}
.ai-tool-btn:hover { background: #F3F7F9; border-color: #C9D7DE; }
.ai-tool-btn.active {
  background: #D9824F; color: #fff;
  border-color: #D9824F;
}
.ai-tool-btn.backup-btn {
  background: rgba(79, 138, 168, 0.1);
  color: #3E6E89;
}
.ai-tool-btn.backup-btn:hover { background: rgba(79, 138, 168, 0.2); }

/* 异常表现（grouped_multi）—— 单列清晰布局，每组独占一行，组内横向 badge 不换行 */
.gm-group { border: 1px solid #E6E0D6; background: #FBFAF7; border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; }
.gm-group-name { font-size: 12px; font-weight: 600; color: #8A7A5C; margin-bottom: 8px; padding-left: 4px; border-left: 3px solid #CE9A63; }
.gm-options { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.gm-opt { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; cursor: pointer; background: #fff; border: 1px solid #E0D5C7; border-radius: 16px; padding: 5px 12px; line-height: 1.4; transition: all 0.15s; white-space: nowrap; }
.gm-opt:hover { background: #F5EFE5; border-color: #C9B68A; }
.gm-opt input { margin: 0; accent-color: #C75B5B; cursor: pointer; }
.gm-opt.is-checked { background: #FCF0EE; border-color: #C75B5B; color: #8a3636; }
