:root {
  /* 蓝紫渐变主色：2025 大学生（Z世代）最受欢迎组合 deep purple → electric blue */
  --grad-a: #6D5BFF;      /* indigo / 数字薰衣草紫 */
  --grad-b: #3B82F6;      /* electric blue 电光蓝 */
  --primary: #5B4BFF;     /* 主品牌紫蓝 */
  --primary-dark: #4338CA;/* 深靛蓝 */
  --accent: #A78BFA;      /* digital lavender 数字薰衣草（点缀） */
  --bg: #F4F5FB;          /* 柔和偏冷的浅底 */
  --card: #ffffff;
  --text: #1E1B2E;        /* 略带紫调的墨色，更年轻 */
  --muted: #8B8AA3;
  --border: #ECEAF6;      /* 薰衣草灰描边 */
  --ok: #22B07D;          /* 鲜活绿 */
  --warn: #F59E0B;
  --bad: #F43F5E;         /* 玫红跳色（比正红更年轻） */
  --shadow: 0 4px 18px rgba(91, 75, 255, 0.10);
  --radius: 16px;
}

/* 轻动态渐变（克制多巴胺：签名渐变缓慢流动，增加年轻感） */
@keyframes gradShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: #E9E9F4;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
.hidden { display: none !important; }

/* 手机外壳（桌面预览时居中） */
.phone {
  max-width: 440px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 40px rgba(0,0,0,0.18);
}

/* 顶部栏 */
.app-header {
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
  background-size: 220% 220%;
  animation: gradShift 9s ease infinite;
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand-logo {
  background: #fff; color: var(--primary-dark);
  font-weight: 800; font-size: 13px;
  padding: 3px 7px; border-radius: 7px; letter-spacing: .5px;
}
.brand-text { font-size: 17px; font-weight: 700; letter-spacing: 1px; }
.brand-tag {
  font-size: 11px; background: rgba(255,255,255,.18);
  padding: 3px 8px; border-radius: 20px;
}

/* 主体 */
.app-main { flex: 1; padding: 12px; padding-bottom: 76px; }
.view { animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px);} to {opacity:1; transform:none;} }

