:root {
  --cream: #f7f3ea;
  --cream-deep: #efe9dc;
  --surface: #fffdf8;
  --surface-soft: rgba(255, 253, 248, 0.78);
  --ink: #26382b;
  --muted: #59675e;
  --line: rgba(65, 86, 69, 0.13);
  --green: #557553;
  --green-dark: #3f5f40;
  --green-soft: #e9f0e5;
  --danger: #a95f55;
  --shadow: 0 14px 34px rgba(64, 75, 58, 0.09);
  --shadow-soft: 0 7px 20px rgba(64, 75, 58, 0.065);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: #ebe7dd;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: #ebe7dd;
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 255, 255, 0.74), transparent 34%),
    #ebe7dd;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}

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

button {
  color: inherit;
}

button,
[role="button"] {
  touch-action: manipulation;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(111, 147, 107, 0.28);
  outline-offset: 2px;
}

.app-shell {
  position: relative;
  width: 100%;
  max-width: 620px;
  min-height: 100svh;
  margin: 0 auto;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 88% 8%, rgba(205, 221, 194, 0.42), transparent 19rem),
    var(--cream);
}

.screen {
  min-height: 100svh;
  padding: calc(22px + var(--safe-top)) 20px calc(116px + var(--safe-bottom));
  animation: screen-in 220ms ease-out both;
}

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

.home-header {
  position: relative;
  min-height: 208px;
  padding: 7px 4px 15px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.04em;
}

.brand-title {
  max-width: 75%;
  margin: 0;
  color: #315239;
  font-family: "STKaiti", "KaiTi", "PingFang SC", sans-serif;
  font-size: clamp(35px, 9vw, 46px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.04em;
}

.date-line {
  margin: 10px 0 0;
  font-size: 16px;
  font-weight: 650;
}

.greeting {
  margin: 12px 0 4px;
  color: #55665a;
  font-size: 15px;
}

.leaf-art {
  position: absolute;
  top: 0;
  right: -6px;
  width: 146px;
  height: 150px;
  opacity: 0.82;
  pointer-events: none;
}

.progress-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(100%, 360px);
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px solid rgba(95, 125, 91, 0.14);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.62);
  backdrop-filter: blur(12px);
}

.progress-number {
  min-width: 53px;
  color: var(--green-dark);
  font-size: 23px;
  font-weight: 750;
}

.progress-copy {
  flex: 1;
}

.progress-copy strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

.progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(75, 103, 74, 0.12);
}

.progress-fill {
  width: var(--progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--accent, var(--green));
  transition: width 280ms ease;
}

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

.section-heading h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.01em;
}

.section-heading span {
  color: var(--muted);
  font-size: 13px;
}

.section-link {
  min-height: 44px;
  margin: -10px -8px -10px 0;
  padding: 8px;
  border: 0;
  background: transparent;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

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

.module-card {
  position: relative;
  min-height: 136px;
  padding: 15px;
  overflow: hidden;
  border: 1px solid var(--card-border, rgba(95, 125, 91, 0.16));
  border-radius: var(--radius-lg);
  background: var(--card-bg, var(--surface));
  box-shadow: var(--shadow-soft);
  text-align: left;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.module-card:active {
  transform: scale(0.98);
  box-shadow: none;
}

.module-icon {
  display: grid;
  width: 39px;
  height: 39px;
  margin-bottom: 10px;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--card-accent, var(--green));
}

.module-icon svg,
.icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
}

.module-card h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.module-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 7px 0 7px;
  color: var(--muted);
  font-size: 13px;
}

.module-card .progress-track {
  height: 5px;
}

.page-header {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  min-height: 52px;
  margin-bottom: 24px;
}

.page-header-copy {
  min-width: 0;
  text-align: center;
}

.page-header h1 {
  margin: 0;
  overflow: hidden;
  font-size: 25px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.icon-button {
  display: grid;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.7);
  color: var(--green-dark);
  place-items: center;
  cursor: pointer;
}

