@font-face {
  font-family: HarmonyOSSans;
  src: url(https://resource-static.bj.bcebos.com/fonts-skill/HarmonyOSSans_Regular.ttf) format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: HarmonyOSSans;
  src: url(https://resource-static.bj.bcebos.com/fonts-skill/HarmonyOSSans_Medium.ttf) format("truetype");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: HarmonyOSSans;
  src: url(https://resource-static.bj.bcebos.com/fonts-skill/HarmonyOSSans_Bold.ttf) format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  --radius: 1.25rem;
  --background: 45 40% 99%;
  --foreground: 222 47% 11%;
  --card: 0 0% 100%;
  --primary: 221 83% 53%;
  --primary-foreground: 0 0% 100%;
  --secondary: 162 70% 32%;
  --secondary-foreground: 0 0% 100%;
  --muted: 40 19% 94%;
  --muted-foreground: 220 15% 35%;
  --accent: 28 80% 40%;
  --accent-foreground: 0 0% 100%;
  --destructive: 0 72% 45%;
  --destructive-foreground: 0 0% 100%;
  --border: 48 8% 88%;
  --input: 48 8% 88%;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0 solid hsl(var(--border));
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: HarmonyOSSans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC",
    "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  cursor: pointer;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: 14px;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

svg {
  display: block;
  flex-shrink: 0;
}

.sig {
  font-variant-numeric: tabular-nums slashed-zero;
}

/* ---------------- 页面骨架 ---------------- */

.page {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: 48px;
  background-color: hsl(var(--background) / 0.5);
  border-left: 1px solid hsl(var(--border) / 0.4);
  border-right: 1px solid hsl(var(--border) / 0.4);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
}

@media (max-width: 480px) {
  .page {
    border-left: 0;
    border-right: 0;
    box-shadow: none;
  }
}

/* ---------------- 顶部 ---------------- */

.hero {
  padding: 32px 20px 16px;
}

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

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

.hero-badges {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background-color: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
  font-size: 12px;
  font-weight: 600;
}

.badge .i3 {
  width: 12px;
  height: 12px;
}

.eyebrow {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: hsl(var(--muted-foreground));
}

.hero-date {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-top: 12px;
}

.hero-day {
  font-size: clamp(64px, 20vw, 88px);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.02em;
}

.hero-date-meta {
  padding-bottom: 6px;
}

.hero-month {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
}

.hero-weekday {
  font-size: 14px;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
}

.hero-summary {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
}

.hero-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  padding-top: 8px;
}

.btn-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
  transition: background-color 0.15s ease;
}

.btn-icon:hover {
  background-color: hsl(var(--muted));
}

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

.btn-today {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08);
  transition: background-color 0.15s ease;
}

.btn-today:hover {
  background-color: hsl(var(--secondary) / 0.9);
}

.btn-today svg {
  width: 14px;
  height: 14px;
}

/* ---------------- 日期条 ---------------- */

.rail {
  display: flex;
  gap: 8px;
  padding: 4px 20px 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.rail::-webkit-scrollbar {
  display: none;
}

.rail-day {
  flex-shrink: 0;
  scroll-snap-align: start;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  text-align: center;
  transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.rail-day:hover {
  background-color: hsl(var(--muted));
}

.rail-day:active {
  transform: scale(0.95);
}

.rail-weekday {
  font-size: 11px;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
}

.rail-num {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.rail-day.is-active {
  border-color: hsl(var(--primary));
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  transform: scale(1.03);
  box-shadow: 0 1px 2px hsl(var(--primary) / 0.25);
}

.rail-day.is-active .rail-weekday {
  color: hsl(var(--primary-foreground) / 0.9);
}

/* ---------------- 今日完成度 ---------------- */

.progress-wrap {
  padding: 0 20px;
}

.progress-card {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
}

.progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.progress-title {
  font-size: 14px;
  font-weight: 600;
}

.progress-count {
  font-size: 12px;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
}

.progress-track {
  height: 10px;
  margin-top: 12px;
  border-radius: 999px;
  background-color: hsl(var(--muted));
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background-color: hsl(var(--primary));
  transition: width 0.7s ease-out;
}

.progress-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid hsl(var(--border) / 0.6);
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.legend-dot {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
}

.legend-dot svg {
  width: 10px;
  height: 10px;
}

.legend-dot.course {
  background-color: hsl(var(--primary) / 0.15);
  color: hsl(var(--primary));
}

.legend-dot.work {
  background-color: hsl(var(--accent) / 0.2);
  color: hsl(var(--accent));
}

.legend-dot.life {
  background-color: hsl(var(--secondary) / 0.15);
  color: hsl(var(--secondary));
}

.next-up {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 16px;
  border-radius: 16px;
  border: 1px solid hsl(var(--border) / 0.5);
  background-color: hsl(var(--muted) / 0.9);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
}

.next-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 999px;
  background-color: hsl(var(--accent) / 0.2);
  color: hsl(var(--accent));
}

.next-icon svg {
  width: 14px;
  height: 14px;
}

.next-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
}

.next-text span {
  color: hsl(var(--muted-foreground));
}

.next-text strong {
  font-weight: 500;
}

.next-time {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background-color: hsl(var(--accent) / 0.15);
  color: hsl(var(--accent));
  font-size: 11px;
  font-weight: 700;
}

.next-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 16px;
  border-radius: 16px;
  background-color: hsl(var(--muted) / 0.6);
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background-color: hsl(var(--secondary));
}

/* ---------------- 分区 ---------------- */

.content {
  flex: 1;
}

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 20px;
}