/* 子栏（周次/视图切换） */
.subbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 10px; flex-wrap: wrap;
}
.week-ctrl { display: flex; align-items: center; gap: 4px; }
.wk-btn {
  border: none; background: var(--card); color: var(--primary);
  width: 32px; height: 32px; border-radius: 9px; font-size: 18px;
  box-shadow: var(--shadow); cursor: pointer;
}
.wk-pick { width: auto; padding: 0 12px; font-weight: 700; font-size: 13px; }
.subbar-right { display: flex; align-items: center; gap: 8px; }
.pill {
  border: 1px solid var(--primary); color: var(--primary);
  background: #fff; border-radius: 20px; padding: 5px 12px; font-size: 12px; cursor: pointer;
}
.seg { display: flex; background: #ECEAF6; border-radius: 20px; padding: 2px; }
.seg-btn {
  border: none; background: transparent; color: var(--muted);
  padding: 5px 12px; border-radius: 18px; font-size: 12px; cursor: pointer;
}
.seg-btn.active { background: #fff; color: var(--primary); font-weight: 700; box-shadow: var(--shadow); }

/* 周视图网格 */
.grid {
  display: grid;
  grid-template-columns: 40px repeat(7, minmax(60px, 1fr));
  grid-auto-rows: 60px;
  gap: 6px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: var(--shadow);
  overflow-x: auto;
}
.grid .g-head {
  text-align: center; font-size: 12px; font-weight: 700; color: var(--muted);
  align-self: center;
}
.grid .g-head.today { color: var(--primary); }
.grid .g-time {
  font-size: 10px; color: var(--muted); text-align: center;
  display: flex; flex-direction: column; justify-content: center; line-height: 1.2;
}
.grid .g-time b { color: var(--text); font-size: 11px; }
.course-cell {
  border-radius: 8px; padding: 6px 7px; font-size: 13px;
  overflow: hidden; cursor: pointer; display: flex; flex-direction: column;
  justify-content: flex-start; box-shadow: 0 1px 4px rgba(0,0,0,.10);
  line-height: 1.28;
}
.course-cell.dark { color: #fff; }
.course-cell.light { color: #1E1B2E; }
.course-cell .c-name {
  font-weight: 700; line-height: 1.28; font-size: 13px; letter-spacing: .2px;
  word-break: break-word; white-space: normal;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.course-cell .c-room {
  font-size: 8px; margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.course-cell.dark .c-room { color: rgba(255,255,255,.72); }
.course-cell.light .c-room { color: rgba(30,27,46,.55); }
.course-cell.sec-1 .c-room { display: none; }
.course-cell.conflict {
  outline: 2px solid #fff;
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.28) 0 6px, transparent 6px 12px);
}

/* 日视图 */
.day-tabs {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 8px;
}
.day-chip {
  flex: 0 0 auto; text-align: center; background: #fff; border-radius: 12px;
  padding: 7px 12px; min-width: 46px; box-shadow: var(--shadow); cursor: pointer;
  border: 2px solid transparent;
}
.day-chip .dc-d { font-size: 12px; font-weight: 700; }
.day-chip .dc-n { font-size: 10px; color: var(--muted); }
.day-chip.active { border-color: var(--primary); color: var(--primary); }
.day-list { display: flex; flex-direction: column; gap: 10px; }
.course-card {
  background: #fff; border-radius: var(--radius); padding: 12px 14px;
  box-shadow: var(--shadow); cursor: pointer; border-left: 4px solid var(--primary);
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.course-card .cc-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.course-card .cc-main .cc-name { font-weight: 700; font-size: 15px; }
.course-card .cc-main .cc-sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.course-card .cc-meta { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.course-card .cc-badge { font-size: 10px; background: #f3f1ff; color: var(--primary); padding: 2px 8px; border-radius: 20px; font-weight: 600; }
.course-card .cc-time { text-align: right; color: var(--primary); font-size: 12px; font-weight: 600; white-space: pre-line; flex: 0 0 auto; }
.empty-tip { text-align: center; color: var(--muted); padding: 40px 0; font-size: 13px; }

/* 成绩 */
.grade-hero {
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
  background-size: 220% 220%;
  animation: gradShift 9s ease infinite;
  color: #fff; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.grade-hero .gh-name { font-size: 15px; font-weight: 700; }
.grade-hero .gh-meta { font-size: 11px; opacity: .9; margin-top: 2px; }
.grade-hero .gh-gpa { text-align: right; }
.grade-hero .gh-gpa b { font-size: 30px; font-weight: 800; }
.grade-hero .gh-gpa span { font-size: 11px; opacity: .9; display: block; }
.term-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; }
.term-tab {
  flex: 0 0 auto; background: #fff; border: 1px solid var(--border); border-radius: 20px;
  padding: 6px 14px; font-size: 12px; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.term-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 700; }
.grade-row {
  background: #fff; border-radius: 12px; padding: 11px 14px; margin-bottom: 8px;
  box-shadow: var(--shadow); display: flex; align-items: center; cursor: pointer;
}
.grade-row .gr-name { flex: 1; font-weight: 600; }
.grade-row .gr-name small { display: block; color: var(--muted); font-weight: 400; font-size: 11px; margin-top: 2px; }
.grade-row .gr-score { font-size: 18px; font-weight: 800; margin: 0 14px; }
.grade-row .gr-credit { color: var(--muted); font-size: 11px; text-align: right; }
.gr-score.fail { color: var(--bad); }

/* 空教室 */
.card {
  background: #fff; border-radius: var(--radius); padding: 14px;
  box-shadow: var(--shadow); margin-bottom: 12px;
}
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.field input, .field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 10px; font-size: 14px; background: #fafbfd; color: var(--text);
}
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }
.sec-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sec-chip {
  border: 1px solid var(--border); background: #fafbfd; border-radius: 8px;
  padding: 6px 9px; font-size: 12px; cursor: pointer; color: var(--muted);
}
.sec-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 700; }
.btn-primary {
  width: 100%; border: none; background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
  color: #fff; padding: 12px; border-radius: 12px; font-size: 15px; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 16px rgba(91,75,255,.32);
}
.login-sync-status {
  background: #eef0ff; color: #4338CA; border: 1px solid #d9d3ff;
  border-radius: 10px; padding: 10px 12px; font-size: 12px; line-height: 1.6;
  margin: 10px 0 2px; word-break: break-word;
}
.login-relay { display: flex; flex-direction: column; }
.login-relay-tip {
  font-size: 12px; color: var(--text); line-height: 1.7; margin: 0 0 12px;
  background: #f3f1ff; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px;
}
.login-relay .field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.login-relay .field label { font-size: 12px; color: var(--muted); font-weight: 600; }
.login-relay .field input {
  border: 1px solid var(--border); border-radius: 10px; padding: 11px 12px; font-size: 14px;
  background: #fff; color: var(--text); outline: none;
}
.login-relay .field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91,75,255,.12); }
.login-demo { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.login-demo-sep { position: relative; text-align: center; margin-bottom: 10px; }
.login-demo-sep span { font-size: 11px; color: var(--muted); background: #fff; padding: 0 8px; position: relative; z-index: 1; }
.login-demo-sep::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--border); }
.login-demo .btn-ghost { width: 100%; margin-top: 4px; }
.captcha-row { display: flex; gap: 8px; align-items: stretch; }
.captcha-row input { flex: 1; }
#relayCaptchaImg {
  height: 44px; border-radius: 10px; border: 1px solid var(--border); background: #f6f8fb;
  cursor: pointer; object-fit: contain; min-width: 110px;
}
.login-extra { margin-top: 12px; text-align: center; font-size: 12px; color: var(--muted); }
.login-extra a { color: var(--primary); text-decoration: none; }
.login-extra .sep { margin: 0 8px; }
.remember-row { display: flex; align-items: center; margin: 4px 0 8px; }
.remember-check { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text); cursor: pointer; }
.remember-check input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.btn-ghost {
  width: 100%; border: 1px solid var(--bad); color: var(--bad); background: #fff;
  padding: 11px; border-radius: 12px; font-size: 14px; cursor: pointer; margin-top: 4px;
}
.room-result .rr-bar {
  height: 12px; border-radius: 8px; background: linear-gradient(90deg, var(--ok), var(--warn), var(--bad));
  position: relative; overflow: hidden; margin: 6px 0 4px;
}
.room-result .rr-bar i {
  position: absolute; right: 0; top: 0; bottom: 0; background: #fff; opacity: .85;
}
.room-result .rr-head { display: flex; justify-content: space-between; font-size: 13px; }
.room-result .rr-free { font-size: 24px; font-weight: 800; color: var(--ok); }
.room-result .rr-list { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.room-result .rr-item {
  background: #eafaf0; color: var(--ok); border-radius: 8px; padding: 5px 10px; font-size: 12px; font-weight: 600;
}
.room-result .rr-item.occ { background: #fdecea; color: var(--bad); }
.collapse-title { margin-top: 10px; font-size: 12px; color: var(--primary); cursor: pointer; }

/* 空教室：全校聚合（按教学楼分组） */
.room-result .rr-title { font-weight: 700; font-size: 14px; color: var(--text); }
.room-result .rr-sum { font-size: 13px; font-weight: 800; color: var(--ok); white-space: nowrap; }
.room-result .rr-selbar {
  margin-top: 8px; font-size: 11px; color: var(--muted); line-height: 1.4;
  background: #f4f3fb; border: 1px dashed var(--border); border-radius: 9px; padding: 7px 9px;
}
.room-result .rr-selbar.active { color: var(--primary); border-color: var(--primary); background: #eef3ff; font-weight: 600; }
.room-result .rr-building {
  margin-top: 12px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px;
  box-shadow: var(--shadow);
}
.room-result .rrb-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.room-result .rrb-name { font-weight: 700; font-size: 13px; color: #2a2350; }
.room-result .rrb-sum { font-size: 12px; font-weight: 700; color: var(--ok); white-space: nowrap; }
/* 空闲教室可点选（勾选高亮） */
.room-result .rr-item { cursor: pointer; transition: transform .1s, box-shadow .1s, background .12s; }
.room-result .rr-item:active { transform: scale(.94); }
.room-result .rr-item.sel {
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b)); color: #fff;
  box-shadow: 0 4px 12px rgba(109,91,255,.28);
}

/* 我的 */
.me-card .me-top { display: flex; align-items: center; gap: 12px; }
.me-avatar {
  width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
  background-size: 220% 220%; animation: gradShift 9s ease infinite;
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800;
}
.me-info .me-name { font-size: 17px; font-weight: 700; }
.me-info .me-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.me-rows { margin-top: 12px; border-top: 1px solid var(--border); }
.me-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.me-k { color: var(--muted); }
.me-v { color: var(--text); font-weight: 600; max-width: 60%; text-align: right; word-break: break-word; }
.me-v-empty { color: #b9b6cc; font-weight: 500; font-style: italic; }
.btn-sync {
  width: 100%; margin-top: 16px; border: 1px solid var(--primary); background: #fff; color: var(--primary);
  padding: 11px; border-radius: 12px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.btn-sync:active { background: #eef3fb; }
.me-sync { margin-top: 12px; font-size: 12px; color: var(--muted); text-align: center; }
/* 上课提醒设置 */
.me-remind { margin-top: 16px; background: linear-gradient(135deg,#f6f4ff,#eef4ff); border: 1px solid #e6e1fb; border-radius: 14px; padding: 14px; }
.mr-head { display: flex; align-items: center; justify-content: space-between; }
.mr-title { font-weight: 700; font-size: 15px; color: #2a2350; }
.mr-desc { font-size: 12px; color: #7a7596; margin: 6px 0 10px; line-height: 1.5; }
.mr-body.hidden { display: none; }
.mr-field { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-top: 1px dashed #e6e1fb; }
.mr-field label { font-size: 13px; color: #443f63; }
.mr-select { border: 1px solid #d8d2f0; border-radius: 9px; padding: 6px 8px; font-size: 13px; background: #fff; color: #2a2350; }
.mr-status { margin-top: 8px; font-size: 12px; color: #7a7596; min-height: 16px; }
.mr-status.ok { color: #22B07D; font-weight: 600; }
.mr-status.err { color: #F43F5E; font-weight: 600; }
/* 开关 */
.mr-toggle { width: 44px; height: 24px; border-radius: 24px; background: #cfc9e6; position: relative; cursor: pointer; transition: background .2s; flex: 0 0 auto; }
.mr-toggle.on { background: linear-gradient(135deg,#6D5BFF,#3B82F6); }
.mr-knob { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .2s; }
.mr-toggle.on .mr-knob { left: 22px; }
.me-empty { text-align: center; padding: 28px 16px; }
.me-empty-icon { font-size: 40px; }
.me-empty-title { font-size: 16px; font-weight: 700; margin-top: 8px; }
.me-empty-sub { color: var(--muted); font-size: 12px; margin: 6px 0 16px; }
.block-title { font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.doc-text { font-size: 12px; color: #45506a; line-height: 1.7; }
.doc-text ol { padding-left: 18px; margin: 6px 0; }
.doc-text code { background: #f3f1ff; padding: 1px 5px; border-radius: 4px; font-size: 11px; }

/* 运行状态指示灯 */
.status-line { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.status-dot {
  width: 10px; height: 10px; border-radius: 50%; background: #d1d1e0;
  box-shadow: 0 0 0 0 rgba(34,176,125,.35); transition: background .2s, box-shadow .2s;
}
.status-dot.ok { background: var(--ok); box-shadow: 0 0 0 4px rgba(34,176,125,.18); }
.status-dot.err { background: var(--bad); box-shadow: 0 0 0 4px rgba(244,63,94,.18); }
.status-text { font-size: 13px; color: var(--text); font-weight: 600; }
.status-hint {
  margin-top: 8px; padding: 8px 10px; background: #fdecea; color: var(--bad);
  border-radius: 9px; font-size: 12px; line-height: 1.5;
}

/* 学习工具（开发中占位入口） */
.me-tools { margin-top: 18px; }
.me-tools > b { display: block; font-size: 14px; color: #2a2350; margin-bottom: 10px; }
.mt-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.mt-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 8px; border: 1px solid #e6e1fb; border-radius: 14px;
  background: #fff; cursor: pointer; position: relative; transition: transform .12s, box-shadow .12s, border-color .12s;
}
.mt-item:active { transform: scale(.97); box-shadow: 0 6px 16px rgba(109,91,255,.14); border-color: #cfc6f5; }
.mt-icon { font-size: 22px; line-height: 1; }
.mt-name { font-size: 13px; font-weight: 600; color: #443f63; }
.mt-badge {
  position: absolute; top: 7px; right: 7px; font-size: 10px; font-weight: 700; color: #8a84a8;
  background: #f1eefb; border: 1px solid #e3def7; border-radius: 8px; padding: 1px 6px;
}

/* 底部 Tab */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 440px; background: #fff; border-top: 1px solid var(--border);
  display: flex; z-index: 30;
}
.tab {
  flex: 1; border: none; background: none; padding: 8px 0 10px; cursor: pointer;
  color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px;
}
.tab .tab-ico { font-size: 19px; }
.tab.active { color: var(--primary); font-weight: 700; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(10,20,40,.5);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 24px;
}
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 360px; padding: 18px;
  animation: pop .2s ease; max-height: 86vh; overflow-y: auto;
}
@keyframes pop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-title { font-size: 17px; font-weight: 800; margin-bottom: 12px; color: var(--primary-dark); }
.modal-body .kv { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.modal-body .kv span:first-child { color: var(--muted); }
.modal-close {
  width: 100%; margin-top: 14px; border: none; background: var(--primary); color: #fff;
  padding: 11px; border-radius: 10px; font-size: 14px; font-weight: 700; cursor: pointer;
}
.login-modal .login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.login-title { font-size: 16px; font-weight: 800; }
.login-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.login-hint { font-size: 11px; color: var(--muted); margin: 8px 0; }
.login-err { color: var(--bad); font-size: 12px; min-height: 16px; margin-top: 6px; text-align: center; }
.sf-icon { font-size: 40px; text-align: center; margin-bottom: 4px; }
.second-factor-modal .login-relay-tip { margin-bottom: 14px; }
.second-factor-modal .field { margin-bottom: 12px; }
.second-factor-modal .btn-ghost { margin-top: 10px; }

/* 首页（个性化聚合，对标「千人千面」首屏） */
.home-greet { background: linear-gradient(135deg, var(--grad-a), var(--grad-b)); background-size: 220% 220%; animation: gradShift 9s ease infinite; color: #fff; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.home-greet .hg-hi { font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.home-greet .hg-icon { font-size: 22px; }
.home-greet .hg-sub { font-size: 12px; opacity: .92; margin-top: 4px; }
.home-greet .hg-tag { font-size: 12px; opacity: .9; margin-top: 4px; }
.home-today { background: #fff; border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); margin-bottom: 12px; }
.home-today .ht-title { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.home-today .ht-empty { color: var(--muted); font-size: 13px; padding: 10px 0; }
.home-today .ht-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0 10px 10px; border-bottom: 1px solid var(--border); border-left: 4px solid var(--primary); cursor: pointer; }
.home-today .ht-item:last-of-type { border-bottom: none; }
.home-today .ht-main { flex: 1; min-width: 0; }
.home-today .ht-name { font-weight: 700; font-size: 14px; }
.home-today .ht-sub { color: var(--muted); font-size: 11px; margin-top: 2px; }
.home-today .ht-right { flex: 0 0 auto; text-align: right; padding-left: 8px; }
.home-today .ht-time { color: var(--primary); font-weight: 700; font-size: 12px; white-space: nowrap; }
.home-today .ht-status { display: inline-block; margin-top: 4px; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.home-today .ht-status.soon { background: #eef0ff; color: var(--primary); }
.home-today .ht-status.live { background: #eafaf0; color: var(--ok); }
.home-today .ht-status.done { background: #f1f1f6; color: var(--muted); }
.home-today .ht-next { margin-top: 10px; background: #eef0ff; color: var(--primary); border-radius: 10px; padding: 8px 10px; font-size: 12px; font-weight: 700; }
.home-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
.home-stats .hs-item { background: #fff; border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); text-align: center; }
.home-stats .hs-v { font-size: 22px; font-weight: 800; color: var(--primary); }
.home-stats .hs-l { font-size: 11px; color: var(--muted); margin-top: 3px; }
.home-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.home-quick .hq-item { background: #fff; border-radius: var(--radius); padding: 12px 4px; box-shadow: var(--shadow); text-align: center; cursor: pointer; }
.home-quick .hq-ico { font-size: 22px; }
.home-quick .hq-t { font-size: 11px; color: var(--text); margin-top: 4px; }
.home-notice { background: #fff; border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.home-notice .hn-title { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.home-notice .hn-item { font-size: 12px; color: var(--muted); line-height: 1.6; }

/* 成绩分析 */
.grade-analyze { background: #fff; border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); margin-bottom: 12px; }
.grade-analyze .ga-title { font-size: 13px; font-weight: 700; margin: 4px 0 10px; }
.grade-analyze .ga-donut { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.grade-analyze .ga-svg { width: 150px; height: 150px; flex: 0 0 auto; }
.grade-analyze .ga-center-num { font-size: 26px; font-weight: 800; fill: var(--text); }
.grade-analyze .ga-center-lbl { font-size: 11px; fill: var(--muted); }
.grade-analyze .ga-legend { display: flex; flex-direction: column; gap: 7px; flex: 1; min-width: 120px; }
.grade-analyze .ga-leg-item { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.grade-analyze .ga-leg-dot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.grade-analyze .ga-leg-name { color: var(--text); }
.grade-analyze .ga-leg-val { margin-left: auto; color: var(--muted); font-weight: 700; }
.grade-analyze .ga-trend { width: 100%; margin-bottom: 4px; }
.grade-analyze .ga-trend-svg { width: 100%; height: auto; display: block; }
.grade-analyze .ga-axis { stroke: var(--border); stroke-width: 1; }
.grade-analyze .ga-area { fill: rgba(91,75,255,.12); }
.grade-analyze .ga-line { fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.grade-analyze .ga-dot { fill: #fff; stroke: var(--primary); stroke-width: 2.5; }
.grade-analyze .ga-pt-val { font-size: 10px; font-weight: 700; fill: var(--primary); }
.grade-analyze .ga-pt-x { font-size: 9px; fill: var(--muted); }
.grade-analyze .ga-chart { display: flex; flex-direction: column; gap: 7px; }
.grade-analyze .ga-bar { position: relative; height: 22px; background: #f3f1ff; border-radius: 7px; overflow: hidden; display: flex; align-items: center; }
.grade-analyze .ga-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 7px; }
.grade-analyze .ga-lbl { position: relative; z-index: 2; font-size: 11px; font-weight: 600; padding-left: 8px; color: #1a2233; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 68%; }
.grade-analyze .ga-val { position: relative; z-index: 2; margin-left: auto; padding-right: 8px; font-size: 12px; font-weight: 800; color: #1a2233; }
.grade-analyze .ga-warn { margin-top: 10px; background: #fdecea; color: var(--bad); border-radius: 10px; padding: 8px 10px; font-size: 12px; font-weight: 700; }

/* 刷新按钮（课表 / 成绩） */
.wk-refresh {
  width: 32px; height: 32px; border: none; background: var(--card);
  color: var(--primary); border-radius: 9px; font-size: 18px; line-height: 1;
  box-shadow: var(--shadow); cursor: pointer; flex: 0 0 auto;
}
.wk-refresh:active { transform: scale(.92); }
.grade-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.grade-bar .term-tabs { flex: 1; padding-bottom: 0; }

/* 全局加载遮罩 */
.loading-overlay {
  position: fixed; inset: 0; background: rgba(244,245,251,.8);
  display: flex; align-items: center; justify-content: center; z-index: 60;
}
.loading-overlay.hidden { display: none; }
.loading-overlay .spin-wrap { text-align: center; }
.loading-overlay .spinner {
  width: 36px; height: 36px; margin: 0 auto;
  border: 3px solid rgba(91,75,255,.22); border-top-color: var(--primary);
  border-radius: 50%; animation: spin .8s linear infinite;
}
.loading-overlay .l-text { margin-top: 12px; color: var(--primary); font-size: 13px; font-weight: 700; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 桌面预览：把页面外框柔化成圆角设备感，消掉直角白矩形的生硬感（真机满屏不受影响） */
@media (min-width: 481px) {
  .phone {
    border-radius: 30px;
    overflow: hidden;
    margin: 18px auto;
    min-height: calc(100vh - 36px);
  }
  .app-header { border-radius: 30px 30px 0 0; }
  .tabbar { border-radius: 0 0 30px 30px; }
}
