/* ================================================
   课表助手 — Apple 级设计系统
   iOS System Design Language + Dark Mode
   ================================================ */

/* ====== CSS 变量（设计令牌） ====== */
:root {
  /* 浅色模式 */
  --bg-primary:    #F2F2F7;
  --bg-secondary:  #FFFFFF;
  --bg-tertiary:   #FBFBFD;
  --text-primary:  #1C1C1E;
  --text-secondary:#6E6E73;
  --text-tertiary: #AEAEB2;
  --tint:          #007AFF;
  --tint-light:    rgba(0, 122, 255, 0.08);
  --tint-medium:   rgba(0, 122, 255, 0.15);
  --separator:     rgba(60, 60, 67, 0.16);
  --separator-thin:rgba(60, 60, 67, 0.08);
  --red:           #FF3B30;
  --green:         #34C759;
  --orange:        #FF9500;
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.06);
  --shadow-md:     0 4px 14px rgba(0,0,0,0.10);
  --shadow-lg:     0 8px 30px rgba(0,0,0,0.12);
  --glass-bg:      rgba(242, 242, 247, 0.72);
  --card-bg:       #FFFFFF;
  --today-glow:    rgba(0, 122, 255, 0.06);
  --inactive-opacity: 0.32;
}

/* 暗黑模式 */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary:    #000000;
    --bg-secondary:  #1C1C1E;
    --bg-tertiary:   #2C2C2E;
    --text-primary:  #FFFFFF;
    --text-secondary:rgba(235, 235, 245, 0.60);
    --text-tertiary: rgba(235, 235, 245, 0.25);
    --tint:          #0A84FF;
    --tint-light:    rgba(10, 132, 255, 0.12);
    --tint-medium:   rgba(10, 132, 255, 0.22);
    --separator:     rgba(84, 84, 88, 0.60);
    --separator-thin:rgba(84, 84, 88, 0.30);
    --shadow-sm:     0 1px 3px rgba(0,0,0,0.2);
    --shadow-md:     0 4px 14px rgba(0,0,0,0.35);
    --shadow-lg:     0 8px 30px rgba(0,0,0,0.45);
    --glass-bg:      rgba(28, 28, 30, 0.72);
    --card-bg:       #1C1C1E;
    --today-glow:    rgba(10, 132, 255, 0.10);
    --inactive-opacity: 0.24;
  }
}

/* 手动模式覆盖 */
[data-theme="light"] {
  --bg-primary:    #F2F2F7;
  --bg-secondary:  #FFFFFF;
  --bg-tertiary:   #F9F9FB;
  --text-primary:  #1C1C1E;
  --text-secondary:#6E6E73;
  --text-tertiary: #AEAEB2;
  --tint:          #007AFF;
  --tint-light:    rgba(0, 122, 255, 0.08);
  --tint-medium:   rgba(0, 122, 255, 0.15);
  --separator:     rgba(60, 60, 67, 0.16);
  --separator-thin:rgba(60, 60, 67, 0.08);
  --glass-bg:      rgba(242, 242, 247, 0.72);
  --card-bg:       #FFFFFF;
  --today-glow:    rgba(0, 122, 255, 0.06);
  --inactive-opacity: 0.32;
}

[data-theme="dark"] {
  --bg-primary:    #000000;
  --bg-secondary:  #1C1C1E;
  --bg-tertiary:   #2C2C2E;
  --text-primary:  #FFFFFF;
  --text-secondary:rgba(235, 235, 245, 0.60);
  --text-tertiary: rgba(235, 235, 245, 0.25);
  --tint:          #0A84FF;
  --tint-light:    rgba(10, 132, 255, 0.12);
  --tint-medium:   rgba(10, 132, 255, 0.22);
  --separator:     rgba(84, 84, 88, 0.60);
  --separator-thin:rgba(84, 84, 88, 0.30);
  --glass-bg:      rgba(28, 28, 30, 0.72);
  --card-bg:       #1C1C1E;
  --today-glow:    rgba(10, 132, 255, 0.10);
  --inactive-opacity: 0.24;
}

/* ====== 全局重置 ====== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-family: -apple-system, "SF Pro Display", "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
  font-size: 17px;
  line-height: 1.47059;
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: background 0.4s ease, color 0.4s ease;
}

body {
  overscroll-behavior: none;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
}

/* ====== App 容器 ====== */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 500px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  background: var(--bg-primary);
  transition: background 0.4s ease;
}

/* ====== 内容区域 ====== */
.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* ====== Tab 页面容器 ====== */
.tab-page {
  display: none;
  animation: tabFadeIn 0.25s ease;
}
.tab-page.active {
  display: block;
}

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ================================================
   Tab 1: 今天视图
   ================================================ */

.today-header {
  padding: 24px 20px 8px;
}