.icon-button.ghost {
  background: transparent;
}

.task-list {
  display: grid;
  gap: 11px;
}

.task-row {
  position: relative;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  min-height: 74px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--surface-soft);
  box-shadow: 0 5px 18px rgba(64, 75, 58, 0.045);
}

.task-open {
  position: absolute;
  z-index: 1;
  inset: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: pointer;
}

.task-open:focus-visible {
  outline: 3px solid rgba(85, 117, 83, 0.34);
  outline-offset: 2px;
}

.task-time {
  position: relative;
  z-index: 2;
  min-width: 49px;
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 700;
  pointer-events: none;
}

.task-check {
  position: relative;
  z-index: 3;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: white;
  place-items: center;
  cursor: pointer;
}

.task-check::before {
  content: "";
  position: absolute;
  width: 28px;
  height: 28px;
  border: 1.5px solid #9aa59b;
  border-radius: 9px;
  background: transparent;
}

.task-check svg {
  position: relative;
  z-index: 1;
  width: 17px;
  height: 17px;
  stroke: currentColor;
}

.task-check.is-complete {
  background: transparent;
}

.task-check.is-complete::before {
  border-color: var(--green);
  background: var(--green);
}

.task-main {
  position: relative;
  z-index: 2;
  min-width: 0;
  text-align: left;
  pointer-events: none;
}

.task-title {
  display: block;
  overflow: hidden;
  font-size: 16px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.task-subline > span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.task-subline svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
}

.task-row.is-complete .task-title {
  color: #829087;
  text-decoration: line-through;
}

.row-chevron {
  position: relative;
  z-index: 2;
  color: #9ba79e;
  pointer-events: none;
}

.empty-state {
  display: grid;
  min-height: 310px;
  padding: 36px 26px;
  border: 1px dashed rgba(83, 110, 80, 0.2);
  border-radius: var(--radius-xl);
  background: rgba(255, 253, 248, 0.42);
  place-items: center;
  text-align: center;
}

.empty-state svg {
  width: 68px;
  height: 68px;
  color: #9db396;
  stroke: currentColor;
}

.empty-state h2 {
  margin: 14px 0 6px;
  font-size: 20px;
}

.empty-state p {
  max-width: 270px;
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.primary-button,
.secondary-button,
.text-button,
.danger-button {
  min-height: 46px;
  padding: 11px 18px;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
}

.primary-button {
  border: 1px solid var(--green);
  background: var(--green);
  color: white;
  box-shadow: 0 8px 18px rgba(84, 119, 82, 0.2);
}

.secondary-button {
  border: 1px solid rgba(83, 110, 80, 0.18);
  background: var(--surface);
  color: var(--green-dark);
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--green-dark);
}

.danger-button {
  border: 1px solid rgba(169, 95, 85, 0.2);
  background: #fff7f4;
  color: var(--danger);
}

.wide-button {
  width: 100%;
}

.bottom-nav {
  position: fixed;
  z-index: 40;
  bottom: 0;
  left: 50%;
  display: grid;
  grid-template-columns: 1fr 94px 1fr;
  align-items: end;
  width: min(100%, 620px);
  min-height: calc(78px + var(--safe-bottom));
  padding: 10px 24px calc(9px + var(--safe-bottom));
  border-top: 1px solid rgba(70, 91, 72, 0.1);
  background: rgba(255, 253, 248, 0.93);
  box-shadow: 0 -8px 24px rgba(54, 68, 55, 0.045);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.nav-button {
  display: grid;
  min-height: 54px;
  padding: 3px 10px;
  border: 0;
  background: transparent;
  color: #88938b;
  font-size: 12px;
  place-items: center;
  cursor: pointer;
}

.nav-button .icon {
  display: grid;
  place-items: center;
}

.nav-button.is-active {
  color: var(--green-dark);
  font-weight: 700;
}

.fab {
  display: grid;
  width: 66px;
  height: 66px;
  margin: -28px auto 0;
  padding: 0;
  border: 6px solid var(--cream);
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 10px 24px rgba(74, 105, 71, 0.3);
  color: white;
  font-size: 38px;
  font-weight: 300;
  line-height: 1;
  place-items: center;
  cursor: pointer;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -5px 0 16px;
}

.calendar-toolbar strong {
  font-size: 19px;
}

.calendar-card {
  padding: 15px 12px 13px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 253, 248, 0.78);
  box-shadow: var(--shadow-soft);
}

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

