/* 高端版「今天」：暖纸 / 墨色 / 蓝色 accent + 下半屏整块白玻璃（v8）
   放在样式链最后，仅作用于 .td-page，不影响其它视图。 */
html[data-view="high"] body[data-page="today"] footer { display: none; }
html[data-view="high"] body[data-page="today"] main { padding-bottom: 0 !important; }

.td-page {
  --td-ink: var(--ink, #1e1d1a);
  --td-muted: var(--muted, #756f66);
  --td-line: var(--line, rgba(35, 31, 25, .09));
  --td-accent: var(--green, #245cff);
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  min-height: calc(100vh - 8px);
  min-height: calc(100dvh - 8px);
  margin: 0 auto;
  color: var(--td-ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.td-page * { box-sizing: border-box; }
.td-page [hidden] { display: none !important; }

/* 背景层：给下半屏的玻璃真实可折的东西。没有这层，磨砂玻璃背后是一片
   连续渐变，模糊看不出变化，玻璃就会退化成一块白板。 */
.td-page::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 0;
  right: 0;
  top: 34%;
  bottom: 0;
  pointer-events: none;
  background:
    radial-gradient(40% 24% at 14% 22%, rgba(255, 184, 100, .55), rgba(255, 184, 100, 0) 74%),
    radial-gradient(36% 22% at 86% 32%, rgba(108, 158, 255, .52), rgba(108, 158, 255, 0) 76%),
    radial-gradient(50% 28% at 54% 86%, rgba(118, 198, 156, .46), rgba(118, 198, 156, 0) 78%),
    radial-gradient(28% 16% at 70% 56%, rgba(224, 160, 255, .3), rgba(224, 160, 255, 0) 78%),
    linear-gradient(102deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .38) 34%, rgba(255, 255, 255, 0) 50%);
}

/* ── 上半屏：纸面，没有大标题，没有右上角添加按钮 ── */
.td-stage {
  position: relative;
  flex: 0 0 auto;
  min-height: 348px;
  padding: 12px 24px 0;
  color: var(--td-ink);
  background: transparent;
}
.td-topline { display: flex; align-items: center; gap: 10px; }
.td-page .td-date-line {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  color: var(--td-ink);
  font-size: 11px;
  white-space: nowrap;
}
.td-date {
  font-family: "Songti SC", "Noto Serif SC", "STSong", Georgia, serif;
  font-size: 28px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -.03em;
  color: var(--td-ink);
}
.td-week {
  font-size: 10.5px;
  line-height: 1.1;
  letter-spacing: .10em;
  color: var(--td-muted);
}
.td-page .weather-chip {
  flex: 0 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--td-muted);
  font-size: 9.5px;
  line-height: 1;
  letter-spacing: .03em;
  white-space: nowrap;
  overflow: hidden;
}
.td-page .weather-chip .wc-city { display: none; }
.td-page .weather-chip .wc-desc { color: var(--td-muted); }
.td-page .weather-chip .wc-temp { color: var(--td-ink); font-weight: 500; }
.td-sync {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 21px;
  padding: 0 8px;
  border: 1px solid var(--td-line);
  border-radius: 999px;
  background: rgba(255, 252, 247, .62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .82);
  color: var(--td-muted);
  font-size: 8.5px;
  line-height: 1;
  letter-spacing: .05em;
  white-space: nowrap;
}
.td-sync i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--td-accent);
  box-shadow: 0 0 0 2px rgba(36, 92, 255, .10);
}
.td-sync.is-offline i { background: #a6a096; box-shadow: 0 0 0 2px rgba(166, 160, 150, .12); }
.td-meta-line {
  margin-top: 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--td-muted);
  font-size: 9.5px;
  line-height: 1.2;
  letter-spacing: .06em;
}
.td-stage-rule {
  height: 1px;
  margin-top: 12px;
  background: linear-gradient(90deg, transparent, rgba(35, 31, 25, .16) 18%, rgba(35, 31, 25, .16) 82%, transparent);
}

