/* =========================================================
   校园学习助手 — 视觉样式
   ========================================================= */

:root {
  --bg: #f2efe8;
  --bg-soft: #f8f5ee;
  --surface: #fffdf8;
  --surface-muted: #f8f4ec;
  --ink: #1e2126;
  --ink-soft: #4d4f50;
  --muted: #7d7b74;
  --faint: #a19d93;
  --line: #e5dfd3;
  --line-strong: #d7cfc0;
  --accent: #3c5bdc;
  --accent-deep: #2d47b8;
  --accent-soft: #e9edff;
  --coral: #dd5c3e;
  --coral-deep: #b9452c;
  --coral-soft: #fcede7;
  --green: #2f7a58;
  --green-soft: #e7f3ed;
  --yellow-soft: #fbf1cf;
  --shadow-panel: 0 1px 2px rgba(35, 31, 23, 0.04),
    0 20px 60px -46px rgba(35, 31, 23, 0.45);
  --shadow-float: 0 24px 80px -28px rgba(24, 25, 28, 0.5);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 11px;
  --font-sans: "Inter", "SF Pro Display", "PingFang SC", "HarmonyOS Sans SC",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas,
    monospace;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background-color: var(--bg);
  background-image: radial-gradient(
      circle at 10% -5%,
      rgba(255, 255, 255, 0.95),
      transparent 34%
    ),
    radial-gradient(circle at 96% 3%, rgba(189, 202, 255, 0.32), transparent 29%),
    radial-gradient(circle at 50% 100%, rgba(242, 219, 202, 0.3), transparent 36%);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.28;
  background-image: radial-gradient(rgba(31, 34, 38, 0.22) 0.55px, transparent 0.55px);
  background-size: 6px 6px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button,
select {
  cursor: pointer;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 顶栏 ---------- */

.topbar {
  width: min(1480px, calc(100% - 56px));
  margin: 0 auto;
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--ink);
  border-radius: 14px;
  box-shadow: 0 7px 16px -8px rgba(24, 25, 28, 0.55);
  transform: rotate(-2deg);
}

.brand-mark .icon {
  width: 23px;
  height: 23px;
  stroke-width: 1.6;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  gap: 5px;
}

.brand-copy strong {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-copy small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-date {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.25;
  padding-right: 14px;
  border-right: 1px solid var(--line-strong);
}

.header-date span {
  font-size: 13px;
  font-weight: 650;
}

.header-date small {
  color: var(--muted);
  font-size: 10.5px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.65);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease,
    transform 0.18s ease;
}

.icon-btn:hover {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.icon-btn:disabled {
  opacity: 0.34;
  cursor: not-allowed;
  transform: none;
}

.icon-btn:disabled:hover {
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.65);
  border-color: var(--line);
}

.icon-btn:active {
  transform: translateY(0);
}

.icon-btn-sm {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.icon-btn-sm .icon {
  width: 16px;
  height: 16px;
}

.icon-btn-accent {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: transparent;
}

.icon-btn-accent:hover {
  color: #fff;
  background: var(--accent);
  border-color: transparent;
}

/* ---------- 页面框架 ---------- */

.app-shell {
  width: min(1480px, calc(100% - 56px));
  margin: 0 auto;
  padding-bottom: 28px;
}

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 410px;
  gap: 54px;
  padding: 38px 42px 36px;
  overflow: hidden;
  color: #fff;
  background: #202127;
  border-radius: var(--radius-xl);
  box-shadow: 0 30px 70px -50px rgba(19, 20, 23, 0.8);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.52;
  background-image: linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(115deg, transparent 10%, #000 58%, transparent 100%);
}

.hero-glow {
  position: absolute;
  z-index: -1;
  display: block;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
}

.hero-glow-a {
  top: -190px;
  right: 70px;
  width: 430px;
  height: 430px;
  background: radial-gradient(circle, rgba(88, 113, 238, 0.5), transparent 68%);
}

.hero-glow-b {
  right: -80px;
  bottom: -230px;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(216, 111, 74, 0.33), transparent 64%);
}

.hero-main {
  align-self: center;
  min-width: 0;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8fdfb4;
  box-shadow: 0 0 0 4px rgba(143, 223, 180, 0.13);
  animation: status-breathe 3.4s ease-in-out infinite;
}

@keyframes status-breathe {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(143, 223, 180, 0.1);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(143, 223, 180, 0.02);
  }
}

.eyebrow-divider {
  color: rgba(255, 255, 255, 0.24);
}

