:root {
  color-scheme: light;
  --bg: #f1f0ec;
  --surface: #faf9f5;
  --surface-strong: #ffffff;
  --ink: #3f4541;
  --muted: #777d78;
  --muted-2: #999e99;
  --line: #dcd9d1;
  --line-strong: #c4c4bc;
  --green: #7d9a89;
  --green-soft: #e7eee9;
  --blue: #7f8fa8;
  --blue-soft: #eceff4;
  --orange: #c19774;
  --orange-soft: #f4ece3;
  --rose: #b18493;
  --rose-soft: #f3e8ec;
  --gold: #b39d6b;
  --gold-soft: #f2eee3;
  --danger: #b5656d;
  --danger-soft: #f5e8e9;
  --shadow: 0 14px 38px rgba(82, 88, 83, 0.1);
  --shadow-soft: 0 5px 19px rgba(82, 88, 83, 0.065);
  --radius: 8px;
  --sidebar-width: 232px;
  --topbar-height: 86px;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(241, 240, 236, 0.78), rgba(241, 240, 236, 0.86)),
    url("./assets/floral-pattern.svg");
  background-size: auto, 320px 220px;
  font-size: 15px;
  line-height: 1.55;
}

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

button {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(61, 115, 167, 0.28);
  outline-offset: 2px;
}

svg {
  display: block;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 24px 16px 18px;
  border-right: 1px solid var(--line);
  background: var(--sidebar-bg, rgba(250, 249, 245, 0.96));
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 52px;
  padding: 0 8px 18px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border-radius: var(--radius);
  color: #ffffff;
  background: var(--button-color, #7d9a89);
  box-shadow: 0 8px 18px rgba(125, 112, 120, 0.2);
}

.brand-mark svg {
  width: 21px;
  height: 21px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 16px;
}

.brand small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 12px;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 20px;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition:
    color 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.nav-button:hover {
  color: var(--ink);
  background: #f3f5f1;
}

.nav-button.is-active {
  border-color: #c9d5cc;
  color: var(--button-color, #536f62);
  background: color-mix(in srgb, var(--button-color, #7d9a89) 14%, var(--surface, #faf9f5));
  font-weight: 700;
}

.nav-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.sync-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  margin-top: auto;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: #fafaf7;
  font-size: 12px;
}

.sync-pill.is-online {
  color: #246559;
  border-color: #c5ddd6;
  background: var(--green-soft);
}

.sync-pill.is-error {
  color: var(--danger);
  border-color: #e9caca;
  background: var(--danger-soft);
}

.sync-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #a9b1ad;
}

.sync-pill.is-online .sync-dot {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(47, 125, 110, 0.12);
}

.sync-pill.is-error .sync-dot {
  background: var(--danger);
}

.workspace {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--topbar-height);
  padding: 16px 28px;
  border-bottom: 1px solid rgba(220, 217, 209, 0.9);
  background: var(--topbar-bg, rgba(241, 240, 236, 0.9));
  backdrop-filter: blur(18px);
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-title h1 {
  margin: 0;
  font-size: clamp(22px, 2.3vw, 32px);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.current-time {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  margin-bottom: 3px;
  padding: 2px 8px;
  border: 1px solid #d8d1c8;
  border-radius: 999px;
  color: #6f716c;
  background: rgba(246, 243, 237, 0.92);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

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

.main-content {
  width: min(100%, 1560px);
  min-height: calc(100vh - var(--topbar-height));
  margin: 0 auto;
  padding: 24px 28px 48px;
}

.button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition:
    transform 120ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.button {
  gap: 7px;
  padding: 8px 12px;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}

.button svg {
  width: 16px;
  height: 16px;
}

.button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.button:active,
.icon-button:active {
  transform: translateY(0);
}

.button-primary {
  color: var(--button-text, #ffffff);
  background: var(--button-color, var(--green));
  box-shadow: 0 6px 16px rgba(47, 125, 110, 0.18);
}

.button-primary:hover {
  background: color-mix(in srgb, var(--button-color, var(--green)) 84%, #000000);
}

.button-subtle {
  border-color: #c9d9d3;
  color: #275f56;
  background: var(--green-soft);
}

.button-ghost {
  border-color: var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
}

.button-ghost:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--surface-strong);
}

.button-danger {
  border-color: #e5c3c3;
  color: var(--danger);
  background: var(--danger-soft);
}

.button-small {
  min-height: 32px;
  padding: 5px 9px;
  font-size: 12px;
}

.icon-button {
  width: 36px;
  min-width: 36px;
  padding: 0;
  border-color: var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.78);
}

.icon-button svg {
  width: 17px;
  height: 17px;
}

.icon-button.is-running {
  color: #ffffff;
  border-color: var(--orange);
  background: var(--orange);
}

.mobile-only {
  display: none;
}

.view-stack {
  display: grid;
  gap: 22px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.section-heading h2,
.section-heading h3 {
  margin: 0;
  letter-spacing: 0;
}

.section-heading h2 {
  font-size: 21px;
}

.section-heading h3 {
  font-size: 17px;
}

.section-heading p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-bg, rgba(255, 253, 248, 0.88));
  box-shadow: var(--shadow-soft);
}

.panel-pad {
  padding: 18px;
}

.today-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(310px, 0.75fr);
  gap: 24px;
  overflow: hidden;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(110deg, rgba(237, 228, 231, 0.95), rgba(237, 237, 230, 0.84) 54%, rgba(224, 234, 227, 0.82)),
    var(--surface);
  box-shadow: var(--shadow);
}

.today-hero h2 {
  margin: 0 0 6px;
  font-size: clamp(24px, 2.7vw, 38px);
  line-height: 1.2;
}

.today-hero p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
}