/* ── 时间、数据和日轨 ── */
.td-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(138px, 40%, 164px);
  gap: 14px;
  align-items: start;
  margin-top: 16px;
}
.td-now { min-width: 0; }
.td-kicker {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--td-muted);
  font-size: 8.5px;
  line-height: 1;
  letter-spacing: .16em;
}
.td-kicker i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--td-accent);
  box-shadow: 0 0 0 2px rgba(36, 92, 255, .10);
}
.td-clock {
  margin-top: 4px;
  color: var(--td-ink);
  font-family: "Helvetica Neue", "PingFang SC", Arial, sans-serif;
  font-size: clamp(58px, 16.4vw, 72px);
  font-weight: 300;
  line-height: .92;
  letter-spacing: -.07em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.td-now-status {
  margin-top: 8px;
  max-width: 100%;
  overflow: hidden;
  color: var(--td-muted);
  font-size: 10.5px;
  line-height: 1.35;
  letter-spacing: .01em;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.td-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
  height: 84px;
  min-width: 0;
  border-left: 1px solid var(--td-line);
  padding-left: 12px;
}
.td-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
  padding: 2px 7px 2px 0;
}
.td-stat:first-child { border-right: 1px solid var(--td-line); padding-right: 8px; }
.td-stat strong {
  max-width: 100%;
  color: var(--td-ink);
  font-family: "Songti SC", "Noto Serif SC", "STSong", Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.td-stat:first-child strong { font-size: 28px; }
.td-stat:nth-child(2) strong { font-size: 15px; letter-spacing: -.03em; }
.td-stat span {
  margin-top: 5px;
  color: var(--td-muted);
  font-size: 8.5px;
  line-height: 1;
  letter-spacing: .10em;
}
.td-day-strip { position: relative; height: 64px; margin-top: 13px; }
.td-day-axis {
  position: absolute;
  left: 0;
  right: 0;
  top: 40px;
  height: 1px;
  background: linear-gradient(90deg, rgba(35, 31, 25, .03), rgba(35, 31, 25, .18) 15%, rgba(35, 31, 25, .18) 85%, rgba(35, 31, 25, .03));
}
.td-tick {
  position: absolute;
  bottom: 0;
  transform: translateX(-50%);
  color: rgba(35, 31, 25, .36);
  font-size: 7.5px;
  line-height: 1;
  letter-spacing: .03em;
  font-variant-numeric: tabular-nums;
}
.td-day-course {
  position: absolute;
  top: 11px;
  height: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  overflow: hidden;
  border-radius: 7px;
  border: 1px solid color-mix(in srgb, var(--course-color, #557d9c) 28%, transparent);
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--course-color, #557d9c) 18%, transparent),
      color-mix(in srgb, var(--course-color, #557d9c) 7%, transparent));
  box-shadow: 0 2px 10px rgba(35, 31, 25, .05), inset 0 1px 0 rgba(255, 255, 255, .52);
  color: var(--td-ink);
  font-size: 7px;
  line-height: 1.05;
  white-space: nowrap;
}
.td-day-course strong {
  max-width: 100%;
  overflow: hidden;
  color: var(--td-ink);
  font-size: 8px;
  font-weight: 500;
  line-height: 1;
  text-overflow: ellipsis;
}
.td-day-course span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; opacity: .72; }
.td-day-now {
  position: absolute;
  top: 6px;
  bottom: 14px;
  width: 1px;
  background: var(--td-accent);
  box-shadow: 0 0 10px rgba(36, 92, 255, .55), 0 0 26px rgba(36, 92, 255, .18);
}
.td-day-now::before {
  content: "";
  position: absolute;
  left: -2px;
  top: -2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--td-accent);
  box-shadow: 0 0 0 3px rgba(36, 92, 255, .10);
}
.td-day-free {
  position: absolute;
  top: 27px;
  transform: translateX(-50%);
  color: var(--td-muted);
  font-size: 7.5px;
  line-height: 1;
  letter-spacing: .04em;
  white-space: nowrap;
}
.td-strip-empty {
  position: absolute;
  left: 0;
  top: 22px;
  color: var(--td-muted);
  font-size: 9px;
}

/* ── 下半屏：整块厚玻璃（有背景可折、有唇边、有厚度） ── */
.td-sheet {
  position: relative;
  z-index: 3;
  flex: 1 1 auto;
  margin: -18px 0 0;
  padding: 20px 24px 96px;
  border: 1px solid rgba(255, 255, 255, .96);
  border-bottom: 0;
  border-radius: 32px 32px 0 0;
  background:
    linear-gradient(180deg,
      rgba(255, 255, 255, .54) 0,
      rgba(252, 254, 255, .24) 4px,
      rgba(246, 251, 255, .15) 52px,
      rgba(238, 246, 255, .05) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0) 2px, rgba(150, 172, 206, .12) 3px, rgba(255, 255, 255, 0) 9px),
    radial-gradient(76% 26% at 16% 0%, rgba(255, 255, 255, .42), rgba(255, 255, 255, 0) 72%);
  -webkit-backdrop-filter: blur(46px) saturate(2.25) brightness(1.02);
  backdrop-filter: blur(46px) saturate(2.25) brightness(1.02);
  box-shadow:
    0 -1px 0 rgba(58, 47, 31, .18),
    0 -30px 68px rgba(58, 47, 31, .26),
    0 -5px 14px rgba(58, 47, 31, .10),
    0 16px 38px rgba(58, 47, 31, .10),
    inset 0 2px 0 rgba(255, 255, 255, 1),
    inset 0 -1px 0 rgba(255, 255, 255, .52),
    inset 0 28px 42px -22px rgba(255, 255, 255, .36),
    inset 18px 0 30px -24px rgba(186, 208, 255, .62),
    inset -18px 0 30px -24px rgba(255, 212, 152, .56);
  overflow: hidden;
  isolation: isolate;
}
.td-sheet::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: 0;
  right: 0;
  top: 0;
  height: 84px;
  border-radius: 32px 32px 0 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .26) 0, rgba(255, 255, 255, .08) 24%, rgba(255, 255, 255, 0) 76%),
    linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .96) 12%, rgba(255, 255, 255, .96) 88%, rgba(255, 255, 255, 0)) 0 0 / 100% 2px no-repeat;
  -webkit-backdrop-filter: blur(64px) saturate(2.3) brightness(1.06);
  backdrop-filter: blur(64px) saturate(2.3) brightness(1.06);
  -webkit-mask-image: linear-gradient(180deg, #000 0 58%, rgba(0, 0, 0, 0) 100%);
  mask-image: linear-gradient(180deg, #000 0 58%, rgba(0, 0, 0, 0) 100%);
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .7)) drop-shadow(0 2px 8px rgba(255, 255, 255, .32));
}
.td-sheet::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: .95;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.07'/%3E%3C/svg%3E"),
    radial-gradient(50% 20% at 24% 4%, rgba(255, 255, 255, .34), rgba(255, 255, 255, 0) 70%),
    linear-gradient(112deg, rgba(255, 255, 255, .50) 0%, rgba(255, 255, 255, 0) 24%, rgba(255, 255, 255, 0) 58%, rgba(255, 255, 255, .20) 100%),
    linear-gradient(98deg, rgba(255, 255, 255, 0) 42%, rgba(255, 255, 255, .12) 47%, rgba(255, 255, 255, 0) 52%);
  background-size: 120px 120px, auto, auto, auto;
  background-repeat: repeat, no-repeat, no-repeat, no-repeat;
}
.td-sheet > * { position: relative; z-index: 2; }
.td-sheet-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.td-sheet-head h2 {
  margin: 0;
  color: var(--td-ink);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .13em;
}
.td-sheet-head span {
  color: var(--td-muted);
  font-size: 9.5px;
  line-height: 1;
  letter-spacing: .03em;
  font-variant-numeric: tabular-nums;
}