.parity-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 2px 8px;
  color: #dbe2ff;
  background: rgba(122, 146, 255, 0.17);
  border: 1px solid rgba(151, 169, 255, 0.24);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.offline-pill {
  color: #b8f0d0;
  background: rgba(79, 190, 133, 0.16);
  border-color: rgba(126, 224, 172, 0.28);
}

.offline-dot {
  width: 5px;
  height: 5px;
  flex: none;
  background: #8fdfb4;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(143, 223, 180, 0.12);
}

.offline-chip {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 5px;
  padding: 3px 9px;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.offline-chip .offline-dot {
  background: var(--green);
  box-shadow: none;
}

.hero h1 {
  max-width: 720px;
  margin: 18px 0 12px;
  font-size: clamp(29px, 3.1vw, 41px);
  font-weight: 680;
  line-height: 1.22;
  letter-spacing: -0.035em;
}

.hero-sub {
  max-width: 660px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13.5px;
  line-height: 1.7;
}

.hero-sub strong {
  color: rgba(255, 255, 255, 0.88);
  font-weight: 600;
}

.hero-sub .sub-urgent {
  color: #ffc3ae;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.hero-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  min-width: 0;
}

.hero-week-card {
  padding: 19px 20px 17px;
  background: rgba(255, 255, 255, 0.065);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 19px;
  backdrop-filter: blur(8px);
}

.hero-week-top,
.hero-week-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hero-week-top {
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.hero-week-top strong {
  color: #fff;
  font-size: 19px;
  font-weight: 680;
  letter-spacing: -0.03em;
}

.progress-track {
  width: 100%;
  height: 5px;
  margin: 12px 0 11px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
}

.progress-track > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #93a6ff 0%, #c3cfff 56%, #f0b29c 100%);
  border-radius: inherit;
  transition: width 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hero-week-meta {
  color: rgba(255, 255, 255, 0.5);
  font-size: 10.5px;
}

.hero-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px 11px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 15px;
}

.kpi strong {
  font-size: 23px;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.kpi span {
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
  white-space: nowrap;
}

.kpi-urgent strong {
  color: #ffb79f;
}

/* ---------- 按钮 ---------- */

.btn {
  min-height: 40px;
  padding: 9px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 620;
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease,
    border-color 0.16s ease;
}

.btn .icon {
  width: 16px;
  height: 16px;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-light {
  color: var(--ink);
  background: #fff;
  border-color: #fff;
  box-shadow: 0 8px 18px -12px rgba(255, 255, 255, 0.7);
}

.btn-light:hover {
  background: #f5f3ed;
  border-color: #f5f3ed;
}

.btn-ghost {
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
}

.btn-ghost:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.26);
}

.btn-primary {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
  box-shadow: 0 7px 16px -12px rgba(30, 33, 38, 0.8);
}

.btn-primary:hover {
  background: #090a0b;
  border-color: #090a0b;
}

.btn-soft {
  color: var(--ink-soft);
  background: var(--surface-muted);
  border-color: var(--line);
}

.btn-soft:hover {
  background: #fff;
  border-color: var(--line-strong);
}

.btn-quiet {
  color: var(--ink-soft);
  background: transparent;
  border-color: var(--line);
}

.btn-quiet:hover {
  background: var(--surface);
  border-color: var(--line-strong);
}

.btn-danger {
  color: #fff;
  background: var(--coral);
  border-color: var(--coral);
}

.btn-danger:hover {
  background: var(--coral-deep);
  border-color: var(--coral-deep);
}

.btn-danger-ghost {
  color: var(--coral-deep);
  background: transparent;
  border-color: transparent;
}

.btn-danger-ghost:hover {
  background: var(--coral-soft);
  border-color: #f3cdc0;
}

.btn-sm {
  min-height: 34px;
  padding: 7px 11px;
  font-size: 11.5px;
  border-radius: 10px;
}

[hidden] {
  display: none !important;
}

/* ---------- 面板与布局 ---------- */

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 388px;
  align-items: start;
  gap: 22px;
  margin-top: 22px;
}

.panel {
  min-width: 0;
  padding: 23px 23px 18px;
  background: rgba(255, 253, 248, 0.94);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
}