.today-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  font-weight: 700;
}

.badge svg {
  width: 13px;
  height: 13px;
}

.badge-priority {
  border-color: #c4dbd5;
  color: #27665b;
  background: var(--green-soft);
}

.today-progress {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  align-items: center;
  gap: 20px;
}

.progress-ring {
  position: relative;
  display: grid;
  width: 142px;
  height: 142px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(
    var(--ring-color, var(--green)) calc(var(--progress-value, 0) * 1%),
    #e3e7e2 0
  );
}

.progress-ring::before {
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: var(--surface);
  content: "";
  box-shadow: inset 0 0 0 1px rgba(216, 221, 215, 0.7);
}

.progress-ring-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.progress-ring strong {
  display: block;
  font-size: 30px;
  line-height: 1;
}

.progress-ring span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.progress-summary {
  display: grid;
  gap: 9px;
}

.progress-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.progress-summary-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.progress-summary-row strong {
  color: var(--ink);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  min-height: 104px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.metric-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric-label svg {
  width: 14px;
  height: 14px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 23px;
  line-height: 1.15;
}

.metric small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.timeline {
  position: relative;
  display: grid;
  gap: 9px;
}

.time-axis-now {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -2px 0 3px 81px;
  color: #b15f7d;
  font-size: 12px;
  font-weight: 800;
}

.time-axis-now span {
  width: 9px;
  height: 9px;
  border: 2px solid #fff8fb;
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 0 3px rgba(216, 120, 157, 0.16);
}

.current-next-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.focus-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 12px;
  align-items: center;
  min-height: 112px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--task-color, var(--rose));
  border-radius: var(--radius);
  background: linear-gradient(100deg, rgba(250, 249, 245, 0.98), rgba(239, 237, 231, 0.9));
  box-shadow: var(--shadow-soft);
}

.focus-panel.is-empty {
  grid-template-columns: 1fr;
}

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

.focus-label svg {
  width: 15px;
  height: 15px;
}

.focus-panel > strong {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.focus-panel > strong .subject-icon {
  --task-color: var(--task-color);
}

.focus-panel > small {
  grid-column: 1;
  color: var(--muted);
  font-size: 11px;
}

.focus-panel > .button {
  grid-column: 2;
  grid-row: 3;
  align-self: end;
}

.timeline::before {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 73px;
  width: 1px;
  background: repeating-linear-gradient(
    180deg,
    #e8a9c0 0,
    #e8a9c0 6px,
    transparent 6px,
    transparent 12px
  );
  content: "";
}

.timeline-row {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 17px;
  align-items: start;
}

.timeline-time {
  padding-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.timeline-time strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
}

.timeline-time span {
  display: block;
  margin-top: 2px;
}

.task-card {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  min-height: 70px;
  padding: 12px 12px 12px 13px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--task-color, var(--green));
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(31, 43, 40, 0.035);
  transition:
    opacity 160ms ease,
    border-color 160ms ease,
    transform 160ms ease,
    background 160ms ease;
}

.task-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.task-card.is-current {
  border-color: #e1b47e;
  background: #fffaf2;
  box-shadow: 0 8px 22px rgba(197, 123, 53, 0.12);
}

.task-card.is-done {
  border-color: #c7ddd6;
  background: #f7fbf9;
}

.task-card.is-done .task-title,
.task-card.is-skipped .task-title {
  text-decoration: line-through;
}

.task-card.is-skipped,
.task-card.is-moved {
  opacity: 0.6;
}

.task-card.is-draggable {
  cursor: grab;
}

.task-card.is-dragging {
  opacity: 0.45;
}

.check-wrap {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
}

.task-check {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--green);
  cursor: pointer;
}

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

.task-title-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.task-title {
  min-width: 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}

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

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

.task-meta svg {
  width: 13px;
  height: 13px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #f7f8f5;
  font-size: 11px;
  font-weight: 800;
}

.status-chip.done {
  border-color: #bdd9d1;
  color: #246559;
  background: var(--green-soft);
}

.status-chip.partial {
  border-color: #e5caa9;
  color: #8e5926;
  background: var(--orange-soft);
}

.status-chip.skipped,
.status-chip.moved {
  border-color: #e5c4c4;
  color: var(--danger);
  background: var(--danger-soft);
}

.status-chip.parallel-chip {
  border-color: #d6cadd;
  color: #6d607d;
  background: #f0ebf3;
}

.task-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.task-actions .icon-button {
  width: 33px;
  min-width: 33px;
  min-height: 33px;
}

.task-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  white-space: pre-line;
}

.empty-state {
  padding: 34px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.45);
  text-align: center;
}

.empty-state svg {
  width: 28px;
  height: 28px;
  margin: 0 auto 9px;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(145px, 1fr));
  gap: 10px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 8px;
}

.week-day {
  min-width: 145px;
  min-height: 360px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.72);
}

.week-day.is-today {
  border-color: #b9d7cf;
  box-shadow: inset 0 0 0 1px rgba(47, 125, 110, 0.12);
}

.week-day.is-drop-target {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.week-day-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  margin: -10px -10px 9px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  background: rgba(255, 253, 248, 0.96);
}