/* ── 课程列表：真实课程卡 + 原有出勤控件 ── */
.td-course-list { position: relative; }
.td-course-list::before {
  content: "";
  position: absolute;
  left: calc(58px + 8px + 3px);
  top: 9px;
  bottom: 14px;
  width: 1px;
  background: linear-gradient(180deg, rgba(85, 125, 156, .30) 0%, rgba(173, 133, 82, .22) 50%, rgba(36, 92, 255, .12) 100%);
  pointer-events: none;
}
.td-page .course-card.td-course {
  position: relative;
  display: grid;
  grid-template-columns: 58px 18px minmax(0, 1fr);
  gap: 0;
  align-items: start;
  margin: 0;
  padding: 14px 0 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--td-ink);
  cursor: default;
  transition: background .18s ease;
}
.td-page .course-card.td-course + .td-course::before {
  content: "";
  position: absolute;
  left: 76px;
  right: 0;
  top: 0;
  height: 1px;
  background: var(--td-line);
}
.td-page .course-card.td-course:active { background: rgba(35, 31, 25, .035); }
.td-course-time {
  padding-top: 1px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.td-course-time strong {
  display: block;
  color: var(--td-ink);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -.02em;
}
.td-course-time span {
  display: block;
  margin-top: 7px;
  color: var(--td-muted);
  font-size: 10px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.td-course-rail { position: relative; }
.td-course-rail i {
  position: absolute;
  left: 8px;
  top: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--course-color, #557d9c);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--course-color, #557d9c) 8%, transparent);
}
.td-course-copy { min-width: 0; padding-left: 10px; }
.td-course-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 32px;
}
.td-course-head h3 {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--td-ink);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.025em;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.td-page .td-att-seg { flex: 0 0 auto; margin-left: 2px; }
.td-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(36, 92, 255, .08);
  color: var(--td-accent);
  font-size: 8px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .02em;
  vertical-align: 1px;
}
.td-course-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  margin: 7px 0 0;
  overflow: hidden;
  color: var(--td-muted);
  font-size: 10px;
  line-height: 1.35;
  letter-spacing: .01em;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.td-course-meta i {
  display: inline-block;
  width: 2.5px;
  height: 2.5px;
  margin: 0 5px;
  border-radius: 50%;
  background: rgba(117, 111, 102, .5);
  vertical-align: 2px;
}
.td-course-note {
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--td-muted);
  font-size: 9px;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.td-course-note a { color: var(--td-accent); text-decoration: none; }
