/* ============================================================
   上课提醒 · 样式
   移动优先，适配 iPhone 安全区域与深浅色模式
   ============================================================ */

*,
*::before,
*::after { box-sizing: border-box; }

:root {
  --bg: #f3f4f8;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef0f6;
  --surface-3: #e4e7f0;
  --text: #171a23;
  --text-soft: #3c4252;
  --muted: #727a8c;
  --line: rgba(23, 26, 35, 0.08);
  --line-strong: rgba(23, 26, 35, 0.14);
  --accent: #5b6cff;
  --accent-soft: rgba(91, 108, 255, 0.12);
  --accent-ink: #ffffff;
  --danger: #e5484d;
  --danger-soft: rgba(229, 72, 77, 0.12);
  --success: #17a673;

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

  --shadow-sm: 0 1px 2px rgba(23, 26, 35, 0.05);
  --shadow-md: 0 8px 24px rgba(23, 26, 35, 0.07);
  --shadow-lg: 0 24px 60px rgba(23, 26, 35, 0.18);

  --tabbar-h: 62px;
  --page-x: 18px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0e14;
    --bg-elevated: #141722;
    --surface: #161a25;
    --surface-2: #1d2230;
    --surface-3: #252b3b;
    --text: #eef0f7;
    --text-soft: #cfd4e2;
    --muted: #8b93a7;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.15);
    --accent-soft: rgba(121, 136, 255, 0.18);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.55);
  }
}

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

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

button {
  border: 0;
  background: none;
  cursor: pointer;
  padding: 0;
}

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

/* ---------- 应用骨架 ---------- */

#app {
  max-width: 680px;
  margin: 0 auto;
  min-height: 100dvh;
}

.view {
  padding:
    calc(var(--safe-top) + 14px)
    var(--page-x)
    calc(var(--tabbar-h) + var(--safe-bottom) + 28px);
  animation: viewIn 0.28s ease both;
}

@keyframes viewIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-top: 4px;
}

.page-head .eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin-bottom: 2px;
}

.page-head h1 {
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 760;
}

.page-head .head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ---------- 通用组件 ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.section {
  margin-top: 26px;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 4px 10px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-transform: none;
}

.section-title .count {
  font-weight: 500;
  color: var(--muted);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-soft);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, background 0.15s ease;
}

.icon-btn:active { transform: scale(0.94); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 650;
  background: var(--surface-2);
  color: var(--text);
  transition: transform 0.15s ease, filter 0.15s ease, background 0.15s ease;
  user-select: none;
}

.btn:active { transform: scale(0.975); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 8px 20px rgba(91, 108, 255, 0.28);
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line-strong);
}

.btn-block { width: 100%; }

.btn-sm {
  min-height: 36px;
  padding: 0 13px;
  font-size: 13px;
  border-radius: 11px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.empty {
  padding: 34px 22px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}

.empty .empty-emoji {
  font-size: 34px;
  line-height: 1;
  margin-bottom: 10px;
}

.empty p { font-size: 14px; }

.empty .btn { margin-top: 16px; }

/* ---------- 今天：下一节课卡片 ---------- */

.next-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: 22px 22px 20px;
  color: #fff;
  background: linear-gradient(135deg, #4f5ef0 0%, #6a5cf5 48%, #8b5cf6 100%);
  box-shadow: 0 16px 36px rgba(91, 108, 255, 0.32);
}

.next-card::after {
  content: "";
  position: absolute;
  right: -52px;
  top: -72px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.13);
}