.today-date {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.012em;
  color: var(--text-primary);
}

.today-meta {
  font-size: 15px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* 当前课程大卡片 */
.now-card {
  margin: 12px 16px;
  background: var(--tint);
  border-radius: 16px;
  padding: 20px;
  color: white;
  box-shadow: 0 8px 24px rgba(0, 122, 255, 0.3);
  animation: cardEnter 0.45s cubic-bezier(0.32, 0.72, 0, 1);
}

.now-card .now-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.85;
}

.now-card .now-course-name {
  font-size: 26px;
  font-weight: 700;
  margin-top: 4px;
  letter-spacing: -0.01em;
}

.now-card .now-detail {
  font-size: 15px;
  opacity: 0.9;
  margin-top: 6px;
}

.now-card .now-countdown {
  font-size: 14px;
  opacity: 0.8;
  margin-top: 10px;
  font-weight: 500;
}

/* 无当前课程 */
.now-empty {
  margin: 12px 16px;
  background: var(--card-bg);
  border-radius: 16px;
  padding: 28px 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 16px;
}

.now-empty .now-empty-icon {
  font-size: 40px;
  margin-bottom: 8px;
  display: block;
}

/* 今日课程列表 */
.today-section {
  padding: 16px 16px 8px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.today-course-list {
  background: var(--card-bg);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.today-course-item {
  display: flex;
  align-items: center;
  padding: 13px 16px;
  border-bottom: 0.5px solid var(--separator-thin);
  transition: background 0.15s;
}
.today-course-item:last-child {
  border-bottom: none;
}
.today-course-item:active {
  background: var(--tint-light);
}

.today-course-item .tci-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 12px;
  flex-shrink: 0;
}
.today-course-item .tci-indicator.done    { background: var(--green); }
.today-course-item .tci-indicator.current { background: var(--tint); box-shadow: 0 0 0 4px var(--tint-light); }
.today-course-item .tci-indicator.upcoming{ background: var(--separator); }

.today-course-item .tci-info {
  flex: 1;
  min-width: 0;
}

.today-course-item .tci-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-course-item .tci-meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-course-item .tci-time {
  font-size: 13px;
  color: var(--text-secondary);
  flex-shrink: 0;
  margin-left: 8px;
  text-align: right;
}

.today-course-item.done .tci-name {
  color: var(--text-tertiary);
}

/* 今日无课 */
.today-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 16px;
}

/* 本周概览 */
.week-overview {
  padding: 8px 16px 20px;
}

.overview-bar-row {
  display: flex;
  align-items: center;
  padding: 7px 0;
  gap: 10px;
}

.overview-bar-row .ovr-label {
  width: 36px;
  font-size: 12px;
  color: var(--text-secondary);
  text-align: right;
  flex-shrink: 0;
}

.overview-bar-row .ovr-label.today-label {
  color: var(--tint);
  font-weight: 700;
}

.overview-bar-row .ovr-bar-track {
  flex: 1;
  height: 6px;
  background: var(--separator-thin);
  border-radius: 3px;
  overflow: hidden;
}

.overview-bar-row .ovr-bar-fill {
  height: 100%;
  background: var(--tint);
  border-radius: 3px;
  transition: width 0.5s cubic-bezier(0.32, 0.72, 0, 1);
}

.overview-bar-row .ovr-count {
  width: 36px;
  font-size: 13px;
  color: var(--text-secondary);
  text-align: left;
  flex-shrink: 0;
}

.overview-bar-row .ovr-count.rest {
  color: var(--green);
  font-weight: 500;
}

/* ================================================
   Tab 2: 课表视图
   ================================================ */

/* 毛玻璃导航栏 */
.nav-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 16px;
  padding-top: max(8px, env(safe-area-inset-top));
  background: var(--glass-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--separator);
}

.nav-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg-tertiary);
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tint);
  transition: transform 0.1s, background 0.15s;
}
.nav-btn:active {
  transform: scale(0.92);
  background: var(--tint-medium);
}

.week-badge {
  display: flex;
  align-items: baseline;
  gap: 3px;
  min-width: 70px;
  justify-content: center;
}

.week-badge .week-num {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--tint);
}

.week-badge .week-unit {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.nav-spacer {
  flex: 1;
}

/* 课表滚动区 */
.schedule-scroll {
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

/* 课表 Grid */
.schedule-grid {
  display: grid;
  grid-template-columns: 48px repeat(7, 1fr);
  min-width: 540px;
  padding: 4px 0;
}

.grid-corner {
  background: var(--bg-primary);
  position: sticky;
  top: 0;
  left: 0;
  z-index: 3;
}

.grid-header {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  text-align: center;
  padding: 10px 2px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--separator-thin);
}

.grid-header.today-col-header {
  color: var(--tint);
  font-weight: 700;
}

.time-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 2px;
  background: var(--bg-tertiary);
  border-right: 0.5px solid var(--separator-thin);
  font-size: 9px;
  color: var(--text-tertiary);
  line-height: 1.4;
  min-height: 78px;
  position: sticky;
  left: 0;
  z-index: 1;
}