.td-course.is-past .td-course-time strong,
.td-course.is-past .td-course-head h3 { color: color-mix(in srgb, var(--td-ink) 62%, #fff); }
.td-empty {
  padding: 26px 0 22px;
  text-align: center;
}
.td-empty strong {
  display: block;
  color: var(--td-ink);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -.01em;
}
.td-empty p { margin: 7px 0 12px; color: var(--td-muted); font-size: 10px; }
.td-empty button {
  padding: 8px 14px;
  border: 1px solid var(--td-line);
  border-radius: 999px;
  background: rgba(255, 252, 247, .7);
  color: var(--td-ink);
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}
.td-now-row {
  display: grid;
  grid-template-columns: 58px 18px minmax(0, 1fr);
  padding: 9px 0 0;
  color: var(--td-muted);
}
.td-now-row > b {
  text-align: right;
  font-size: 9.5px;
  font-weight: 400;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.td-now-rail { position: relative; }
.td-now-rail i {
  position: absolute;
  left: 5px;
  top: 0;
  width: 11px;
  height: 11px;
  border: 1px solid rgba(36, 92, 255, .32);
  border-radius: 50%;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 0 0 5px rgba(36, 92, 255, .05);
}
.td-now-rail i::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--td-accent);
}
.td-now-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-left: 10px;
  color: var(--td-muted);
  font-size: 9.5px;
  line-height: 1.3;
}
.td-now-copy span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-now-copy small { flex: 0 1 auto; color: var(--td-ink); font-size: 9.5px; white-space: nowrap; }
.td-bottom-rule { height: 1px; margin-top: 14px; background: var(--td-line); }
.td-tomorrow { padding-top: 12px; }
.td-tomorrow-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.td-tomorrow-head > div { display: flex; align-items: baseline; gap: 7px; }
.td-tomorrow-head h3 {
  margin: 0;
  color: var(--td-ink);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .01em;
}
.td-tomorrow-head span { color: var(--td-muted); font-size: 9.5px; }
.td-tomorrow-head small { color: var(--td-muted); font-size: 9.5px; letter-spacing: .06em; }
.td-tomorrow-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  color: var(--td-ink);
}
.td-tomorrow-row > b {
  width: 32px;
  color: var(--td-muted);
  font-size: 10px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.td-tomorrow-row > div { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.td-tomorrow-row strong { overflow: hidden; font-size: 11.5px; font-weight: 400; white-space: nowrap; text-overflow: ellipsis; }
.td-tomorrow-row small { flex: 0 0 auto; margin-left: auto; color: var(--td-muted); font-size: 9.5px; white-space: nowrap; }
.td-tomorrow-empty { margin: 10px 0 0; color: var(--td-muted); font-size: 10px; }
.td-presence { margin: 12px 0 0; color: var(--td-muted); font-size: 9px; line-height: 1.3; }

/* ── 深色：同一块玻璃，只是夜色 ── */
html[data-scheme="dark"] .td-page {
  --td-ink: #edf2fb;
  --td-muted: #98a5ba;
  --td-line: rgba(255, 255, 255, .13);
  --td-accent: #9dbcff;
}
html[data-scheme="dark"] .td-sync {
  border-color: rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16);
}
html[data-scheme="dark"] .td-sync i { box-shadow: 0 0 0 2px rgba(157, 188, 255, .12); }
html[data-scheme="dark"] .td-sync.is-offline i { background: #718096; box-shadow: 0 0 0 2px rgba(113, 128, 150, .12); }
html[data-scheme="dark"] .td-stage-rule { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .16) 18%, rgba(255, 255, 255, .16) 82%, transparent); }
html[data-scheme="dark"] .td-kicker i { box-shadow: 0 0 0 2px rgba(157, 188, 255, .10); }
html[data-scheme="dark"] .td-day-axis { background: linear-gradient(90deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .22) 15%, rgba(255, 255, 255, .22) 85%, rgba(255, 255, 255, .04)); }
html[data-scheme="dark"] .td-tick { color: rgba(228, 236, 250, .38); }
html[data-scheme="dark"] .td-day-course {
  background: linear-gradient(180deg, color-mix(in srgb, var(--course-color, #557d9c) 30%, transparent), color-mix(in srgb, var(--course-color, #557d9c) 10%, transparent));
  border-color: color-mix(in srgb, var(--course-color, #557d9c) 34%, transparent);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .14), inset 0 1px 0 rgba(255, 255, 255, .16);
}
html[data-scheme="dark"] .td-day-now { box-shadow: 0 0 10px rgba(151, 190, 255, .55), 0 0 26px rgba(151, 190, 255, .18); }
html[data-scheme="dark"] .td-day-now::before { box-shadow: 0 0 0 3px rgba(151, 190, 255, .10); }
html[data-scheme="dark"] .td-page::before { opacity: .58; }
html[data-scheme="dark"] .td-sheet {
  border-color: rgba(255, 255, 255, .22);
  background:
    linear-gradient(180deg,
      rgba(58, 72, 96, .52) 0,
      rgba(34, 44, 62, .40) 4px,
      rgba(24, 32, 46, .24) 48px,
      rgba(17, 23, 34, .12) 100%),
    radial-gradient(76% 26% at 16% 0%, rgba(196, 222, 255, .16), rgba(196, 222, 255, 0) 72%);
  -webkit-backdrop-filter: blur(46px) saturate(1.7) brightness(.98);
  backdrop-filter: blur(46px) saturate(1.7) brightness(.98);
  box-shadow:
    0 -30px 68px rgba(0, 0, 0, .48),
    0 -5px 14px rgba(0, 0, 0, .26),
    0 16px 38px rgba(0, 0, 0, .22),
    inset 0 2px 0 rgba(214, 234, 255, .42),
    inset 0 -1px 0 rgba(255, 255, 255, .12),
    inset 0 28px 42px -22px rgba(255, 255, 255, .10),
    inset 18px 0 30px -24px rgba(151, 190, 255, .26),
    inset -18px 0 30px -24px rgba(255, 206, 150, .18);
}
html[data-scheme="dark"] .td-sheet::before {
  background:
    linear-gradient(180deg, rgba(196, 222, 255, .16) 0, rgba(196, 222, 255, .04) 24%, rgba(196, 222, 255, 0) 76%),
    linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(214, 234, 255, .72) 12%, rgba(214, 234, 255, .72) 88%, rgba(255, 255, 255, 0)) 0 0 / 100% 2px no-repeat;
  -webkit-backdrop-filter: blur(64px) saturate(1.9) brightness(.99);
  backdrop-filter: blur(64px) saturate(1.9) brightness(.99);
  filter: drop-shadow(0 1px 0 rgba(214, 234, 255, .28)) drop-shadow(0 2px 10px rgba(160, 200, 255, .18));
}
html[data-scheme="dark"] .td-sheet::after { opacity: .55; }
html[data-scheme="dark"] .td-course-rail i { box-shadow: 0 0 0 4px color-mix(in srgb, var(--course-color, #557d9c) 14%, transparent); }
html[data-scheme="dark"] .td-course-meta i { background: rgba(152, 165, 186, .6); }
html[data-scheme="dark"] .td-now-rail i { background: rgba(255, 255, 255, .16); border-color: rgba(157, 188, 255, .34); box-shadow: 0 0 0 5px rgba(157, 188, 255, .06); }
html[data-scheme="dark"] .td-empty button { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); color: var(--td-ink); }
html[data-scheme="dark"] .td-tag { background: rgba(157, 188, 255, .12); color: #9dbcff; }

/* ── 手机：页面贴边，顶部无标题，玻璃覆盖整条下半屏 ── */
@media (max-width: 650px) {
  .td-page { width: calc(100% + 40px); max-width: none; margin-left: -20px; margin-right: -20px; }
  .td-stage { padding-right: 24px; padding-left: 24px; }
  .td-sheet { padding-right: 24px; padding-left: 24px; }
}
@media (max-width: 380px) {
  .td-date { font-size: 25px; }
  .td-clock { font-size: 59px; }
  .td-hero { grid-template-columns: minmax(0, 1fr) 124px; gap: 10px; }
  .td-stats { padding-left: 9px; }
  .td-page .course-card.td-course { grid-template-columns: 52px 16px minmax(0, 1fr); }
  .td-page .course-card.td-course + .td-course::before { left: 68px; }
  .td-course-list::before { left: calc(52px + 8px + 3px); }
  .td-course-head h3 { font-size: 16.5px; }
  .td-course-time strong { font-size: 16px; }
  .td-course-time span { font-size: 9.5px; }
  .td-course-meta { font-size: 9.5px; }
}
@media (min-width: 651px) {
  .td-page .td-att-seg {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    flex: 0 0 auto;
    height: 30px;
    padding: 3px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .82);
    border-radius: 15px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .72), rgba(255, 255, 255, .42));
    box-shadow: 0 8px 20px rgba(34, 48, 82, .10), inset 0 1px 0 rgba(255, 255, 255, .92);
    -webkit-backdrop-filter: blur(18px) saturate(1.7);
    backdrop-filter: blur(18px) saturate(1.7);
  }
  .td-page .td-att-seg .card-tool.att-btn {
    width: auto;
    min-width: 44px;
    height: 24px;
    min-height: 24px;
    margin: 0;
    padding: 0 8px;
    border: 0 !important;
    border-radius: 12px;
    background: transparent !important;
    box-shadow: none !important;
    color: rgba(17, 21, 28, .60);
    font: inherit;
    font-size: 10px;
    font-weight: 500;
    line-height: 1;
  }
  .td-page .td-att-seg .card-tool.att-btn.on { color: var(--td-accent) !important; font-weight: 600 !important; }
  html[data-scheme="dark"] .td-page .td-att-seg {
    border-color: rgba(255, 255, 255, .18);
    background: linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .03));
    box-shadow: 0 8px 22px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255, 255, 255, .18);
  }
  html[data-scheme="dark"] .td-page .td-att-seg .card-tool.att-btn { color: rgba(231, 238, 250, .66); }
  html[data-scheme="dark"] .td-page .td-att-seg .card-tool.att-btn.on { color: #9dbcff !important; }
}

/* ── 深色「今天」玻璃修正：和上半屏同一个夜色，不再发灰、发绿 ── */
html[data-view="high"][data-scheme="dark"] body[data-page="today"] {
  background:
    radial-gradient(46% 38% at 4% 0%, rgba(219, 138, 82, .10), rgba(219, 138, 82, 0) 66%),
    radial-gradient(44% 36% at 100% 2%, rgba(92, 142, 255, .22), rgba(92, 142, 255, 0) 64%),
    radial-gradient(52% 42% at 84% 100%, rgba(56, 96, 184, .18), rgba(56, 96, 184, 0) 68%),
    radial-gradient(48% 36% at 6% 100%, rgba(76, 108, 200, .12), rgba(76, 108, 200, 0) 68%),
    linear-gradient(150deg, #080c12 0%, #0c1422 48%, #081018 100%);
}
html[data-scheme="dark"] .td-page::before {
  opacity: .34;
  background:
    radial-gradient(40% 24% at 14% 22%, rgba(80, 132, 255, .26), rgba(80, 132, 255, 0) 74%),
    radial-gradient(36% 22% at 86% 32%, rgba(64, 104, 215, .20), rgba(64, 104, 215, 0) 76%),
    radial-gradient(50% 28% at 54% 86%, rgba(32, 68, 140, .26), rgba(32, 68, 140, 0) 78%),
    radial-gradient(28% 16% at 70% 56%, rgba(95, 95, 225, .06), rgba(95, 95, 225, 0) 78%);
}
html[data-scheme="dark"] .td-sheet {
  border-color: rgba(255, 255, 255, .15);
  background:
    linear-gradient(180deg,
      rgba(255, 255, 255, .045) 0,
      rgba(255, 255, 255, .018) 4px,
      rgba(255, 255, 255, .008) 52px,
      rgba(255, 255, 255, 0) 100%),
    radial-gradient(76% 26% at 16% 0%, rgba(150, 190, 255, .055), rgba(150, 190, 255, 0) 72%);
  -webkit-backdrop-filter: blur(46px) saturate(1.04) brightness(1.005);
  backdrop-filter: blur(46px) saturate(1.04) brightness(1.005);
  box-shadow:
    0 -1px 0 rgba(255, 255, 255, .16),
    0 -30px 68px rgba(0, 0, 0, .44),
    0 -5px 14px rgba(0, 0, 0, .22),
    0 16px 38px rgba(0, 0, 0, .18),
    inset 0 1px 0 rgba(220, 235, 255, .22),
    inset 0 -1px 0 rgba(255, 255, 255, .06),
    inset 0 24px 42px -24px rgba(255, 255, 255, .10),
    inset 18px 0 30px -24px rgba(125, 170, 255, .12),
    inset -18px 0 30px -24px rgba(255, 190, 140, .04);
}
html[data-scheme="dark"] .td-sheet::before {
  height: 60px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .09) 0, rgba(255, 255, 255, .018) 24%, rgba(255, 255, 255, 0) 76%),
    linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .52) 10%, rgba(255, 255, 255, .52) 90%, rgba(255, 255, 255, 0)) 0 0 / 100% 1px no-repeat;
  -webkit-backdrop-filter: blur(64px) saturate(1.04) brightness(1);
  backdrop-filter: blur(64px) saturate(1.04) brightness(1);
  filter: none;
}
html[data-scheme="dark"] .td-sheet::after {
  opacity: .42;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.07'/%3E%3C/svg%3E"),
    radial-gradient(62% 24% at 16% 2%, rgba(220, 235, 255, .10), rgba(220, 235, 255, 0) 70%),
    radial-gradient(52% 30% at 88% 4%, rgba(130, 180, 255, .045), rgba(130, 180, 255, 0) 72%);
  background-size: 120px 120px, auto, auto;
  background-repeat: repeat, no-repeat, no-repeat;
}

