:root {
  color-scheme: light;
  --paper: #f7f1e4;
  --surface: #fffdf8;
  --surface-deep: #efe5d4;
  --ink: #292721;
  --muted: #777064;
  --line: #292721;
  --line-soft: rgba(41, 39, 33, 0.16);
  --accent: #e66f4b;
  --accent-soft: #f6c8b5;
  --yellow: #f3c759;
  --shadow: 8px 9px 0 rgba(41, 39, 33, 0.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 8% 3%, rgba(243, 199, 89, 0.3), transparent 24rem),
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 36px 36px, 36px 36px, auto;
  color: var(--ink);
  font-family: "Outfit", "Noto Sans SC", sans-serif;
}

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

.paper-noise {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
}

.topbar {
  display: flex;
  width: min(100% - 40px, 1440px);
  min-height: 88px;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto;
  border-bottom: 2px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 14px 11px 15px 9px;
  background: var(--accent);
  transform: rotate(-3deg);
  box-shadow: 3px 3px 0 var(--line);
}

.brand-mark svg {
  width: 31px;
  fill: var(--surface);
  stroke: var(--line);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand strong, .brand small { display: block; }
.brand strong { font-family: "ZCOOL KuaiLe", sans-serif; font-size: 1.25rem; letter-spacing: .05em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: .62rem; font-weight: 800; letter-spacing: .14em; }

.save-state {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: .83rem;
  font-weight: 700;
}

.save-state span {
  width: 9px;
  height: 9px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--accent);
}

.save-state.is-saving span { animation: pulse 700ms ease infinite alternate; }

.page-shell { width: min(100% - 40px, 1440px); margin: 0 auto; padding-bottom: 70px; }

.intro {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, .6fr);
  min-height: 104px;
  align-items: center;
  gap: 16px;
  padding: 10px 3vw 8px;
  overflow: hidden;
}

.intro-copy { position: relative; z-index: 1; }
.eyebrow { margin: 0 0 4px; color: var(--accent); font-size: .54rem; font-weight: 800; letter-spacing: .18em; }
.intro-text { max-width: 570px; margin: 0; color: var(--muted); font-size: .72rem; line-height: 1.55; }

.doodle-scene { display: flex; min-width: 0; align-items: center; justify-content: flex-end; }
.note-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  width: min(100%, 390px);
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 2px solid var(--line);
  border-radius: 4px 8px 6px 3px;
  background: var(--surface);
  transform: rotate(1deg);
  box-shadow: var(--shadow);
}
.note-card::before { content: ""; position: absolute; top: -7px; right: 52px; width: 44px; height: 13px; background: rgba(230, 111, 75, .46); transform: rotate(-2deg); }
.note-card span { color: var(--accent); font-size: .54rem; font-weight: 800; letter-spacing: .1em; white-space: nowrap; }
.note-card textarea { display: block; width: 100%; min-width: 0; min-height: 28px; padding: 4px 6px; overflow: hidden; resize: none; border: 0; border-bottom: 1px dashed var(--line-soft); outline: 0; background: transparent; color: var(--ink); font: 400 .78rem/1.4 "ZCOOL KuaiLe", sans-serif; overflow-wrap: anywhere; }
.note-card:focus-within { transform: rotate(0); background: #fffefa; }

.planner { scroll-margin-top: 20px; border: 2px solid var(--line); background: var(--surface); box-shadow: 12px 14px 0 rgba(41, 39, 33, .13); }
.planner-heading { display: flex; min-height: 118px; align-items: center; justify-content: space-between; gap: 28px; padding: 22px 28px; border-bottom: 2px solid var(--line); }
.month-controls { display: flex; align-items: center; gap: 13px; }
.round-button, .today-button, .topic-form button {
  border: 2px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: transform 180ms cubic-bezier(.16, 1, .3, 1), background 180ms ease;
}
.round-button { display: grid; width: 44px; height: 44px; flex: 0 0 auto; place-items: center; border-radius: 50%; }
.round-button svg, .topic-form button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.round-button:hover, .today-button:hover { background: var(--accent-soft); transform: translateY(-2px); }
.round-button:active, .today-button:active, .topic-form button:active { transform: translateY(1px) scale(.97); }
.month-title { min-width: 168px; }
.month-title span { display: block; color: var(--accent); font-size: .67rem; font-weight: 800; letter-spacing: .18em; }
.month-title h2 { margin: 2px 0 0; font-size: 1.65rem; letter-spacing: -.03em; }
.today-button { min-height: 42px; margin-left: 4px; padding: 0 16px; border-radius: 99px; font-size: .82rem; font-weight: 800; }

.month-stats { display: flex; gap: 0; }
.month-stats div { min-width: 94px; padding: 0 20px; border-left: 1px solid var(--line-soft); text-align: center; }
.month-stats strong, .month-stats span { display: block; }
.month-stats strong { font-family: "Outfit", sans-serif; font-size: 1.55rem; line-height: 1; }
.month-stats span { margin-top: 7px; color: var(--muted); font-size: .73rem; font-weight: 700; }

.week-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 2px solid var(--line); background: var(--surface-deep); }
.week-row span { padding: 11px 8px; border-right: 1px solid var(--line-soft); color: var(--muted); font-size: .75rem; font-weight: 800; text-align: center; }
.week-row span:last-child { border-right: 0; }
.week-row span:nth-last-child(-n+2) { color: var(--accent); }