.weekdays span {
  padding: 7px 0 9px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.calendar-day {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 48px;
  padding: 5px 2px 10px;
  border: 0;
  border-radius: 15px;
  background: transparent;
  color: var(--ink);
  place-items: center;
  cursor: pointer;
}

.calendar-day.is-outside {
  color: #b9c0ba;
}

.calendar-day.is-today::before,
.calendar-day.is-selected::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 35px;
  height: 35px;
  border-radius: 50%;
}

.calendar-day.is-today::before {
  border: 1px solid #a1b59c;
}

.calendar-day.is-selected {
  color: white;
  font-weight: 750;
}

.calendar-day.is-selected::before {
  background: var(--green);
}

.task-dots {
  position: absolute;
  bottom: 4px;
  display: flex;
  gap: 2px;
}

.task-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--green);
}

.calendar-day.is-selected .task-dots i {
  background: rgba(255, 255, 255, 0.86);
}

.day-agenda {
  margin-top: 24px;
}

.agenda-group {
  margin-bottom: 20px;
}

.agenda-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 2px 9px;
  color: #546659;
  font-size: 14px;
}

.agenda-group-title i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--group-accent, var(--green));
}

.detail-hero {
  padding: 14px 6px 27px;
}

.detail-module {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 13px;
  padding: 6px 10px;
  border-radius: 99px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 700;
}

.detail-hero h1 {
  margin: 0;
  font-size: clamp(29px, 8vw, 40px);
  line-height: 1.3;
}

.detail-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 23px;
  background: rgba(255, 253, 248, 0.82);
  box-shadow: var(--shadow-soft);
}