.time-label .slot-name {
  font-weight: 600;
  font-size: 10px;
  color: var(--text-secondary);
}

/* 格子 */
.grid-cell {
  border-right: 0.5px solid var(--separator-thin);
  border-bottom: 0.5px solid var(--separator-thin);
  padding: 3px 4px;
  min-height: 78px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  position: relative;
  background: var(--bg-secondary);
  transition: background 0.15s;
}
.grid-cell:active {
  background: var(--tint-light);
}

.grid-cell.today-col {
  background: var(--today-glow);
}
.grid-cell.weekend-col {
  background: var(--bg-tertiary);
}
.grid-cell.weekend-col.today-col {
  background: var(--today-glow);
}

/* 空单元格添加提示 */
.cell-add-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  font-size: 20px;
  color: var(--text-tertiary);
  transition: opacity 0.2s;
}
.grid-cell:hover .cell-add-hint,
.grid-cell:active .cell-add-hint {
  opacity: 1;
}

/* 课程卡片 */
.course-card {
  border-radius: 8px;
  padding: 4px 7px;
  font-size: 10px;
  line-height: 1.35;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.12s, opacity 0.2s, box-shadow 0.12s;
  animation: cardPopIn 0.3s cubic-bezier(0.32, 0.72, 0, 1) backwards;
  position: relative;
}

.course-card:active {
  transform: scale(0.96);
}

.course-card .card-name {
  font-weight: 700;
  font-size: 11px;
  color: #1a1a2e;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-card .card-location {
  font-size: 9px;
  color: rgba(0,0,0,0.45);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 1px;
}

.course-card .card-week-badge {
  font-size: 8px;
  color: rgba(0,0,0,0.35);
  margin-top: 1px;
}

/* 暗黑模式下的卡片文字 */
@media (prefers-color-scheme: dark) {
  .course-card .card-name { color: #f0f0f0; }
  .course-card .card-location { color: rgba(255,255,255,0.45); }
  .course-card .card-week-badge { color: rgba(255,255,255,0.3); }
}
[data-theme="dark"] .course-card .card-name { color: #f0f0f0; }
[data-theme="dark"] .course-card .card-location { color: rgba(255,255,255,0.45); }
[data-theme="dark"] .course-card .card-week-badge { color: rgba(255,255,255,0.3); }

/* 本周无课 */
.course-card.inactive {
  opacity: var(--inactive-opacity);
}

/* 课程卡片入场动画 */
@keyframes cardPopIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

/* ====== 底部浮动按钮 ====== */
.fab-add {
  position: fixed;
  bottom: 100px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--tint);
  color: white;
  font-size: 28px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 8;
  transition: transform 0.12s, box-shadow 0.2s;
}
.fab-add:active {
  transform: scale(0.91);
  box-shadow: var(--shadow-sm);
}

/* ================================================
   Tab 3: 设置视图
   ================================================ */

.settings-page {
  padding: 20px 16px;
}

.settings-group {
  background: var(--card-bg);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.settings-group-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  padding: 8px 16px 6px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 0.5px solid var(--separator-thin);
  font-size: 16px;
  cursor: pointer;
  transition: background 0.12s;
}
.settings-row:last-child { border-bottom: none; }
.settings-row:active { background: var(--tint-light); }

.settings-row .sr-label {
  flex: 1;
}

.settings-row .sr-value {
  color: var(--text-secondary);
  font-size: 16px;
  margin-right: 8px;
}

.settings-row .sr-arrow {
  color: var(--text-tertiary);
  font-size: 14px;
}

.settings-row select,
.settings-row input[type="date"] {
  border: none;
  background: transparent;
  font-size: 15px;
  color: var(--text-secondary);
  text-align: right;
  font-family: inherit;
  padding: 0;
}
.settings-row select:focus,
.settings-row input:focus {
  outline: none;
}

.theme-segment {
  display: flex;
  background: var(--bg-tertiary);
  border-radius: 8px;
  padding: 2px;
}

.theme-seg-btn {
  flex: 1;
  padding: 6px 14px;
  border: none;
  background: transparent;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-secondary);
  font-family: inherit;
  transition: all 0.2s;
}
.theme-seg-btn.active {
  background: var(--card-bg);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.btn-danger-text {
  color: var(--red);
  cursor: pointer;
  font-size: 16px;
  text-align: center;
  padding: 12px;
}

.app-version {
  text-align: center;
  font-size: 13px;
  color: var(--text-tertiary);
  padding: 20px;
}

/* ================================================
   Tab Bar
   ================================================ */

.tab-bar {
  display: flex;
  background: var(--glass-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--separator);
  padding-bottom: env(safe-area-inset-bottom, 4px);
  flex-shrink: 0;
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 0 4px;
  cursor: pointer;
  transition: color 0.2s;
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.01em;
  -webkit-tap-highlight-color: transparent;
}

.tab-item .tab-icon {
  font-size: 22px;
  margin-bottom: 2px;
  transition: transform 0.2s cubic-bezier(0.32, 0.72, 0, 1);
}

.tab-item.active {
  color: var(--tint);
}

.tab-item.active .tab-icon {
  transform: scale(1.1);
}

/* ================================================
   Bottom Sheet（iOS 风格弹窗）
   ================================================ */

.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: overlayIn 0.3s ease;
}