.week-day-head strong {
  display: block;
  font-size: 13px;
}

.week-day-head span {
  color: var(--muted);
  font-size: 11px;
}

.week-progress {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(
    var(--green) calc(var(--progress-value, 0) * 1%),
    #e3e7e2 0
  );
  font-size: 9px;
  font-weight: 800;
}

.week-progress::before {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface);
  content: attr(data-label);
  text-align: center;
  line-height: 26px;
}

.week-tasks {
  display: grid;
  gap: 7px;
}

.compact-task {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--task-color, var(--green));
  border-radius: 6px;
  background: var(--surface);
}

.compact-task.is-done {
  background: var(--green-soft);
}

.compact-task.is-moved,
.compact-task.is-skipped {
  opacity: 0.55;
}

.compact-task .task-check {
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

.compact-task strong {
  display: block;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.compact-task small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.month-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.month-weekday {
  padding: 8px 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.month-day {
  position: relative;
  display: grid;
  min-height: 145px;
  aspect-ratio: 1 / 0.82;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255, 253, 248, 0.8);
  text-align: left;
}

.month-day:hover {
  border-color: var(--line-strong);
  background: var(--surface);
}

.month-day-main {
  display: grid;
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 10px;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.month-day-add {
  position: absolute;
  right: 6px;
  bottom: 6px;
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid #d1c9d0;
  border-radius: 50%;
  color: #7f6d7d;
  background: rgba(250, 248, 244, 0.94);
  cursor: pointer;
}

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

.month-day.is-empty {
  border-color: transparent;
  background: transparent;
  cursor: default;
}

.month-day.is-today {
  border-color: #9dcabf;
  box-shadow: inset 0 0 0 1px rgba(47, 125, 110, 0.12);
}

.month-day.is-rest-day {
  background: linear-gradient(135deg, #f0ebe8, #ecece5);
}

.rest-label {
  color: #8e7568 !important;
  font-weight: 800;
}

.month-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.month-day-date {
  font-size: 15px;
  font-weight: 800;
}

.month-day-score {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.month-day-bar {
  height: 5px;
  margin: 9px 0;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e8e4;
}

.month-day-bar span {
  display: block;
  width: calc(var(--progress-value, 0) * 1%);
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.month-day-tasks {
  display: grid;
  gap: 4px;
  align-content: start;
  min-width: 0;
}

.month-day-tasks span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.month-day-foot {
  align-self: end;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field-full {
  grid-column: 1 / -1;
}

.field label,
.field-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.input,
.select,
.textarea {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface-strong);
}

.input,
.select {
  padding: 8px 10px;
}

.textarea {
  min-height: 92px;
  padding: 10px;
  resize: vertical;
}

.input:disabled,
.select:disabled,
.textarea:disabled {
  color: var(--muted);
  background: #f0f1ee;
}

.form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 14px;
}

.helper-text {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 13px;
  border: 1px solid #c7ddd6;
  border-radius: var(--radius);
  color: #285e55;
  background: var(--green-soft);
  font-size: 13px;
}

.notice.warning {
  border-color: #e4ccb0;
  color: #7a4c20;
  background: var(--orange-soft);
}

.notice.danger {
  border-color: #e4c2c2;
  color: var(--danger);
  background: var(--danger-soft);
}

.notice svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  margin-top: 1px;
}

.error-details {
  margin: 12px 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid #e4c2c2;
  border-radius: var(--radius);
  color: #6d4448;
  background: #fff7f7;
  font-family: Consolas, "Microsoft YaHei", monospace;
  font-size: 12px;
  white-space: pre-wrap;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.subject-progress-list {
  display: grid;
  gap: 12px;
}

.subject-progress {
  display: grid;
  gap: 6px;
}

.subject-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.subject-progress-head strong {
  display: flex;
  align-items: center;
  gap: 7px;
}

.subject-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--subject-color, var(--green));
}

.subject-progress-head span {
  color: var(--muted);
  font-size: 12px;
}

.bar-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e8e4;
}

.bar-fill {
  display: block;
  width: calc(var(--bar-value, 0) * 1%);
  height: 100%;
  border-radius: inherit;
  background: var(--subject-color, var(--green));
}

.session-list {
  display: grid;
  gap: 8px;
}

.session-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.session-row strong {
  display: block;
  font-size: 13px;
}

.session-row span,
.session-row small {
  color: var(--muted);
  font-size: 12px;
}

.review-summary {
  margin: 0;
  color: #35413e;
  font-size: 15px;
  line-height: 1.75;
}

.review-list {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.review-item {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

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

.review-item-dot {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--item-color, var(--green));
}

.review-item strong {
  display: block;
  font-size: 13px;
}

.review-item p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.diff-list {
  display: grid;
  gap: 9px;
}

.diff-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.diff-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 26px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #286157;
  background: var(--green-soft);
  font-size: 11px;
  font-weight: 800;
}

.diff-row.cut .diff-type {
  color: #8b5321;
  background: var(--orange-soft);
}

.diff-row.backlog .diff-type {
  color: var(--danger);
  background: var(--danger-soft);
}

.diff-row strong {
  display: block;
  font-size: 13px;
}

.diff-row p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.settings-block {
  display: grid;
  gap: 14px;
}

.settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.65fr);
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.settings-row:last-child {
  border-bottom: 0;
}

.settings-row strong {
  display: block;
}

.settings-row p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.subject-edit-list {
  display: grid;
  gap: 9px;
}

.subject-edit {
  display: grid;
  grid-template-columns: 160px minmax(150px, 1fr) minmax(190px, 1.2fr);
  gap: 9px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.subject-edit-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
  font-weight: 800;
}

.subject-edit-label span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subject-edit .input {
  min-height: 36px;
  padding: 6px 9px;
  font-size: 12px;
}

.health-list {
  display: grid;
  gap: 8px;
}

.health-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 12px;
}