.loading-state[hidden] {
  display: none;
}

.spinner {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 2px solid hsl(var(--primary));
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}

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

.section {
  padding: 28px 20px 0;
}

.section-last {
  padding-bottom: 12px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.section-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-chip {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
}

.section-chip svg {
  width: 14px;
  height: 14px;
}

.section-chip.course {
  background-color: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
}

.section-chip.work {
  background-color: hsl(var(--accent) / 0.15);
  color: hsl(var(--accent));
}

.section-chip.life {
  background-color: hsl(var(--secondary) / 0.15);
  color: hsl(var(--secondary));
}

.section-h {
  font-size: 16px;
  font-weight: 600;
}

.section-count {
  flex-shrink: 0;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  font-weight: 400;
}

.btn-add {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08);
  transition: opacity 0.15s ease;
}

.btn-add:hover {
  opacity: 0.9;
}

.btn-add svg {
  width: 14px;
  height: 14px;
}

.btn-add.course {
  background-color: hsl(var(--primary));
}

.btn-add.work {
  background-color: hsl(var(--accent));
}

.btn-add.life {
  background-color: hsl(var(--secondary));
}

.empty {
  margin-top: 12px;
  padding: 24px 20px;
  border-radius: 16px;
  border: 1px dashed hsl(var(--border));
  text-align: center;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}

/* ---------------- 课程卡片 ---------------- */

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

.course-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
  transition: border-color 0.15s ease, opacity 0.15s ease;
}

.course-item:hover {
  border-color: hsl(var(--primary) / 0.4);
}

.course-item.is-done {
  border-color: hsl(var(--border) / 0.6);
  background-color: hsl(var(--card) / 0.6);
  opacity: 0.75;
}

.cat-chip {
  flex-shrink: 0;
  margin-top: 2px;
  padding: 2px 6px;
  border-radius: 6px;
  background-color: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.item-body {
  flex: 1;
  min-width: 0;
}

.item-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.is-done .item-title {
  color: hsl(var(--muted-foreground));
  text-decoration: line-through;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 12px;
  margin-top: 4px;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}

.meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.meta svg {
  width: 12px;
  height: 12px;
}

.meta.time svg {
  color: hsl(var(--primary));
}

.meta.lock svg {
  color: hsl(var(--muted-foreground));
}

.item-note {
  margin-top: 6px;
  padding: 4px 8px;
  border-radius: 8px;
  background-color: hsl(var(--muted) / 0.6);
  font-size: 11px;
  color: hsl(var(--muted-foreground));
}

.item-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  padding-top: 2px;
}