.side-column {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading-tight {
  align-items: center;
}

.section-label {
  margin-bottom: 5px;
  color: var(--faint);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.panel h2 {
  font-size: 20px;
  font-weight: 680;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.week-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.week-select-wrap {
  position: relative;
  display: inline-flex;
}

.week-select-wrap select {
  width: 92px;
  height: 34px;
  padding: 0 27px 0 11px;
  color: var(--ink);
  background-color: var(--surface-muted);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237d7b74' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 650;
  appearance: none;
}

.week-select-wrap select:hover {
  background-color: #fff;
  border-color: var(--line-strong);
}

.schedule-subhead {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin: 17px 0 12px;
}

.schedule-range {
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 620;
}

.parity-note {
  padding: 2px 7px;
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-radius: 5px;
  font-size: 10px;
  font-weight: 650;
}

.schedule-legend {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  color: var(--faint);
  font-size: 10.5px;
}

.schedule-legend i {
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(60, 91, 220, 0.11);
}

.timetable-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  border: 1px solid var(--line);
  border-radius: 17px;
  scrollbar-width: thin;
  scrollbar-color: #d4ccbe transparent;
}

.timetable-scroll::-webkit-scrollbar {
  height: 8px;
}

.timetable-scroll::-webkit-scrollbar-thumb {
  background: #d4ccbe;
  border-radius: 99px;
}

.timetable {
  position: relative;
  display: grid;
  grid-template-columns: 57px repeat(7, minmax(104px, 1fr));
  grid-template-rows: 55px repeat(11, 66px);
  min-width: 860px;
  background: var(--surface);
}

.tt-corner {
  position: sticky;
  left: 0;
  z-index: 5;
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
  background: #faf6ee;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.12em;
}

.tt-day {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 5px;
  background: #fbf7f0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.tt-day.is-last-column {
  border-right: 0;
}

.tt-day .weekday {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 620;
}

.tt-day .date {
  min-width: 25px;
  height: 25px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.tt-day.is-weekend {
  background: #f9f5ee;
}

.tt-day.is-today {
  background: #eef2ff;
}

.tt-day.is-today .weekday {
  color: var(--accent-deep);
}

.tt-day.is-today .date {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 4px 10px -6px rgba(60, 91, 220, 0.9);
}

.tt-time {
  position: sticky;
  left: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  background: #faf6ee;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.tt-time strong {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.2;
}

.tt-time span {
  color: var(--faint);
  font-size: 8.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.tt-cell {
  border-right: 1px solid rgba(229, 223, 211, 0.68);
  border-bottom: 1px solid rgba(229, 223, 211, 0.68);
  background: transparent;
}

.tt-cell.is-last-column {
  border-right: 0;
}

.timetable-empty {
  position: relative;
  z-index: 2;
  align-self: center;
  justify-self: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 26px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 253, 248, 0.84);
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  pointer-events: none;
}

.timetable-empty span {
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 620;
}

.timetable-empty small {
  color: var(--faint);
  font-size: 10px;
}

.tt-cell.is-weekend {
  background: rgba(37, 35, 29, 0.012);
}

.tt-cell.is-today {
  background: rgba(60, 91, 220, 0.042);
}

.tt-cell.period-group-start {
  border-top: 1px solid var(--line-strong);
}

.course-card {
  --course-bg: #e8efff;
  --course-border: #7b97e8;
  --course-ink: #233d7a;
  position: relative;
  z-index: 4;
  min-width: 0;
  margin: 3px 4px;
  padding: 7px 9px 7px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  color: var(--course-ink);
  text-align: left;
  background: var(--course-bg);
  border: 0;
  border-left: 3px solid var(--course-border);
  border-radius: 10px;
  box-shadow: 0 1px 0 rgba(36, 31, 22, 0.04);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.course-card:hover {
  z-index: 6;
  filter: saturate(1.04);
  transform: translateY(-1px);
  box-shadow: 0 7px 18px -12px rgba(35, 31, 23, 0.55);
}

.course-card.is-today {
  box-shadow: inset 0 0 0 1.5px var(--course-border),
    0 4px 12px -10px rgba(35, 31, 23, 0.5);
}

.course-card.is-live {
  box-shadow: inset 0 0 0 1.5px var(--course-border),
    0 0 0 3px rgba(60, 91, 220, 0.11);
}

.course-time {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  color: var(--course-ink);
  opacity: 0.57;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.course-today-tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 4px;
  color: #fff;
  background: var(--course-border);
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 7.5px;
  font-weight: 650;
  letter-spacing: 0;
  opacity: 0.95;
}

.course-name {
  display: -webkit-box;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 680;
  line-height: 1.32;
  letter-spacing: -0.015em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.course-meta {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  color: var(--course-ink);
  opacity: 0.68;
  font-size: 9px;
  line-height: 1.35;
  white-space: nowrap;
}

.course-meta .icon {
  width: 9px;
  height: 9px;
  stroke-width: 2;
  opacity: 0.7;
}

.course-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.course-weeks {
  margin-top: auto;
  padding-top: 2px;
  color: var(--course-ink);
  opacity: 0.48;
  font-size: 8px;
  line-height: 1.3;
  white-space: nowrap;
}

.course-card.span-1 {
  padding-top: 6px;
  padding-bottom: 6px;
}

.course-card.span-1 .course-name {
  font-size: 11.5px;
  line-height: 1.25;
  -webkit-line-clamp: 1;
}

.course-card.span-1 .course-meta,
.course-card.span-1 .course-weeks {
  display: none;
}

.course-card.span-1 .course-today-tag {
  display: none;
}

.color-blue {
  --course-bg: #e8efff;
  --course-border: #7b97e8;
  --course-ink: #263f7a;
}

.color-mint {
  --course-bg: #e5f3ec;
  --course-border: #79b99a;
  --course-ink: #225c44;
}

.color-peach {
  --course-bg: #fbe9df;
  --course-border: #e3a180;
  --course-ink: #8b4327;
}

.color-lilac {
  --course-bg: #efe8fa;
  --course-border: #a88bd2;
  --course-ink: #5b3d84;
}

.color-yellow {
  --course-bg: #fbf0cf;
  --course-border: #d8b65b;
  --course-ink: #715616;
}

.color-rose {
  --course-bg: #f9e5e9;
  --course-border: #d58e9e;
  --course-ink: #843c4d;
}

.color-teal {
  --course-bg: #def1f1;
  --course-border: #64b1b4;
  --course-ink: #1e5c60;
}

.panel-hint {
  margin-top: 11px;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.5;
}

/* ---------- 今日安排 ---------- */

.date-chip {
  padding: 4px 8px;
  color: var(--muted);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 10px;
  font-weight: 620;
  white-space: nowrap;
}

.today-list {
  margin-top: 8px;
}

.today-item {
  display: grid;
  grid-template-columns: 46px 11px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
}

.today-item:last-child {
  border-bottom: 0;
  padding-bottom: 4px;
}

.today-time {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-variant-numeric: tabular-nums;
}

.today-time strong {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
}

.today-time span {
  color: var(--faint);
  font-size: 8.5px;
  line-height: 1.25;
}

.today-rail {
  position: relative;
  align-self: stretch;
  min-height: 30px;
}

.today-rail::before {
  content: "";
  position: absolute;
  top: -12px;
  bottom: -12px;
  left: 50%;
  width: 1px;
  background: var(--line);
  transform: translateX(-50%);
}

.today-item:first-child .today-rail::before {
  top: 50%;
}

.today-item:last-child .today-rail::before {
  bottom: 50%;
}

.today-rail i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  background: var(--dot-color, var(--accent));
  border: 2px solid var(--surface);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--dot-color, var(--accent));
  transform: translate(-50%, -50%);
}

.today-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.today-info strong {
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-info span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-item.is-past {
  opacity: 0.52;
}

.today-item.is-live .today-info strong {
  color: var(--accent-deep);
}

.status-tag {
  padding: 2px 5px;
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-radius: 4px;
  font-size: 8px;
  font-weight: 650;
  white-space: nowrap;
}

.status-tag.is-live {
  color: #1e6848;
  background: var(--green-soft);
}

.today-footer {
  margin-top: 10px;
  padding-top: 11px;
  color: var(--faint);
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  line-height: 1.5;
}

.today-footer strong {
  color: var(--ink-soft);
  font-weight: 600;
}

.empty-state {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 22px 6px 18px;
  color: var(--muted);
}

.empty-state .empty-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--faint);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.empty-state .empty-icon .icon {
  width: 17px;
  height: 17px;
}

.empty-state strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 620;
}

.empty-state p {
  font-size: 10.5px;
  line-height: 1.5;
}

/* ---------- DDL ---------- */

.count-badge {
  display: inline-flex;
  min-width: 19px;
  height: 19px;
  margin-left: 5px;
  padding: 0 6px;
  align-items: center;
  justify-content: center;
  color: var(--coral-deep);
  background: var(--coral-soft);
  border-radius: 6px;
  font-size: 9.5px;
  font-weight: 700;
  vertical-align: 2px;
}

.ddl-filters {
  display: flex;
  gap: 3px;
  margin: 15px 0 8px;
  padding: 3px;
  background: #f3eee4;
  border-radius: 10px;
}

.filter-btn {
  flex: 1;
  padding: 6px 5px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.filter-btn:hover {
  color: var(--ink);
}

.filter-btn.is-active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(30, 33, 38, 0.09);
}

.ddl-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ddl-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 26px;
  gap: 9px;
  align-items: start;
  padding: 11px 8px 11px 9px;
  border: 1px solid transparent;
  border-radius: 12px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.ddl-item:hover {
  background: rgba(248, 244, 236, 0.8);
  border-color: var(--line);
}

.ddl-item.is-urgent {
  background: #fff3ed;
  border-color: #f6d5c7;
}

.ddl-item.is-urgent:hover {
  background: #fff0e8;
  border-color: #f0c7b6;
}

.ddl-item.is-overdue {
  background: #fff6f3;
  border-color: #f3d4cb;
}

.ddl-item.is-completed {
  opacity: 0.56;
}

.ddl-check {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  padding: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: transparent;
  border: 1.5px solid #c9c1b2;
  border-radius: 7px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.ddl-check .icon {
  width: 12px;
  height: 12px;
  opacity: 0;
  stroke-width: 2.6;
  transition: opacity 0.15s ease;
}

.ddl-check:hover {
  border-color: var(--green);
  transform: scale(1.05);
}

.ddl-check.is-done {
  background: var(--green);
  border-color: var(--green);
}

.ddl-check.is-done .icon {
  opacity: 1;
}

.ddl-main {
  min-width: 0;
}

.ddl-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 14px;
}

.ddl-course {
  max-width: 160px;
  padding: 1px 5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  color: var(--ink-soft);
  background: rgba(30, 33, 38, 0.055);
  border-radius: 4px;
  font-size: 8.5px;
  font-weight: 620;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ddl-course i {
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
}

.ddl-badge {
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 8px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}

.ddl-badge.badge-urgent {
  color: var(--coral-deep);
  background: #fbdcd1;
}

.ddl-badge.badge-overdue {
  color: #9b3224;
  background: #f7d4cc;
}

.ddl-badge.badge-done {
  color: var(--green);
  background: var(--green-soft);
}

.ddl-title {
  margin: 3px 0 4px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 620;
  line-height: 1.4;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ddl-item.is-completed .ddl-title {
  text-decoration: line-through;
  text-decoration-color: rgba(47, 122, 88, 0.55);
}

.ddl-due {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.ddl-due .icon {
  width: 10px;
  height: 10px;
  stroke-width: 2;
}

.ddl-due .remaining {
  color: var(--faint);
}

.ddl-item.is-urgent .ddl-due {
  color: var(--coral-deep);
}

.ddl-item.is-urgent .ddl-due .remaining {
  color: rgba(185, 69, 44, 0.68);
}

.ddl-edit {
  width: 26px;
  height: 26px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--faint);
  background: transparent;
  border: 0;
  border-radius: 7px;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.ddl-edit .icon {
  width: 13px;
  height: 13px;
}

.ddl-item:hover .ddl-edit,
.ddl-edit:focus-visible {
  opacity: 1;
}

.ddl-edit:hover {
  color: var(--ink);
  background: rgba(30, 33, 38, 0.06);
}

.ddl-footer {
  margin-top: 10px;
  padding-top: 11px;
  color: var(--faint);
  border-top: 1px solid var(--line);
  font-size: 10px;
  line-height: 1.5;
}

.ddl-footer strong {
  color: var(--ink-soft);
  font-weight: 650;
}

.ddl-footer .footer-urgent {
  color: var(--coral-deep);
  font-weight: 600;
}

/* ---------- 页脚 ---------- */

.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 4px 2px;
  color: var(--faint);
  font-size: 9.5px;
}

.app-footer span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-dot {
  width: 5px;
  height: 5px;
  background: var(--green);
  border-radius: 50%;
}

.footer-dot.is-pending {
  background: var(--faint);
}

.footer-dot.is-offline {
  background: var(--coral);
}

.footer-dot.is-warn {
  background: var(--coral-deep);
}

/* ---------- 弹窗与表单 ---------- */

.modal {
  width: min(620px, calc(100vw - 32px));
  max-height: min(92vh, 840px);
  padding: 0;
  overflow: auto;
  color: var(--ink);
  background: var(--surface);
  border: 0;
  border-radius: 23px;
  box-shadow: var(--shadow-float);
}

.modal::backdrop {
  background: rgba(21, 22, 25, 0.48);
  backdrop-filter: blur(5px);
}

.modal[open] {
  animation: modal-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal form {
  display: flex;
  flex-direction: column;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px 0;
}

.modal-head h2 {
  font-size: 22px;
  font-weight: 680;
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.modal-body {
  padding: 19px 26px 9px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 13px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field-wide {
  grid-column: 1 / -1;
}

.field > span,
.field-split span {
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 620;
}

.field em {
  color: var(--coral);
  font-style: normal;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  background: #fcfaf5;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input,
.field select {
  height: 42px;
  padding: 0 12px;
  font-size: 12.5px;
}

.field select {
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237d7b74' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  appearance: none;
}

.field textarea {
  padding: 10px 12px;
  resize: vertical;
  font-size: 12.5px;
  line-height: 1.6;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #b1aca1;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: var(--line-strong);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(60, 91, 220, 0.1);
}

.field-hint {
  color: var(--faint);
  font-size: 9.5px;
  line-height: 1.35;
}

.field-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field-split label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.color-picker {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.color-swatch {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}

.color-swatch input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.color-swatch span {
  width: 25px;
  height: 25px;
  display: block;
  background: var(--swatch, #e8efff);
  border: 1px solid rgba(30, 33, 38, 0.08);
  border-radius: 8px;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.color-swatch:hover span {
  transform: translateY(-1px);
}

.color-swatch input:checked + span {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--swatch-border, #263f7a);
  transform: translateY(-1px);
}

.color-swatch input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.form-error {
  min-height: 17px;
  margin-top: 8px;
  color: var(--coral-deep);
  font-size: 10.5px;
  font-weight: 550;
  line-height: 1.45;
}

.form-error:empty {
  min-height: 0;
}

.modal-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  padding: 14px 26px 20px;
  background: linear-gradient(rgba(255, 253, 248, 0.8), var(--surface) 32%);
  border-top: 1px solid var(--line);
}

.modal-spacer {
  flex: 1;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  color: var(--ink-soft);
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}

.check-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.custom-check {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  color: #fff;
  background: transparent;
  border: 1.5px solid #c9c1b2;
  border-radius: 6px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.custom-check .icon {
  width: 12px;
  height: 12px;
  opacity: 0;
  stroke-width: 2.5;
}

.check-row input:checked + .custom-check {
  background: var(--green);
  border-color: var(--green);
}

.check-row input:checked + .custom-check .icon {
  opacity: 1;
}

.check-row input:focus-visible + .custom-check {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.settings-section {
  margin-top: 17px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.settings-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.settings-section-head h3 {
  font-size: 14px;
  font-weight: 650;
}

.settings-section-head span {
  color: var(--faint);
  font-size: 9.5px;
}

.settings-copy {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.65;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.settings-actions .btn {
  min-height: 35px;
  padding: 7px 11px;
  font-size: 11px;
}

.settings-actions .icon {
  width: 14px;
  height: 14px;
}

/* ---------- AI 智能导入 ---------- */

.modal-wide {
  width: min(900px, calc(100vw - 32px));
  max-height: min(94vh, 1000px);
}

.ai-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  background: #fff6e8;
  border: 1px solid #efd9b8;
  border-radius: 14px;
}

.ai-notice-icon {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  color: #a96b1f;
  background: #fbe8c8;
  border-radius: 10px;
}

.ai-notice-icon .icon {
  width: 17px;
  height: 17px;
}

.ai-notice p {
  color: #6b5232;
  font-size: 11.5px;
  line-height: 1.7;
}

.ai-notice strong {
  color: #8a5a1d;
  font-weight: 650;
}

.ai-notice .ai-notice-sub {
  margin-top: 3px;
  color: #9a7a4a;
  font-size: 10.5px;
}

.ai-section {
  margin-top: 17px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.ai-section .settings-section-head {
  margin-bottom: 10px;
}

.ai-inline-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-top: 7px;
}

.ai-inline-actions .check-row {
  min-height: 30px;
}

.ai-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.5;
}

.ai-status.is-busy::before {
  content: "";
  width: 12px;
  height: 12px;
  flex: none;
  border: 2px solid rgba(60, 91, 220, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: ai-spin 0.8s linear infinite;
}

@keyframes ai-spin {
  to {
    transform: rotate(360deg);
  }
}

.ai-preview {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-strong);
}

.ai-preview-head {
  display: grid;
  gap: 5px;
}

.ai-preview-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.ai-preview-title strong {
  font-size: 13px;
  font-weight: 650;
}

.ai-badge {
  padding: 2px 7px;
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-radius: 99px;
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.ai-confidence {
  color: var(--faint);
  font-size: 10px;
}

.ai-preview-note {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.65;
}

.ai-warning-list {
  margin: 10px 0 0;
  padding: 9px 12px 9px 28px;
  color: #7d5a20;
  background: var(--yellow-soft);
  border: 1px solid #f0e0ae;
  border-radius: 10px;
  font-size: 10.5px;
  line-height: 1.6;
}

.ai-conflict {
  margin-top: 10px;
  padding: 9px 11px;
  color: var(--coral-deep);
  background: var(--coral-soft);
  border: 1px solid #f3d3c8;
  border-radius: 10px;
  font-size: 10.5px;
  line-height: 1.6;
}

.ai-settings-row {
  margin-top: 11px;
  padding: 8px 11px;
  background: var(--surface-muted);
  border-radius: 10px;
  font-size: 11px;
}

.ai-table-wrap {
  margin-top: 10px;
  overflow-x: auto;
  background: #fcfaf5;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.ai-table {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
  font-size: 11px;
}

.ai-table th {
  padding: 8px 9px;
  color: var(--muted);
  background: var(--surface-muted);
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  font-weight: 620;
  text-align: left;
  white-space: nowrap;
}

.ai-table td {
  padding: 8px 9px;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.ai-table tr:last-child td {
  border-bottom: 0;
}

.ai-table td strong {
  display: block;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 620;
}

.ai-table td small {
  display: block;
  margin-top: 1px;
  color: var(--faint);
  font-size: 9.5px;
}

.ai-table input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
}

.ai-table .ai-empty {
  padding: 14px;
  color: var(--faint);
  text-align: center;
}

.ai-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 11px;
  padding: 9px 11px;
  color: var(--ink-soft);
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  font-size: 11px;
}

.ai-mode label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.ai-mode input {
  accent-color: var(--accent);
}

#aiDialog .modal-actions {
  flex-wrap: wrap;
}

.ai-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 16px;
  color: var(--ink-soft);
  background: #fcfaf5;
  border: 1.5px dashed var(--line-strong);
  border-radius: 14px;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.ai-dropzone:hover,
.ai-dropzone:focus-within {
  background: var(--surface-muted);
  border-color: var(--accent);
}

.ai-dropzone-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 50%;
}

.ai-dropzone-icon .icon {
  width: 21px;
  height: 21px;
}

.ai-dropzone strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.ai-dropzone > span:last-child {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.ai-shot-preview {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  margin-top: 10px;
  padding: 10px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.ai-shot-preview img {
  width: 100%;
  max-height: 150px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.ai-shot-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 10.5px;
}

.ai-shot-meta strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-shot-meta .btn {
  align-self: flex-start;
  margin-top: 3px;
}

.week-list,
.mobile-week-toolbar {
  display: none;
}

.modal-small {
  width: min(460px, calc(100vw - 32px));
}

.confirm-body {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 25px 26px 8px;
}

.confirm-icon {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  color: var(--coral-deep);
  background: var(--coral-soft);
  border-radius: 12px;
}

.confirm-icon .icon {
  width: 19px;
  height: 19px;
}

.confirm-body h2 {
  margin: 1px 0 5px;
  font-size: 18px;
  font-weight: 680;
  letter-spacing: -0.025em;
}

.confirm-body p {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.7;
}

/* ---------- Toast ---------- */

.toast-region {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.toast {
  max-width: min(360px, calc(100vw - 40px));
  padding: 11px 15px 11px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #fff;
  background: #24262b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 18px 44px -20px rgba(17, 18, 21, 0.8);
  font-size: 11.5px;
  line-height: 1.45;
  animation: toast-in 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.toast.is-leaving {
  animation: toast-out 0.2s ease forwards;
}

.toast-dot {
  width: 7px;
  height: 7px;
  flex: none;
  background: #8fdfb4;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(143, 223, 180, 0.1);
}

.toast.is-error .toast-dot {
  background: #ff9c7d;
  box-shadow: 0 0 0 3px rgba(255, 156, 125, 0.1);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(5px);
  }
}

/* ---------- 响应式 ---------- */

@media (max-width: 1240px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 34px;
    padding: 34px 34px 32px;
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr) 352px;
    gap: 18px;
  }

  .panel {
    padding: 21px 19px 16px;
  }

  .timetable {
    grid-template-columns: 54px repeat(7, minmax(100px, 1fr));
  }
}

@media (max-width: 1060px) {
  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .side-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 18px;
  }

  .timetable {
    grid-template-columns: 56px repeat(7, minmax(106px, 1fr));
  }
}

@media (max-width: 920px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 26px;
    padding: 32px;
  }

  .hero-side {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
    align-items: stretch;
  }

  .hero-week-card {
    height: 100%;
  }

  .hero-kpis {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .kpi {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    padding: 7px 13px;
  }

  .kpi strong {
    font-size: 18px;
  }

  .hero h1 {
    font-size: 34px;
  }
}

@media (max-width: 760px) {
  .topbar {
    width: calc(100% - 30px);
    min-height: 76px;
  }

  .app-shell {
    width: calc(100% - 30px);
    padding-bottom: 18px;
  }

  .hero {
    display: none;
  }

  .hero h1 {
    margin-top: 15px;
    font-size: 28px;
    letter-spacing: -0.03em;
  }

  .hero-sub {
    font-size: 12.5px;
  }

  .hero-side {
    display: flex;
  }

  .hero-kpis {
    grid-template-columns: repeat(3, 1fr);
  }

  .kpi {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 11px 12px;
  }

  .kpi strong {
    font-size: 21px;
  }

  .dashboard-grid {
    margin-top: 16px;
    gap: 16px;
  }

  .panel {
    padding: 19px 16px 15px;
    border-radius: 20px;
  }

  .panel h2 {
    font-size: 18px;
  }

  .schedule-panel .panel-heading {
    flex-direction: column;
    align-items: stretch;
  }

  .week-nav {
    justify-content: flex-end;
    margin-top: 2px;
  }

  .week-select-wrap {
    flex: 1;
  }

  .week-select-wrap select {
    width: 100%;
  }

  .schedule-subhead {
    margin-top: 14px;
  }

  .mobile-week-toolbar {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin: 13px 0 4px;
    padding: 11px;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: 14px;
  }

  .mobile-week-info {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
  }

  .mobile-week-info strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 13.5px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-week-info span {
    color: var(--muted);
    font-size: 10.5px;
    white-space: nowrap;
  }

  .mobile-week-actions {
    display: flex;
    gap: 7px;
  }

  .mobile-week-actions .btn {
    flex: 1;
    min-height: 34px;
    padding: 6px 8px;
    font-size: 10.5px;
  }

  .timetable-scroll {
    display: none;
  }

  .week-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-top: 10px;
  }

  .week-day {
    overflow: hidden;
    background: #fcfaf5;
    border: 1px solid var(--line);
    border-radius: 14px;
  }

  .week-day.is-today {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
  }

  .week-day-head {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 11px;
    background: var(--surface-muted);
    border-bottom: 1px solid var(--line);
  }

  .week-day-head strong {
    font-size: 12px;
    font-weight: 650;
  }

  .week-day-head span {
    color: var(--faint);
    font-size: 10px;
  }

  .week-day-head em {
    margin-left: auto;
    padding: 1px 6px;
    color: var(--accent-deep);
    background: var(--accent-soft);
    border-radius: 99px;
    font-size: 9px;
    font-style: normal;
    font-weight: 650;
  }

  .week-day-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
  }

  .week-day-empty {
    margin: 0;
    padding: 6px 8px;
    color: var(--faint);
    font-size: 10.5px;
  }

  .week-course {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px;
    text-align: left;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
  }

  .week-course-time {
    color: var(--muted);
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }

  .week-course-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
  }

  .week-course-main strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 12px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .week-course-main small {
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .week-course-main em {
    color: var(--faint);
    font-size: 9px;
    font-style: normal;
  }

  .side-column {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .today-item {
    grid-template-columns: 50px 11px minmax(0, 1fr) auto;
  }

  .ddl-edit {
    opacity: 0.55;
  }

  .app-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding-top: 17px;
  }

  .modal {
    width: calc(100vw - 22px);
    max-height: 94vh;
    border-radius: 19px;
  }

  .modal-head {
    padding: 20px 18px 0;
  }

  .modal-body {
    padding: 17px 18px 7px;
  }

  .modal-actions {
    padding: 12px 18px 16px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .field-wide {
    grid-column: auto;
  }

  .field-split {
    grid-template-columns: 1fr 1fr;
  }

  .toast-region {
    right: 12px;
    bottom: 12px;
  }
}

@media (max-width: 480px) {
  .header-date {
    display: none;
  }

  .brand-copy small {
    display: none;
  }

  .brand-copy strong {
    font-size: 15px;
  }

  .hero-eyebrow {
    font-size: 10px;
    gap: 6px;
  }

  .hero h1 {
    font-size: 25px;
  }

  .hero-actions {
    gap: 8px;
  }

  .hero-actions .btn {
    flex: 1;
    padding-left: 8px;
    padding-right: 8px;
  }

  .hero-kpis {
    gap: 5px;
  }

  .kpi {
    padding: 9px 10px;
  }

  .kpi strong {
    font-size: 19px;
  }

  .kpi span {
    font-size: 9px;
  }

  .schedule-legend {
    display: none;
  }

  .week-nav {
    gap: 4px;
  }

  .week-nav .btn-soft {
    padding-left: 8px;
    padding-right: 8px;
    font-size: 10.5px;
  }

  .ddl-item {
    grid-template-columns: 22px minmax(0, 1fr) 24px;
    padding-right: 5px;
  }

  .settings-actions .btn {
    flex: 1 1 calc(50% - 8px);
  }

  .modal-actions {
    flex-wrap: wrap;
  }

  .modal-actions .btn {
    flex: 1;
  }

  .modal-actions .btn-danger-ghost {
    flex: 0 0 auto;
  }

  .modal-spacer {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
