﻿:root {
  --brand: #2f6fed;
  --brand-dark: #1e4fc4;
  --ink: #1b2437;
  --muted: #7b8496;
  --line: #e6eaf2;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --side: #0f2136;
  --green: #2f9e6e;
  --amber: #d98b1c;
  --red: #d4553f;
  --radius: 12px;
  --shadow: 0 6px 20px rgba(20, 35, 60, .06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; font-size: 14px; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 700; }
p { margin: 0; }
a { color: var(--brand); }

/* ---------------- 登录 ---------------- */
.login {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  min-height: 100vh;
}
.login-side {
  background: radial-gradient(1200px 600px at 20% 10%, #1c4d8f 0%, #0f2136 55%, #0a1725 100%);
  color: #fff;
  padding: 64px 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.login-side::after {
  content: "";
  position: absolute;
  width: 420px; height: 420px;
  right: -120px; bottom: -140px;
  background: radial-gradient(circle, rgba(74, 144, 255, .35), transparent 65%);
}
.login-brand { font-size: 13px; letter-spacing: 3px; color: #9fc0ea; margin-bottom: 18px; }
.login-side h1 { font-size: 40px; line-height: 1.25; letter-spacing: 1px; }
.login-side .lead { margin-top: 18px; color: #b8c9e0; line-height: 1.9; font-size: 14.5px; max-width: 460px; }
.login-points { list-style: none; padding: 0; margin: 34px 0 0; display: grid; gap: 14px; max-width: 470px; }
.login-points li {
  color: #c7d6ea; font-size: 13.5px; line-height: 1.7;
  padding-left: 18px; position: relative;
}
.login-points li::before {
  content: ""; position: absolute; left: 0; top: 9px;
  width: 6px; height: 6px; border-radius: 50%; background: #4a90ff;
}
.login-points b { color: #fff; font-weight: 600; margin-right: 6px; }

.login-main {
  display: flex; align-items: center; justify-content: center; padding: 48px 32px;
  background:
    radial-gradient(760px 420px at 82% 8%, #e6efff 0%, rgba(230,239,255,0) 62%),
    radial-gradient(620px 360px at 10% 92%, #e9f5ef 0%, rgba(233,245,239,0) 60%),
    linear-gradient(180deg, #fafbfe 0%, #f2f5fa 100%);
}
.login-card {
  width: 100%; max-width: 404px;
  background: var(--panel);
  border-radius: 16px;
  padding: 34px 32px 26px;
  box-shadow: 0 20px 50px rgba(20, 35, 60, .10);
}
.login-card h2 { font-size: 22px; }
.login-card .sub { color: var(--muted); font-size: 12.5px; margin: 8px 0 22px; }
.login-card .fld { margin-bottom: 14px; }
.login-card .btn-block { width: 100%; margin-top: 6px; padding: 11px; font-size: 15px; }
.err { color: var(--red); font-size: 12.5px; min-height: 18px; margin-top: 8px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.quick span { color: var(--muted); font-size: 12px; margin-right: 2px; }
.qbtn {
  border: 1px solid var(--line); background: #f7f9fd; color: #41506a;
  border-radius: 20px; padding: 5px 14px; font-size: 12.5px; cursor: pointer;
  transition: .15s;
}
.qbtn:hover { border-color: var(--brand); color: var(--brand); background: #eef4ff; }
.hint { color: #98a1b3; font-size: 11.5px; margin-top: 14px; line-height: 1.7; }

/* ---------------- 整体布局 ---------------- */
.layout { display: flex; min-height: 100vh; }

.side {
  width: 228px; flex: 0 0 228px;
  background: linear-gradient(180deg, #12263d 0%, #0d1d30 100%);
  color: #cbd7e6;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 22px 18px 18px; }
.logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, #4a90ff, #2f6fed);
  color: #fff; font-weight: 700; display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(47, 111, 237, .4);
}
.brand b { display: block; color: #fff; font-size: 14px; letter-spacing: .5px; }
.brand small { display: block; color: #7e93ad; font-size: 11px; margin-top: 3px; }

.nav { padding: 8px 10px; overflow-y: auto; flex: 1; }
.nav-item {
  width: 100%; text-align: left; border: 0; background: transparent; color: #b7c6d8;
  padding: 10px 12px; border-radius: 9px; cursor: pointer; margin-bottom: 3px;
  display: flex; align-items: center; gap: 9px; font-size: 13.5px;
  transition: .15s;
}
.nav-item .dot { width: 5px; height: 5px; border-radius: 50%; background: #40587a; transition: .15s; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active { background: linear-gradient(90deg, rgba(47, 111, 237, .9), rgba(47, 111, 237, .55)); color: #fff; }
.nav-item.active .dot { background: #fff; }

.side-foot {
  padding: 14px; border-top: 1px solid rgba(255, 255, 255, .07);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 30px;
  background: rgba(255, 255, 255, .12); color: #fff;
  display: grid; place-items: center; font-size: 12.5px;
}
.who b { display: block; font-size: 12.5px; color: #eaf1fa; font-weight: 600; }
.who small { display: block; font-size: 11px; color: #7e93ad; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 58px; flex: 0 0 58px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px; position: sticky; top: 0; z-index: 20;
}
.crumb { font-weight: 600; font-size: 14.5px; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.pill {
  font-size: 11.5px; color: #52607a; background: #eef2f8;
  padding: 4px 10px; border-radius: 20px;
}
.pill-green { color: #1f7a52; background: #e6f4ed; }

.content { padding: 24px 28px 50px; max-width: 1560px; width: 100%; margin: 0 auto; }

/* ---------------- 通用 ---------------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { font-size: 20px; letter-spacing: .3px; }
.page-head p { color: var(--muted); font-size: 12.5px; margin-top: 7px; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.btn {
  border: 1px solid var(--line); background: #fff; color: #33415c;
  padding: 8px 15px; border-radius: 9px; cursor: pointer; transition: .15s;
  font-size: 13px; white-space: nowrap;
}
.btn:hover { border-color: #c9d5ea; background: #f7f9fd; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(47, 111, 237, .25); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-warn { background: #fff8ea; border-color: #f0d9ae; color: #a8690b; }
.btn-ghost { background: transparent; border-color: rgba(255, 255, 255, .18); color: #cbd7e6; }
.btn-ghost:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.btn-danger-ghost:hover { border-color: #f0c1b8; color: var(--red); background: #fff6f4; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn-block { display: block; width: 100%; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.stat {
  background: var(--panel); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); border: 1px solid #eef2f8;
}
.stat-label { color: var(--muted); font-size: 12px; }
.stat-value { font-size: 26px; font-weight: 700; margin: 8px 0 4px; letter-spacing: .5px; }
.stat-value small { font-size: 12px; color: var(--muted); font-weight: 400; }
.stat-sub { color: #9aa3b5; font-size: 11.5px; }
.stat-green .stat-value { color: var(--green); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }

.card {
  background: var(--panel); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid #eef2f8;
  margin-bottom: 16px; overflow: hidden;
}
.card-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 12px; gap: 10px; }
.card-head h3 { font-size: 14.5px; }
.card-head .muted { font-size: 11.5px; }
.chart { width: 100%; height: auto; display: block; padding: 0 8px 10px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left; font-weight: 600; color: #65708a; font-size: 12px;
  background: #f7f9fd; padding: 10px 14px; border-top: 1px solid #eef2f8;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
tbody td { padding: 10px 14px; border-bottom: 1px solid #f1f4fa; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafcff; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.ta-r { text-align: right; }
.ta-c { text-align: center; }
.strong { font-weight: 600; }
.muted { color: var(--muted); }
.w120 { width: 120px; }
.empty { text-align: center; color: #a7afc0; padding: 36px 0 !important; }

.tag {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 11.5px; line-height: 1.7; white-space: nowrap;
}
.tag-gray { background: #eef1f6; color: #6b7488; }
.tag-green { background: #e6f4ed; color: #1f7a52; }
.tag-blue { background: #e9f0ff; color: #2b5bd7; }
.tag-amber { background: #fdf3e2; color: #a8690b; }
.tag-yellow { background: #fbf8dd; color: #8a7614; }
.tag-red { background: #fdeceb; color: #b8432f; }
.prob { font-size: 11px; color: var(--muted); margin-left: 4px; font-variant-numeric: tabular-nums; }
.warn-fail { font-size: 12px; color: #8a4a3a; max-width: 240px; }

.hero-warn { background: linear-gradient(120deg, #4a1f1f 0%, #7a3326 55%, #b8432f 130%); }
.hero-warn .hero-score .pct { font-size: 22px; margin-left: 2px; opacity: .8; }
.reason-list { margin: 0; padding: 8px 18px 10px 36px; line-height: 2; font-size: 13px; color: #4c5870; }

.stat-red .stat-value { color: var(--red); }

.search {
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px;
  outline: none; font-size: 12.5px; width: 200px;
}
.search:focus { border-color: var(--brand); }

/* ---------------- 表单 ---------------- */
.fld { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.fld > span { font-size: 12px; color: #5d6982; }
.fld input, .fld select, .fld textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px;
  outline: none; background: #fff; width: 100%; transition: .15s;
}
.fld input:focus, .fld select:focus, .fld textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 111, 237, .1); }
.fld input[readonly] { background: #f5f7fb; color: #8b93a7; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; padding: 4px 18px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.score-input { width: 84px; border: 1px solid var(--line); border-radius: 7px; padding: 6px 9px; text-align: right; outline: none; }
.score-input:focus { border-color: var(--brand); }

.formula { padding: 4px 18px 18px; display: grid; gap: 8px; }
.formula code {
  display: block; background: #f5f8ff; color: #2c4a86; border: 1px solid #e3ebfb;
  padding: 9px 12px; border-radius: 8px; font-size: 12.5px;
  font-family: Consolas, "Courier New", monospace;
}
.formula.small { padding: 12px 18px 18px; }

.sample { margin: 0 18px 18px; background: #fafbff; border: 1px dashed #dfe7f5; border-radius: 10px; padding: 14px 16px; }
.sample-title { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.sample-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; color: #4c5870; }
.sample-row b { font-variant-numeric: tabular-nums; }
.sample-row .hl { color: var(--brand); font-size: 15px; }

.notice {
  margin: 0 18px 14px; background: #f3f7ff; color: #3a5a97;
  border-left: 3px solid var(--brand); padding: 10px 14px; border-radius: 0 8px 8px 0;
  font-size: 12.5px; line-height: 1.8;
}
.notice-warn { background: #fdf7ea; border-left-color: var(--amber); color: #8a6417; }
.foot-note { color: #98a1b3; font-size: 11.5px; line-height: 1.9; padding: 0 2px; }

/* ---------------- 学生端 ---------------- */
.hero {
  background: linear-gradient(120deg, #17335a 0%, #23508a 55%, #2f6fed 130%);
  color: #fff; border-radius: 16px; padding: 26px 28px;
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  margin-bottom: 16px; box-shadow: 0 12px 30px rgba(23, 51, 90, .22);
}
.hero-label { font-size: 12px; color: #a9c3e6; letter-spacing: 2px; }
.hero-score { font-size: 54px; font-weight: 700; line-height: 1.1; margin: 8px 0 6px; font-variant-numeric: tabular-nums; }
.hero-sub { font-size: 12.5px; color: #c2d5ee; }
.hero-side { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 34px; align-content: center; }
.hero-cell span { display: block; font-size: 11.5px; color: #a9c3e6; }
.hero-cell b { font-size: 19px; font-variant-numeric: tabular-nums; }

/* ---------------- 弹窗 / 提示 ---------------- */
.modal {
  position: fixed; inset: 0; background: rgba(15, 28, 46, .45);
  display: grid; place-items: center; z-index: 100; padding: 20px;
  backdrop-filter: blur(2px);
}
.modal-box {
  width: 100%; max-width: 460px; background: #fff; border-radius: 14px;
  box-shadow: 0 30px 70px rgba(10, 20, 40, .3); overflow: hidden;
  animation: pop .18s ease-out;
}
@keyframes pop { from { transform: translateY(8px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 18px; border-bottom: 1px solid var(--line); font-size: 14.5px;
}
.modal-head .x { border: 0; background: transparent; font-size: 20px; color: #9aa3b5; cursor: pointer; line-height: 1; }
.modal-body { padding: 18px; max-height: 70vh; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  background: #1b2437; color: #fff; padding: 11px 18px; border-radius: 10px;
  font-size: 13px; z-index: 200; box-shadow: 0 12px 30px rgba(10, 20, 40, .28);
  transition: .3s; opacity: 1;
}
.toast-warn { background: #8a6417; }
.toast.out { opacity: 0; transform: translate(-50%, 8px); }

/* ---------------- 云端模式 ---------------- */
.pill-warn { color: #8a6417; background: #fdf3e2; }
.cloud-hint { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); display: grid; gap: 3px; }
.cloud-hint b { font-size: 12px; color: #2b5bd7; }
.cloud-hint span { font-size: 11.5px; color: var(--muted); }
.linkbtn { border: 0; background: transparent; color: var(--brand); font-size: 11.5px; padding: 4px 0 0; cursor: pointer; text-align: left; }
.linkbtn:hover { text-decoration: underline; }
.fld-tip { font-style: normal; font-size: 11px; color: var(--muted); }
.proof-link { color: var(--brand); font-size: 12.5px; text-decoration: none; margin-right: 6px; }
.proof-link:hover { text-decoration: underline; }
.proof-name { font-size: 11px; color: var(--muted); }
.fld input[type="file"] { padding: 8px; background: #f7f9fd; border-style: dashed; }
tbody tr.me td { background: #eef4ff; }
.ok-inline { color: #1f7a52; font-size: 11.5px; }
.warn-inline { color: #a8690b; font-size: 11.5px; }
.note-line { font-size: 11px; color: #b8432f; line-height: 1.6; margin-top: 3px; max-width: 220px; white-space: normal; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1080px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .login-side { display: none; }
  .layout { flex-direction: column; }
  .side { width: 100%; flex: none; height: auto; position: static; }
  .nav { display: flex; overflow-x: auto; gap: 4px; padding: 6px 10px 10px; }
  .nav-item { width: auto; white-space: nowrap; margin: 0; }
  .side-foot { display: none; }
  .brand { padding: 14px 16px 8px; }
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .page-head { align-items: flex-start; }
  .form-grid { grid-template-columns: 1fr; }
}

@media print {
  .side, .topbar, .head-actions, .toast { display: none !important; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  .hero { box-shadow: none; }
  body { background: #fff; }
}

/* ---------------- 交互手感：非交互元素不出现文本选择光标 ---------------- */
.side, .topbar, .page-head, .card-head, .stat, .hero, .chart, th,
.tag, .pill, .btn, .qbtn, .nav-item, .linkbtn, .modal-head, .side-foot,
.stat-label, .stat-value, .stat-sub, .hero-cell, .hero-label, .hero-sub {
  -webkit-user-select: none;
  user-select: none;
}
.card, .stat, .hero, .chart, .table-wrap, .content, td { cursor: default; }
.chart svg { pointer-events: none; }
.stat, .hero, .card { -webkit-user-drag: none; }

/* 打印优化：表格行不跨页、表头每页重复 */
@media print {
  tr, .card, .stat, .hero, .notice { break-inside: avoid; page-break-inside: avoid; }
  thead { display: table-header-group; }
  .table-wrap { overflow: visible; }
  .content { padding: 0; }
}

/* ---------------- 移动端顶栏 ---------------- */
.top-logout { display: none; }
.crumb { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) {
  .top-logout { display: inline-block; }
  .topbar { gap: 8px; }
  .top-actions { gap: 6px; }
}
@media (max-width: 560px) {
  .pill-year { display: none; }
}

.nav-logout { display: none; }
@media (max-width: 900px) {
  .nav-logout { display: flex; color: #ff9b8a; }
  .nav-logout .dot { background: #ff9b8a; }
}

/* 附件预览 */
.proof-img { display: block; max-width: 100%; max-height: 60vh; margin: 0 auto; border-radius: 8px; border: 1px solid #e6eaf2; }
button.proof-link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
