/* ============================================================
   Canvas 交大版 · 桌面版
   两套配色 · 14 个语义色位 · 课程固定色相
   ============================================================ */

/* ---------- 主题 ---------- */
:root {
  --brand: #c8102e;
  --brand-2: #e4232c;
  --brand-soft: rgba(200, 16, 46, .12);

  --danger: #f04438;
  --warn: #f79009;
  --ok: #12b76a;
  --info: #2e90fa;
  --violet: #a855f7;

  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --maxw: 1180px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #080a0e;
  --bg-2: #0c0f14;
  --surface: #12161d;
  --surface-2: #171c24;
  --surface-3: #1d232d;
  --line: rgba(255, 255, 255, .075);
  --line-strong: rgba(255, 255, 255, .14);
  --text: #edf0f5;
  --text-2: #c3cad6;
  --muted: #8f99a8;
  --faint: #6a7484;
  --shadow-lg: 0 24px 60px -30px rgba(0, 0, 0, .9);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, .35);
  --hero-a: #7d0a1c;
  --hero-b: #3d0710;
  --glow: rgba(228, 35, 44, .28);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f3f6;
  --bg-2: #eceef3;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eef0f4;
  --line: rgba(17, 24, 39, .085);
  --line-strong: rgba(17, 24, 39, .16);
  --text: #12161d;
  --text-2: #333a46;
  --muted: #5f6a7a;
  --faint: #8b95a4;
  --shadow-lg: 0 26px 50px -34px rgba(17, 24, 39, .45);
  --shadow-sm: 0 1px 3px rgba(17, 24, 39, .08);
  --hero-a: #c8102e;
  --hero-b: #8b0c20;
  --glow: rgba(200, 16, 46, .18);
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI",
        "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; }
li { list-style: none; }
button { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--brand); color: #fff; }

:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 2px;
  border-radius: 8px;
}

/* 背景氛围 */
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.ambient i {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .5;
}
.ambient i:nth-child(1) {
  width: 620px; height: 620px;
  left: -180px; top: -240px;
  background: var(--glow);
}
.ambient i:nth-child(2) {
  width: 520px; height: 520px;
  right: -160px; top: 120px;
  background: rgba(46, 144, 250, .16);
}
.ambient i:nth-child(3) {
  width: 460px; height: 460px;
  left: 40%; bottom: -260px;
  background: rgba(168, 85, 247, .12);
}

:root[data-theme="light"] .ambient i { opacity: .3; }
:root[data-theme="light"] .ambient i:nth-child(2) { opacity: .22; }
:root[data-theme="light"] .ambient i:nth-child(3) { opacity: .18; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 22px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 24px 12px;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease);
}
.topbar.is-stuck { border-bottom-color: var(--line); }

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

.brand-mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: linear-gradient(160deg, var(--brand-2), var(--brand));
  color: #fff;
  font-weight: 800;
  font-size: 19px;
  box-shadow: 0 6px 16px -6px rgba(200, 16, 46, .8), inset 0 1px 0 rgba(255,255,255,.25);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 15px; letter-spacing: .01em; }
.brand-text small { font-size: 11px; color: var(--faint); letter-spacing: .06em; }
.brand-text .only-narrow { display: none; }

.tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  margin-left: auto;
}
.tab {
  border: 0;
  background: transparent;
  padding: 7px 16px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
  white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.is-active {
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.top-actions { display: flex; align-items: center; gap: 10px; }

.conn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  white-space: nowrap;
}
.conn i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--faint);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--faint) 22%, transparent);
}
.conn[data-mode="live"] i { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 24%, transparent); }
.conn[data-mode="error"] i { background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 24%, transparent); }
.conn[data-mode="demo"] i { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 24%, transparent); }

