/* ============================================================
   学生成绩管理系统 — 设计系统
   清新简约教育风 · 浅蓝主色 / 浅绿辅助 / 暖橙点缀
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700;900&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  /* ---- 主色：浅蓝 ---- */
  --blue-50:  oklch(0.97 0.02 233);
  --blue-100: oklch(0.93 0.04 233);
  --blue-200: oklch(0.86 0.07 233);
  --blue-400: oklch(0.74 0.11 233);
  --blue-500: oklch(0.66 0.13 233);
  --blue-600: oklch(0.58 0.13 233);

  /* ---- 辅助：浅绿 ---- */
  --green-50:  oklch(0.96 0.03 162);
  --green-100: oklch(0.92 0.05 162);
  --green-400: oklch(0.76 0.12 162);
  --green-500: oklch(0.68 0.13 162);
  --green-600: oklch(0.60 0.12 162);

  /* ---- 点缀：暖橙 / 暖黄（积分·激励） ---- */
  --orange-50:  oklch(0.96 0.03 62);
  --orange-100: oklch(0.92 0.06 62);
  --orange-400: oklch(0.78 0.13 56);
  --orange-500: oklch(0.72 0.15 52);
  --gold-400:   oklch(0.85 0.12 88);

  /* ---- 语义色 ---- */
  --coral:   oklch(0.70 0.15 25);   /* 薄弱 / 下滑 */
  --coral-50:oklch(0.96 0.03 25);
  --teal:    oklch(0.72 0.10 195);
  --purple:  oklch(0.66 0.13 290);

  /* ---- 中性（冷调） ---- */
  --bg:        oklch(0.975 0.008 233);
  --surface:   #ffffff;
  --surface-2: oklch(0.985 0.006 233);
  --surface-3: oklch(0.965 0.010 233);
  --ink:    oklch(0.27 0.02 250);
  --ink-2:  oklch(0.46 0.02 250);
  --ink-3:  oklch(0.64 0.02 250);
  --ink-4:  oklch(0.78 0.015 250);
  --line:   oklch(0.92 0.012 233);
  --line-2: oklch(0.95 0.010 233);

  /* ---- 学科色板 ---- */
  --sub-chinese: oklch(0.68 0.15 25);    /* 语文 红 */
  --sub-math:    oklch(0.66 0.13 233);   /* 数学 蓝 */
  --sub-english: oklch(0.68 0.13 162);   /* 英语 绿 */
  --sub-physics: oklch(0.66 0.13 290);   /* 物理 紫 */
  --sub-chem:    oklch(0.74 0.13 56);    /* 化学 橙 */
  --sub-bio:     oklch(0.72 0.10 195);   /* 生物 青 */

  /* ---- 圆角 / 阴影 ---- */
  --r-sm: 10px;
  --r:    14px;
  --r-lg: 20px;
  --r-xl: 26px;
  --shadow-sm: 0 1px 2px oklch(0.55 0.05 233 / 0.06), 0 1px 3px oklch(0.55 0.05 233 / 0.05);
  --shadow:    0 2px 8px oklch(0.55 0.05 233 / 0.07), 0 8px 24px oklch(0.55 0.05 233 / 0.06);
  --shadow-lg: 0 8px 24px oklch(0.55 0.05 233 / 0.10), 0 18px 50px oklch(0.55 0.05 233 / 0.10);

  --sidebar-w: 232px;
  --topbar-h: 66px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Noto Sans SC', 'PingFang SC', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 14px;
  line-height: 1.5;
}
.num, .stat-num { font-family: 'Outfit', 'Noto Sans SC', sans-serif; font-variant-numeric: tabular-nums; }

h1,h2,h3,h4,h5 { margin: 0; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
svg { display: block; }

/* ============================================================
   布局外壳
   ============================================================ */
.app { display: flex; min-height: 100vh; }

/* ---- 左侧菜单 ---- */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  z-index: 30;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 20px 22px 18px;
}
.brand .logo {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(145deg, var(--blue-400), var(--green-400));
  display: grid; place-items: center;
  box-shadow: 0 4px 12px oklch(0.66 0.13 233 / 0.30);
  flex: 0 0 auto;
}
.brand .logo svg { width: 22px; height: 22px; }
.brand .name { font-weight: 900; font-size: 16px; letter-spacing: -0.02em; }
.brand .name small { display:block; font-weight: 500; font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.06em; }