.mini-btn {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  color: hsl(var(--muted-foreground));
  opacity: 0.6;
  transition: opacity 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.mini-btn svg {
  width: 14px;
  height: 14px;
}

.mini-btn:hover {
  opacity: 1;
  background-color: hsl(var(--muted));
}

.mini-btn.danger:hover {
  background-color: hsl(var(--destructive) / 0.1);
  color: hsl(var(--destructive));
}

.check-btn {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  transition: all 0.15s ease;
}

.check-btn svg {
  width: 14px;
  height: 14px;
  stroke-width: 3;
}

.check-btn:hover {
  border-color: hsl(var(--primary) / 0.6);
}

.check-btn.is-on.course {
  border-color: hsl(var(--primary));
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.check-btn.is-on.work {
  border-color: hsl(var(--accent));
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.check-btn.is-on.life {
  border-color: hsl(var(--secondary));
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

/* ---------------- 要点列表 ---------------- */

.point-list {
  margin-top: 8px;
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
}

.point-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid hsl(var(--border) / 0.6);
  transition: background-color 0.15s ease;
}

.point-item:last-child {
  border-bottom: 0;
}

.point-code {
  flex-shrink: 0;
  width: 36px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.point-code.work {
  color: hsl(var(--accent));
}

.point-code.life {
  color: hsl(var(--secondary));
}

.point-body {
  flex: 1;
  min-width: 0;
}

.point-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
}

.is-done .point-title {
  color: hsl(var(--muted-foreground));
  text-decoration: line-through;
}

.point-remind {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  font-size: 11px;
  color: hsl(var(--muted-foreground));
}

.point-remind svg {
  width: 12px;
  height: 12px;
}

.point-remind.work svg {
  color: hsl(var(--accent));
}

.point-remind.life svg {
  color: hsl(var(--secondary));
}

.point-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
}

/* ---------------- 底部 & 浮动按钮 ---------------- */

.footer {
  margin-top: auto;
  padding: 32px 20px 24px;
  text-align: center;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}

.fab {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 40;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background-color: hsl(var(--foreground));
  color: hsl(var(--background));
  box-shadow: 0 8px 24px rgb(15 23 42 / 0.25);
  transition: transform 0.15s ease;
}

.fab:hover {
  transform: translateY(-1px) scale(1.03);
}

.fab svg {
  width: 20px;
  height: 20px;
}

.fab::after {
  content: "";
  position: absolute;
  top: 9px;
  right: 9px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background-color: hsl(43 96% 56%);
  box-shadow: 0 0 0 2px hsl(var(--foreground));
  display: none;
}

.fab.has-alert::after {
  display: block;
}

@media (min-width: 560px) {
  .fab {
    right: calc(50vw - 240px + 20px);
  }
}

/* ---------------- 弹窗 ---------------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px 0;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgb(15 23 42 / 0.45);
  backdrop-filter: blur(2px);
  animation: fade 0.18s ease-out;
}

.dialog-card {
  position: relative;
  width: calc(100% - 32px);
  max-width: 440px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 24px;
  border-radius: 20px;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  box-shadow: 0 24px 60px rgb(15 23 42 / 0.22);
  animation: pop 0.2s ease-out;
}

.dialog-title {
  font-size: 16px;
  font-weight: 600;
}

.dialog-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

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

.field > label {
  font-size: 12px;
  font-weight: 500;
  color: hsl(var(--foreground));
}

.req {
  color: hsl(var(--destructive));
}

.field input,
.field textarea,
.field select,
.copy-row input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid hsl(var(--input));
  background-color: hsl(var(--background));
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field textarea {
  height: auto;
  min-height: 80px;
  padding: 10px 12px;
  line-height: 1.6;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.copy-row input:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.15);
}

.field input::placeholder,
.field textarea::placeholder {
  color: hsl(var(--muted-foreground) / 0.7);
}

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

.dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease, border-color 0.15s ease;
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.btn-primary {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.btn-primary:hover {
  background-color: hsl(var(--primary) / 0.9);
}

.btn-outline {
  border-color: hsl(var(--border));
  background-color: transparent;
}

.btn-outline:hover {
  background-color: hsl(var(--muted));
}

.btn-ghost {
  background-color: hsl(var(--muted));
}

.btn-ghost:hover {
  background-color: hsl(var(--muted) / 0.7);
}

.btn-sm {
  height: 32px;
  padding: 0 12px;
}

/* ---------------- 设置面板 ---------------- */

.sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: calc(100% - 24px);
  max-width: 480px;
  max-height: calc(100vh - 48px);
  border-radius: 24px;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  box-shadow: 0 24px 70px rgb(15 23 42 / 0.28);
  overflow: hidden;
  animation: pop 0.22s ease-out;
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 12px;
}

.sheet-head h2 {
  font-size: 16px;
  font-weight: 600;
}

.sheet-sub {
  margin-top: 2px;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  color: hsl(var(--muted-foreground));
  transition: background-color 0.15s ease;
}

.icon-btn:hover {
  background-color: hsl(var(--muted));
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.tabs {
  display: flex;
  gap: 6px;
  padding: 0 20px 12px;
  border-bottom: 1px solid hsl(var(--border) / 0.7);
}

.tab {
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  transition: background-color 0.15s ease, color 0.15s ease;
}

.tab:hover {
  background-color: hsl(var(--muted));
}

.tab.is-active {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 12px;
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hint {
  font-size: 11px;
  line-height: 1.7;
  color: hsl(var(--muted-foreground));
}

.copy-row {
  display: flex;
  gap: 8px;
}

.copy-row input {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-row .btn {
  flex: 1;
  min-width: 130px;
}

.notice {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid hsl(var(--accent) / 0.3);
  background-color: hsl(var(--accent) / 0.08);
  font-size: 11px;
  line-height: 1.7;
  color: hsl(var(--accent));
}

.notice b {
  font-weight: 600;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  cursor: pointer;
}

.switch-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: hsl(var(--primary));
}

.switch-strong span {
  font-weight: 600;
}

.switch-strong em {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-style: normal;
  font-weight: 400;
  color: hsl(var(--muted-foreground));
}

.switch-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background-color: hsl(var(--muted) / 0.5);
}

.steps {
  padding: 14px 16px;
  border-radius: 14px;
  background-color: hsl(var(--muted) / 0.5);
  font-size: 12px;
  line-height: 1.75;
  color: hsl(var(--muted-foreground));
}

.steps-title {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.steps-title:first-child {
  margin-top: 0;
}

.steps ol {
  margin-top: 4px;
  padding-left: 18px;
  list-style: decimal;
}

.steps li {
  margin-top: 2px;
}

.steps-note {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed hsl(var(--border));
  font-size: 11px;
}

.meta-line {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
}

.log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
}

.link-btn {
  font-size: 11px;
  color: hsl(var(--primary));
}

.log-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.log-item {
  padding: 8px 10px;
  border-radius: 10px;
  background-color: hsl(var(--muted) / 0.5);
  font-size: 11px;
  line-height: 1.55;
  color: hsl(var(--muted-foreground));
}

.log-item b {
  font-weight: 600;
}

.log-item.ok b {
  color: hsl(var(--secondary));
}

.log-item.err b {
  color: hsl(var(--destructive));
}

.sheet-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px 16px;
  border-top: 1px solid hsl(var(--border) / 0.7);
}

.foot-status {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
}

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

.toast-stack {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: calc(100% - 40px);
  max-width: 420px;
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  background-color: hsl(var(--foreground));
  color: hsl(var(--background));
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 10px 30px rgb(15 23 42 / 0.28);
  animation: toastIn 0.2s ease-out;
}

.toast .toast-title {
  font-weight: 500;
}

.toast .toast-mark {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  margin-top: 7px;
  border-radius: 999px;
  background-color: hsl(43 96% 56%);
}

.toast.success .toast-mark {
  background-color: hsl(162 70% 52%);
}

.toast.error .toast-mark {
  background-color: hsl(0 84% 60%);
}

.toast .toast-desc {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  opacity: 0.75;
}

/* ---------------- 动画 ---------------- */

.rise {
  animation: rise 0.45s ease-out both;
}

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

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ================= 登录 / 注册 ================= */

.auth {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 28px 16px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 28px 24px 24px;
  border-radius: 24px;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  box-shadow: 0 18px 50px rgb(15 23 42 / 0.08);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-title {
  margin-top: 18px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.auth-sub {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.6;
  color: hsl(var(--muted-foreground));
}

.auth-tabs {
  margin-top: 18px;
  padding: 0 0 12px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.auth-form[hidden] {
  display: none;
}

.btn-block {
  width: 100%;
  height: 42px;
  margin-top: 2px;
}

.form-error {
  font-size: 12px;
  line-height: 1.5;
  color: hsl(var(--destructive));
}

.form-error:empty {
  display: none;
}

.auth-foot {
  margin-top: 16px;
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
  color: hsl(var(--muted-foreground));
}

/* ================= 重复规则 ================= */

.recur-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background-color: hsl(var(--muted) / 0.45);
}

.recur-extra {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recur-extra[hidden],
.weekday-field[hidden] {
  display: none;
}

.interval-row {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid hsl(var(--input));
  background-color: hsl(var(--background));
}

.interval-row input {
  width: 46px;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
}

.interval-row input:focus {
  outline: none;
  box-shadow: none;
}

.interval-prefix,
.interval-suffix {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}

.weekday-picker {
  display: flex;
  gap: 6px;
}

.weekday-picker button {
  flex: 1;
  height: 34px;
  border-radius: 10px;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  font-size: 12px;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.weekday-picker button.is-on {
  border-color: hsl(var(--primary));
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.meta.rec {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
}

.meta.rec.course {
  background-color: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
}

.meta.rec.work {
  background-color: hsl(var(--accent) / 0.12);
  color: hsl(var(--accent));
}

.meta.rec.life {
  background-color: hsl(var(--secondary) / 0.12);
  color: hsl(var(--secondary));
}

/* ================= 账号 / 管理 ================= */

.account-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.account-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background-color: hsl(var(--primary) / 0.12);
  color: hsl(var(--primary));
  font-size: 16px;
  font-weight: 700;
}

.account-name {
  font-size: 14px;
  font-weight: 600;
}

.account-meta {
  margin-top: 2px;
  font-size: 11px;
  color: hsl(var(--muted-foreground));
}

.fold {
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid hsl(var(--border));
}

.fold summary {
  padding: 10px 0;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}

.fold summary::-webkit-details-marker {
  display: none;
}

.fold-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0 12px;
}

.fold-body .btn {
  align-self: flex-start;
}

.divider {
  height: 1px;
  margin: 6px 0;
  background-color: hsl(var(--border));
}

.sub-title {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
}

.invite-actions {
  justify-content: flex-start;
}

.invite-actions .btn {
  flex: 0 0 auto;
  min-width: 0;
}

.mini-select {
  width: auto;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--background));
  font-size: 12px;
}

.invite-list,
.user-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.invite-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background-color: hsl(var(--muted) / 0.5);
  font-size: 11px;
}

.invite-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.invite-side {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.invite-state {
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 500;
}

.invite-state.free {
  background-color: hsl(var(--secondary) / 0.15);
  color: hsl(var(--secondary));
}

.invite-state.used {
  background-color: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}

.invite-state.revoked {
  background-color: hsl(var(--destructive) / 0.12);
  color: hsl(var(--destructive));
}

.user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  background-color: hsl(var(--muted) / 0.4);
  font-size: 11px;
  color: hsl(var(--muted-foreground));
}

.user-item b {
  font-size: 12px;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.role-tag {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background-color: hsl(var(--primary) / 0.12);
  color: hsl(var(--primary));
  font-size: 10px;
  font-weight: 500;
}

.btn-danger {
  background-color: hsl(var(--destructive));
  color: #fff;
}

.btn-danger:hover {
  background-color: hsl(var(--destructive) / 0.9);
}

.danger-text {
  border-color: hsl(var(--destructive) / 0.35);
  color: hsl(var(--destructive));
}

.danger-text:hover {
  background-color: hsl(var(--destructive) / 0.08);
}

.dialog-small {
  max-width: 380px;
}

.confirm-desc {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.7;
  color: hsl(var(--muted-foreground));
}

.confirm-foot {
  flex-wrap: wrap;
  margin-top: 18px;
}

.btn[hidden] {
  display: none;
}

.invite-sub {
  margin-top: 2px;
  font-size: 10px;
  color: hsl(var(--muted-foreground));
}

/* hidden 属性一律优先，避免被 flex/grid 的 display 覆盖 */
[hidden] {
  display: none !important;
}

.sheet-link {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  color: hsl(var(--primary));
}

.sheet-link:hover {
  text-decoration: underline;
}

.auth-link {
  color: hsl(var(--primary));
  font-weight: 500;
}

.auth-link:hover {
  text-decoration: underline;
}

/* 备案号 */
.beian {
  margin-top: 10px;
  font-size: 11px;
  line-height: 1.6;
}

.beian a {
  color: hsl(var(--muted-foreground));
}

.beian a:hover {
  color: hsl(var(--primary));
  text-decoration: underline;
}

.beian-link {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
}

.beian-link:hover {
  color: hsl(var(--primary));
  text-decoration: underline;
}
