.settings-screen {
  height: 100%;
  overflow-y: auto;
  padding: 28px 0 18px;
  overscroll-behavior: contain;
}
.settings-header {
  margin-bottom: 21px;
}
.settings-header p {
  margin: 0 0 5px;
  color: #6686a2;
  font-size: 12px;
  font-weight: 700;
}
.settings-header h1 {
  margin: 0;
  color: #18324f;
  font-size: 28px;
  letter-spacing: -0.6px;
}
.settings-section {
  margin: 0 0 20px;
}
.settings-section-label {
  margin: 0 0 9px;
  color: #496b86;
  font-size: 13px;
  font-weight: 850;
}
.settings-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.settings-section-heading small {
  color: #829caf;
  font-size: 11px;
}
.settings-account-button {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 11px;
  width: 100%;
  border: 1px solid #b9d9ec;
  border-radius: 13px;
  background: linear-gradient(135deg, #f4faff, #e7f5ff);
  color: #204c6d;
  padding: 13px;
  text-align: left;
  cursor: pointer;
}
.settings-account-button:hover {
  border-color: #79b4d7;
  background: #e8f6ff;
}
.settings-account-icon,
.settings-feature-icon,
.settings-order-icon {
  display: grid;
  place-items: center;
  color: var(--app-accent, #1769aa);
}
.settings-account-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #d9efff;
}
.settings-account-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.settings-account-button strong,
.settings-account-button small {
  display: block;
}
.settings-account-button strong {
  font-size: 14px;
}
.settings-account-button small {
  margin-top: 3px;
  color: #6e8ca4;
  font-size: 11px;
  line-height: 1.4;
}
.settings-account-button b {
  color: var(--app-accent, #1769aa);
  font-size: 25px;
  font-weight: 400;
}
.settings-theme-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.settings-theme-choice {
  display: grid;
  justify-items: center;
  gap: 7px;
  min-height: 82px;
  border: 1px solid #d3e3ed;
  border-radius: 12px;
  background: #fbfdff;
  color: #54718a;
  padding: 9px 4px;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}
.settings-theme-choice i {
  display: block;
  width: 27px;
  height: 27px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: var(--theme-color);
  box-shadow: 0 0 0 1px #bed3e1;
}
.settings-theme-choice.is-selected {
  border-color: var(--app-accent, #1769aa);
  background: #eef8ff;
  box-shadow: 0 0 0 1px
    color-mix(in srgb, var(--app-accent, #1769aa) 28%, transparent);
  color: #214d6c;
}
.settings-feature-list,
.settings-order-list {
  display: grid;
  gap: 8px;
}
.settings-feature-row {
  display: grid;
  grid-template-columns: 30px 1fr 42px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 55px;
  border: 1px solid #d3e3ed;
  border-radius: 11px;
  background: #fbfdff;
  color: #365b77;
  padding: 9px 12px;
  text-align: left;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.settings-feature-row:hover {
  border-color: #aad0e6;
  background: #f3faff;
}
.settings-feature-icon {
  width: 28px;
  height: 28px;
}
.settings-feature-icon svg,
.settings-order-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.settings-feature-row > i {
  position: relative;
  width: 40px;
  height: 23px;
  border-radius: 99px;
  background: #b8cad7;
  transition: 0.18s;
}
.settings-feature-row > i::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px #36546a55;
  content: "";
  transition: 0.18s;
}
.settings-feature-row.is-on > i {
  background: var(--app-accent, #1769aa);
}
.settings-feature-row.is-on > i::after {
  transform: translateX(17px);
}
.settings-order-row {
  display: grid;
  grid-template-columns: 24px 29px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 9px;
  min-height: 51px;
  border: 1px solid #d3e3ed;
  border-radius: 10px;
  background: #fbfdff;
  color: #385c77;
  padding: 9px 11px;
  font-size: 13px;
  font-weight: 800;
  cursor: default;
  touch-action: pan-y;
  position: relative;
  transition: transform .2s cubic-bezier(.2,.85,.28,1), box-shadow .2s ease, border-color .2s ease, background .2s ease, opacity .2s ease;
}
.settings-order-row.is-dragging {
  opacity: 1;
  border-color: var(--app-accent, #1769aa);
  background: var(--theme-tint, #eef8ff);
  cursor: grabbing;
  z-index: 2;
  transform: scale(1.025);
  box-shadow: 0 10px 20px color-mix(in srgb, var(--app-accent, #1769aa) 25%, transparent);
}
.settings-order-row.is-drop-target::before,
.settings-order-row.is-drop-last::after { position: absolute; z-index: 3; left: 12px; right: 12px; height: 3px; border-radius: 99px; background: var(--app-accent, #1769aa); box-shadow: 0 0 0 3px color-mix(in srgb, var(--app-accent, #1769aa) 14%, transparent); content: ""; }
.settings-order-row.is-drop-target::before { top: -6px; }
.settings-order-row.is-drop-last::after { bottom: -6px; }
.settings-order-feedback { min-height: 20px; margin: 9px 3px 0; color: var(--theme-muted, #6686a2); font-size: 11px; font-weight: 700; line-height: 1.45; }
.tabbar.is-order-updated .tab { animation: tab-order-settle .36s cubic-bezier(.2,.85,.28,1) both; }
.tabbar.is-order-updated .tab:nth-child(2) { animation-delay: .035s; }.tabbar.is-order-updated .tab:nth-child(3) { animation-delay: .07s; }.tabbar.is-order-updated .tab:nth-child(4) { animation-delay: .105s; }.tabbar.is-order-updated .tab:nth-child(5) { animation-delay: .14s; }
@keyframes tab-order-settle { 0% { opacity: .35; transform: translateY(8px) scale(.94); } 100% { opacity: 1; transform: none; } }
.settings-drag-handle {
  display: grid;
  place-items: center;
  align-self: stretch;
  width: 24px;
  min-height: 32px;
  color: #9bb3c3;
  font-size: 20px;
  line-height: 1;
  letter-spacing: 0;
  cursor: grab;
  touch-action: none;
}
.settings-drag-handle:active { cursor: grabbing; }
.settings-order-icon {
  width: 26px;
  height: 26px;
}
.settings-order-row small {
  justify-self: end;
  color: #829bad;
  font-size: 10px;
  font-weight: 700;
}
.settings-order-toggle {
  position: relative;
  width: 40px;
  height: 23px;
  border: 0;
  border-radius: 99px;
  background: #b8cad7;
  cursor: pointer;
  transition: background .18s ease, transform .16s ease;
}
.settings-order-toggle::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px #36546a55;
  content: "";
  transition: transform .18s ease;
}
.settings-order-toggle.is-on { background: var(--app-accent, #1769aa); }
.settings-order-toggle.is-on::after { transform: translateX(17px); }
.settings-order-toggle:active { transform: scale(.96); }
.tabbar[data-tab-count="5"] .tab {
  font-size: 11px;
}
.tabbar[data-tab-count="6"] {
  padding-inline: 8px;
}
.tabbar[data-tab-count="6"] .tab {
  font-size: 9.5px;
}
.tabbar[data-tab-count="6"] .tab-icon,
.tabbar[data-tab-count="6"] .tab-icon svg {
  width: 23px;
  height: 23px;
}
.tabbar[data-tab-count="1"] {
  justify-content: center;
}
.tabbar[data-tab-count="1"] .tab {
  flex: 0 1 82px;
}
body[data-app-theme="mint"] {
  --app-accent: #277f75;
}
body[data-app-theme="violet"] {
  --app-accent: #7253a6;
}
body[data-app-theme="coral"] {
  --app-accent: #bf6465;
}
body[data-app-theme="blue"] {
  --app-accent: #1769aa;
}
body[data-app-theme]:not([data-app-theme="blue"]) .tab.is-active,
body[data-app-theme]:not([data-app-theme="blue"]) .tab-icon,
body[data-app-theme]:not([data-app-theme="blue"]) .today-button,
body[data-app-theme]:not([data-app-theme="blue"]) .settings-account-icon,
body[data-app-theme]:not([data-app-theme="blue"]) .settings-feature-icon,
body[data-app-theme]:not([data-app-theme="blue"]) .settings-order-icon {
  color: var(--app-accent);
}
body[data-app-theme]:not([data-app-theme="blue"]) .add-button,
body[data-app-theme]:not([data-app-theme="blue"]) .save-button,
body[data-app-theme]:not([data-app-theme="blue"]) .push-settings-button,
body[data-app-theme]:not([data-app-theme="blue"]) .release-update-button {
  background: var(--app-accent);
}
body[data-app-theme]:not([data-app-theme="blue"]) .day-cell.is-selected,
body[data-app-theme]:not([data-app-theme="blue"]) .mini-day.is-selected {
  background: var(--app-accent);
  box-shadow: 0 5px 12px color-mix(in srgb, var(--app-accent) 28%, transparent);
}
body[data-app-theme]:not([data-app-theme="blue"]) .today-button {
  border-color: color-mix(in srgb, var(--app-accent) 35%, #fff);
}
@media (max-width: 380px) {
  .settings-theme-list {
    gap: 6px;
  }
  .settings-theme-choice {
    min-height: 76px;
    font-size: 10px;
  }
  .settings-account-button {
    grid-template-columns: 38px minmax(0, 1fr) 18px;
    padding: 11px;
  }
  .settings-account-icon {
    width: 36px;
    height: 36px;
  }
}

/* 夜晚模式：保留清晰的信息层级，同时降低夜间阅读的刺眼感。 */
body[data-app-theme="night"] { --app-accent: #8bb9ff; color: #edf4ff; background: #090d14; }
body[data-app-theme="night"] .app-shell, body[data-app-theme="night"] .screen, body[data-app-theme="night"] .tabbar { background: #111823 !important; color: #edf4ff; }
body[data-app-theme="night"] .tabbar { border-color: #283445; }
body[data-app-theme="night"] .tab { color: #93a4b8; }
body[data-app-theme="night"] .tab.is-active, body[data-app-theme="night"] .tab-icon { color: #9cc4ff; }
body[data-app-theme="night"] :is(h1, h2, h3, strong, .day-number, .calendar-selected-date h1, .calendar-month-trigger, .modal-header h2) { color: #f4f7fb !important; }
body[data-app-theme="night"] :is(p, small, .day-header p, .day-summary, .memo-sync-copy, .anniversary-copy, .weekdays, .time-label, .empty-state, .settings-section-label, .settings-section-heading small) { color: #aebdce !important; }
body[data-app-theme="night"] :is(.calendar-scroll, .day-cell, .calendar-event, .agenda-item, .event-card, .memo-card, .memo-empty, .anniversary-card, .anniversary-empty, .settings-account-button, .settings-theme-choice, .settings-feature-row, .settings-order-row, .schedule-editor, .memo-editor-media, .memo-editor-content, .anniversary-date-field, .group-sidebar, dialog) { background: #182230 !important; border-color: #324155 !important; color: #eaf1fa !important; }
body[data-app-theme="night"] :is(input, select, textarea, .anniversary-date-trigger, .color-picker-trigger, .event-group-trigger, .schedule-editor-trigger, .memo-date-picker-trigger, .early-reminder-trigger) { background: #131c28 !important; border-color: #3a4b60 !important; color: #eef4fb !important; }
body[data-app-theme="night"] :is(.day-cell.is-empty:not(.is-selected), .day-cell.is-other, .mini-day.is-other) { background: #151e2a !important; color: #8293a8 !important; }
body[data-app-theme="night"] :is(.calendar-event, .agenda-item, .event-card) { border-color: #4c7097 !important; background: #1d2b3d !important; }
body[data-app-theme="night"] .today-button { background: #17283b; border-color: #4a6c91; color: #acd0ff; }
body[data-app-theme="night"] :is(.settings-account-icon, .memo-card-mark) { background: #213a58 !important; }
body[data-app-theme="night"] .settings-theme-choice.is-selected { background: #243957 !important; border-color: #8bb9ff !important; color: #fff !important; }
body[data-app-theme="night"] dialog::backdrop { background: #000b !important; }
body[data-app-theme="night"] .group-sidebar-scrim { background: #000a !important; }

/* 每种配色不仅改变图标，也改变页面、卡片和日历的整套色调。 */
body[data-app-theme="blue"] { --theme-page: #eaf5ff; --theme-surface: #fafdff; --theme-card: #f4faff; --theme-border: #cfe2f0; --theme-text: #183b60; --theme-muted: #6f8fa9; --theme-tint: #e3f2ff; }
body[data-app-theme="mint"] { --theme-page: #edf9f5; --theme-surface: #fbfffd; --theme-card: #f1fbf7; --theme-border: #b8dfd2; --theme-text: #1c4b43; --theme-muted: #6f968c; --theme-tint: #dff3eb; }
body[data-app-theme="violet"] { --theme-page: #f5f1ff; --theme-surface: #fdfbff; --theme-card: #f5efff; --theme-border: #d5c7ee; --theme-text: #3f315c; --theme-muted: #8a7da5; --theme-tint: #ece3ff; }
body[data-app-theme="coral"] { --theme-page: #fff4f2; --theme-surface: #fffdfc; --theme-card: #fff3f0; --theme-border: #f0c9c3; --theme-text: #613938; --theme-muted: #9d7774; --theme-tint: #ffe5e0; }
body[data-app-theme="night"] { --theme-page: #080d15; --theme-surface: #111823; --theme-card: #182230; --theme-border: #324155; --theme-text: #edf4ff; --theme-muted: #aebdce; --theme-tint: #213a58; }

body[data-app-theme] { background: var(--theme-page); color: var(--theme-text); }
body[data-app-theme] .app-shell, body[data-app-theme] .screen, body[data-app-theme] .tabbar { background: var(--theme-surface) !important; }
body[data-app-theme] .tabbar { border-color: var(--theme-border); }
body[data-app-theme] :is(.calendar-scroll, .calendar-scroll .weekdays, .day-cell, .day-cell.is-empty:not(.is-selected), .memo-card, .memo-empty, .anniversary-card, .anniversary-empty, .settings-account-button, .settings-theme-choice, .settings-feature-row, .settings-order-row, .group-sidebar, dialog) { background: var(--theme-card) !important; border-color: var(--theme-border) !important; color: var(--theme-text); }
body[data-app-theme] :is(.calendar-selected-date p, .day-header p, .day-summary, .memo-sync-copy, .anniversary-copy, .settings-section-label, .settings-section-heading small, .weekdays, .time-label, .empty-state, .settings-account-button small, .settings-order-row small) { color: var(--theme-muted) !important; }
body[data-app-theme] :is(.calendar-selected-date h1, .day-header h1, .memo-header h1, .anniversary-header h1, .settings-header h1, .day-number, .memo-card h2, .anniversary-card strong, .settings-account-button strong) { color: var(--theme-text) !important; }
body[data-app-theme] :is(.agenda-item, .event-card, .calendar-event, .memo-event-link, .account-summary, .schedule-editor) { background: var(--theme-tint); }
body[data-app-theme] :is(input, select, textarea, .anniversary-date-trigger, .color-picker-trigger, .event-group-trigger, .schedule-editor-trigger, .memo-date-picker-trigger, .early-reminder-trigger) { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; color: var(--theme-text) !important; }
body[data-app-theme] .settings-theme-choice.is-selected { background: var(--theme-tint) !important; color: var(--theme-text) !important; }
body[data-app-theme] :is(.day-cell.is-selected, .mini-day.is-selected) { border-color: var(--app-accent) !important; background: var(--theme-tint) !important; color: var(--theme-text) !important; box-shadow: 0 3px 10px color-mix(in srgb, var(--app-accent) 28%, transparent); }
body[data-app-theme] :is(.day-cell.is-today .day-number, .add-button, .save-button, .push-settings-button, .release-update-button) { background: var(--app-accent); }
body[data-app-theme] :is(.today-button, .group-sidebar-toggle, .calendar-month-trigger) { border-color: var(--theme-border); color: var(--app-accent); }

/* 固定周标题层与滚动月历同色，避免暮夜蓝出现一条白色横栏。 */
body[data-app-theme="night"] .calendar-scroll .weekdays { background: #182230 !important; color: #aebdce !important; }
body[data-app-theme="night"] .calendar-scroll { scrollbar-color: #52667d transparent; }
body[data-app-theme="night"] .calendar-scroll::-webkit-scrollbar-thumb { background: #52667d; }

/* 日程在月历中以独立高对比卡片呈现，标题与时间都能一眼看清。 */
body[data-app-theme] .calendar-event {
  min-height: 38px;
  border: 1px solid color-mix(in srgb, var(--app-accent) 72%, #fff) !important;
  border-left: 4px solid var(--app-accent) !important;
  border-radius: 6px;
  background: color-mix(in srgb, var(--app-accent) 16%, var(--theme-surface)) !important;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--app-accent) 18%, transparent);
  color: var(--theme-text) !important;
  padding: 4px 5px;
}
body[data-app-theme] .calendar-event-time { color: color-mix(in srgb, var(--app-accent) 72%, var(--theme-text)) !important; font-size: max(9px, var(--calendar-time-font)); font-weight: 850; }
body[data-app-theme] .calendar-event-title { color: var(--theme-text) !important; font-size: max(10px, var(--calendar-title-font)); font-weight: 850; }
body[data-app-theme="night"] .calendar-event { background: #213a58 !important; border-color: #75adf7 !important; color: #f3f8ff !important; }
body[data-app-theme="night"] .calendar-event-time { color: #b9d5ff !important; }
body[data-app-theme="night"] .calendar-event-title { color: #f3f8ff !important; }

/* 排序操作专用：从按下开始停止文字选择，避免电脑和手机拖动时干扰。 */
.settings-order-row, .settings-order-row * { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.settings-order-row { -webkit-user-drag: none; }
body.is-reordering-navigation, body.is-reordering-navigation * { user-select: none !important; -webkit-user-select: none !important; cursor: grabbing !important; }

/* 设置内容仍可滚动，但不再占用右侧一条显眼的滚动条。 */
.settings-screen { scrollbar-width: none; }
.settings-screen::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* 设置页只允许在内容范围内纵向滚动，避免手机边缘回弹带出横向空白。 */
.settings-screen {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  overscroll-behavior: none;
  touch-action: pan-y;
}
.settings-order-list { touch-action: pan-y; }

/* 恢复日历右上角的缩放控制，并让它使用当前主题。 */
.calendar-zoom-controls { display: flex !important; }
body[data-app-theme] .zoom-button { background: var(--theme-card); border-color: var(--theme-border); color: var(--app-accent); }
body[data-app-theme] .zoom-button:hover:not(:disabled) { background: var(--theme-tint); }
body[data-app-theme] .zoom-button:disabled { color: var(--theme-muted); }

/* 侧拉日程表入口与各页面顶部提示文字同步跟随主题。 */
body[data-app-theme] :is(.group-sidebar-toggle, #app-shell.is-group-drawer-open .group-sidebar-toggle) { background: var(--theme-card) !important; border-color: var(--theme-border) !important; color: var(--app-accent) !important; box-shadow: 3px 5px 12px color-mix(in srgb, var(--theme-text) 14%, transparent); }
body[data-app-theme] :is(.memo-header p, .anniversary-header p, .settings-header p, .group-sidebar-header p, .memo-editor-header p) { color: var(--theme-muted) !important; }

/* 三档缩放直接改变月历的格子尺寸与可视区域，避免只改变按钮状态。 */
#calendar-screen[data-calendar-zoom="1"] .calendar-scroll { height: 390px !important; --calendar-row-height: 138px !important; --calendar-cell-padding: 7px !important; --calendar-number-size: 23px !important; --calendar-number-font: 14px !important; --calendar-time-font: 10px !important; --calendar-title-font: 11px !important; --calendar-more-font: 10px !important; --calendar-event-padding: 4px 5px !important; }
#calendar-screen[data-calendar-zoom="2"] .calendar-scroll { height: 460px !important; --calendar-row-height: 172px !important; --calendar-cell-padding: 9px !important; --calendar-number-size: 27px !important; --calendar-number-font: 16px !important; --calendar-time-font: 11px !important; --calendar-title-font: 13px !important; --calendar-more-font: 11px !important; --calendar-event-padding: 5px 6px !important; }
#calendar-screen[data-calendar-zoom="1"] .calendar-canvas, #calendar-screen[data-calendar-zoom="2"] .calendar-canvas { width: 100% !important; padding-inline: 0 !important; }
#calendar-screen[data-calendar-zoom="1"] .calendar-grid, #calendar-screen[data-calendar-zoom="2"] .calendar-grid { margin-block: 0 !important; }
@media (max-width: 540px) { #calendar-screen[data-calendar-zoom="1"] .calendar-scroll { height: min(51dvh, 390px) !important; } #calendar-screen[data-calendar-zoom="2"] .calendar-scroll { height: min(59dvh, 460px) !important; } }

/* 下载与更新弹窗也使用完整主题：标题、版本说明、平台图标和按钮始终清晰。 */
body[data-app-theme] :is(.release-notice-dialog, .push-help-dialog) { background: var(--theme-surface) !important; color: var(--theme-text) !important; }
body[data-app-theme] :is(.release-notice-dialog, .push-help-dialog)::backdrop { background: color-mix(in srgb, var(--theme-page) 72%, #000 28%) !important; }
body[data-app-theme] :is(.release-notice-panel h2, .push-help-panel h2) { color: var(--theme-text) !important; }
body[data-app-theme] :is(.release-notice-copy, .push-help-copy) { color: var(--theme-muted) !important; }
body[data-app-theme] :is(.release-notice-dialog, .push-help-dialog) .modal-eyebrow { color: var(--app-accent) !important; }
body[data-app-theme] :is(.release-notice-icon, .push-help-step span) { background: var(--theme-tint); color: var(--app-accent); box-shadow: none; }
body[data-app-theme] :is(.release-notice-item, .push-help-step) { background: var(--theme-card); color: var(--theme-text); border: 1px solid var(--theme-border); }
body[data-app-theme] .release-notice-item::before { background: var(--theme-surface); color: var(--app-accent); }
body[data-app-theme] .app-download-option { background: var(--theme-card) !important; border-color: var(--theme-border) !important; color: var(--theme-text) !important; }
body[data-app-theme] .app-download-option:hover, body[data-app-theme] .app-download-option.is-recommended { background: var(--theme-tint) !important; border-color: var(--app-accent) !important; box-shadow: 0 0 0 1px color-mix(in srgb, var(--app-accent) 28%, transparent); }
body[data-app-theme] .app-download-option strong { color: var(--theme-text) !important; }
body[data-app-theme] .app-download-option small { color: var(--theme-muted) !important; }
body[data-app-theme] :is(.app-download-option b, .app-download-option > .app-download-platform-icon) { color: var(--app-accent) !important; }
body[data-app-theme] .release-dismiss-button { background: var(--theme-card); border-color: var(--theme-border); color: var(--theme-text); }
body[data-app-theme] .release-dismiss-button:hover { background: var(--theme-tint); }

/* 账号内的系统通知区域也跟随主题，避免暮夜蓝下出现浅色底搭配浅色字。 */
body[data-app-theme] .account-summary { background: var(--theme-tint) !important; border-color: var(--theme-border) !important; }
body[data-app-theme] :is(.account-summary strong, .push-settings-copy strong) { color: var(--theme-text) !important; }
body[data-app-theme] :is(.account-summary small, .auth-copy, .auth-note, .auth-message, .push-settings-copy small, .push-settings-message) { color: var(--theme-muted) !important; }
body[data-app-theme] .account-summary-icon { background: var(--app-accent); color: #fff; }
body[data-app-theme] .push-settings-card { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }
body[data-app-theme] .push-settings-icon { background: var(--theme-tint); color: var(--app-accent); }
body[data-app-theme] .push-settings-button { background: var(--app-accent) !important; color: #fff !important; }
body[data-app-theme] .push-settings-button.is-enabled { background: var(--theme-card) !important; border-color: var(--theme-border) !important; color: var(--theme-text) !important; }
body[data-app-theme] :is(.push-test-button, #install-app-button) { background: var(--theme-card) !important; border-color: var(--theme-border) !important; color: var(--app-accent) !important; }
body[data-app-theme] .sync-now-button { background: var(--app-accent) !important; color: #fff !important; }
body[data-app-theme] .sign-out-button { background: color-mix(in srgb, #d56a70 12%, var(--theme-surface)) !important; border-color: color-mix(in srgb, #d56a70 42%, var(--theme-border)) !important; color: #cb6169 !important; }

/* 网页端下载入口放在账号与同步下方；已安装 App 会由脚本隐藏。 */
.settings-download-section { margin-top: -2px; }
.settings-download-button { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 11px; width: 100%; min-height: 66px; border: 1px solid #cfe0ee; border-radius: 12px; background: #f6fbff; color: #264e6f; padding: 11px 13px; text-align: left; cursor: pointer; }
.settings-download-button:hover { border-color: var(--app-accent, #1769aa); background: #edf7ff; }
.settings-download-icon { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 12px; background: #dcefff; color: var(--app-accent, #1769aa); }
.settings-download-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.settings-download-button strong, .settings-download-button small { display: block; }
.settings-download-button strong { font-size: 14px; }
.settings-download-button small { margin-top: 3px; color: #6e8ca4; font-size: 11px; line-height: 1.4; }
.settings-download-button b { color: var(--app-accent, #1769aa); font-size: 25px; font-weight: 400; }
body[data-app-theme] .settings-download-button { background: var(--theme-card); border-color: var(--theme-border); color: var(--theme-text); }
body[data-app-theme] .settings-download-button:hover { background: var(--theme-tint); border-color: var(--app-accent); }
body[data-app-theme] .settings-download-icon { background: var(--theme-tint); color: var(--app-accent); }
body[data-app-theme] .settings-download-button strong { color: var(--theme-text) !important; }
body[data-app-theme] .settings-download-button small { color: var(--theme-muted) !important; }

/* 三档月历：完整月视图看分布，两周和一周视图查看具体安排。 */
#calendar-screen[data-calendar-zoom="0"] .calendar-scroll { height: clamp(236px, 30dvh, 292px) !important; overflow: hidden; padding-right: 0; }
#calendar-screen .calendar-scroll { flex: 0 0 auto !important; }
#calendar-screen .calendar-agenda-section { flex: 1 1 0; min-height: 0; }
#calendar-screen[data-calendar-zoom="0"] .calendar-canvas { display: flex; flex-direction: column; height: 100%; }
#calendar-screen[data-calendar-zoom="0"] .calendar-scroll .weekdays { flex: 0 0 auto; margin-bottom: 4px; padding: 2px 0 4px; }
#calendar-screen[data-calendar-zoom="0"] .calendar-grid { flex: 1 1 auto; min-height: 0; grid-template-rows: repeat(6, minmax(0, 1fr)); grid-auto-rows: unset; gap: 3px; margin: 0 !important; }
#calendar-screen[data-calendar-zoom="0"] .day-cell { align-items: center; justify-content: flex-start; border-radius: 6px; padding: 3px; }
#calendar-screen[data-calendar-zoom="0"] .day-cell.is-selected { padding: 2px; }
#calendar-screen[data-calendar-zoom="0"] .day-number { align-self: center; width: 18px; height: 18px; font-size: 11px; }
#calendar-screen[data-calendar-zoom="0"] .day-event-previews { flex: 0 0 auto; width: 100%; min-height: 10px; margin-top: 1px; overflow: visible; }
.calendar-event-dots { display: flex; align-items: center; justify-content: center; min-height: 8px; gap: 2px; overflow: hidden; }
.calendar-event-dot { display: block; width: 5px; height: 5px; flex: 0 0 5px; border-radius: 50%; background: #328ccd; }
.calendar-event-dot.navy { background: #3266a7; }.calendar-event-dot.cyan { background: #2db3d6; }.calendar-event-dot.mint { background: #42aaa4; }.calendar-event-dot.purple { background: #8a64c7; }.calendar-event-dot.pink, .calendar-event-dot.anniversary { background: #c86b9b; }.calendar-event-dot.coral { background: #dc795d; }.calendar-event-dot.yellow { background: #d9a330; }.calendar-event-dot.green { background: #4d9b63; }.calendar-event-dots small { color: var(--app-accent, #1769aa); font-size: 8px; font-weight: 800; line-height: 1; }
#calendar-screen[data-calendar-zoom="1"] .calendar-scroll { height: clamp(250px, 34dvh, 340px) !important; overflow-y: auto; overflow-x: hidden; }
#calendar-screen[data-calendar-zoom="1"] .calendar-canvas { width: 100% !important; min-width: 100%; height: auto; padding-inline: 0 !important; }
#calendar-screen[data-calendar-zoom="1"] .calendar-grid { grid-auto-rows: clamp(118px, 17dvh, 154px); gap: 5px; margin: 0 !important; }
#calendar-screen[data-calendar-zoom="1"] .day-cell { padding: 5px; }
#calendar-screen[data-calendar-zoom="1"] .calendar-event { min-height: 38px; }
#calendar-screen[data-calendar-zoom="2"] .calendar-scroll { height: clamp(230px, 31dvh, 306px) !important; overflow-y: auto; overflow-x: hidden; }
#calendar-screen[data-calendar-zoom="2"] .calendar-canvas { width: 100% !important; min-width: 100%; height: auto; padding-inline: 0 !important; }
#calendar-screen[data-calendar-zoom="2"] .calendar-grid { grid-auto-rows: clamp(210px, 29dvh, 280px); gap: 6px; margin: 0 !important; }
#calendar-screen[data-calendar-zoom="2"] .day-cell { padding: 8px; }
#calendar-screen[data-calendar-zoom="2"] .calendar-event { min-height: 49px; padding: 5px 6px; }
#calendar-screen[data-calendar-zoom="2"] .calendar-event-title { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
#calendar-screen[data-calendar-zoom="2"] .calendar-anniversary { font-size: 10px; }
#calendar-screen[data-calendar-zoom="0"] + .calendar-agenda-section { margin-top: 12px; }
body[data-app-theme] .calendar-event-dots small { color: var(--app-accent); }

/* 轻量月历：减少每个日期的卡片感，让日期与日程分布成为主角。 */
#calendar-screen[data-calendar-zoom="0"] .calendar-selected-date { display: flex; align-items: baseline; gap: 8px; padding: 3px 0 10px; }
#calendar-screen[data-calendar-zoom="0"] .calendar-selected-date p { font-size: 12px; font-weight: 700; white-space: nowrap; }
#calendar-screen[data-calendar-zoom="0"] .calendar-selected-date h1 { margin: 0; font-size: 27px; line-height: 1.12; letter-spacing: -.5px; }
#calendar-screen[data-calendar-zoom="0"] .calendar-month-navigation { margin-bottom: 6px; }
#calendar-screen[data-calendar-zoom="0"] .calendar-scroll { border-top: 1px solid var(--theme-border, #d7e6f2); background: var(--theme-surface, #fafdff) !important; }
#calendar-screen[data-calendar-zoom="0"] .calendar-grid { gap: 0; border-left: 1px solid var(--theme-border, #d7e6f2); }
#calendar-screen[data-calendar-zoom="0"] .day-cell,
#calendar-screen[data-calendar-zoom="0"] .day-cell.is-empty:not(.is-selected),
#calendar-screen[data-calendar-zoom="0"] .day-cell.is-other { border: 0 !important; border-right: 1px solid var(--theme-border, #d7e6f2) !important; border-bottom: 1px solid var(--theme-border, #d7e6f2) !important; border-radius: 0; background: transparent !important; box-shadow: none; opacity: 1; }
#calendar-screen[data-calendar-zoom="0"] .day-cell.is-other { color: var(--theme-muted, #8fa2b3) !important; opacity: .58; }
#calendar-screen[data-calendar-zoom="0"] .day-cell:hover { background: var(--theme-tint, #eef7ff) !important; }
#calendar-screen[data-calendar-zoom="0"] .day-cell.is-selected { border: 2px solid var(--app-accent, #1769aa) !important; border-radius: 7px; background: var(--theme-tint, #eef7ff) !important; box-shadow: none; z-index: 1; }
#calendar-screen[data-calendar-zoom="0"] .day-number { font-weight: 650; }
#calendar-screen[data-calendar-zoom="0"] .day-cell.is-today .day-number { box-shadow: none; }
.calendar-agenda-section { border-top: 1px solid var(--theme-border, #d7e6f2); padding-top: 11px; }
.calendar-agenda-section .section-heading { margin: 0 0 4px; font-size: 15px; }
.calendar-agenda-section .agenda-list { gap: 0; }
.calendar-agenda-section .agenda-item { min-height: 58px; gap: 13px; border: 0; border-bottom: 1px solid var(--theme-border, #d7e6f2); border-left: 3px solid #328ccd; border-radius: 0; background: transparent !important; padding: 11px 8px 11px 11px; }
.calendar-agenda-section .agenda-item.navy { border-left-color: #3266a7; }.calendar-agenda-section .agenda-item.cyan { border-left-color: #2db3d6; }.calendar-agenda-section .agenda-item.mint { border-left-color: #42aaa4; }.calendar-agenda-section .agenda-item.purple { border-left-color: #8a64c7; }.calendar-agenda-section .agenda-item.pink { border-left-color: #d96696; }.calendar-agenda-section .agenda-item.coral { border-left-color: #dc795d; }.calendar-agenda-section .agenda-item.yellow { border-left-color: #c79424; }.calendar-agenda-section .agenda-item.green { border-left-color: #4d9b63; }
.calendar-agenda-section .agenda-time { display: grid; place-items: center; min-width: 44px; min-height: 30px; border-radius: 7px; background: var(--theme-tint, #eaf5ff); color: var(--app-accent, #1769aa); font-weight: 750; }
.calendar-agenda-section .agenda-title { font-size: 14px; font-weight: 700; }
body[data-app-theme] .calendar-agenda-section .agenda-item { background: transparent !important; border-bottom-color: var(--theme-border) !important; color: var(--theme-text); }
body[data-app-theme] .calendar-agenda-section .agenda-time { background: var(--theme-tint); color: var(--app-accent); }
@media (max-width: 540px) { #calendar-screen[data-calendar-zoom="0"] .calendar-selected-date h1 { font-size: 25px; } #calendar-screen[data-calendar-zoom="0"] .calendar-selected-date p { font-size: 11px; } }

/* 纪念日与当天日程一起呈现，使用温和的粉色标记区分全天的重要日子。 */
.calendar-agenda-section .calendar-anniversary-agenda { border-left-color: #d96696; }
.calendar-agenda-section .calendar-anniversary-agenda .agenda-time { color: #c75586; background: #fff0f6; font-size: 17px; }
.calendar-anniversary-agenda small { display: block; margin-top: 3px; color: #9d7184; font-size: 11px; }
body[data-app-theme] .calendar-agenda-section .calendar-anniversary-agenda .agenda-time { background: color-mix(in srgb, #d96696 14%, var(--theme-surface)); color: #cf6d95; }
body[data-app-theme] .calendar-anniversary-agenda small { color: var(--theme-muted) !important; }

/* 日历的阅读顺序：先看日期，再在月历上方直接操作。 */
.calendar-date-header { flex: 0 0 auto; padding: max(20px, env(safe-area-inset-top)) 10px 15px; }
#calendar-screen .calendar-date-header .calendar-selected-date { padding-left: 0; }
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: 0 0 auto; margin: 4px 0 12px; }
.calendar-toolbar .today-button { min-height: 34px; border: 1px solid var(--theme-border, #cfe2f0); border-radius: 18px; background: var(--theme-card, #f4faff); color: var(--app-accent, #1769aa); padding: 6px 12px; font-size: 13px; font-weight: 750; box-shadow: none; }
.calendar-toolbar .today-button:hover { background: var(--theme-tint, #e3f2ff); }
.calendar-toolbar .calendar-zoom-controls { margin-left: auto; }
body[data-app-theme] .calendar-toolbar .today-button { border-color: var(--theme-border); background: var(--theme-card); color: var(--app-accent); }
body[data-app-theme] .calendar-toolbar .today-button:hover { background: var(--theme-tint); }
@media (max-width: 540px) { .calendar-date-header { padding: max(18px, env(safe-area-inset-top)) 8px 13px; } .calendar-toolbar { margin-top: 2px; margin-bottom: 10px; } }

/* 月历放大只改变内容密度，顶部日期始终保持同一节奏，避免页面跳动。 */
#calendar-screen .calendar-selected-date { display: flex; align-items: baseline; gap: 8px; padding: 3px 0 10px; }
#calendar-screen .calendar-selected-date h1 { margin: 0; font-size: 27px; line-height: 1.12; letter-spacing: -.5px; }
@media (max-width: 540px) { #calendar-screen .calendar-selected-date h1 { font-size: 25px; } }

/* 纪念日卡片向两侧舒展，保持标题区留白但减少列表的压迫感。 */
.anniversary-list { margin-inline: -12px; }
@media (max-width: 540px) { .anniversary-list { margin-inline: -10px; } }

/* 侧栏打开时保留背景日历；临时取消固定周标题，避免移动端出现叠层残影。 */
.group-sidebar { isolation: isolate; overflow: hidden; }
#app-shell.is-group-drawer-open #calendar-screen { visibility: visible; }
#app-shell.is-group-drawer-open .calendar-scroll .weekdays { position: static; z-index: auto; backdrop-filter: none; }

/* 新建入口改为实线轮廓，避免高分屏上虚线边缘出现毛刺。 */
.new-group-button { border: 1px solid var(--theme-border, #8fb9d8); background: var(--theme-card, #f4faff); color: var(--app-accent, #1769aa); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--app-accent, #1769aa) 8%, transparent); }
.new-group-button:hover { border-color: var(--app-accent, #1769aa); background: var(--theme-tint, #e4f3ff); }
body[data-app-theme] .new-group-button { border-color: var(--theme-border); background: var(--theme-card); color: var(--app-accent); }
body[data-app-theme] .new-group-button:hover { border-color: var(--app-accent); background: var(--theme-tint); }

/* 排序中的浮起状态在所有主题下都保持清晰。 */
body[data-app-theme] .settings-order-row.is-dragging { background: var(--theme-tint) !important; border-color: var(--app-accent) !important; color: var(--theme-text) !important; }
body[data-app-theme] .settings-order-feedback { color: var(--theme-muted); }

/* 入口半收进边缘，保留清晰的点击提示，却不再压住月历首列。 */
#app-shell .group-sidebar-toggle { left: -14px; }
#app-shell.is-group-drawer-open .group-sidebar-toggle { left: calc(var(--group-drawer-width, min(286px, calc(100% - 58px))) - 14px); }

/* 下载和更新提示保留当前页面上下文，只做轻度弱化而不是遮住背景。 */
body[data-app-theme] :is(.release-notice-dialog, .push-help-dialog)::backdrop { background: color-mix(in srgb, var(--app-accent) 14%, transparent) !important; backdrop-filter: blur(.5px); }
body[data-app-theme="night"] :is(.release-notice-dialog, .push-help-dialog)::backdrop { background: rgb(2 10 20 / .24) !important; }

/* 课程表式的每周重复：一个日程本体，勾选上课日后在日历中自动持续出现。 */
.weekly-repeat-editor { margin: -3px 0 15px; border: 1px solid var(--theme-border, #cfe0ee); border-radius: 10px; background: var(--theme-card, #f8fcff); padding: 13px; }
.weekly-repeat-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.weekly-repeat-heading strong, .weekly-repeat-heading small { display: block; }
.weekly-repeat-heading strong { color: var(--theme-text, #284e6d); font-size: 14px; }
.weekly-repeat-heading small { margin-top: 3px; color: var(--theme-muted, #6a89a4); font-size: 11px; line-height: 1.45; }
.weekly-day-choices { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-top: 13px; }
.weekly-day-choice { display: grid; place-items: center; gap: 2px; min-height: 52px; border: 1px solid var(--theme-border, #cfe0ee); border-radius: 9px; background: var(--theme-surface, #fff); color: var(--theme-muted, #6686a2); cursor: pointer; }
.weekly-day-choice span { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid currentColor; border-radius: 50%; font-size: 12px; font-weight: 850; }
.weekly-day-choice small { font-size: 9px; font-weight: 700; }
.weekly-day-choice.is-selected { border-color: var(--app-accent, #1769aa); background: var(--theme-tint, #eaf5ff); color: var(--app-accent, #1769aa); box-shadow: 0 0 0 1px color-mix(in srgb, var(--app-accent, #1769aa) 20%, transparent); }
.weekly-repeat-range { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: 11px; margin-top: 13px; }
.weekly-repeat-range label { display: grid; gap: 5px; color: var(--theme-muted, #6686a2); font-size: 10px; font-weight: 760; }
.weekly-repeat-range input { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; min-height: 38px; border: 1px solid var(--theme-border, #cfe0ee); border-radius: 8px; padding: 5px 4px; background: var(--theme-surface, #fff); color: var(--theme-text, #284e6d); font: inherit; font-size: 10px; letter-spacing: -.25px; }
.weekly-repeat-range > span { display: none; }
.weekly-repeat-range-note { display: block; margin-top: 7px; color: var(--theme-muted, #6686a2); font-size: 10px; }
.weekly-repeat-editor:not(.is-enabled) :is(.weekly-day-choices, .weekly-repeat-range, .weekly-repeat-range-note) { opacity: .42; pointer-events: none; }
body[data-app-theme] .weekly-repeat-editor { border-color: var(--theme-border); background: var(--theme-card); }
body[data-app-theme] .weekly-day-choice { border-color: var(--theme-border); background: var(--theme-surface); color: var(--theme-muted); }
body[data-app-theme] .weekly-repeat-range input { border-color: var(--theme-border); background: var(--theme-surface); color: var(--theme-text); }
/* 系统通知卡片跟随主题，避免深色文字规则落在浅色卡片上。 */
body[data-app-theme] .push-reminder-row { border-color: var(--theme-border); background: var(--theme-card); color: var(--theme-text); }
body[data-app-theme] .push-reminder-row strong { color: var(--theme-text) !important; }
body[data-app-theme] .push-reminder-row small, body[data-app-theme] #push-reminder-copy { color: var(--theme-muted) !important; }
body[data-app-theme] .weekly-day-choice.is-selected { border-color: var(--app-accent); background: var(--theme-tint); color: var(--app-accent); }
@media (max-width: 380px) { .weekly-day-choices { gap: 4px; }.weekly-day-choice { min-height: 47px; } }