.sheet {
  background: var(--bg-secondary);
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: sheetUp 0.4s cubic-bezier(0.32, 0.72, 0, 1);
  padding-bottom: env(safe-area-inset-bottom, 16px);
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0 4px;
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-secondary);
}

.sheet-handle {
  width: 36px;
  height: 5px;
  background: var(--separator);
  border-radius: 3px;
}

.sheet-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px 12px;
}

.sheet-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.sheet-close {
  width: 30px;
  height: 30px;
  border: none;
  background: var(--bg-tertiary);
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px 20px;
  -webkit-overflow-scrolling: touch;
}

@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes sheetUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

/* ====== 表单样式 ====== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.form-input,
.form-select {
  width: 100%;
  padding: 11px 14px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}

.form-input:focus {
  outline: 2px solid var(--tint);
  outline-offset: -2px;
  background: var(--bg-secondary);
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23999' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form-row {
  display: flex;
  gap: 10px;
}

.form-col {
  flex: 1;
}

/* 周次预览 */
.week-preview {
  background: var(--tint-light);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--tint);
  font-weight: 500;
  line-height: 1.5;
}

/* 颜色选择器 */
.color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.color-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  border: 2.5px solid transparent;
  transition: transform 0.15s cubic-bezier(0.32, 0.72, 0, 1);
}
.color-dot:active {
  transform: scale(1.2);
}
.color-dot.selected {
  border-color: var(--tint);
  transform: scale(1.15);
  box-shadow: 0 0 0 3px var(--tint-light);
}

/* 表单按钮 */
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.btn-primary {
  flex: 1;
  padding: 13px;
  background: var(--tint);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: -0.01em;
  transition: opacity 0.12s;
}
.btn-primary:active {
  opacity: 0.85;
}

.btn-danger-outline {
  padding: 13px 20px;
  background: transparent;
  color: var(--red);
  border: 1.5px solid var(--red);
  border-radius: 12px;
  font-size: 16px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.12s;
}
.btn-danger-outline:active {
  background: rgba(255, 59, 48, 0.1);
}

/* ====== Toast ====== */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: white;
  padding: 10px 22px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  z-index: 300;
  pointer-events: none;
  transition: opacity 0.25s;
}

/* ====== 空状态 ====== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 30px;
  text-align: center;
}

.empty-state .empty-icon {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state .empty-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.empty-state .empty-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ====== 通知权限提示条 ====== */
.notify-banner {
  margin: 12px 16px;
  padding: 14px 16px;
  background: var(--tint-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.notify-banner .nb-text {
  font-size: 14px;
  color: var(--tint);
  font-weight: 500;
  flex: 1;
}

.notify-banner .nb-btn {
  padding: 8px 16px;
  background: var(--tint);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.notify-banner .nb-dismiss {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--tint);
  font-size: 16px;
  cursor: pointer;
  border-radius: 50%;
}

/* ====== 响应式 ====== */
@media (max-width: 390px) {
  .schedule-grid {
    min-width: 480px;
    grid-template-columns: 42px repeat(7, 1fr);
  }
  .course-card { padding: 3px 5px; }
  .course-card .card-name { font-size: 10px; }
  .now-card .now-course-name { font-size: 22px; }
  .today-date { font-size: 24px; }
}

/* ====== 周切换动画 ====== */
.schedule-grid.switching-left {
  animation: slideOutLeft 0.2s ease forwards;
}
.schedule-grid.switching-right {
  animation: slideOutRight 0.2s ease forwards;
}
.schedule-grid.switching-done {
  animation: slideIn 0.25s cubic-bezier(0.32, 0.72, 0, 1) forwards;
}

@keyframes slideOutLeft {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-30px); }
}
@keyframes slideOutRight {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(30px); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* 骨架屏 */
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--separator-thin) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 周次指示器滚动条美化 */
.main-content::-webkit-scrollbar {
  width: 0;
  height: 0;
}