.nav { padding: 6px 14px; flex: 1; overflow-y: auto; }
.nav .group-label {
  font-size: 11px; font-weight: 700; color: var(--ink-4);
  letter-spacing: 0.08em; padding: 16px 12px 7px;
}
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--r-sm);
  color: var(--ink-2); font-weight: 500; font-size: 13.5px;
  margin-bottom: 2px; transition: background .15s, color .15s;
  position: relative;
}
.nav a svg { width: 19px; height: 19px; flex: 0 0 auto; opacity: .85; }
.nav a:hover { background: var(--surface-3); color: var(--ink); }
.nav a.active {
  background: var(--blue-50); color: var(--blue-600); font-weight: 700;
}
.nav a.active svg { opacity: 1; }
.nav a .badge-dot {
  margin-left: auto; background: var(--coral); color:#fff;
  font-size: 10px; font-weight: 700; min-width: 18px; height: 18px;
  border-radius: 9px; display: grid; place-items: center; padding: 0 5px;
}
.sidebar-foot { padding: 14px; border-top: 1px solid var(--line-2); }
.role-pill {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--line);
}
.role-pill .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex:0 0 auto; }
.role-pill .ico svg { width: 17px; height: 17px; }
.role-pill .t { font-size: 12.5px; font-weight: 700; line-height: 1.2; }
.role-pill .s { font-size: 11px; color: var(--ink-3); }

/* ---- 主区 ---- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---- 顶栏 ---- */
.topbar {
  height: var(--topbar-h); flex: 0 0 var(--topbar-h);
  background: oklch(1 0 0 / 0.82); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px;
  padding: 0 28px; position: sticky; top: 0; z-index: 20;
}
.topbar .page-title { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.topbar .crumb { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.topbar .spacer { flex: 1; }
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 15px; width: 240px; color: var(--ink-3);
}
.search svg { width: 16px; height: 16px; }
.search input { border: none; background: none; outline: none; font-size: 13px; color: var(--ink); width: 100%; font-family: inherit; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--line); position: relative;
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--coral); border: 1.5px solid #fff; }

/* 子女切换下拉（家长端） */
.child-switch {
  display: flex; align-items: center; gap: 9px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px 5px 6px; box-shadow: var(--shadow-sm);
}
.child-switch .avt { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; flex: 0 0 auto; }
.child-switch .t { font-size: 13px; font-weight: 700; line-height: 1.1; }
.child-switch .s { font-size: 10.5px; color: var(--ink-3); }
.child-switch svg { width: 16px; height: 16px; color: var(--ink-3); }

.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items:center; color:#fff; font-weight: 700; font-size: 15px; flex:0 0 auto; }

.content { padding: 28px; flex: 1; }
.content-narrow { max-width: 1180px; margin: 0 auto; width: 100%; }

/* ============================================================
   组件
   ============================================================ */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.card-head h3 { font-size: 15.5px; }
.card-head .sub { font-size: 12px; color: var(--ink-3); }
.card-head .spacer { flex: 1; }

.section-title { font-size: 13px; font-weight: 800; color: var(--ink-2); letter-spacing: 0.02em; display:flex; align-items:center; gap:8px; margin-bottom: 14px; }
.section-title .bar { width: 4px; height: 15px; border-radius: 2px; background: var(--blue-400); }

/* 网格 */
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }

/* 统计卡 */
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.stat .ico { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 14px; }
.stat .ico svg { width: 22px; height: 22px; }
.stat .label { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.stat .value { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; margin-top: 3px; line-height: 1; }
.stat .value small { font-size: 15px; font-weight: 700; color: var(--ink-3); margin-left: 2px; }
.stat .trend { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; margin-top: 9px; padding: 3px 8px; border-radius: 999px; }
.trend.up { color: var(--green-600); background: var(--green-50); }
.trend.down { color: var(--coral); background: var(--coral-50); }
.trend.flat { color: var(--ink-3); background: var(--surface-3); }

/* 标签 / 徽章 */
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 4px 11px; border-radius: 999px; }
.tag.blue { color: var(--blue-600); background: var(--blue-50); }
.tag.green { color: var(--green-600); background: var(--green-50); }
.tag.orange { color: var(--orange-500); background: var(--orange-50); }
.tag.coral { color: var(--coral); background: var(--coral-50); }
.tag.gray { color: var(--ink-2); background: var(--surface-3); }
.tag .dt { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; font-weight: 700; font-size: 14px;
  transition: transform .12s, box-shadow .12s, background .15s;
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue-500); color: #fff; box-shadow: 0 6px 16px oklch(0.66 0.13 233 / 0.30); }
.btn-primary:hover { background: var(--blue-600); }
.btn-green { background: var(--green-500); color:#fff; box-shadow: 0 6px 16px oklch(0.68 0.13 162 / 0.28); }
.btn-warm { background: var(--orange-400); color:#fff; box-shadow: 0 6px 16px oklch(0.78 0.13 56 / 0.30); }
.btn-ghost { background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-soft { background: var(--blue-50); color: var(--blue-600); }
.btn-lg { padding: 14px 26px; font-size: 15px; }
.btn-sm { padding: 8px 14px; font-size: 12.5px; }

/* 学科圆点 / 进度 */
.subj-dot { width: 9px; height: 9px; border-radius: 50%; flex:0 0 auto; }
.progress { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 999px; }

.bar-row { display: grid; grid-template-columns: 56px 1fr 52px; align-items: center; gap: 12px; }
.bar-row .nm { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.bar-row .vl { font-size: 13px; font-weight: 800; text-align: right; font-family:'Outfit',sans-serif; }

/* 列表项 */
.list-item { display:flex; align-items:center; gap:14px; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.list-item:last-child { border-bottom: none; }

/* 头像渐变工具类 */
.av-blue { background: linear-gradient(145deg, var(--blue-400), var(--blue-600)); }
.av-green { background: linear-gradient(145deg, var(--green-400), var(--green-600)); }
.av-orange { background: linear-gradient(145deg, var(--orange-400), var(--orange-500)); }
.av-purple { background: linear-gradient(145deg, oklch(0.72 0.12 290), var(--purple)); }
.bg-blue-soft { background: var(--blue-50); color: var(--blue-600); }
.bg-green-soft { background: var(--green-50); color: var(--green-600); }
.bg-orange-soft { background: var(--orange-50); color: var(--orange-500); }
.bg-coral-soft { background: var(--coral-50); color: var(--coral); }
.bg-purple-soft { background: oklch(0.95 0.03 290); color: var(--purple); }

/* 鸡汤卡 */
.muted { color: var(--ink-3); }
.hr { height: 1px; background: var(--line-2); border: none; margin: 18px 0; }

.chart { width: 100%; }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: oklch(0.88 0.01 233); border-radius: 999px; border: 3px solid var(--surface); }
::-webkit-scrollbar-thumb:hover { background: oklch(0.82 0.01 233); }

/* 录入字段 */
.field { margin-bottom: 16px; }
.field > label { display:block; font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 7px; }
.field > label .req { color: var(--coral); }
.input, .select, textarea.input {
  width: 100%; padding: 11px 14px; border-radius: var(--r-sm);
  border: 1.5px solid var(--line); background: var(--surface-2);
  font-family: inherit; font-size: 14px; color: var(--ink); outline: none;
  transition: border-color .15s, background .15s;
}
.input:focus, .select:focus, textarea.input:focus { border-color: var(--blue-400); background: #fff; }
.input::placeholder { color: var(--ink-4); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2393a1b0' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 38px; }
.chip-select { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 15px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface-2); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.chip.on { background: var(--blue-50); border-color: var(--blue-200); color: var(--blue-600); }

/* 表格 */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 700; color: var(--ink-3); padding: 11px 14px; border-bottom: 1.5px solid var(--line); letter-spacing: 0.03em; }
.tbl td { padding: 13px 14px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.tbl tr:hover td { background: var(--surface-2); }
.tbl .num { font-family: 'Outfit', sans-serif; font-weight: 600; }