.health-item.ok {
  border-color: #c7ddd6;
  color: #286157;
  background: var(--green-soft);
}

.health-item.error {
  border-color: #e4c2c2;
  color: var(--danger);
  background: var(--danger-soft);
}

.health-item svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  margin-top: 1px;
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(27, 35, 33, 0.34);
  backdrop-filter: blur(4px);
}

.modal-root.is-open {
  display: flex;
}

.modal {
  width: min(680px, 100%);
  max-height: min(88vh, 920px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(24, 34, 31, 0.24);
}

.modal-wide {
  width: min(880px, 100%);
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.96);
  backdrop-filter: blur(12px);
}

.modal-head h2 {
  margin: 0;
  font-size: 20px;
}

.modal-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.modal-body {
  padding: 18px 20px 20px;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--line);
  background: #fbfaf6;
}

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 120;
  display: grid;
  width: min(390px, calc(100vw - 40px));
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 12px 13px;
  border: 1px solid #c7ddd6;
  border-radius: var(--radius);
  color: #234f48;
  background: #f1f9f6;
  box-shadow: var(--shadow);
  animation: toast-in 180ms ease both;
  pointer-events: auto;
}

.toast.warning {
  border-color: #e4ccb0;
  color: #7a4c20;
  background: #fff6eb;
}

.toast.error {
  border-color: #e4c2c2;
  color: var(--danger);
  background: #fff2f2;
}

.toast svg {
  width: 18px;
  height: 18px;
}

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

.noscript {
  margin: 24px;
  padding: 16px;
  border: 1px solid var(--danger);
  color: var(--danger);
  background: var(--danger-soft);
}

@media (max-width: 1240px) {
  .topbar {
    align-items: flex-start;
    gap: 14px;
  }

  .topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .today-hero {
    grid-template-columns: 1fr;
  }

  .today-progress {
    grid-template-columns: 124px minmax(0, 1fr);
  }

  .progress-ring {
    width: 118px;
    height: 118px;
  }

  .month-day {
    min-height: 130px;
  }
}