.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  transition: color .2s var(--ease), background .2s var(--ease), transform .2s var(--ease);
}
.icon-btn:hover { color: var(--text); background: var(--surface-3); }
.icon-btn:active { transform: scale(.95); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .16s var(--ease), background .2s var(--ease),
              border-color .2s var(--ease), color .2s var(--ease), opacity .2s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-3); color: var(--text); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn.primary {
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px -12px rgba(200, 16, 46, .9);
}
.btn.primary:hover { filter: brightness(1.06); color: #fff; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.btn.small { padding: 6px 12px; font-size: 12.5px; }
.btn[disabled] { opacity: .55; cursor: progress; }

.link {
  border: 0;
  background: none;
  padding: 2px 4px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  transition: color .18s var(--ease);
  white-space: nowrap;
}
.link:hover { color: var(--brand-2); }
.link.tiny { font-size: 11.5px; }

/* ---------- 布局 ---------- */
.layout {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 10px 24px 64px;
}

.view { display: none; animation: rise .32s var(--ease) both; }
.view.is-active { display: block; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.col-main, .col-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

#view-home.is-active {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: start;
}

/* ---------- 卡片 ---------- */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

/* ---------- 首屏 hero ---------- */
.hero {
  overflow: hidden;
  padding: 26px 26px 18px;
  color: #fff;
  background: radial-gradient(120% 130% at 12% -10%, var(--hero-a) 0%, var(--hero-b) 55%, #1a0509 100%);
  border-color: transparent;
  box-shadow: 0 30px 60px -40px rgba(200, 16, 46, .85);
}
:root[data-theme="light"] .hero {
  background: radial-gradient(120% 130% at 10% -10%, #d81330 0%, #a30f24 52%, #6d0a17 100%);
}

.hero-mesh {
  position: absolute;
  inset: -40% -10% auto auto;
  width: 460px; height: 460px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .22), transparent 55%),
    radial-gradient(circle at 70% 60%, rgba(255, 180, 120, .28), transparent 50%),
    conic-gradient(from 210deg, rgba(255, 255, 255, .14), transparent 40%, rgba(255, 120, 120, .3));
  filter: blur(38px);
  opacity: .8;
  pointer-events: none;
}

.hero-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.hero h1 {
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: -.02em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .18);
}

.hero-sub {
  margin-top: 4px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, .74);
  letter-spacing: .01em;
}

.hero-tag {
  flex: none;
  font-size: 11.5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .22);
  border: 1px solid rgba(255, 255, 255, .18);
  color: rgba(255, 255, 255, .82);
  backdrop-filter: blur(6px);
  white-space: nowrap;
}

.hero-stats {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 26px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .09);
  backdrop-filter: blur(8px);
  cursor: pointer;
  text-align: left;
  transition: background .2s var(--ease), transform .2s var(--ease), border-color .2s var(--ease);
}
.stat:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .28); }
.stat:active { transform: scale(.985); }
.stat b {
  font-size: 30px;
  line-height: 1.05;
  font-weight: 750;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.stat span { font-size: 12px; color: rgba(255, 255, 255, .74); }

.hero-foot {
  position: relative;
  margin-top: 18px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, .5);
  letter-spacing: .04em;
}

/* ---------- 进入 Canvas ---------- */
.enter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px 14px 20px;
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.enter:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.enter-text { display: flex; flex-direction: column; gap: 2px; }
.enter-text strong { font-size: 16px; }
.enter-text span { font-size: 12.5px; color: var(--muted); }
.enter-go {
  flex: none;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(170deg, var(--brand-2), var(--brand));
  color: #fff;
  box-shadow: 0 10px 22px -12px rgba(200, 16, 46, .9);
  transition: transform .2s var(--ease), filter .2s;
}
.enter-go:hover { transform: translateX(2px); filter: brightness(1.08); }

/* ---------- 四个入口 ---------- */
.quick {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 10px;
}
.quick-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 6px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s var(--ease), transform .18s var(--ease);
}
.quick-item:hover { background: var(--surface-2); }
.quick-item:active { transform: scale(.97); }
.qi-icon {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(165deg, color-mix(in srgb, var(--q) 88%, #fff), var(--q));
  box-shadow: 0 10px 22px -14px var(--q), inset 0 1px 0 rgba(255, 255, 255, .3);
}

/* ---------- 48 小时横幅 ---------- */
.banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--warn) 34%, transparent);
  background: color-mix(in srgb, var(--warn) 12%, var(--surface));
  font-size: 13px;
  color: var(--text-2);
}
.banner-dot {
  width: 8px; height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--warn) 22%, transparent);
}
.banner .link { margin-left: auto; color: var(--warn); }
.banner .link:hover { color: var(--text); }

/* ---------- 日程列表 ---------- */
.list { padding: 6px 6px 8px; }

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px 8px;
}
.list-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}
.list-head h2 em {
  font-style: normal;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-2);
  background: var(--surface-3);
  border-radius: 999px;
  padding: 1px 7px;
  font-variant-numeric: tabular-nums;
}
.list-actions { display: flex; gap: 4px; }

.items { display: flex; flex-direction: column; padding: 0 4px; }

.item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 0;
  background: transparent;
  text-align: left;
  width: 100%;
  transition: background .16s var(--ease);
}
.item:hover { background: var(--surface-2); }
.item + .item { box-shadow: inset 0 1px 0 var(--line); }

.item-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--c, var(--muted));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, var(--muted)) 20%, transparent);
}

.item-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }

.item-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
  min-width: 0;
}
.item-when { font-weight: 700; color: var(--c, var(--muted)); font-variant-numeric: tabular-nums; white-space: nowrap; }
.item-course {
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--k, var(--muted)) 34%, transparent);
  color: var(--k, var(--muted));
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
}
.item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item.is-done .item-title { color: var(--faint); text-decoration: line-through; text-decoration-thickness: 1px; }

.item-side { display: flex; align-items: center; gap: 8px; color: var(--faint); }
.item-remain { font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.item-chevron { opacity: .5; transition: transform .18s var(--ease), opacity .18s; }
.item:hover .item-chevron { transform: translateX(2px); opacity: 1; }

/* ---------- 空状态 ---------- */
.empty {
  padding: 22px 16px 26px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.empty.big { padding: 56px 16px; font-size: 14px; }

/* ---------- 侧栏 ---------- */
.support { padding: 18px; }
.support-head { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 38px; height: 38px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(160deg, #f0648b, #c8102e);
  box-shadow: 0 8px 18px -12px rgba(200, 16, 46, .9);
}
.support-who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.support-who strong { font-size: 14px; }
.support-who small { font-size: 11px; color: var(--faint); letter-spacing: .04em; }
.support-head .link { margin-left: auto; }
.support-quote {
  margin-top: 14px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-2);
  padding-left: 11px;
  border-left: 2px solid color-mix(in srgb, var(--brand-2) 60%, transparent);
}

.side-card { padding: 16px 18px 18px; }
.side-card h3 { font-size: 12.5px; color: var(--muted); font-weight: 700; letter-spacing: .04em; margin-bottom: 12px; }
.hint { margin-top: 10px; font-size: 11.5px; line-height: 1.6; color: var(--faint); }

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 3px;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.segmented.wide { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.segmented button {
  border: 0;
  background: transparent;
  padding: 7px 4px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease);
}
.segmented button:hover { color: var(--text); }
.segmented button.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .10), 0 0 0 1px var(--line-strong);
}

.remind-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.remind-state { font-size: 13px; color: var(--text-2); }
.remind-state.is-on { color: var(--ok); }

.meta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  font-size: 11.5px;
  color: var(--faint);
  background: transparent;
  border-style: dashed;
  box-shadow: none;
}
.meta-card .ver { font-variant-numeric: tabular-nums; letter-spacing: .02em; }

/* ---------- 本周柱状 ---------- */
.week-bars {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
  height: 104px;
  align-items: end;
}
.wbar {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 5px;
  height: 100%;
}
.wbar b {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.wbar i {
  display: block;
  width: 100%;
  max-width: 20px;
  min-height: 4px;
  border-radius: 5px 5px 3px 3px;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--brand-2) 62%, transparent),
    color-mix(in srgb, var(--brand) 26%, transparent));
  transition: height .35s var(--ease);
}
.wbar small {
  font-size: 10px;
  color: var(--faint);
  line-height: 1;
  white-space: nowrap;
}
.wbar.is-today i {
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  box-shadow: 0 0 14px -2px color-mix(in srgb, var(--brand-2) 55%, transparent);
}
.wbar.is-today b { color: var(--brand-2); }
.wbar.is-today small { color: var(--brand-2); font-weight: 700; }

/* ---------- 页面标题 ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 14px 4px 18px;
}
.page-head h1 { font-size: 24px; letter-spacing: -.02em; }
.page-sub { margin-top: 3px; font-size: 12.5px; color: var(--muted); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.is-active {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

/* ---------- 日程分组 ---------- */
.groups { display: flex; flex-direction: column; gap: 16px; }

.group {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.group-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 13px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.group-head strong { font-size: 13.5px; }
.group-head span { font-size: 11.5px; color: var(--faint); }
.group-head .count { margin-left: auto; font-variant-numeric: tabular-nums; }
.group .items { padding: 4px; }

/* ---------- 课程 ---------- */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 14px;
}

.course {
  position: relative;
  overflow: hidden;
  padding: 18px 18px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), border-color .2s var(--ease);
}
.course:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.course::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--c);
}
.course-glow {
  position: absolute;
  inset: -60% -30% auto auto;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: var(--c);
  filter: blur(60px);
  opacity: .12;
  pointer-events: none;
}
.course-code {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--c);
  text-transform: uppercase;
}
.course-code::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--c);
}
.course-name { margin-top: 8px; font-size: 16px; font-weight: 700; line-height: 1.35; }
.course-meta { margin-top: 6px; font-size: 12px; color: var(--muted); }
.course-next {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.course-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  color: var(--text-2);
}
.course-foot b { font-variant-numeric: tabular-nums; color: var(--c); font-size: 15px; }

/* ---------- 设置 ---------- */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
  align-items: start;
}