.next-card::before {
  content: "";
  position: absolute;
  right: 26px;
  bottom: -68px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.next-card.is-idle {
  background: linear-gradient(135deg, #2c3346 0%, #3a4258 100%);
  box-shadow: 0 14px 32px rgba(20, 24, 38, 0.28);
}

@media (prefers-color-scheme: dark) {
  .next-card.is-idle {
    background: linear-gradient(135deg, #1e2433 0%, #2a3145 100%);
    border: 1px solid var(--line);
  }
}

.next-card .next-label {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  opacity: 0.82;
  margin-bottom: 10px;
}

.next-card .next-name {
  position: relative;
  z-index: 1;
  font-size: 27px;
  font-weight: 760;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin-bottom: 6px;
  word-break: break-word;
}

.next-card .next-meta {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 13.5px;
  opacity: 0.9;
  margin-bottom: 16px;
}

.next-card .next-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.next-card .next-countdown {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(6px);
  font-size: 14px;
  font-weight: 650;
}

.next-card .next-countdown strong {
  font-size: 17px;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
}

.next-card .next-hint {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  font-size: 12px;
  opacity: 0.68;
}

/* ---------- 课程行 ---------- */

.course-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.course-row {
  display: flex;
  align-items: stretch;
  gap: 13px;
  width: 100%;
  padding: 14px 14px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.14s ease, background 0.14s ease;
}

.course-row:active { transform: scale(0.985); }

.course-row.is-past { opacity: 0.52; }

.course-row.is-ongoing {
  border-color: color-mix(in srgb, var(--course-color, var(--accent)) 45%, transparent);
  background: color-mix(in srgb, var(--course-color, var(--accent)) 7%, var(--surface));
}

.course-time {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 46px;
  padding-right: 2px;
  font-variant-numeric: tabular-nums;
}

.course-time b {
  font-size: 16px;
  font-weight: 720;
  letter-spacing: -0.01em;
}

.course-time span {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.course-bar {
  width: 4px;
  border-radius: 999px;
  background: var(--course-color, var(--accent));
  flex: none;
}

.course-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.course-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 16px;
  font-weight: 680;
  letter-spacing: -0.01em;
  word-break: break-word;
}

.course-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 12px;
  font-size: 12.5px;
  color: var(--muted);
  word-break: break-word;
}

.course-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.course-chevron {
  display: flex;
  align-items: center;
  color: var(--muted);
  opacity: 0.7;
  flex: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.6;
  background: var(--surface-2);
  color: var(--muted);
}

.chip-live {
  background: color-mix(in srgb, var(--course-color, var(--accent)) 16%, transparent);
  color: var(--course-color, var(--accent));
}

.chip-next {
  background: var(--accent-soft);
  color: var(--accent);
}

.chip-once {
  background: rgba(245, 158, 11, 0.14);
  color: #b57906;
}

@media (prefers-color-scheme: dark) {
  .chip-once { color: #fbbf24; }
}

/* ---------- 周课表 ---------- */

.week-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.week-range {
  text-align: center;
  flex: 1;
}

.week-range b {
  display: block;
  font-size: 15px;
  font-weight: 700;
}

.week-range span {
  font-size: 12px;
  color: var(--muted);
}

.week-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0 -12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}

.week-scroll::-webkit-scrollbar { height: 0; }

.week-grid {
  position: relative;
  display: grid;
  grid-template-columns: 36px repeat(7, minmax(0, 1fr));
  min-width: 0;
}

.week-head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: contents;
}

.week-head .corner,
.week-head .day-head {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 9px 4px 8px;
  text-align: center;
}

.week-head .corner {
  position: sticky;
  left: 0;
  z-index: 7;
}

.week-head .day-head {
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.3;
}

.week-head .day-head b {
  display: block;
  font-size: 13.5px;
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.week-head .day-head.is-today b,
.week-head .day-head.is-today span {
  color: var(--accent);
}

.week-head .day-head.is-today b {
  position: relative;
}

.week-head .day-head.is-today b::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -3px;
  width: 16px;
  height: 3px;
  border-radius: 3px;
  background: var(--accent);
  transform: translateX(-50%);
}

.week-body {
  grid-column: 1 / -1;
  position: relative;
  display: grid;
  grid-template-columns: 36px repeat(7, minmax(0, 1fr));
}

.time-col {
  grid-column: 1;
  position: sticky;
  left: 0;
  z-index: 4;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.time-slot {
  height: var(--hour-h, 56px);
  font-size: 9.5px;
  color: var(--muted);
  text-align: right;
  padding: 2px 4px 0 0;
  font-variant-numeric: tabular-nums;
  transform: translateY(-7px);
}

.time-slot:first-child { transform: translateY(0); padding-top: 4px; }

.day-col {
  position: relative;
  border-right: 1px solid var(--line);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(var(--hour-h, 56px) - 1px),
    var(--line) calc(var(--hour-h, 56px) - 1px),
    var(--line) var(--hour-h, 56px)
  );
}

.day-col:last-child { border-right: 0; }

.day-col.is-today { background-color: var(--accent-soft); }

.week-event {
  position: absolute;
  left: 2px;
  right: 2px;
  overflow: hidden;
  border-radius: 7px;
  padding: 3px 2px;
  text-align: left;
  background: color-mix(in srgb, var(--course-color, var(--accent)) 15%, var(--surface));
  border-left: 2px solid var(--course-color, var(--accent));
  color: var(--text);
  font-size: 10px;
  line-height: 1.25;
  transition: transform 0.14s ease;
}

.week-event:active { transform: scale(0.97); }

.week-event .we-time {
  display: block;
  font-size: 8.5px;
  font-weight: 650;
  color: var(--course-color, var(--accent));
  font-variant-numeric: tabular-nums;
  margin-bottom: 1px;
}

.week-event .we-name {
  display: -webkit-box;
  font-size: 9.5px;
  font-weight: 650;
  word-break: break-word;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.week-event .we-place {
  display: block;
  margin-top: 1px;
  font-size: 8.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.week-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: 12px 4px 0;
  font-size: 11.5px;
  color: var(--muted);
}

.week-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.week-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* ---------- 课程管理 ---------- */

.manage-group { margin-top: 22px; }

.manage-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 12px 13px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.manage-row + .manage-row { margin-top: 9px; }

.manage-row .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
  background: var(--course-color, var(--accent));
}

.manage-row .manage-main {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.manage-row .manage-name {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  word-break: break-word;
}

.manage-row .manage-meta {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  word-break: break-word;
}

.row-actions {
  display: flex;
  gap: 2px;
  flex: none;
}

.mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  color: var(--muted);
}

.mini-btn:active { background: var(--surface-2); }

.mini-btn.danger { color: var(--danger); }

/* ---------- 设置 ---------- */

.settings-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 14px;
}