@media (max-width: 980px) {
  :root {
    --sidebar-width: 84px;
  }

  .sidebar {
    padding-inline: 12px;
  }

  .brand {
    justify-content: center;
    padding-inline: 0;
  }

  .brand > span:last-child,
  .nav-button span,
  .sync-pill span:last-child {
    display: none;
  }

  .nav-button {
    justify-content: center;
    padding-inline: 8px;
  }

  .sync-pill {
    justify-content: center;
    padding-inline: 8px;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  :root {
    --topbar-height: auto;
  }

  body {
    font-size: 14px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    display: block;
    width: 100%;
    height: auto;
    padding: 7px 8px;
    border-top: 1px solid var(--line);
    border-right: 0;
    background: rgba(255, 253, 248, 0.96);
  }

  .brand,
  .sync-pill {
    display: none;
  }

  .nav-list {
    flex-direction: row;
    gap: 4px;
    margin: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav-list::-webkit-scrollbar {
    display: none;
  }

  .nav-button {
    display: grid;
    min-width: 68px;
    min-height: 48px;
    flex: 0 0 68px;
    place-items: center;
    gap: 2px;
    padding: 5px 4px;
    font-size: 10px;
  }

  .nav-button span {
    display: block;
  }

  .nav-button svg {
    width: 17px;
    height: 17px;
  }

  .workspace {
    padding-bottom: 66px;
  }

  .topbar {
    position: static;
    display: block;
    padding: 14px 14px 12px;
  }

  .topbar-title {
    align-items: flex-start;
  }

  .mobile-only {
    display: inline-flex;
  }

  .topbar-actions {
    justify-content: flex-start;
    margin-top: 12px;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .topbar-actions .button {
    flex: 0 0 auto;
  }

  .main-content {
    padding: 16px 14px 34px;
  }

  .today-hero {
    padding: 18px 16px;
  }

  .today-progress {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .progress-summary {
    width: 100%;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .metric {
    min-height: 90px;
    padding: 12px;
  }

  .metric strong {
    font-size: 19px;
  }

  .timeline::before {
    display: none;
  }

  .timeline-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .timeline-time {
    display: flex;
    gap: 6px;
    padding-top: 0;
    text-align: left;
  }

  .timeline-time strong,
  .timeline-time span {
    display: inline;
  }

  .task-card {
    grid-template-columns: 27px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
  }

  .task-actions {
    grid-column: 2;
    justify-content: flex-start;
  }

  .week-grid {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .week-day {
    min-height: auto;
  }

  .month-calendar {
    grid-template-columns: repeat(7, minmax(42px, 1fr));
    gap: 4px;
  }

  .month-weekday {
    padding-inline: 2px;
    font-size: 10px;
  }

  .month-day {
    min-height: 82px;
    aspect-ratio: 1 / 1.15;
    padding: 0;
  }

  .month-day-main {
    padding: 6px;
  }

  .month-day-tasks,
  .month-day-foot {
    display: none;
  }

  .month-day-bar {
    margin: 7px 0 0;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .settings-row,
  .subject-edit {
    grid-template-columns: 1fr;
  }

  .modal-root {
    align-items: flex-end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 92vh;
    border-radius: var(--radius) var(--radius) 0 0;
  }

  .toast-region {
    right: 12px;
    bottom: 74px;
    width: calc(100vw - 24px);
  }
}

.subject-icon {
  display: inline-grid;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  place-items: center;
  border-radius: 50%;
  color: var(--task-color, var(--rose));
  background: color-mix(in srgb, var(--task-color, var(--rose)) 14%, white);
}

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

.rhythm-panel {
  background:
    linear-gradient(120deg, rgba(240, 235, 232, 0.94), rgba(236, 236, 229, 0.84)),
    var(--surface);
}

.rhythm-grid {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.note-textarea {
  min-height: 128px;
}

.goal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.goal-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--subject-color, var(--rose));
  border-radius: var(--radius);
  background: linear-gradient(120deg, rgba(250, 249, 245, 0.96), rgba(239, 237, 232, 0.86));
}

.goal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.goal-head strong {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 13px;
}

.goal-head strong .subject-icon {
  --task-color: var(--subject-color);
}

.goal-head > span {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.goal-card > p {
  margin: 7px 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.goal-bars {
  display: grid;
  gap: 9px;
}

.goal-bars > div > span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
}

.goal-card small {
  display: block;
  margin-top: 11px;
  color: var(--muted);
  font-size: 11px;
}

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

.weekday-choice {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
  cursor: pointer;
}

.weekday-choice input {
  accent-color: var(--rose);
}

.color-input {
  min-width: 48px;
  padding: 4px;
}

.subject-edit {
  grid-template-columns: 150px minmax(140px, 1fr) minmax(170px, 1.1fr) 52px 96px auto;
}

@media (max-width: 1100px) {
  .goal-grid {
    grid-template-columns: 1fr;
  }

  .subject-edit {
    grid-template-columns: minmax(130px, 0.8fr) repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .rhythm-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .current-next-grid {
    grid-template-columns: 1fr;
  }

  .time-axis-now {
    margin-left: 0;
  }

  .goal-head {
    display: block;
  }

  .goal-head > span {
    display: block;
    margin-top: 4px;
  }

  .subject-edit {
    grid-template-columns: 1fr;
  }
}

.view-stack {
  gap: 28px;
}

.timeline-section {
  margin-top: 6px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.timeline {
  gap: 13px;
  padding-top: 10px;
}

.current-next-grid {
  margin-bottom: 4px;
}

.focus-panel {
  background: color-mix(in srgb, var(--task-color, var(--rose)) 22%, #faf9f5);
  border-left-width: 5px;
}

.focus-panel.is-empty {
  border-left-width: 1px;
}

.task-card,
.compact-task {
  color: #ffffff;
  border-color: color-mix(in srgb, var(--task-color, var(--rose)) 78%, #333333);
  background: var(--task-color, var(--rose));
  box-shadow: 0 7px 18px color-mix(in srgb, var(--task-color, var(--rose)) 24%, transparent);
}

.task-card:hover {
  border-color: rgba(255, 255, 255, 0.72);
  background: color-mix(in srgb, var(--task-color, var(--rose)) 88%, #ffffff);
}

.task-card .task-title,
.task-card .task-meta,
.task-card .task-note,
.compact-task strong,
.compact-task small {
  color: #ffffff;
}

.task-card .task-meta {
  color: rgba(255, 255, 255, 0.84);
}

.task-card .status-chip {
  border-color: rgba(255, 255, 255, 0.32);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.17);
}

.task-card .subject-icon {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.2);
}

.task-card .icon-button {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
}

.task-card .icon-button.is-running {
  color: #4b403c;
  border-color: #ffffff;
  background: #ffffff;
}

.task-card.is-done {
  border-color: rgba(255, 255, 255, 0.72);
  background: color-mix(in srgb, var(--task-color, var(--green)) 91%, #ffffff);
}

.task-card.is-current {
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.92),
    0 10px 26px color-mix(in srgb, var(--task-color, var(--rose)) 34%, transparent);
}

.task-card.is-skipped,
.task-card.is-moved {
  opacity: 0.52;
}

.timeline::before {
  left: 77px;
  z-index: 0;
  width: 3px;
  opacity: 1;
}

.timeline-row {
  z-index: 1;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 22px;
}

.timeline-row::before {
  position: absolute;
  top: 23px;
  left: 71px;
  z-index: 2;
  width: 13px;
  height: 13px;
  border: 3px solid var(--bg);
  border-radius: 50%;
  background: var(--task-color, var(--rose));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--task-color, var(--rose)) 38%, #ffffff);
  content: "";
}

.time-axis-now {
  margin: 7px 0 7px 90px;
  padding: 5px 10px;
  border: 1px solid color-mix(in srgb, var(--rose) 36%, #ffffff);
  border-radius: 999px;
  background: color-mix(in srgb, var(--rose) 11%, #ffffff);
  width: fit-content;
}

.month-calendar {
  column-gap: 18px;
  row-gap: 18px;
}

.month-day {
  min-height: 188px;
  aspect-ratio: 1 / 0.92;
  border-width: 2px;
  border-color: #d2d0c8;
  box-shadow: 0 7px 18px rgba(82, 88, 83, 0.1);
}

.month-day-main {
  padding: 12px;
}

.month-day-bar {
  margin: 11px 0 10px;
}

.month-day-tasks {
  gap: 6px;
  margin-top: 2px;
}

.month-day-tasks span {
  display: block;
  padding: 5px 7px;
  overflow: visible;
  border-radius: 6px;
  color: #ffffff;
  background: var(--task-color, var(--muted));
  font-size: 11px;
  line-height: 1.25;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.month-day-tasks .rest-label {
  color: #766a62 !important;
  background: rgba(255, 255, 255, 0.72);
}

.month-day-tasks .more-tasks {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.62);
}

.month-day-foot {
  margin-top: 10px;
  padding-right: 30px;
}

.monthly-summary-card {
  background:
    linear-gradient(115deg, rgba(228, 237, 230, 0.78), rgba(241, 237, 232, 0.9)),
    var(--surface);
}

.diary-list {
  display: grid;
  gap: 8px;
}

.diary-list-item {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
}

.diary-list-item:hover,
.diary-list-item.is-active {
  border-color: #b8cbbf;
  background: var(--green-soft);
}

.diary-list-item span {
  color: var(--muted);
  font-size: 11px;
}

.diary-textarea {
  min-height: 260px;
  line-height: 1.8;
}

.sticker-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.sticker-choice {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface);
  cursor: pointer;
  font-size: 12px;
}

.sticker-choice input {
  display: none;
}

.sticker-choice svg {
  width: 15px;
  height: 15px;
}

.sticker-choice:has(input:checked) {
  color: #6d5b77;
  border-color: #cdbed4;
  background: #f0ebf3;
  box-shadow: 0 0 0 2px rgba(141, 127, 162, 0.12);
}

.sticker-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.handmade-sticker {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(128, 103, 118, 0.2);
  border-radius: 50%;
  color: #8e6680;
  background: rgba(255, 255, 255, 0.7);
  transform: rotate(-5deg);
  box-shadow: 0 2px 7px rgba(82, 88, 83, 0.09);
}

.handmade-sticker:nth-child(even) {
  color: #668273;
  transform: rotate(6deg);
}

.handmade-sticker svg {
  width: 15px;
  height: 15px;
}

.notebook-preview {
  position: relative;
  max-width: 860px;
  min-height: 320px;
  margin: 4px auto 0;
  padding: 42px 44px;
  border: 1px solid #d8cfc7;
  border-radius: 8px;
  color: var(--note-text-color, #4a4541);
  box-shadow: 0 18px 42px rgba(82, 88, 83, 0.12);
}

.notebook-preview h3 {
  margin: 0 0 6px;
  font-size: 24px;
}

.notebook-preview p {
  margin: 18px 0 0;
  line-height: 1.95;
  white-space: normal;
}

.notebook-meta {
  color: #7c756f;
  font-size: 12px;
}

.notebook-tape {
  position: absolute;
  top: -11px;
  left: 50%;
  width: 118px;
  height: 25px;
  background: rgba(222, 197, 206, 0.72);
  transform: translateX(-50%) rotate(-2deg);
}

.paper-floral {
  background-color: var(--paper-bg, #fffaf7);
  background-image:
    linear-gradient(
      color-mix(in srgb, var(--paper-bg, #fffaf7) 76%, transparent),
      color-mix(in srgb, var(--paper-bg, #fffaf7) 82%, transparent)
    ),
    url("./assets/floral-pattern.svg");
  background-size: auto, 320px 220px;
}

.paper-grid {
  background-color: var(--paper-bg, #fbfaf6);
  background-image:
    linear-gradient(
      color-mix(in srgb, var(--paper-accent, #8f9f96) 18%, transparent) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      color-mix(in srgb, var(--paper-accent, #8f9f96) 18%, transparent) 1px,
      transparent 1px
    );
  background-size: 22px 22px;
}

.paper-dots {
  background-color: var(--paper-bg, #faf8f3);
  background-image: radial-gradient(
    color-mix(in srgb, var(--paper-accent, #8d7fa2) 28%, transparent) 1.4px,
    transparent 1.4px
  );
  background-size: 18px 18px;
}

.paper-washi {
  background-color: var(--paper-bg, #fbf8f4);
  background-image: repeating-linear-gradient(
    135deg,
    color-mix(in srgb, var(--paper-accent, #b18493) 16%, transparent) 0,
    color-mix(in srgb, var(--paper-accent, #b18493) 16%, transparent) 10px,
    transparent 10px,
    transparent 24px,
    rgba(125, 154, 137, 0.11) 24px,
    rgba(125, 154, 137, 0.11) 34px,
    transparent 34px,
    transparent 48px
  );
}

.paper-plain {
  background-color: var(--paper-bg, #fbfaf5);
}

.paper-lines {
  background-color: var(--paper-bg, #fbfaf5);
  background-image: repeating-linear-gradient(
    0deg,
    transparent 0 25px,
    color-mix(in srgb, var(--paper-accent, #a9b5ae) 22%, transparent) 25px 26px
  );
}

.paper-check {
  background-color: var(--paper-bg, #faf8f2);
  background-image:
    linear-gradient(45deg, color-mix(in srgb, var(--paper-accent, #c3b2a4) 16%, transparent) 25%, transparent 25%),
    linear-gradient(-45deg, color-mix(in srgb, var(--paper-accent, #c3b2a4) 16%, transparent) 25%, transparent 25%);
  background-size: 28px 28px;
}

.paper-confetti {
  background-color: var(--paper-bg, #fcfaf6);
  background-image:
    radial-gradient(circle at 8px 9px, color-mix(in srgb, var(--paper-accent, #b18493) 42%, transparent) 2px, transparent 3px),
    radial-gradient(circle at 24px 19px, color-mix(in srgb, var(--green) 36%, transparent) 2px, transparent 3px);
  background-size: 36px 32px;
}

.paper-stars {
  background-color: var(--paper-bg, #f8f7fb);
  background-image:
    radial-gradient(circle at 10px 10px, color-mix(in srgb, var(--paper-accent, #8d7fa2) 46%, transparent) 1.6px, transparent 2.4px),
    radial-gradient(circle at 26px 24px, color-mix(in srgb, var(--paper-accent, #8d7fa2) 28%, transparent) 1.2px, transparent 2px);
  background-size: 38px 38px;
}

.font-round {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

.font-kai {
  font-family: "KaiTi", "STKaiti", "Microsoft YaHei", serif;
}

.font-song {
  font-family: "SimSun", "Songti SC", serif;
}

.font-hand {
  font-family: "Segoe Print", "Comic Sans MS", "KaiTi", cursive;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.media-card {
  position: relative;
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.media-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.media-cover-wrap {
  position: relative;
  overflow: hidden;
}

.media-cover-placeholder {
  display: grid;
  place-items: center;
  color: #8b7b88;
  background: linear-gradient(135deg, #eee7e9, #e7ece7);
}

.media-cover-placeholder svg {
  width: 36px;
  height: 36px;
}

.media-card-body {
  padding: 13px 14px 18px;
  color: var(--note-text-color, var(--ink));
}

.media-card-body h3 {
  margin: 8px 0;
  font-size: 17px;
}

.media-card-body p {
  display: -webkit-box;
  margin: 10px 0 0;
  overflow: hidden;
  color: var(--note-text-color, #665f61);
  font-size: 13px;
  line-height: 1.7;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.media-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.media-type {
  padding: 2px 7px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--type-color, #7d9a89);
  font-weight: 800;
}

.media-card-actions {
  position: absolute;
  top: 9px;
  right: 9px;
}

.media-image-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 9px;
  min-height: 34px;
}

.media-image-item {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f1efea;
}

.image-sticker {
  position: absolute;
  z-index: 3;
  display: grid;
  width: 1em;
  height: 1em;
  place-items: center;
  color: var(--sticker-ink, #896f81);
  cursor: grab;
  filter: drop-shadow(0 3px 5px rgba(49, 43, 47, 0.22));
  touch-action: none;
}

.image-sticker::before {
  position: absolute;
  inset: -12%;
  z-index: -1;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 48% 54% 45% 58%;
  background: var(--sticker-bg, #f2dce5);
  content: "";
}

.image-sticker svg {
  width: 62%;
  height: 62%;
}

.image-sticker button {
  position: absolute;
  top: -6px;
  right: -6px;
  display: none;
  width: 15px;
  height: 15px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #ffffff;
  background: #8d6678;
  cursor: pointer;
}

.image-sticker:hover button {
  display: grid;
  place-items: center;
}

.image-sticker button svg {
  width: 9px;
  height: 9px;
}

.image-sticker.is-dragging {
  cursor: grabbing;
  filter: drop-shadow(0 7px 10px rgba(49, 43, 47, 0.3));
}

.media-image-item.is-active {
  outline: 3px solid rgba(125, 154, 137, 0.32);
  outline-offset: -3px;
}

.media-image-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.media-image-item .icon-button {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 28px;
  min-width: 28px;
  min-height: 28px;
}

.media-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 8px 0;
}

.media-tags span {
  padding: 3px 7px;
  border: 1px solid color-mix(in srgb, var(--tag-color, #7d9a89) 72%, #ffffff);
  border-radius: 999px;
  color: #ffffff;
  background: var(--tag-color, #7d9a89);
  font-size: 11px;
}

.media-progress {
  display: grid;
  gap: 5px;
  margin: 10px 0;
}

.media-progress-preview {
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
}

.media-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.episode-progress {
  display: grid;
  grid-template-columns: repeat(var(--progress-count, 20), minmax(4px, 1fr));
  gap: 3px;
  width: 100%;
}

.episode-progress span {
  height: 13px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--progress-color, #7d9a89) 18%, #e8e6e0);
}

.episode-progress span.is-watched {
  background: var(--progress-color, #7d9a89);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.media-card-actions {
  display: flex;
  gap: 5px;
}

.tag-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 8px;
}

.tag-choice {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  cursor: pointer;
  font-size: 12px;
}

.tag-choice input {
  accent-color: var(--green);
}

.tag-choice span {
  position: relative;
  padding-left: 12px;
}

.tag-choice span::before {
  position: absolute;
  top: 50%;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tag-color, #7d9a89);
  transform: translateY(-50%);
  content: "";
}

.type-manager-list {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.type-manager-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(100px, auto) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.type-manager-row code {
  color: var(--muted);
  font-size: 11px;
}

.summary-section {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.summary-section:first-child {
  padding-top: 0;
}

.summary-section:last-child {
  border-bottom: 0;
}

.summary-section h3 {
  margin: 0 0 6px;
}

.summary-section p {
  margin: 0;
  color: #5f5d59;
  line-height: 1.8;
}

.search-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.relationship-graph {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf6;
}

.relationship-graph svg {
  display: block;
  width: 100%;
  height: auto;
}

.paper-swatch {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid rgba(108, 104, 99, 0.18);
  border-radius: 8px;
  color: #5c5753;
  font-size: 12px;
  font-weight: 800;
}

.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.media-folder {
  position: relative;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 12px;
  min-height: 205px;
  padding: 24px 14px 14px;
  border: 2px solid color-mix(in srgb, var(--folder-color, #8d7fa2) 42%, #ffffff);
  border-radius: 8px;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--folder-color, #8d7fa2) 16%, #fffdf9),
      #fbfaf6 44%
    );
  box-shadow: var(--shadow-soft);
}

.folder-tab {
  position: absolute;
  top: -13px;
  left: 18px;
  width: 96px;
  height: 26px;
  border: 2px solid color-mix(in srgb, var(--folder-color, #8d7fa2) 42%, #ffffff);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: color-mix(in srgb, var(--folder-color, #8d7fa2) 18%, #fffdf9);
}

.folder-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--folder-color, #8d7fa2);
}

.folder-icon svg {
  width: 22px;
  height: 22px;
}

.folder-body {
  min-width: 0;
}

.folder-body h3 {
  margin: 7px 0;
}

.folder-children {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 8px 0;
}

.folder-children span {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
  font-size: 10px;
}

.media-folder .media-card-actions {
  position: absolute;
  top: 9px;
  right: 9px;
}

@media (max-width: 720px) {
  .timeline-section {
    padding-top: 18px;
  }

  .timeline::before,
  .timeline-row::before {
    display: none;
  }

  .timeline-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .month-day {
    min-height: 96px;
    aspect-ratio: 1 / 1.2;
  }

  .month-day-main {
    padding: 7px;
  }

  .month-day-tasks {
    display: none;
  }

  .type-manager-row {
    grid-template-columns: 1fr;
  }

  .media-grid {
    grid-template-columns: 1fr;
  }
}

.sticker-choice {
  --sticker-bg: #eee9e5;
  --sticker-ink: #756b68;
  border-width: 2px;
  border-color: #ffffff;
  background: var(--sticker-bg);
  box-shadow: 0 3px 9px rgba(82, 88, 83, 0.1);
}

.sticker-choice svg {
  color: var(--sticker-ink);
}

.sticker-choice.is-selected,
.sticker-choice:has(input:checked) {
  border-color: color-mix(in srgb, var(--sticker-ink) 32%, #ffffff);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--sticker-ink) 18%, transparent),
    0 5px 12px rgba(82, 88, 83, 0.13);
}

.sticker-flower-2 {
  --sticker-bg: #f3dbe4;
  --sticker-ink: #a45f7c;
}

.sticker-heart {
  --sticker-bg: #f3d8db;
  --sticker-ink: #ae6170;
}

.sticker-star {
  --sticker-bg: #f4e8c8;
  --sticker-ink: #a88945;
}

.sticker-leaf {
  --sticker-bg: #dceadf;
  --sticker-ink: #62836b;
}

.sticker-sparkles {
  --sticker-bg: #e8e0f0;
  --sticker-ink: #79698d;
}

.sticker-ribbon {
  --sticker-bg: #f0ddd2;
  --sticker-ink: #966f58;
}

.sticker-moon {
  --sticker-bg: #e1e7f1;
  --sticker-ink: #65758f;
}

.sticker-cloud {
  --sticker-bg: #e4ebee;
  --sticker-ink: #667d85;
}

.sticker-sun {
  --sticker-bg: #f5dfbd;
  --sticker-ink: #a47438;
}

.sticker-music-2 {
  --sticker-bg: #d9e9e6;
  --sticker-ink: #527c75;
}

.sticker-coffee {
  --sticker-bg: #e8d9cf;
  --sticker-ink: #80604d;
}

.sticker-rainbow {
  --sticker-bg: linear-gradient(135deg, #f2d5dd, #f1e6c6 38%, #d9e9df 68%, #ddd9ed);
  --sticker-ink: #6d6579;
}

.handmade-sticker {
  position: relative;
  width: 35px;
  height: 35px;
  border: 3px solid #ffffff;
  border-radius: 52% 46% 55% 44%;
  color: var(--sticker-ink, #806d7a);
  background: var(--sticker-bg, #f1e6eb);
  box-shadow: 0 4px 10px rgba(82, 88, 83, 0.13);
  transform: rotate(-7deg);
}

.handmade-sticker:nth-child(3n + 2) {
  border-radius: 44% 58% 45% 57%;
  transform: rotate(7deg);
}

.handmade-sticker:nth-child(3n) {
  border-radius: 57% 43% 55% 45%;
  transform: rotate(-3deg);
}

.handmade-sticker::after {
  position: absolute;
  right: 1px;
  bottom: -5px;
  width: 15px;
  height: 7px;
  border-radius: 2px;
  background: rgba(224, 200, 178, 0.66);
  transform: rotate(10deg);
  content: "";
}

.handmade-sticker svg {
  width: 17px;
  height: 17px;
}

@media print {
  body {
    background: #ffffff;
  }

  .sidebar,
  .topbar-actions,
  .task-actions,
  .sync-pill {
    display: none !important;
  }

  .app-shell {
    display: block;
  }

  .topbar {
    position: static;
    border-bottom: 1px solid #cccccc;
    background: #ffffff;
  }

  .main-content {
    width: 100%;
    padding: 16px 0;
  }

  .panel,
  .task-card,
  .month-day,
  .week-day {
    break-inside: avoid;
    box-shadow: none;
  }
}