/* 今天页时间轴 chip 可点 + 定位高亮 */
.td-day-course[data-goto] { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.td-course.is-flash { box-shadow: 0 0 0 2px color-mix(in srgb, var(--td-accent, #245cff) 45%, transparent); transition: box-shadow .2s ease; }
/* 记缺勤后出现的找人代课 */
.sub-gap { margin-left: 4px; color: #245cff; border-color: color-mix(in srgb, #245cff 38%, transparent); }
/* 今天页的找人代课单独一行，别把课名挤没了 */
.td-page .sub-gap { margin: 6px 0 0; align-self: flex-start; font-size: 11.5px; }
/* 整周页：今天已结束的课淡化 */
.schedule-course.is-past { opacity: .48; filter: saturate(.55); }
.schedule-course.is-past:hover { opacity: .72; }
@media (prefers-reduced-motion:reduce) { .schedule-course.is-past { transition: none; } }

/* 空课日「添加课程」胶囊：覆盖 quiet-ui 的纯圆形加号按钮 */
html[data-theme][data-view="high"] .td-empty .td-empty-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  width: auto;
  min-height: 40px;
  height: auto;
  padding: 9px 18px !important;
  border-radius: 999px !important;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.2;
}
html[data-theme][data-view="high"] .td-empty .td-empty-add span { font-size: 15px; line-height: 1; }