.settings-card .settings-head {
  padding: 14px 16px 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.03em;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  border-top: 1px solid var(--line);
}

.setting-row:first-of-type { border-top: 0; }

.setting-row .setting-label {
  font-size: 14.5px;
  font-weight: 550;
}

.setting-row .setting-desc {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.setting-row .setting-control {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.setting-stack {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}

.setting-stack:first-of-type { border-top: 0; }

.setting-stack .setting-label {
  font-size: 14.5px;
  font-weight: 550;
  margin-bottom: 3px;
}

.setting-stack .setting-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 10px;
}

.text-input,
.select-input,
.date-input,
.time-input {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 11px;
  padding: 10px 12px;
  font-size: 14px;
  min-height: 42px;
  outline: none;
  width: 100%;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.text-input:focus,
.select-input:focus,
.date-input:focus,
.time-input:focus {
  border-color: var(--accent);
  background: var(--surface);
}

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

.date-input, .time-input {
  min-width: 132px;
}

.date-input { min-width: 150px; }

.inline-fields {
  display: flex;
  gap: 9px;
}

.inline-fields > * { flex: 1; min-width: 0; }

.field-hint {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.45;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.status-badge .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}

.status-badge.ok { color: var(--success); }
.status-badge.ok .status-dot { background: var(--success); }
.status-badge.warn { color: #d97706; }
.status-badge.warn .status-dot { background: #d97706; }

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 30px;
  flex: none;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

.switch .track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--surface-3);
  transition: background 0.18s ease;
}

.switch .thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
  transition: transform 0.18s ease;
}

.switch input:checked + .track { background: var(--accent); }
.switch input:checked ~ .thumb { transform: translateX(18px); }

.help-text {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.65;
}

.help-text ol {
  margin: 8px 0 0;
  padding-left: 18px;
}

.help-text li { margin-bottom: 5px; }

.help-text b { color: var(--text-soft); font-weight: 650; }

/* ---------- 底部导航 ---------- */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  justify-content: center;
  gap: 2px;
  padding: 6px 10px calc(6px + var(--safe-bottom));
  background: color-mix(in srgb, var(--bg-elevated) 82%, transparent);
  border-top: 1px solid var(--line);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.tabbar-inner {
  display: flex;
  width: 100%;
  max-width: 520px;
  gap: 2px;
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 50px;
  border-radius: 13px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: color 0.15s ease, background 0.15s ease;
}

.tab-btn svg {
  width: 21px;
  height: 21px;
  stroke-width: 1.9;
}

.tab-btn:active { background: var(--surface-2); }

.tab-btn.is-active { color: var(--accent); }

.tab-btn.is-active svg { stroke-width: 2.2; }

/* ---------- 弹层 / 表单 ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8, 10, 18, 0.42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease both;
}

@media (min-width: 640px) {
  .modal-backdrop { align-items: center; }
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  width: 100%;
  max-width: 560px;
  max-height: 92dvh;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border-radius: 24px 24px 0 0;
  box-shadow: var(--shadow-lg);
  animation: sheetUp 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
  overflow: hidden;
}

@media (min-width: 640px) {
  .sheet {
    border-radius: 24px;
    margin: 20px;
    max-height: 88vh;
  }
}

@keyframes sheetUp {
  from { transform: translateY(36px); opacity: 0.6; }
  to   { transform: translateY(0); opacity: 1; }
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  flex: none;
}

.sheet-head h2 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.sheet-head .sheet-side {
  min-width: 64px;
  display: flex;
  align-items: center;
}

.sheet-head .sheet-side.right { justify-content: flex-end; }

.sheet-head button {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  padding: 6px 2px;
}

.sheet-head button.muted { color: var(--muted); }

.sheet-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 16px calc(24px + var(--safe-bottom));
}

.form-group { margin-bottom: 18px; }

.form-group > label,
.form-group > .form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--muted);
  margin-bottom: 7px;
  letter-spacing: 0.02em;
}

.form-group .field-hint { margin-top: 6px; }

.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 13px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.segmented label {
  flex: 1;
  position: relative;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.segmented input:checked + span {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.color-swatch {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

.color-swatch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

.color-swatch .swatch-dot {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--swatch, var(--accent));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.color-swatch input:checked + .swatch-dot {
  transform: scale(1.06);
  box-shadow: 0 0 0 3px var(--bg-elevated), 0 0 0 5px var(--swatch, var(--accent));
}

.sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

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

/* ---------- 提醒弹窗 ---------- */

.reminder-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(8, 10, 18, 0.52);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 0.22s ease both;
}

