* { margin:0; padding:0; box-sizing:border-box; }
:root {
  --primary:#4f6ef7; --primary-dark:#3a56d4; --primary-soft:rgba(79,110,247,.14);
  --text:#1d2333; --muted:#5c6478; --border:rgba(255,255,255,.6);
  --ok:#2f9e63; --danger:#e5484d;
  --radius:22px;
  --glass:rgba(255,255,255,.6);
  --glass-strong:rgba(255,255,255,.78);
  --shadow:0 8px 32px rgba(31,38,135,.14);
  --shadow-hover:0 14px 40px rgba(31,38,135,.22);
}
body {
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;
  background:linear-gradient(rgba(12,18,38,.32),rgba(12,18,38,.42)), url('/static/bg.jpg') center/cover fixed no-repeat;
  color:var(--text); -webkit-font-smoothing:antialiased; min-height:100vh;
}
.app { max-width:900px; margin:0 auto; padding:0 16px 80px; }

/* ---------- 顶栏（玻璃） ---------- */
.topbar {
  display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px;
  padding:16px 4px; position:sticky; top:0; z-index:20;
  background:rgba(255,255,255,.5); backdrop-filter:blur(18px) saturate(1.6); -webkit-backdrop-filter:blur(18px) saturate(1.6);
  border-bottom:1px solid rgba(255,255,255,.45);
}
.brand { font-size:21px; font-weight:800; letter-spacing:.4px; background:linear-gradient(90deg,#3b5bf0,#7b5cf0); -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; filter:drop-shadow(0 2px 6px rgba(255,255,255,.6)); }
.nav { display:flex; gap:8px; flex-wrap:wrap; }
.nav-btn {
  border:1px solid rgba(255,255,255,.55); background:rgba(255,255,255,.45); color:#3a4156;
  padding:8px 16px; border-radius:999px; font-size:14px; font-weight:600; cursor:pointer;
  backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px); transition:.2s;
}
.nav-btn:hover { background:rgba(255,255,255,.75); transform:translateY(-1px); }
.nav-btn.active { background:linear-gradient(135deg,var(--primary),#8b5cf6); color:#fff; border-color:transparent; box-shadow:0 6px 18px rgba(79,110,247,.4); }

/* ---------- 页面切换 ---------- */
.page { display:none; }
.page.active { display:block; animation:fade .25s ease; }
@keyframes fade { from{opacity:0; transform:translateY(8px)} to{opacity:1; transform:none} }

/* ---------- 玻璃卡片 ---------- */
.card {
  background:var(--glass); backdrop-filter:blur(20px) saturate(1.6); -webkit-backdrop-filter:blur(20px) saturate(1.6);
  border:1px solid rgba(255,255,255,.55); border-radius:var(--radius); padding:18px;
  box-shadow:var(--shadow); transition:box-shadow .25s, transform .25s;
}
@media (hover:hover) {
  .cards .card:hover { box-shadow:var(--shadow-hover); transform:translateY(-2px); }
}
.section-title { display:flex; align-items:center; gap:9px; font-size:16px; font-weight:800; margin:26px 0 12px; color:#fff; text-shadow:0 1px 8px rgba(0,0,0,.45); }
.section-title::before { content:""; width:5px; height:18px; border-radius:3px; background:linear-gradient(180deg,#7dd3fc,#8b5cf6); box-shadow:0 0 10px rgba(125,211,252,.6); }
.cards { display:flex; flex-direction:column; gap:12px; }
.cards .card { padding:15px 18px; }

.muted { color:var(--muted); }
.small { font-size:12px; }
h2 { font-size:20px; margin-bottom:4px; }
h3 { font-size:16px; margin-bottom:12px; }

/* ---------- 欢迎卡（渐变玻璃） ---------- */
.welcome {
  position:relative; overflow:hidden; color:#fff; border:none;
  background:linear-gradient(135deg,rgba(79,110,247,.72) 0%,rgba(123,92,240,.68) 55%,rgba(155,108,246,.62) 100%);
  backdrop-filter:blur(24px) saturate(1.5); -webkit-backdrop-filter:blur(24px) saturate(1.5);
  border:1px solid rgba(255,255,255,.5);
}
.welcome::before, .welcome::after { content:""; position:absolute; border-radius:50%; pointer-events:none; }
.welcome::before { width:240px; height:240px; top:-120px; right:-70px; background:radial-gradient(circle,rgba(255,255,255,.35),transparent 70%); }
.welcome::after { width:170px; height:170px; bottom:-90px; left:-50px; background:radial-gradient(circle,rgba(255,255,255,.22),transparent 70%); }
.welcome > * { position:relative; z-index:1; }
.welcome .quote { font-size:18px; font-weight:700; line-height:1.8; margin-bottom:8px; text-shadow:0 2px 10px rgba(0,0,0,.25); }
.welcome .muted { color:rgba(255,255,255,.92); text-shadow:0 1px 4px rgba(0,0,0,.2); }

/* ---------- 作业 / 考试卡 ---------- */
.exam-card { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.exam-card .ename { font-weight:700; }
.exam-card .days { color:var(--primary); font-weight:800; font-size:13px; white-space:nowrap; background:var(--primary-soft); padding:6px 14px; border-radius:999px; box-shadow:inset 0 0 0 1px rgba(79,110,247,.18); }
.exam-card .detail { font-size:12px; color:var(--muted); margin-top:4px; }
.danger-text { color:var(--danger) !important; background:rgba(229,72,77,.14) !important; box-shadow:inset 0 0 0 1px rgba(229,72,77,.2) !important; }
.exam-card .days.muted { background:rgba(90,100,120,.12); color:var(--muted); box-shadow:inset 0 0 0 1px rgba(90,100,120,.16); }
.assign-done { opacity:.6; }
.assign-done .ename { text-decoration:line-through; }

/* ---------- 课表行（今日/明日） ---------- */
.course-row { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.course-row .cname { font-weight:700; }
.course-row .cinfo { font-size:12px; color:var(--muted); margin-top:4px; }
.course-row .csection { color:var(--primary); font-weight:800; font-size:13px; white-space:nowrap; background:var(--primary-soft); padding:6px 14px; border-radius:999px; box-shadow:inset 0 0 0 1px rgba(79,110,247,.18); }

/* ---------- 课表整周（玻璃） ---------- */
.week-bar { display:flex; align-items:center; gap:8px; margin-bottom:16px; flex-wrap:wrap; }
.week-bar select {
  padding:9px 14px; border:1px solid rgba(255,255,255,.6); border-radius:14px; background:rgba(255,255,255,.75);
  font-size:14px; font-weight:700; color:var(--primary); outline:none; box-shadow:var(--shadow); cursor:pointer;
  backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px);
}
.week-bar .btn { padding:8px 14px; font-size:16px; line-height:1; }
.week-table-wrap {
  overflow-x:auto; background:var(--glass); backdrop-filter:blur(20px) saturate(1.5); -webkit-backdrop-filter:blur(20px) saturate(1.5);
  border-radius:var(--radius); box-shadow:var(--shadow); border:1px solid rgba(255,255,255,.55);
}
.week-table { width:100%; min-width:790px; border-collapse:collapse; }
.week-table th { background:rgba(255,255,255,.5); color:#3a4156; font-size:13px; font-weight:700; padding:12px 8px; text-align:center; border-bottom:1px solid rgba(230,233,240,.7); position:sticky; top:0; z-index:2; }
.week-table th.today-col { background:linear-gradient(180deg,rgba(125,211,252,.4),rgba(139,92,246,.25)); color:var(--primary-dark); }
.week-table td { border:1px solid rgba(230,233,240,.6); vertical-align:top; padding:6px; min-height:80px; height:80px; width:12.5%; }
.week-table td.today-col { background:rgba(125,211,252,.14); }
.week-table .sec-cell { background:rgba(255,255,255,.45); font-weight:700; font-size:13px; text-align:center; white-space:nowrap; width:9%; }
.week-table .sec-time { font-weight:400; font-size:11px; color:var(--muted); margin-top:2px; }
.cell-course {
  background:linear-gradient(135deg,rgba(255,255,255,.85),rgba(238,241,255,.9)); border-left:3px solid var(--primary);
  border-radius:10px; padding:7px 9px; margin-bottom:5px; font-size:12px; font-weight:700; color:#3a4a9f; line-height:1.4;
  box-shadow:0 2px 8px rgba(31,38,135,.08);
}
.cell-course span { display:block; font-weight:400; font-size:11px; color:var(--muted); margin-top:2px; }

/* ---------- 通用表格（玻璃） ---------- */
table {
  width:100%; border-collapse:collapse; background:var(--glass); backdrop-filter:blur(16px); -webkit-backdrop-filter:blur(16px);
  border-radius:16px; overflow:hidden; box-shadow:var(--shadow); border:1px solid rgba(255,255,255,.5);
}
th,td { padding:12px 10px; text-align:left; font-size:14px; border-bottom:1px solid rgba(230,233,240,.6); }
th { background:rgba(255,255,255,.5); color:#3a4156; font-size:13px; }
tr:last-child td { border-bottom:none; }

/* ---------- 绩点 ---------- */
.gpa-tip { background:rgba(255,255,255,.5); border:1px dashed rgba(139,92,246,.5); border-radius:12px; padding:8px 12px; margin-bottom:16px; line-height:1.6; backdrop-filter:blur(8px); }
.gpa-row { display:grid; grid-template-columns:1.6fr .7fr .7fr .7fr 34px; gap:8px; align-items:center; margin-bottom:8px; }
.gpa-row.header { font-size:12px; color:var(--muted); font-weight:600; }
.gpa-row input {
  width:100%; padding:10px 12px; border:1px solid rgba(255,255,255,.6); border-radius:12px; font-size:14px; outline:none;
  background:rgba(255,255,255,.7); backdrop-filter:blur(8px); transition:border-color .15s, box-shadow .15s;
}
.gpa-row input:focus { border-color:var(--primary); box-shadow:0 0 0 3px rgba(79,110,247,.2); }
.gpa-row .gp { text-align:center; font-weight:700; color:var(--primary); }
.gpa-row .del { border:none; background:rgba(229,72,77,.15); color:var(--danger); width:32px; height:32px; border-radius:10px; cursor:pointer; font-weight:700; }
.gpa-actions { display:flex; gap:10px; margin-top:12px; }
.gpa-result {
  margin-top:16px; padding:16px 18px; border-radius:14px; font-size:15px; line-height:1.9; display:none;
  background:linear-gradient(135deg,rgba(47,158,99,.16),rgba(47,158,99,.1)); backdrop-filter:blur(12px);
  border:1px solid rgba(47,158,99,.25);
}
.gpa-result .big { font-size:27px; font-weight:800; color:var(--ok); }

/* ---------- 通知 ---------- */
.notice-item { padding:16px 18px; margin-bottom:12px; }
.notice-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:6px; }
.notice-head b { font-size:15px; color:#1d2333; }
.notice-content { font-size:14px; color:#3a4156; line-height:1.8; white-space:pre-wrap; }
.notice-mini { padding:13px 16px; margin-bottom:10px; }
.more-link { text-align:center; padding:6px 0 2px; }
.more-link a { color:var(--primary-dark); text-decoration:none; font-size:13px; font-weight:700; }
.more-link a:hover { text-decoration:underline; }

/* ---------- 按钮 ---------- */
.btn { border:none; padding:11px 20px; border-radius:14px; font-size:14px; font-weight:700; cursor:pointer; transition:.2s; }
.btn.primary { background:linear-gradient(135deg,var(--primary),#8b5cf6); color:#fff; box-shadow:0 6px 18px rgba(79,110,247,.35); }
.btn.primary:hover { transform:translateY(-1px); box-shadow:0 10px 24px rgba(79,110,247,.42); filter:brightness(1.05); }
.btn.secondary { background:rgba(255,255,255,.7); color:#3a4156; border:1px solid rgba(255,255,255,.6); backdrop-filter:blur(8px); }
.btn.secondary:hover { background:rgba(255,255,255,.92); }
.btn.danger { background:rgba(229,72,77,.16); color:var(--danger); }
.btn.danger:hover { background:rgba(229,72,77,.24); }
.btn:disabled { opacity:.5; cursor:not-allowed; }

/* ---------- 管理后台 ---------- */
.admin-tabs { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:18px; }
.admin-tabs .atab { border:1px solid rgba(255,255,255,.55); background:rgba(255,255,255,.55); backdrop-filter:blur(8px); }
.admin-tabs .atab.active { background:linear-gradient(135deg,var(--primary),#8b5cf6); color:#fff; border-color:transparent; box-shadow:0 6px 18px rgba(79,110,247,.35); }
.atab-pane { display:none; }
.atab-pane.active { display:block; animation:fade .2s ease; }
.admin-form {
  background:rgba(255,255,255,.62); border:1px solid rgba(255,255,255,.6); border-radius:16px; padding:16px; margin-bottom:16px;
  display:flex; flex-direction:column; gap:9px; box-shadow:var(--shadow); backdrop-filter:blur(16px); -webkit-backdrop-filter:blur(16px);
}
.admin-form input, .admin-form select, .admin-form textarea {
  padding:11px 13px; border:1px solid rgba(255,255,255,.65); border-radius:12px; font-size:14px; outline:none;
  background:rgba(255,255,255,.72); transition:border-color .15s, box-shadow .15s; font-family:inherit; backdrop-filter:blur(8px);
}
.admin-form input:focus, .admin-form select:focus, .admin-form textarea:focus { border-color:var(--primary); box-shadow:0 0 0 3px rgba(79,110,247,.2); }
.admin-form textarea { min-height:60px; resize:vertical; }
.admin-form .row2 { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.admin-list-item {
  display:flex; justify-content:space-between; align-items:center; gap:10px; padding:12px 14px;
  background:rgba(255,255,255,.65); border:1px solid rgba(255,255,255,.6); border-radius:14px; margin-bottom:9px; font-size:14px;
  backdrop-filter:blur(10px); transition:box-shadow .15s;
}
.admin-list-item:hover { box-shadow:var(--shadow); }
.admin-list-item .del-btn { border:none; background:rgba(229,72,77,.16); color:var(--danger); padding:6px 14px; border-radius:10px; cursor:pointer; font-weight:700; }
.admin-list-item .del-btn:hover { background:rgba(229,72,77,.26); }
.empty { color:var(--muted); text-align:center; padding:28px; }

#admin-login { max-width:360px; margin:50px auto; }
#admin-login input {
  padding:12px 14px; border:1px solid rgba(255,255,255,.65); border-radius:12px; font-size:14px; width:100%; margin-bottom:12px;
  outline:none; background:rgba(255,255,255,.75); transition:border-color .15s, box-shadow .15s; backdrop-filter:blur(8px);
}
#admin-login input:focus { border-color:var(--primary); box-shadow:0 0 0 3px rgba(79,110,247,.2); }

/* ---------- 页脚 ---------- */
.footer { text-align:center; margin-top:40px; padding-top:18px; border-top:1px solid rgba(255,255,255,.4); color:rgba(255,255,255,.85); font-size:12px; text-shadow:0 1px 6px rgba(0,0,0,.4); }

/* ---------- 移动端 ---------- */
@media (max-width:560px) {
  .brand { font-size:18px; }
  .card { border-radius:18px; }
  .gpa-row { grid-template-columns:1.4fr .7fr .7fr .7fr 30px; }
}
