:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff6ff;
  --bg: #f4f6fb;
  --bg-2: #f8fafc;
  --card: #ffffff;
  --text: #1e293b;
  --text-1: #0f172a;
  --text-2: #64748b;
  --text-3: #94a3b8;
  --line: #e6eaf2;
  --green: #16a34a;
  --red: #e11d48;
  --radius: 16px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 8px 24px -12px rgba(16, 24, 40, .12);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; }
p { margin: 0; }

/* ---------------- 登录 / 注册 ---------------- */
.auth-screen {
  min-height: 100vh;
  background: linear-gradient(165deg, #2563eb 0%, #4f46e5 45%, #7c3aed 100%);
  padding: 40px 18px 32px;
  display: flex; flex-direction: column; align-items: center;
}
.auth-hero { text-align: center; color: #fff; margin-bottom: 22px; }
.auth-logo {
  width: 68px; height: 68px; margin: 0 auto 12px;
  display: grid; place-items: center; font-size: 36px;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 22px; backdrop-filter: blur(6px);
}
.auth-hero h1 { font-size: 24px; letter-spacing: .5px; }
.auth-sub { color: rgba(255, 255, 255, .82); font-size: 13.5px; margin-top: 4px; }

.auth-card {
  width: 100%; max-width: 420px;
  background: var(--card); border-radius: 22px;
  padding: 18px 18px 22px;
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .45);
}
.tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: #f1f5f9; border-radius: 12px; padding: 4px; margin-bottom: 18px;
}
.tab {
  border: 0; background: transparent; padding: 9px 0; border-radius: 9px;
  font-weight: 600; color: var(--text-2); cursor: pointer; transition: .18s;
}
.tab.active { background: #fff; color: var(--primary); box-shadow: 0 1px 4px rgba(16, 24, 40, .1); }

.form { display: flex; flex-direction: column; gap: 13px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field .req { color: var(--red); font-style: normal; }
.field .opt { color: var(--text-3); font-style: normal; font-size: 12px; font-weight: 400; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 12px;
  border: 1.5px solid var(--line); border-radius: 11px;
  background: #fbfcfe; outline: none; transition: .18s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary); background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.field-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; }
.field .hint { font-size: 12px; font-style: normal; min-height: 15px; }
.field .hint.bad { color: var(--red); }
.field .hint.good { color: var(--green); }

.strength { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.strength-bars { display: flex; gap: 4px; flex: 0 0 96px; }
.strength-bars i { flex: 1; height: 5px; border-radius: 3px; background: #e2e8f0; transition: .2s; }
.strength-text { font-size: 12px; color: var(--text-3); }
.strength.s1 .strength-bars i:nth-child(1) { background: #ef4444; }
.strength.s2 .strength-bars i:nth-child(-n+2) { background: #f59e0b; }
.strength.s3 .strength-bars i { background: #16a34a; }
.strength.s1 .strength-text { color: #ef4444; }
.strength.s2 .strength-text { color: #f59e0b; }
.strength.s3 .strength-text { color: #16a34a; }

.form-error { color: var(--red); font-size: 13px; min-height: 18px; }
.form-note { font-size: 12px; color: var(--text-3); text-align: center; }
.auth-foot { text-align: center; margin-top: 2px; }
.link { background: none; border: 0; color: var(--primary); cursor: pointer; font-size: 13.5px; padding: 6px; }

.btn {
  border: 0; border-radius: 12px; padding: 12px 18px;
  font-weight: 600; cursor: pointer; transition: .18s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:active { background: var(--primary-dark); transform: scale(.99); }
.btn-ghost { background: var(--primary-soft); color: var(--primary); }
.btn-line { background: #fff; border: 1.5px solid var(--line); color: var(--text-2); }
.btn-danger { background: #fef2f2; color: var(--red); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------------- 主界面 ---------------- */
.app-screen { min-height: 100vh; padding-bottom: calc(64px + var(--safe-b)); }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 14px;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-left .avatar { width: 38px; height: 38px; border-radius: 12px; flex: 0 0 38px; background: #eef2f8; }
.topbar-left .who { min-width: 0; }
.topbar-left .who b { display: block; font-size: 15px; line-height: 1.3; }
.topbar-left .who small { color: var(--text-3); font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; gap: 4px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 10px; border: 0;
  background: #f1f5f9; color: var(--text-2); cursor: pointer;
  display: grid; place-items: center; font-size: 15px;
}

.main { padding: 14px; max-width: 900px; margin: 0 auto; }
.section { margin-bottom: 16px; }
.section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 2px 9px; font-size: 14.5px; font-weight: 700;
}
.section-title small { font-weight: 400; color: var(--text-3); font-size: 12px; }

.card {
  background: var(--card); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 12px; }
.card-title { font-size: 14px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }

/* 综合评分大卡 */
.hero-card {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(135deg, #2563eb, #4f46e5 55%, #7c3aed);
  border-radius: 20px; padding: 20px; box-shadow: var(--shadow);
}
.hero-card::after {
  content: ''; position: absolute; right: -30px; top: -40px;
  width: 160px; height: 160px; border-radius: 50%;
  background: rgba(255, 255, 255, .1);
}
.hero-row { display: flex; align-items: center; gap: 16px; position: relative; z-index: 1; }
.hero-score { font-size: 44px; font-weight: 800; line-height: 1; letter-spacing: -1px; }
.hero-score small { font-size: 15px; font-weight: 500; opacity: .85; margin-left: 3px; }
.hero-meta { flex: 1; min-width: 0; }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 11px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; background: rgba(255, 255, 255, .22);
  border: 1px solid rgba(255, 255, 255, .3);
}
.hero-meta p { font-size: 12.5px; opacity: .88; margin-top: 5px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 16px; position: relative; z-index: 1; }
.hero-stats div { font-size: 12px; opacity: .85; }
.hero-stats b { display: block; font-size: 19px; font-weight: 700; opacity: 1; }

/* 雷达图 */
.radar-wrap { display: grid; place-items: center; padding: 4px 0; }
.radar-wrap svg { width: 100%; max-width: 320px; height: auto; }

/* 五维卡片 */
.dim-list { display: flex; flex-direction: column; gap: 10px; }
.dim-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: 14px; background: #fafbfe;
  border: 1px solid var(--line);
}
.dim-icon {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px;
  display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 16px;
}
.dim-body { flex: 1; min-width: 0; }
.dim-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.dim-head b { font-size: 14px; }
.dim-head span { font-size: 12px; color: var(--text-3); }
.dim-head em { font-style: normal; font-weight: 800; font-size: 16px; }
.bar { height: 7px; border-radius: 4px; background: #e9edf5; margin-top: 7px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 4px; transition: width .5s ease; }

/* 成长记录 */
.timeline { display: flex; flex-direction: column; }
.rec {
  display: flex; gap: 11px; padding: 11px 0;
  border-bottom: 1px dashed var(--line);
}
.rec:last-child { border-bottom: 0; }
.rec-dot {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 11px;
  display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 13px;
}
.rec-body { flex: 1; min-width: 0; }
.rec-title { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.rec-title b { font-size: 14px; }
/* 成长记录：事由前的「登记日期」标签 */
.rec-main { display: flex; align-items: baseline; gap: 7px; min-width: 0; flex: 1 1 auto; }
.rec-main b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-date {
  flex: 0 0 auto; font-size: 11.5px; font-weight: 700; letter-spacing: .3px;
  color: var(--text-2); background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 5px; padding: 0 5px; line-height: 17px;
}
.rec-title em { font-style: normal; font-weight: 800; font-size: 14.5px; }
.rec-title em.plus { color: var(--red); }
.rec-title em.minus { color: var(--green); }
.rec-meta { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.rec-note { font-size: 12.5px; color: var(--text-2); margin-top: 3px; }
/* 成长记录：右侧「分值 + 删除」（删除仅班主任/管理员可见） */
.rec-right { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; }
.rec-del {
  font-style: normal;
  width: 20px; height: 20px; flex: 0 0 20px;
  display: inline-grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--line); background: #fff;
  font-size: 11px; line-height: 1; color: var(--text-3);
  cursor: pointer; -webkit-user-select: none; user-select: none;
  transition: background .15s, color .15s, border-color .15s;
}
.rec-del:hover, .rec-del:focus { color: #fff; background: var(--red); border-color: var(--red); }
.rec-del:active { transform: scale(.9); }

/* 排行榜 */
.rank-list { display: flex; flex-direction: column; gap: 8px; }
.rank-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px; border-radius: 14px; background: #fff;
  border: 1px solid var(--line); cursor: pointer; transition: .16s;
}
.rank-item:active { transform: scale(.995); }
.rank-no {
  width: 28px; height: 28px; flex: 0 0 28px; border-radius: 9px;
  display: grid; place-items: center; font-weight: 800; font-size: 13px;
  background: #f1f5f9; color: var(--text-2);
}
.rank-item.g1 .rank-no { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; }
.rank-item.g2 .rank-no { background: linear-gradient(135deg, #cbd5e1, #94a3b8); color: #fff; }
.rank-item.g3 .rank-no { background: linear-gradient(135deg, #fdba74, #f97316); color: #fff; }
.rank-item .avatar { width: 38px; height: 38px; border-radius: 12px; flex: 0 0 38px; background: #eef2f8; }
.rank-body { flex: 1; min-width: 0; }
.rank-body b { font-size: 14.5px; }
.rank-body small { display: block; color: var(--text-3); font-size: 12px; }
.rank-right { text-align: right; }
.rank-right b { font-size: 18px; font-weight: 800; }
.rank-right small { display: block; font-size: 11.5px; }

.pill {
  display: inline-block; padding: 1.5px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700;
}

/* 统计块 */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat {
  background: #fff; border-radius: 14px; padding: 13px;
  border: 1px solid var(--line);
}
.stat b { display: block; font-size: 23px; font-weight: 800; letter-spacing: -.5px; }
.stat small { color: var(--text-3); font-size: 12px; }

/* 分布条 */
.dist-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.dist-row span { flex: 0 0 62px; font-size: 12.5px; font-weight: 600; }
.dist-row .bar { flex: 1; margin: 0; }
.dist-row em { font-style: normal; font-size: 12.5px; font-weight: 700; flex: 0 0 30px; text-align: right; }

/* 工具条 */
.toolbar { display: flex; gap: 9px; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar input, .toolbar select {
  flex: 1; min-width: 130px; padding: 10px 12px;
  border: 1.5px solid var(--line); border-radius: 11px; background: #fff; outline: none;
}
.toolbar input:focus, .toolbar select:focus { border-color: var(--primary); }

/* 表单行 */
.inline-fields { display: flex; flex-direction: column; gap: 12px; }
.chip-group { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  padding: 7px 12px; border-radius: 999px; border: 1.5px solid var(--line);
  background: #fff; font-size: 13px; cursor: pointer; transition: .16s;
}
.chip.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.chip.neg { color: var(--text-2); }
/* 只读标签（班级列表） */
.chip.static { cursor: default; display: inline-flex; align-items: center; gap: 6px; background: var(--bg-2, #f5f7fb); }
.chip.static em.opt { font-size: 12px; color: var(--text-3); font-style: normal; }
.chip.custom { border-color: var(--primary); border-style: dashed; }
.chip-x {
  font-style: normal; font-size: 13px; line-height: 1;
  width: 16px; height: 16px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; cursor: pointer;
  background: rgba(0, 0, 0, .06); color: var(--text-2);
}
.chip-x:hover { background: #ef4444; color: #fff; }
.chip.add { border-style: dashed; border-color: var(--primary); color: var(--primary); font-weight: 600; }

/* 上传 */
.upload-box {
  border: 2px dashed #c7d2e4; border-radius: 16px; padding: 24px 16px;
  text-align: center; background: #fbfcfe; cursor: pointer; transition: .18s;
}
.upload-box:active { border-color: var(--primary); background: var(--primary-soft); }
.upload-box .big { font-size: 34px; }
.upload-box b { display: block; margin-top: 6px; }
.upload-box small { color: var(--text-3); }
.upload-preview { width: 100%; border-radius: 14px; margin-top: 12px; border: 1px solid var(--line); }

/* 表格 */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { padding: 8px 6px; text-align: left; border-bottom: 1px solid var(--line); }
.table th { color: var(--text-3); font-weight: 600; font-size: 12px; }
.table td select, .table td input {
  width: 100%; padding: 6px 7px; border: 1.5px solid var(--line);
  border-radius: 8px; background: #fff; outline: none; font-size: 13px;
}
.table .warn { color: var(--red); font-size: 12px; }

/* 空状态 */
.empty { text-align: center; padding: 34px 16px; color: var(--text-3); }
.empty .big { font-size: 40px; margin-bottom: 8px; }

/* 底部导航 */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
}
.tabbar button {
  flex: 1; border: 0; background: none; padding: 8px 2px 9px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--text-3); font-size: 11px; cursor: pointer;
}
.tabbar button i { font-style: normal; font-size: 19px; line-height: 1; }
.tabbar button.active { color: var(--primary); font-weight: 700; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 92px; z-index: 90;
  transform: translateX(-50%) translateY(12px);
  background: rgba(23, 32, 46, .93); color: #fff;
  padding: 10px 18px; border-radius: 12px; font-size: 13.5px;
  opacity: 0; pointer-events: none; transition: .22s; max-width: 86vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 游戏桥接卡片 */
.game-card { }
.game-top { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.game-dia {
  width: 82px; height: 82px; border-radius: 20px; flex: 0 0 auto;
  background: linear-gradient(140deg, #38bdf8, #6366f1); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 10px 24px -12px rgba(56, 189, 248, .9);
}
.game-dia b { font-size: 22px; line-height: 1.1; font-weight: 800; letter-spacing: -.5px; }
.game-dia small { font-size: 11px; opacity: .9; margin-top: 2px; }
.game-top .game-dia + .game-dia { width: 82px; }
.game-dia.gold {
  background: linear-gradient(140deg, #fbbf24, #f59e0b);
  box-shadow: 0 10px 24px -12px rgba(245, 158, 11, .9);
}
.game-dia.gold b { font-size: 19px; }
.game-info { flex: 1; min-width: 0; font-size: 14px; color: var(--text-2); }
.game-info b { color: var(--text-1); }
.game-hint { font-size: 12px; color: var(--text-3); margin-top: 4px; word-break: break-all; }
.game-hint a { color: var(--primary); }
.game-strip {
  background: #eef2ff; color: #3730a3; font-size: 13px;
  border-radius: 12px; padding: 9px 12px; margin-bottom: 12px; text-align: center;
}
.switch-line { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); margin-top: 10px; }
.switch-line input { width: 18px; height: 18px; }

/* ---------------- 内嵌班级农场（游戏直接显示在页面里） ---------------- */
.farm-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 10px; }
.farm-stat {
  background: var(--card); border-radius: 14px; padding: 10px 6px; text-align: center;
  box-shadow: var(--shadow);
}
.farm-stat b { display: block; font-size: 20px; font-weight: 800; letter-spacing: -.5px; }
.farm-stat small { font-size: 11px; color: var(--text-3); }
.farm-stat.dia b { color: #6366f1; }
.farm-stat.gold b { color: #d97706; }

/* 钻石换金币 */
.ex-card { margin-bottom: 10px; }
.ex-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.ex-head b { font-size: 15px; }
.ex-head span { font-size: 12px; color: var(--text-3); }
.ex-row { display: flex; align-items: center; gap: 6px; }
.ex-row input {
  flex: 1; min-width: 0; height: 38px; border-radius: 10px; border: 1px solid var(--line);
  padding: 0 12px; font-size: 16px; font-weight: 700; color: var(--text-1);
  background: var(--bg-2); outline: none;
}
.ex-row input:focus { border-color: var(--primary); }
.ex-chip {
  flex: 0 0 auto; height: 34px; min-width: 40px; padding: 0 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text-2);
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.ex-chip:active { background: #e0e7ff; }
.ex-preview { margin: 10px 0 10px; font-size: 13px; color: var(--text-2); }
.ex-preview b { color: #d97706; font-size: 16px; }

/* 农场账号刚开通 / 积分已同步提示 */
.farm-tip {
  margin-bottom: 10px; border-radius: 12px; padding: 9px 12px;
  font-size: 13px; line-height: 1.7;
}
.farm-tip.ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.farm-tip.ok b { color: #047857; }

.farm-bar {
  display: flex; align-items: center; gap: 6px; margin-bottom: 8px;
  background: #eef2ff; color: #3730a3; border-radius: 12px; padding: 7px 10px;
}
.farm-acc { flex: 1; min-width: 0; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.farm-bar .btn-sm { padding: 5px 9px; font-size: 12.5px; white-space: nowrap; }

.farm-phone {
  position: relative; margin: 0 auto;
  width: min(100%, calc((100vh - 140px) * 0.5634));
  width: min(100%, calc((100dvh - 140px) * 0.5634));
  aspect-ratio: 640 / 1136;
  background: #000; border-radius: 16px; overflow: hidden;
  box-shadow: 0 16px 40px -18px rgba(16, 24, 40, .55);
}
.farm-frame { display: block; width: 100%; height: 100%; border: 0; background: #000; }

/* 成长记录：按月查看 */
.m-picker { display: flex; gap: 7px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: none; }
.m-picker::-webkit-scrollbar { display: none; }
.m-chip {
  flex: 0 0 auto; padding: 6px 13px; border-radius: 999px; border: 1.5px solid var(--line);
  background: #fff; color: var(--text-2); font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.m-chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.m-summary { display: grid; gap: 8px; margin-bottom: 10px; }
.m-summary.cols-3 { grid-template-columns: repeat(3, 1fr); }
.m-summary.cols-4 { grid-template-columns: repeat(4, 1fr); }
.m-stat { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 9px 6px; text-align: center; }
.m-stat b { display: block; font-size: 17px; font-weight: 800; letter-spacing: -.3px; }
.m-stat b.plus { color: #16a34a; }
.m-stat b.minus { color: #dc2626; }
.m-stat small { display: block; margin-top: 2px; color: var(--text-3); font-size: 11px; line-height: 1.3; }
.m-dims { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -2px 0 10px; font-size: 12px; color: var(--text-3); }
.m-dims span { padding: 3px 9px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); font-weight: 700; }
@media (max-width: 560px) { .m-summary.cols-4 { grid-template-columns: repeat(2, 1fr); } }
.farm-phone:fullscreen,
.farm-phone:-webkit-full-screen {
  width: 100vw; height: 100vh; aspect-ratio: auto; border-radius: 0; max-width: none;
}

.farm-loading {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px;
  background: rgba(9, 14, 26, .93); color: #fff; text-align: center; padding: 22px;
  transition: opacity .35s ease, visibility .35s;
}
.farm-loading.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.farm-loading p { font-size: 14px; font-weight: 600; }
.farm-loading small { font-size: 11.5px; color: rgba(255, 255, 255, .58); line-height: 1.5; }
.farm-spin {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .22); border-top-color: #fff;
  animation: farmspin .8s linear infinite;
}
@keyframes farmspin { to { transform: rotate(360deg); } }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; }
.modal-mask { position: absolute; inset: 0; background: rgba(15, 23, 42, .5); }
.modal-body {
  position: relative; width: 100%; max-width: 430px; max-height: 84vh; overflow: auto;
  background: #fff; border-radius: 20px; padding: 20px; box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .5);
}
.modal-body h3 { font-size: 17px; margin-bottom: 4px; }
.modal-body .sub { color: var(--text-3); font-size: 13px; margin-bottom: 14px; }

/* 学生详情头部 */
.stu-head { display: flex; align-items: center; gap: 13px; margin-bottom: 14px; }
.stu-head .avatar { width: 58px; height: 58px; border-radius: 18px; background: #eef2f8; }
.stu-head b { font-size: 17px; display: block; }
.stu-head small { color: var(--text-3); font-size: 12.5px; }

@media (min-width: 720px) {
  .main { padding: 20px; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .auth-screen { justify-content: center; padding-top: 0; }
}

/* ============ 多角色：角色选择 ============ */
.role-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.role {
  border: 1px solid var(--line); background: #fff; border-radius: 14px;
  padding: 10px 2px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  cursor: pointer; color: var(--text-2); font-size: 12px; font-weight: 600; transition: .18s;
  font-family: inherit;
}
.role i { font-style: normal; font-size: 20px; line-height: 1; }
.role.active {
  border-color: var(--primary); background: var(--primary-soft); color: var(--primary);
  box-shadow: 0 8px 18px -14px var(--primary); font-weight: 700;
}

/* ============ 家长端：孩子卡片 ============ */
.kid-list { display: flex; flex-direction: column; gap: 10px; }
.kid-card {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer; box-shadow: var(--shadow); transition: .18s;
}
.kid-card:active { transform: scale(.995); }
.kid-card .avatar { width: 46px; height: 46px; border-radius: 14px; flex: 0 0 46px; background: #eef2f8; }
.kid-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.kid-body b { font-size: 15.5px; }
.kid-body small { color: var(--text-3); font-size: 12.5px; }
.kid-right { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.kid-right > b { font-size: 19px; color: var(--primary); line-height: 1.1; }

/* ============ 勾选行（绑定孩子 / 学生） ============ */
.pick-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 4px;
  border-bottom: 1px solid var(--line); cursor: pointer;
}
.pick-row:last-child { border-bottom: 0; }
.pick-row input[type=checkbox] { width: 18px; height: 18px; flex: 0 0 18px; accent-color: var(--primary); }
.pick-row .avatar { width: 34px; height: 34px; border-radius: 10px; flex: 0 0 34px; }
.pick-row > div { display: flex; flex-direction: column; gap: 1px; }
.pick-row b { font-size: 14.5px; }
.pick-row small { color: var(--text-3); font-size: 12px; }

/* ============ 行内操作按钮组 ============ */
.row-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.row-actions select {
  padding: 6px 8px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; font-size: 13px; max-width: 148px; font-family: inherit; color: var(--text);
}
.badge-warn {
  font-style: normal; font-size: 11px; font-weight: 700; color: #b45309;
  background: #fef3c7; border-radius: 999px; padding: 2px 8px; margin-left: 6px;
  vertical-align: 1px;
}

/* 标签较多时底部导航横向滚动 */
.tabbar { overflow-x: auto; scrollbar-width: none; }
.tabbar::-webkit-scrollbar { display: none; }
.tabbar button { flex: 1 0 auto; min-width: 62px; }

/* ============ 账号管理：上下两行的账号卡片 ============ */
.acct-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; box-shadow: var(--shadow); margin-bottom: 10px;
  display: flex; flex-direction: column; gap: 10px;
}
.acct-main { display: flex; align-items: center; gap: 12px; }
.acct-avatar {
  width: 44px; height: 44px; border-radius: 14px; flex: 0 0 44px;
  display: grid; place-items: center; font-size: 19px; background: #eef2f8;
}
.acct-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.acct-body b { font-size: 15px; }
.acct-body small { color: var(--text-3); font-size: 12.5px; }

/* ============ 每日考勤 ============ */
.att-summary { grid-template-columns: repeat(4, 1fr); gap: 8px; }
.att-summary .stat { padding: 11px 6px; text-align: center; }
.att-summary .stat b { font-size: 21px; line-height: 1.2; }
.att-summary .stat.wide { grid-column: 1 / -1; }

.att-list { display: flex; flex-direction: column; gap: 8px; }
.att-row {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 12px; box-shadow: var(--shadow);
}
.att-top { display: flex; align-items: center; gap: 10px; }
.att-top .avatar { width: 36px; height: 36px; border-radius: 11px; flex: 0 0 36px; background: #eef2f8; }
.att-body { flex: 1; min-width: 0; }
.att-body b { font-size: 14.5px; }
.att-body small { display: block; color: var(--text-3); font-size: 12px; }
.att-seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 9px; }
.att-seg .seg {
  border: 1.5px solid var(--line); background: #fff; border-radius: 9px;
  padding: 7px 0; font-size: 12.5px; color: var(--text-2); cursor: pointer;
  font-family: inherit; transition: .15s;
}
.att-seg .seg:active { transform: scale(.97); }
.att-seg .seg.on.present { border-color: #16a34a; background: #dcfce7; color: #15803d; font-weight: 700; }
.att-seg .seg.on.late { border-color: #f59e0b; background: #fef3c7; color: #b45309; font-weight: 700; }
.att-seg .seg.on.leave { border-color: #3b82f6; background: #dbeafe; color: #1d4ed8; font-weight: 700; }
.att-seg .seg.on.sick { border-color: #8b5cf6; background: #ede9fe; color: #6d28d9; font-weight: 700; }

/* ============ 班干部 ============ */
.officer-badge {
  display: inline-block; font-style: normal; font-size: 11px; font-weight: 700;
  color: #92400e; background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #f59e0b55; border-radius: 999px; padding: 1px 8px;
  margin-left: 6px; vertical-align: 2px; white-space: nowrap;
}
.officer-next {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 10px; font-size: 13px; color: var(--text-2); flex-wrap: wrap;
}
.officer-next b { color: var(--primary); }
.officer-title-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: #fef3c7; color: #92400e; border: 1px solid #f59e0b55;
  border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 600;
}
.officer-title-chip i {
  font-style: normal; cursor: pointer; color: #b45309; font-weight: 700;
  width: 16px; height: 16px; line-height: 15px; text-align: center; border-radius: 50%;
}
.officer-title-chip i:hover { background: #f59e0b33; }
.officer-list { display: flex; flex-direction: column; gap: 8px; }
.officer-row {
  display: flex; align-items: flex-start; gap: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px;
}
.officer-row .avatar { width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; margin-top: 2px; }
.officer-body { flex: 1; min-width: 0; }
.officer-body b { font-size: 14.5px; }
.officer-body small { display: block; color: var(--text-3); font-size: 12px; margin-top: 2px; }

/* 多职务标签选择器：点亮即任职 */
.of-legend { font-size: 12px; color: var(--text-3); margin: -2px 0 10px; }
.of-picks { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 46%; flex-shrink: 0; }
.of-pick {
  border: 1px solid var(--line); background: #fff; color: var(--text-2);
  border-radius: 999px; padding: 4px 11px; font-size: 12.5px; cursor: pointer;
  transition: background .12s, border-color .12s, color .12s; white-space: nowrap;
}
.of-pick:hover { border-color: #f59e0b; color: #92400e; }
.of-pick.on {
  background: #fef3c7; border-color: #f59e0b; color: #92400e; font-weight: 700;
}
.of-pick.on::before { content: '🎖 '; }
.of-pick:disabled { opacity: .5; cursor: default; }
@media (max-width: 640px) {
  .officer-row { flex-wrap: wrap; }
  .of-picks { max-width: 100%; justify-content: flex-start; width: 100%; margin-top: 6px; }
}
.officer-result { display: flex; flex-direction: column; gap: 6px; }
.officer-result-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 13.5px; padding: 7px 10px; background: #fff;
  border: 1px solid var(--line); border-radius: 10px;
}
.of-ok { color: #16a34a; font-weight: 700; }
.of-no { color: var(--text-3); }

/* 各职务单独加分设置 */
.of-tb-title { font-size: 13px; font-weight: 700; color: var(--text-2); margin: 12px 0 6px; display: flex; align-items: baseline; gap: 8px; }
.of-tb-title small { font-size: 11.5px; font-weight: 400; color: var(--text-3); }
.of-tb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin-bottom: 12px; }
.of-tb-row { display: flex; align-items: center; gap: 8px; background: var(--bg-2, #f6f7fb); border-radius: 10px; padding: 6px 10px; }
.of-tb-name { font-size: 13px; font-weight: 600; white-space: nowrap; }
.of-tb-input { width: 76px; padding: 5px 8px; border: 1px solid var(--line, #e3e6ef); border-radius: 8px; font-size: 13px; text-align: center; background: #fff; }
.officer-result-row small { display: block; font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* 成长记录里「不扣分」的 0 分档（病假等） */
.rec-title em.zero { color: var(--text-3); font-size: 12.5px; font-weight: 700; }

/* ============ 记一笔：学生多选勾选列表 ============ */
.section-title:has(.pick-count) { justify-content: flex-start; gap: 7px; }
.pick-count {
  margin-left: auto; font-size: 12px; font-weight: 700; color: var(--primary);
  background: var(--primary-soft); border-radius: 999px; padding: 2px 10px; white-space: nowrap;
}
.pick-tools { display: flex; gap: 8px; margin-bottom: 9px; align-items: center; }
.pick-tools input {
  flex: 1; min-width: 0; border: 1.5px solid var(--line); border-radius: 10px;
  padding: 8px 11px; font-size: 13.5px; font-family: inherit; background: #fff;
}
.pick-tools input:focus { outline: none; border-color: var(--primary); }
.pick-tools .btn { flex: 0 0 auto; }
.pick-list {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); max-height: 46vh; overflow: auto; padding: 4px 0;
}
.pick-group {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; color: var(--text-3);
  padding: 9px 13px 4px; position: sticky; top: 0; background: var(--card);
}
.pick-group span {
  font-weight: 600; color: var(--text-3); background: #f1f5f9;
  border-radius: 999px; padding: 1px 8px; font-size: 11px;
}
.pick-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 13px;
  cursor: pointer; border-top: 1px dashed var(--line);
}
.pick-item:first-of-type, .pick-group + .pick-item { border-top: none; }
.pick-item:hover { background: #f8fafc; }
.pick-item input[type="checkbox"] {
  width: 18px; height: 18px; accent-color: var(--primary); flex: 0 0 18px; cursor: pointer;
}
.pick-item .avatar { width: 34px; height: 34px; border-radius: 10px; background: #eef2f8; flex: 0 0 34px; }
.pick-name { font-size: 14.5px; font-weight: 600; }
.pick-no { margin-left: auto; font-size: 12px; color: var(--text-3); white-space: nowrap; }

/* ============ 跟岗实习 ============ */
.ck-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 14px; box-shadow: var(--shadow); margin-bottom: 10px;
}
.ck-head { display: flex; flex-direction: column; gap: 3px; }
.ck-title { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.ck-title b { font-size: 15.5px; }
.ck-badge {
  font-size: 11px; font-weight: 700; color: var(--primary);
  background: var(--primary-soft); border-radius: 999px; padding: 2px 8px;
}
.ck-badge.off { color: var(--text-3); background: #f1f5f9; }
.ck-time { color: var(--text-2); font-size: 13px; }
.ck-place { color: var(--text-3); font-size: 12.5px; }
.ck-note {
  font-size: 12.5px; color: var(--text-2); background: var(--bg-2);
  border-radius: 9px; padding: 6px 9px; margin-top: 4px;
}
.ck-action { margin-top: 11px; }
.ck-done { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ck-done small { color: var(--text-3); font-size: 12.5px; flex: 1; min-width: 0; }

.ck-hist { display: flex; flex-direction: column; }
.ck-hist-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.ck-hist-row:last-child { border-bottom: 0; }
.ck-hist-date { flex: 0 0 74px; text-align: center; }
.ck-hist-date b { display: block; font-size: 13px; }
.ck-hist-date small { color: var(--text-3); font-size: 11.5px; }
.ck-hist-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ck-hist-body b { font-size: 14px; }
.ck-hist-body small { color: var(--text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ck-stu-list { display: flex; flex-direction: column; margin-top: 10px; border-top: 1px dashed var(--line); }
.ck-stu { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.ck-stu:last-child { border-bottom: 0; }
.ck-stu .avatar { width: 32px; height: 32px; border-radius: 10px; flex: 0 0 32px; background: #eef2f8; }
.ck-stu-body { flex: 1; min-width: 0; }
.ck-stu-body b { font-size: 13.5px; }
.ck-stu-body small { display: block; color: var(--text-3); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 动态发布框 */
.composer textarea {
  width: 100%; min-height: 68px; resize: vertical; border: 0; outline: none;
  font-family: inherit; font-size: 14.5px; line-height: 1.6; background: transparent;
}
.composer-imgs { display: none; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.composer-imgs.has { display: grid; }
.cimg { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #eef2f8; }
.cimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cimg button {
  position: absolute; top: 3px; right: 3px; width: 19px; height: 19px; border: 0; border-radius: 50%;
  background: rgba(15, 23, 42, .62); color: #fff; font-size: 12px; line-height: 1; cursor: pointer;
  display: grid; place-items: center; padding: 0;
}
.composer-bar {
  display: flex; align-items: center; gap: 8px; margin-top: 10px;
  padding-top: 10px; border-top: 1px solid var(--line);
}
.composer-bar #postImgTip { flex: 1; text-align: left; }

/* 动态列表 */
.feed-list { display: flex; flex-direction: column; gap: 12px; }
.post {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 14px; box-shadow: var(--shadow);
}
.post-head { display: flex; align-items: center; gap: 10px; }
.post-head .avatar { width: 40px; height: 40px; border-radius: 13px; flex: 0 0 40px; background: #eef2f8; }
.ava-emo { display: grid; place-items: center; font-size: 20px; }
.post-who { flex: 1; min-width: 0; }
.post-who b { font-size: 14.5px; display: flex; align-items: center; gap: 6px; }
.post-who small { display: block; color: var(--text-3); font-size: 12px; }
.role-tag { font-size: 10.5px; padding: 1px 7px; border-radius: 999px; font-weight: 700; }
.role-tag.r-student { color: #1d4ed8; background: #dbeafe; }
.role-tag.r-teacher { color: #b45309; background: #fef3c7; }
.role-tag.r-admin { color: #6d28d9; background: #ede9fe; }
.role-tag.r-parent { color: #0f766e; background: #ccfbf1; }
.post-text { font-size: 14.5px; line-height: 1.68; margin-top: 10px; word-break: break-word; }
.post-imgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-top: 10px; }
.post-imgs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; cursor: zoom-in; }
.post-bar { display: flex; gap: 16px; margin-top: 11px; padding-top: 9px; border-top: 1px solid var(--line); }
.post-btn {
  border: 0; background: none; padding: 0; font-size: 13.5px; color: var(--text-2);
  cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
}
.post-btn.on { color: #e11d48; font-weight: 700; }
.post-btn:disabled { opacity: .55; cursor: default; }

/* 评论 */
.cmt-box { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 9px; }
.cmt-list { display: flex; flex-direction: column; gap: 9px; }
.cmt-loading { color: var(--text-3); font-size: 12.5px; text-align: center; padding: 6px 0; }
.cmt { display: flex; gap: 8px; align-items: flex-start; }
.cmt .avatar { width: 28px; height: 28px; border-radius: 9px; flex: 0 0 28px; background: #eef2f8; font-size: 15px; }
.cmt-body { flex: 1; min-width: 0; background: var(--bg-2); border-radius: 10px; padding: 6px 10px; }
.cmt-body b { font-size: 12.5px; display: flex; align-items: center; gap: 5px; }
.cmt-text { font-size: 13.5px; margin-top: 2px; word-break: break-word; }
.cmt-body small { color: var(--text-3); font-size: 11px; }
.cmt-del { border: 0; background: none; color: var(--text-3); font-size: 11.5px; cursor: pointer; padding: 2px; }
.cmt-del:hover { color: var(--red); }
.cmt-form { display: flex; gap: 7px; margin-top: 10px; }
.cmt-form input {
  flex: 1; min-width: 0; padding: 8px 11px; border: 1.5px solid var(--line);
  border-radius: 10px; outline: none; font-size: 13.5px; background: #fff;
}
.cmt-form input:focus { border-color: var(--primary); }

/* ============ 成绩管理（导入 / 发布 / 查看） ============ */
.sc-paste {
  width: 100%; box-sizing: border-box; padding: 9px 11px;
  border: 1.5px solid var(--line); border-radius: 10px; outline: none;
  font-size: 13px; line-height: 1.6; resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #fbfcfe; color: var(--text-1);
}
.sc-paste:focus { border-color: var(--primary); background: #fff; }

.sc-table-wrap { overflow: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 10px; }
.sc-table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
.sc-table th {
  position: sticky; top: 0; z-index: 2; background: #f5f7fb;
  font-size: 12px; font-weight: 700; color: var(--text-2);
  padding: 7px 9px; text-align: center; border-bottom: 1px solid var(--line);
}
.sc-table td { padding: 6px 9px; border-bottom: 1px solid #f1f4f9; }
.sc-table tbody tr:last-child td { border-bottom: 0; }
.sc-table td.c, .sc-table th.c { text-align: center; }
.sc-table tr.sc-unmatched { background: #fff7ed; }
.sc-table tr.sc-unmatched td { color: #b45309; }
.sc-ok { color: var(--green); font-size: 12px; font-weight: 600; }
.sc-bad { color: #b45309; font-size: 12px; font-weight: 600; }

/* 分数分级着色 */
.sc-a { color: var(--green); font-weight: 700; }
.sc-b { color: #2563eb; font-weight: 600; }
.sc-c { color: #d97706; font-weight: 600; }
.sc-d { color: var(--red); font-weight: 700; }
.sc-none { color: var(--text-3); }

/* 成绩单列表卡片 */
.sc-exam { position: relative; }
.sc-exam-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sc-exam-name { font-size: 14.5px; }
.sc-badge {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px;
  font-size: 11px; font-weight: 600; vertical-align: 1px;
}
.sc-badge-on { background: #dcfce7; color: #15803d; }
.sc-badge-off { background: #f1f5f9; color: var(--text-3); }
.sc-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* 明细弹窗底部均分条 */
.sc-avg-line { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sc-avg {
  font-size: 11.5px; color: var(--text-2); background: var(--bg-2, #f5f7fb);
  border-radius: 8px; padding: 4px 9px;
}
.sc-avg b { color: var(--text-1); }

/* 弹窗顶部标题栏 */
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 6px;
}
.modal-head b { font-size: 17px; }
.modal-x {
  border: 0; background: none; font-size: 16px; line-height: 1;
  color: var(--text-3); cursor: pointer; padding: 4px 6px; border-radius: 8px;
}
.modal-x:hover { background: var(--bg-2, #f1f5f9); color: var(--text-1); }

@media print {
  .sc-actions, .sc-paste, #scPickFile, #scParse { display: none !important; }
  .sc-table-wrap { overflow: visible; }
  .sc-table th { position: static; }
}

/* ---- 成绩：Excel 上传区 ---- */
.sc-up {
  border: 2px dashed #c7d2e5; border-radius: 16px; padding: 22px 16px;
  text-align: center; cursor: pointer; background: #fafcff;
  transition: border-color .15s, background .15s, transform .1s;
}
.sc-up:hover { border-color: var(--primary); background: var(--primary-soft); }
.sc-up.over { border-color: var(--primary); background: #e8f0fe; transform: scale(1.01); }
.sc-up .big { font-size: 34px; line-height: 1; }
.sc-up b { display: block; margin-top: 8px; font-size: 14.5px; color: var(--text-1); }
.sc-up small { display: block; margin-top: 4px; color: var(--text-3); font-size: 12px; }

.sc-or {
  display: flex; align-items: center; gap: 10px; margin: 14px 0 10px;
  color: var(--text-3); font-size: 12px;
}
.sc-or::before, .sc-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.sc-loading { margin-top: 10px; font-size: 13px; color: var(--text-2); }
.sc-loaded {
  margin-top: 10px; font-size: 13px; color: var(--green);
  background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px; padding: 8px 11px;
}
.sc-pick { margin-top: 10px; }
.sc-pick > b { font-size: 13.5px; display: block; margin-bottom: 8px; }
.sc-pick-list { display: flex; flex-wrap: wrap; gap: 8px; }
.sc-pick-list .btn small { opacity: .7; font-weight: 400; }

/* ---- 成绩：名次徽章 ---- */
.sc-rank {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.sc-rank small { font-weight: 400; opacity: .7; font-size: 10px; }
.sc-rank-1 { background: #fef3c7; color: #b45309; }
.sc-rank-2 { background: #e5e7eb; color: #475569; }
.sc-rank-3 { background: #fde8d7; color: #c2410c; }
.sc-rank-n { background: #eff6ff; color: #2563eb; }
.sc-rank-none { color: var(--text-3); font-weight: 400; }

/* ---- 成绩：名次条 ---- */
.sc-bar {
  height: 7px; border-radius: 999px; background: #eef2f8; overflow: hidden; min-width: 40px;
}
.sc-bar i { display: block; height: 100%; border-radius: 999px; }
.sc-bar i.good { background: linear-gradient(90deg, #34d399, #10b981); }
.sc-bar i.mid { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.sc-bar i.low { background: linear-gradient(90deg, #fb7185, #e11d48); }

.sc-sheet .sc-exam-head { align-items: center; }
.sc-total-badge {
  display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25;
  background: var(--primary-soft); border-radius: 12px; padding: 6px 12px;
}
.sc-total-badge span { font-size: 11px; color: var(--text-3); }
.sc-total-badge b { font-size: 20px; color: var(--primary-dark); }
.sc-total-badge em { font-size: 11.5px; color: var(--primary); font-style: normal; font-weight: 600; }

.sc-badge-tie { background: #ede9fe; color: #6d28d9; }
.sc-top { color: var(--green); font-weight: 700; font-size: 11.5px; }

.sc-table-mine td.sc-sub-name { font-weight: 600; color: var(--text-1); white-space: nowrap; }
.sc-table .c { text-align: center; }

/* ================= 成绩：AI 评语 / 趋势 / 历次对比 ================= */

/* ---- 批量评语卡 ---- */
.sc-batch { border-left: 4px solid var(--primary); }
.sc-batch > b { font-size: 15px; }
.sc-batch-btns { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---- 评语卡片 ---- */
.sc-comment { border-left: 4px solid #8b5cf6; background: linear-gradient(180deg, #faf8ff 0%, #ffffff 46%); }
.sc-cmt-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.sc-cmt-head > b { font-size: 14.5px; }
.sc-cmt-icon { font-size: 15px; }
.sc-cmt-src {
  font-size: 11px; font-weight: 600; color: #7c3aed; background: #ede9fe;
  padding: 1px 8px; border-radius: 999px; white-space: nowrap;
}
.sc-cmt-text {
  margin: 9px 0 0; font-size: 14px; line-height: 1.85; color: var(--text-1);
  white-space: pre-wrap; word-break: break-word;
}
.sc-cmt-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sc-tag {
  font-size: 12px; padding: 3px 10px; border-radius: 999px; line-height: 1.5;
  display: inline-flex; align-items: center; gap: 3px;
}
.sc-tag-good { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.sc-tag-tip { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }

/* ---- 趋势卡片 ---- */
.sc-trend-head { display: flex; align-items: flex-start; gap: 10px; }
.sc-trend-icon { font-size: 26px; line-height: 1; }
.sc-trend-head > div > b { font-size: 15px; }

.sc-chart {
  display: flex; align-items: flex-end; gap: 10px; height: 170px;
  margin: 16px 0 4px; padding: 0 4px; overflow-x: auto;
}
.sc-bar-col {
  flex: 1 1 0; min-width: 52px; height: 100%;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  gap: 3px;
}
.sc-bar-val {
  font-size: 11.5px; font-weight: 700; color: var(--text-1); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 3px;
}
.sc-bar-val em { font-style: normal; font-size: 10px; font-weight: 700; }
.sc-bar-val em.up { color: #e11d48; }
.sc-bar-val em.down { color: #059669; }
.sc-bar-val em.flat { color: var(--text-3); }
.sc-bar-shape {
  width: 62%; max-width: 44px; min-height: 6px; border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, #93c5fd, #60a5fa);
  transition: height .3s ease;
}
.sc-bar-shape.up { background: linear-gradient(180deg, #fda4af, #fb7185); }
.sc-bar-shape.down { background: linear-gradient(180deg, #6ee7b7, #34d399); }
.sc-bar-lbl { font-size: 11px; color: var(--text-3); white-space: nowrap; }

/* ---- 历次对比表 ---- */
.sc-compare { padding: 0; overflow: hidden; }
.sc-cmp-wrap { overflow-x: auto; }
.sc-table.sc-cmp { min-width: 100%; }
.sc-table.sc-cmp th small { display: block; font-weight: 400; font-size: 10px; opacity: .7; }
.sc-table.sc-cmp th.c, .sc-table.sc-cmp td.c { text-align: center; white-space: nowrap; }
.sc-table.sc-cmp .sc-sub-name { font-weight: 600; white-space: nowrap; }
.sc-cmp-total { background: #f8fafd; }

/* ---- 升降色（中国习惯：涨=红 跌=绿）---- */
.sc-pos { color: #e11d48; font-weight: 700; }
.sc-neg { color: #059669; font-weight: 700; }
.sc-none { color: var(--text-3); }

/* ---- 徽章：升降 / 序号 ---- */
.sc-badge-up { background: #fff1f2; color: #e11d48; }
.sc-badge-down { background: #ecfdf5; color: #059669; }
.sc-badge-flat { background: #f1f5f9; color: #64748b; }
.sc-badge-seq { background: var(--primary-soft); color: var(--primary-dark); }

/* ---- 明细表：学号小字 ---- */
.sc-sub-id { display: block; font-size: 10.5px; color: var(--text-3); font-weight: 400; }

/* ---- 移动端 ---- */
@media (max-width: 640px) {
  .sc-chart { height: 148px; gap: 6px; }
  .sc-bar-col { min-width: 42px; }
  .sc-cmt-text { font-size: 13.5px; line-height: 1.8; }
  .sc-batch-btns .btn { flex: 1 1 auto; }
}