.reminder-card {
  width: 100%;
  max-width: 380px;
  border-radius: 28px;
  padding: 28px 24px 22px;
  text-align: center;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-lg);
  animation: popIn 0.32s cubic-bezier(0.22, 1.4, 0.36, 1) both;
}

@keyframes popIn {
  from { transform: scale(0.88); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.reminder-icon {
  width: 76px;
  height: 76px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 36px;
  animation: ringPulse 1.6s ease-in-out infinite;
}

@keyframes ringPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(91, 108, 255, 0.28); }
  50% { transform: scale(1.04); box-shadow: 0 0 0 14px rgba(91, 108, 255, 0); }
}

.reminder-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 8px;
}

.reminder-name {
  font-size: 26px;
  font-weight: 780;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 8px;
  word-break: break-word;
}

.reminder-time {
  font-size: 17px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  margin-bottom: 6px;
}

.reminder-place {
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 20px;
  word-break: break-word;
}

.reminder-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.reminder-actions .btn { width: 100%; }

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

.toast-root {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px);
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: min(92vw, 420px);
}

.toast {
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(24, 27, 38, 0.92);
  color: #fff;
  font-size: 13.5px;
  font-weight: 550;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.24);
  animation: toastIn 0.24s ease both;
  text-align: center;
}

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

.toast.is-out { animation: toastOut 0.2s ease both; }

@keyframes toastOut {
  to { opacity: 0; transform: translateY(6px); }
}

/* ---------- 杂项 ---------- */

.hidden { display: none !important; }

.loading-card {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
}

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