.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.day-cell { position: relative; display: flex; min-width: 0; min-height: 246px; flex-direction: column; gap: 8px; padding: 12px 10px 10px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); animation: cell-in 420ms both; animation-delay: calc(var(--cell-index) * 16ms); }
.day-cell:nth-child(7n) { border-right: 0; }
.day-cell:nth-last-child(-n+7) { border-bottom: 0; }
.day-cell.is-today { background: rgba(243, 199, 89, .16); }
.day-cell.is-today::after { content: ""; position: absolute; inset: 4px; pointer-events: none; border: 2px dashed var(--accent); border-radius: 12px 9px 14px 8px; }
.day-header { position: relative; z-index: 1; display: flex; min-height: 27px; align-items: center; justify-content: space-between; }
.day-number { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; font-size: .88rem; font-weight: 800; }
.is-today .day-number { background: var(--accent); color: var(--surface); }
.day-labels { display: flex; min-width: 0; align-items: center; gap: 4px; }
.solar-term-label { display: none; padding: 3px 6px; border: 1px solid var(--line); border-radius: 99px; font-size: .56rem; font-weight: 800; white-space: nowrap; }
.day-cell.has-solar-term .solar-term-label { display: inline-block; background: var(--yellow); }
.today-label { display: none; padding: 3px 7px; border: 1px solid var(--line); border-radius: 99px; background: var(--yellow); font-size: .6rem; font-weight: 800; transform: rotate(2deg); }
.is-today .today-label { display: inline-block; }
.holiday-label { display: none; max-width: 74px; overflow: hidden; padding: 3px 6px; border: 1px solid var(--accent); border-radius: 99px; background: var(--surface); color: var(--accent); font-size: .58rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.day-cell.is-holiday { background: rgba(230, 111, 75, .06); }
.day-cell.is-holiday .holiday-label { display: inline-block; }

.daily-hot-topic { position: relative; z-index: 1; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; overflow: hidden; border: 1px dashed var(--accent); border-radius: 5px; background: rgba(246, 200, 181, .22); }
.daily-hot-topic span { padding-left: 6px; color: var(--accent); font-size: .64rem; font-weight: 800; white-space: nowrap; }
.daily-hot-topic textarea { display: block; width: 100%; min-width: 0; min-height: 27px; padding: 5px 6px; overflow: hidden; resize: none; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: .68rem; line-height: 1.45; overflow-wrap: anywhere; }
.daily-hot-topic:focus-within { border-style: solid; background: var(--surface); }
.daily-hot-topic textarea::placeholder { color: #b3ab9e; }

.fixed-topics { position: relative; z-index: 1; display: grid; gap: 5px; }
.fixed-topic { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; overflow: hidden; border: 1px solid var(--line-soft); border-radius: 5px; background: rgba(255, 253, 248, .82); }
.fixed-topic label { padding-left: 6px; color: var(--accent); font-size: .66rem; font-weight: 800; white-space: nowrap; }
.fixed-topic label { padding-top: 5px; }
.fixed-topic textarea { display: block; width: 100%; min-width: 0; min-height: 27px; padding: 5px 6px 5px 2px; overflow: hidden; resize: none; border: 0; outline: none; background: transparent; color: var(--ink); font: inherit; font-size: .68rem; line-height: 1.45; overflow-wrap: anywhere; }
.fixed-topic:focus-within { border-color: var(--accent); background: var(--surface); }
.fixed-topic textarea::placeholder { color: #b3ab9e; }
.rest-note { margin: 12px 0 auto; color: #a0998d; font-size: .7rem; font-weight: 700; line-height: 1.55; text-align: center; }

.topic-list { position: relative; z-index: 1; display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.topic-item { display: grid; grid-template-columns: 18px minmax(0, 1fr) 19px; gap: 5px; align-items: start; padding: 6px 5px; border-left: 3px solid var(--accent); border-radius: 2px 6px 6px 2px; background: var(--accent-soft); animation: item-in 220ms cubic-bezier(.16, 1, .3, 1); }
.topic-item.is-done { border-left-color: var(--muted); background: var(--surface-deep); color: var(--muted); }
.topic-item.is-done .topic-text { text-decoration: line-through; }
.check-topic, .delete-topic { display: grid; width: 18px; height: 18px; place-items: center; padding: 0; border: 0; background: transparent; cursor: pointer; }
.check-topic { border: 1.5px solid currentColor; border-radius: 5px; }
.check-topic svg, .delete-topic svg { width: 13px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.check-topic svg { opacity: 0; }
.is-done .check-topic svg { opacity: 1; }
.delete-topic { opacity: 0; transition: opacity 160ms ease; }
.topic-item:hover .delete-topic, .delete-topic:focus-visible { opacity: 1; }
.topic-text { min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; font-size: .72rem; font-weight: 600; line-height: 1.4; }

.topic-form { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) 28px; gap: 5px; margin-top: auto; }
.topic-form label { min-width: 0; }
.topic-form textarea { display: block; width: 100%; min-height: 30px; padding: 5px 7px; overflow: hidden; resize: none; border: 1px dashed transparent; border-radius: 5px; outline: none; background: transparent; color: var(--ink); font: inherit; font-size: .7rem; line-height: 1.45; overflow-wrap: anywhere; }
.topic-form textarea::placeholder { color: #a0998d; }
.topic-form:hover textarea, .topic-form textarea:focus { border-color: var(--line-soft); background: var(--surface); }
.topic-form textarea:focus { border-style: solid; border-color: var(--accent); }
.topic-form button { display: grid; width: 28px; height: 28px; place-items: center; border-width: 1px; border-radius: 50%; background: var(--surface); opacity: .55; }
.topic-form:focus-within button, .topic-form:hover button { opacity: 1; background: var(--yellow); }
.topic-form button svg { width: 15px; }

.planner-footer { display: flex; align-items: center; gap: 20px; padding: 20px 28px; border-top: 2px solid var(--line); background: var(--surface-deep); }
.planner-footer p { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.6; }
.tip-mark { display: inline-block; margin-right: 7px; padding: 2px 6px; border: 1px solid var(--line); background: var(--yellow); color: var(--ink); font-size: .62rem; font-weight: 800; transform: rotate(-2deg); }

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@keyframes cell-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes item-in { from { opacity: 0; transform: scale(.94) translateY(3px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes sun-float { 0%, 100% { transform: rotate(-3deg) translateY(0); } 50% { transform: rotate(3deg) translateY(-8px); } }
@keyframes pulse { from { transform: scale(.75); opacity: .5; } to { transform: scale(1.1); opacity: 1; } }

@media (max-width: 960px) {
  .intro { grid-template-columns: minmax(0, 1fr) 300px; padding-inline: 0; }
  .planner-heading { align-items: flex-start; }
  .month-stats div { min-width: 74px; padding: 0 12px; }
  .day-cell { min-height: 246px; padding-inline: 7px; }
}

@media (max-width: 760px) {
  .topbar, .page-shell { width: min(100% - 24px, 1440px); }
  .topbar { min-height: 72px; }
  .brand-mark { width: 40px; height: 40px; }
  .save-state { font-size: 0; }
  .intro { grid-template-columns: 1fr; min-height: auto; padding: 16px 0 14px; }
  .doodle-scene { justify-content: stretch; }
  .note-card { width: 100%; }
  .planner { border-left: 0; border-right: 0; box-shadow: 7px 9px 0 rgba(41, 39, 33, .12); }
  .planner-heading { display: grid; padding: 18px 12px; }
  .month-controls { display: grid; grid-template-columns: 40px minmax(130px, 1fr) 40px; width: 100%; }
  .round-button { width: 40px; height: 40px; }
  .today-button { grid-column: 1 / -1; width: 100%; margin: 0; }
  .month-title { min-width: 0; text-align: center; }
  .month-stats { width: 100%; justify-content: center; border-top: 1px solid var(--line-soft); padding-top: 16px; }
  .month-stats div:first-child { border-left: 0; }
  .week-row { position: sticky; top: 0; z-index: 5; }
  .week-row span { padding-inline: 2px; font-size: .64rem; }
  .calendar-grid { display: block; }
  .day-cell { min-height: 238px; padding: 12px; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .day-cell:nth-last-child(-n+7) { border-bottom: 1px solid var(--line-soft); }
  .day-cell:last-child { border-bottom: 0; }
  .day-header { justify-content: flex-start; gap: 8px; }
  .day-header::after { content: attr(data-weekday); color: var(--muted); font-size: .68rem; font-weight: 700; }
  .topic-item { grid-template-columns: 21px minmax(0, 1fr) 24px; padding: 8px 7px; }
  .topic-text { font-size: .8rem; }
  .fixed-topic label { font-size: .76rem; }
  .fixed-topic textarea { min-height: 34px; font-size: .78rem; }
  .daily-hot-topic span { font-size: .74rem; }
  .daily-hot-topic textarea { min-height: 34px; font-size: .78rem; }
  .check-topic, .delete-topic { width: 21px; height: 21px; }
  .delete-topic { opacity: .6; }
  .topic-form { grid-template-columns: minmax(0, 1fr) 34px; }
  .topic-form textarea { min-height: 36px; font-size: .78rem; border-color: var(--line-soft); background: var(--surface); }
  .topic-form button { width: 34px; height: 34px; }
  .planner-footer { padding: 18px 12px; }
}

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