.detail-row {
  display: grid;
  grid-template-columns: 36px 86px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 68px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

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

.detail-row .icon {
  color: var(--green-dark);
}

.detail-row .label {
  font-weight: 650;
}

.detail-row .value {
  overflow-wrap: anywhere;
  color: var(--muted);
  text-align: right;
}

.detail-actions {
  display: grid;
  gap: 11px;
  margin-top: 30px;
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-top: calc(24px + var(--safe-top));
  background: rgba(31, 42, 33, 0.33);
  backdrop-filter: blur(5px);
  animation: fade-in 160ms ease-out both;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-sheet {
  width: min(100%, 620px);
  max-height: calc(100svh - 24px - var(--safe-top));
  padding: 12px 20px calc(24px + var(--safe-bottom));
  overflow-y: auto;
  border-radius: 28px 28px 0 0;
  background: var(--cream);
  box-shadow: 0 -18px 48px rgba(37, 49, 39, 0.18);
  animation: sheet-in 220ms ease-out both;
}

@keyframes sheet-in {
  from { transform: translateY(28px); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}

.sheet-grabber {
  width: 42px;
  height: 5px;
  margin: 0 auto 18px;
  border-radius: 99px;
  background: #d1d4ce;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.sheet-header h2 {
  margin: 0;
  font-size: 24px;
}

.form-grid {
  display: grid;
  gap: 15px;
}

.field {
  display: grid;
  gap: 8px;
}

.field > span,
.fieldset-label {
  color: #526357;
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid rgba(70, 95, 71, 0.16);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
}

.field textarea {
  min-height: 84px;
  resize: vertical;
}

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

.check-line {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  border: 1px solid rgba(70, 95, 71, 0.16);
  border-radius: 14px;
  background: var(--surface);
}

.switch {
  position: relative;
  width: 48px;
  height: 29px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 99px;
  background: #d8ddd6;
  cursor: pointer;
  transition: background 160ms ease;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 6px rgba(40, 52, 42, 0.18);
  transition: transform 160ms ease;
}

.switch input:checked + span {
  background: var(--green);
}

.switch input:checked + span::after {
  transform: translateX(19px);
}

.weekday-picker {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.weekday-picker label {
  position: relative;
}

.weekday-picker input {
  position: absolute;
  opacity: 0;
}

.weekday-picker span {
  display: grid;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  place-items: center;
  cursor: pointer;
}

.weekday-picker input:checked + span {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 750;
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 10px;
  margin-top: 8px;
}

.helper-text {
  margin: -2px 2px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.data-tool-list {
  display: grid;
  gap: 12px;
}

.data-tool-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.data-tool-icon {
  display: grid;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--green-soft);
  color: var(--green-dark);
  place-items: center;
}

.data-tool-card h3 {
  margin: 1px 0 5px;
  font-size: 16px;
}

.data-tool-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.compact-button {
  min-height: 44px;
  margin-top: 11px;
  padding: 9px 13px;
}

.privacy-note,
.warning-note {
  margin: 14px 2px 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(233, 240, 229, 0.78);
  color: #4e6252;
  font-size: 12px;
  line-height: 1.65;
}

.warning-note {
  margin-bottom: 16px;
  background: #fff2df;
  color: #6a543a;
}

.import-summary {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--line);
}

.import-summary div {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 14px;
  background: var(--surface);
}

.import-summary span {
  color: var(--muted);
  font-size: 13px;
}

.import-summary strong {
  text-align: right;
  font-size: 14px;
}

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

.overdue-item {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.overdue-item h3 {
  margin: 0 0 5px;
  font-size: 16px;
}

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

.overdue-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.overdue-actions button {
  min-height: 44px;
  padding: 8px 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #faf8f2;
  color: #506057;
  font-size: 12px;
  font-weight: 700;
}

.toast-root {
  position: fixed;
  z-index: 200;
  top: calc(18px + var(--safe-top));
  left: 50%;
  display: grid;
  width: min(calc(100% - 32px), 440px);
  gap: 8px;
  pointer-events: none;
  transform: translateX(-50%);
}

.toast {
  padding: 12px 16px;
  border: 1px solid rgba(91, 118, 89, 0.16);
  border-radius: 15px;
  background: rgba(42, 61, 46, 0.94);
  box-shadow: var(--shadow);
  color: white;
  font-size: 13px;
  line-height: 1.5;
  animation: toast-in 220ms ease-out both;
}

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

.notification-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 15px;
  padding: 13px 14px;
  border: 1px solid rgba(207, 156, 93, 0.25);
  border-radius: 16px;
  background: #fff5e6;
  color: #69553c;
  font-size: 13px;
}

.notification-banner button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  border-radius: 11px;
  background: #d89b55;
  color: white;
  font-weight: 700;
}

@media (max-width: 360px) {
  .screen {
    padding-inline: 14px;
  }

  .home-header {
    min-height: 202px;
  }

  .leaf-art {
    width: 120px;
    opacity: 0.58;
  }

  .module-grid {
    gap: 10px;
  }

  .module-card {
    min-height: 132px;
    padding: 14px;
  }

  .task-row {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    gap: 9px;
    padding-inline: 11px;
  }

  .task-time {
    min-width: 43px;
    font-size: 13px;
  }

  .detail-row {
    grid-template-columns: 30px 65px minmax(0, 1fr);
    padding-inline: 12px;
  }
}

@media (min-width: 760px) {
  .app-shell {
    min-height: calc(100svh - 32px);
    margin-block: 16px;
    border: 1px solid rgba(62, 81, 64, 0.11);
    border-radius: 34px;
    box-shadow: 0 25px 70px rgba(54, 66, 52, 0.14);
  }

  .bottom-nav {
    bottom: 16px;
    border-radius: 0 0 34px 34px;
  }
}

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