.form { padding: 20px 22px 22px; }
.form h3 { font-size: 14px; margin-bottom: 16px; }

.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.field > small { display: block; margin-top: 7px; font-size: 11.5px; line-height: 1.6; color: var(--faint); }
.field > small code, .note code {
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--text-2);
}

input[type="url"], input[type="password"], input[type="text"] {
  width: 100%;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  transition: border-color .18s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease);
}
input::placeholder { color: var(--faint); }
input:hover { border-color: var(--line-strong); }
input:focus {
  outline: none;
  border-color: var(--brand-2);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.form-status { margin-top: 12px; font-size: 12.5px; min-height: 18px; color: var(--muted); }
.form-status.ok { color: var(--ok); }
.form-status.err { color: var(--danger); }

.switch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
}
.switch-row > span { display: flex; flex-direction: column; gap: 2px; }
.switch-row strong { font-size: 13.5px; font-weight: 600; }
.switch-row small { font-size: 11.5px; color: var(--faint); }
.switch-row input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch {
  margin-left: auto;
  position: relative;
  width: 42px; height: 24px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  transition: background .22s var(--ease);
  flex: none;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--faint);
  transition: transform .22s var(--ease), background .22s var(--ease);
}
.switch-row input:checked + .switch { background: var(--brand); border-color: transparent; }
.switch-row input:checked + .switch::after { transform: translateX(18px); background: #fff; }
.switch-row input:focus-visible + .switch { outline: 2px solid var(--brand-2); outline-offset: 2px; }

.kv {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kv > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 12.5px; }
.kv dt { color: var(--muted); }
.kv dd { color: var(--text-2); font-variant-numeric: tabular-nums; text-align: right; }

.note { margin-top: 16px; padding: 18px 22px 20px; }
.note h3 { font-size: 13px; margin-bottom: 10px; color: var(--muted); letter-spacing: .03em; }
.note ul { display: flex; flex-direction: column; gap: 7px; }
.note li {
  position: relative;
  padding-left: 16px;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.6;
}
.note li::before {
  content: "";
  position: absolute;
  left: 2px; top: 8px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--brand-2);
  opacity: .7;
}

/* ---------- Toast ---------- */
.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, calc(100vw - 40px));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  color: var(--text-2);
  animation: toast-in .28s var(--ease) both;
}
.toast::before {
  content: "";
  flex: none;
  width: 7px; height: 7px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--info);
}
.toast.ok::before { background: var(--ok); }
.toast.err::before { background: var(--danger); }
.toast.warn::before { background: var(--warn); }
.toast.is-out { animation: toast-out .22s var(--ease) both; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: none; }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateX(12px); }
}

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  #view-home.is-active { grid-template-columns: minmax(0, 1fr); }
  .col-side {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    align-items: start;
  }
}

/* ---------- 手机底部导航 ---------- */
.bottom-nav { display: none; }

@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
  .topbar .tabs { display: none; }
  .layout { padding: 8px 14px calc(96px + env(safe-area-inset-bottom)); }
  .hero { padding: 20px 18px 16px; }
  .hero h1 { font-size: 21px; }
  .hero-tag { display: none; }
  .stat b { font-size: 24px; }
  .item-side .item-remain { display: none; }
  .col-side { grid-template-columns: minmax(0, 1fr); }
  .page-head { padding: 10px 2px 14px; }
  .page-head h1 { font-size: 20px; }
  .brand-text .only-wide { display: none; }
  .brand-text .only-narrow { display: inline; }

  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-top: 1px solid var(--line);
  }

  .bnav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 4px 6px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--faint);
    font-size: 10.5px;
    font-weight: 600;
    cursor: pointer;
    transition: color .18s var(--ease), background .18s var(--ease);
  }
  .bnav-item:active { background: var(--surface-2); }
  .bnav-item.is-active { color: var(--brand-2); }
  .bnav-item.is-active svg { filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--brand-2) 45%, transparent)); }
}

@media (max-width: 560px) {
  .conn { padding: 6px; }
  .conn #connText { display: none; }
  #btnSync { padding: 8px 11px; }
  #btnSync span { display: none; }
  .hero-stats { gap: 8px; }
  .stat { padding: 9px 11px; }
  .stat b { font-size: 22px; }
  .quick { gap: 2px; padding: 8px 4px; }
  .qi-icon { width: 42px; height: 42px; border-radius: 13px; }
}

/* 紧凑模式：矮屏 */
@media (max-height: 720px) and (min-width: 1025px) {
  .hero { padding: 18px 22px 14px; }
  .hero-stats { margin-top: 16px; }
  .hero-foot { margin-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}
