:root {
  --bg: #f5f8f6;
  --surface: #ffffff;
  --surface-soft: #f1f6f4;
  --ink: #1c2723;
  --muted: #65736d;
  --line: #dce5df;
  --green: #4f8f72;
  --green-dark: #2f6d54;
  --green-deep: #1f4f3c;
  --mint: #eaf6ef;
  --blue: #577da9;
  --blue-soft: #eef4fb;
  --amber: #c99137;
  --amber-soft: #fff6df;
  --peach: #fff2e8;
  --cream: #fffaf0;
  --rose: #be6b64;
  --shadow: 0 18px 45px rgba(31, 55, 45, 0.12);
  --shadow-soft: 0 10px 24px rgba(31, 55, 45, 0.08);
  font-family:
    "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(255, 214, 107, 0.22), transparent 34%),
    radial-gradient(circle at 92% 12%, rgba(244, 166, 160, 0.18), transparent 30%),
    linear-gradient(180deg, #fffaf2 0%, #f2f8f1 48%, #fff8ef 100%);
  color: var(--ink);
}

html,
body {
  width: 100%;
  overflow-x: hidden;
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  position: relative;
  width: 100%;
  max-width: 390px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 16px 16px 98px;
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.86), rgba(248, 250, 247, 0.94)),
    var(--bg);
  overflow-x: hidden;
}

.topbar,
.section-heading,
.month-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.section-heading {
  flex-wrap: wrap;
}

.topbar {
  margin-bottom: 16px;
  border: 1px solid rgba(220, 229, 223, 0.9);
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 246, 226, 0.9) 46%, rgba(241, 248, 244, 0.96)),
    var(--surface);
  box-shadow: var(--shadow-soft);
}

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

.brand-mark {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffe08a, #f4a6a0);
  box-shadow: 0 10px 22px rgba(201, 145, 55, 0.22);
}

.brand-mark::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: #fff8ec;
  box-shadow:
    0 -13px 0 -9px #fff8ec,
    0 13px 0 -9px #fff8ec,
    13px 0 0 -9px #fff8ec,
    -13px 0 0 -9px #fff8ec;
}

.brand-mark span {
  position: absolute;
  left: 18px;
  top: 22px;
  width: 9px;
  height: 5px;
  border: 2px solid #8a6327;
  border-top: 0;
  border-radius: 0 0 10px 10px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 23px;
}

h2 {
  font-size: 22px;
}

.tagline {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.icon-button,
.small-button,
.primary-button,
.nav-button {
  border: 0;
  cursor: pointer;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--green-dark);
  font-size: 18px;
  box-shadow: 0 6px 14px rgba(31, 55, 45, 0.06);
}

.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notice {
  margin: 0 0 14px;
  padding: 13px 14px;
  border: 1px solid #ecd7ad;
  border-radius: 8px;
  background: #fff8e8;
  color: #5a4420;
  box-shadow: var(--shadow-soft);
}

.notice button {
  margin-top: 10px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.date-control {
  display: grid;
  gap: 4px;
  flex: 1 1 140px;
  min-width: 0;
  max-width: 180px;
  color: var(--muted);
  font-size: 12px;
}

.date-control input,
.text-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.date-control input {
  min-height: 38px;
  padding: 0 9px;
}

.checkin-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.field-group,
.text-field,
.review-box,
.metric-card,
.record-card,
.today-summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-soft);
}

.today-summary {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding: 16px;
  border-color: rgba(79, 143, 114, 0.4);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(243, 248, 245, 0.98) 100%),
    var(--surface);
  box-shadow: 0 18px 45px rgba(47, 109, 84, 0.14);
}

.summary-kicker {
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 900;
}

.today-summary h3 {
  margin: 0;
  font-size: 21px;
  letter-spacing: 0;
}

.today-summary p,
.today-summary blockquote {
  margin: 0;
  line-height: 1.65;
}

.today-summary .summary-text {
  color: var(--ink);
  font-size: 16px;
}

.today-summary blockquote {
  border-left: 3px solid rgba(79, 143, 114, 0.35);
  padding: 6px 0 6px 10px;
  color: var(--green-dark);
}

.summary-actions {
  display: grid;
  margin-top: 4px;
}

.field-group {
  display: grid;
  gap: 10px;
  min-width: 0;
  min-inline-size: 0;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 14px;
}

.field-group legend {
  color: var(--green-deep);
}

.field-group.compact {
  box-shadow: none;
}

legend {
  padding: 0;
  font-weight: 800;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.option-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  min-width: 0;
  width: 100%;
}

.option-cards.three,
.option-cards.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.segmented label,
.tag-grid label,
.choice-stack label {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  cursor: pointer;
}

.segmented label {
  display: grid;
  place-items: center;
  padding: 9px 7px;
  text-align: center;
  font-size: 14px;
}

.choice-stack {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.choice-stack label {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
}

.option-card {
  position: relative;
  display: grid;
  gap: 4px;
  min-height: 78px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: linear-gradient(180deg, #ffffff, #fbfdfc);
  box-shadow: 0 8px 18px rgba(31, 55, 45, 0.04);
  cursor: pointer;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    transform 140ms ease,
    box-shadow 140ms ease;
}

.option-card:active {
  transform: scale(0.99);
}

.option-card input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.option-title {
  font-size: 16px;
  font-weight: 900;
  line-height: 1.2;
}

.option-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

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

.tag-grid label {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px;
  font-size: 13px;
  line-height: 1.3;
}

input[type="radio"],
input[type="checkbox"] {
  accent-color: var(--green);
}

.segmented label:has(input:checked),
.choice-stack label:has(input:checked),
.tag-grid label:has(input:checked),
.option-card:has(input:checked) {
  border-color: var(--green);
  background: linear-gradient(180deg, #f4faf7, #eaf4ee);
  color: var(--green-dark);
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(79, 143, 114, 0.15);
}

.option-card:has(input:checked)::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(79, 143, 114, 0.15);
}

.option-card:has(input:checked) .option-hint {
  color: var(--green-dark);
}

.helper-text,
.save-status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.review-box {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-color: #ead8ad;
  background: linear-gradient(180deg, #fffef9, #fff9e9);
}

.review-title strong {
  display: block;
  font-size: 15px;
}

.text-field {
  display: grid;
  gap: 8px;
  padding: 14px;
  font-weight: 800;
}

.text-field textarea {
  min-height: 88px;
  padding: 11px 12px;
  resize: vertical;
  font-weight: 400;
  line-height: 1.5;
}

.primary-button,
.small-button {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 800;
}

.primary-button {
  background: linear-gradient(135deg, var(--green-dark), #3e8567);
  color: white;
  box-shadow: 0 12px 24px rgba(47, 109, 84, 0.22);
}

.small-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 6px 14px rgba(31, 55, 45, 0.05);
}

.small-button.ghost {
  min-height: 34px;
  padding: 0 11px;
  color: var(--green-dark);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.metric-card {
  min-height: 128px;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 250, 240, 0.92)),
    var(--surface);
}

.metric-illustration {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  margin-bottom: 8px;
  border-radius: 8px;
  background: var(--cream);
}

.metric-illustration svg {
  width: 32px;
  height: 32px;
}

.metric-card strong {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.metric-card span {
  font-size: 25px;
  font-weight: 900;
  color: var(--green-deep);
}

.metric-card em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.month-header {
  margin: 22px 0 12px;
}

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

.calendar-cell,
.calendar-head {
  display: grid;
  min-height: 48px;
  place-items: center;
  border-radius: 8px;
  font-size: 13px;
}

.calendar-head {
  min-height: 26px;
  color: var(--muted);
  font-weight: 800;
}

.calendar-cell {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 14px rgba(31, 55, 45, 0.04);
  gap: 1px;
  padding: 4px 0;
  color: var(--ink);
  cursor: pointer;
}

.calendar-day {
  font-weight: 800;
}

.calendar-icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
}

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

.calendar-cell.empty {
  border: 0;
  background: transparent;
}

.calendar-cell.steady {
  border-color: rgba(240, 169, 58, 0.55);
  background: #fff8df;
}

.calendar-cell.paused {
  border-color: rgba(79, 143, 114, 0.45);
  background: #edf8f1;
}

.calendar-cell.repaired {
  border-color: rgba(244, 166, 160, 0.55);
  background: #fff0ee;
}

.calendar-cell.unrepaired {
  border-color: rgba(87, 125, 169, 0.42);
  background: #f0f4fb;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.7);
}

.legend-icon {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  font-style: normal;
}

.legend-icon::before {
  font-size: 15px;
  line-height: 1;
}

.legend-icon.sun::before {
  content: "☀";
}

.legend-icon.leaf::before {
  content: "☘";
}

.legend-icon.heart::before {
  content: "♥";
  color: #e48f88;
}

.legend-icon.moon::before {
  content: "☾";
  color: #6a7fa6;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.dot.steady {
  background: var(--green);
}

.dot.paused {
  background: var(--blue);
}

.dot.repaired {
  background: var(--amber);
}

.dot.unrepaired {
  background: var(--rose);
}

.record-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.record-card {
  display: grid;
  gap: 10px;
  padding: 15px;
  background: linear-gradient(180deg, #ffffff, #fbfdfc);
}

.record-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.record-status {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--cream);
}

.record-status.sun {
  background: #fff8df;
}

.record-status.leaf {
  background: #edf8f1;
}

.record-status.heart {
  background: #fff0ee;
}

.record-status.moon {
  background: #f0f4fb;
}

.record-status svg {
  width: 27px;
  height: 27px;
}

.record-card h3 {
  margin: 0;
  font-size: 17px;
}

.record-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.record-card .record-text {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.7;
}

.record-card blockquote {
  margin: 2px 0 0;
  border-left: 3px solid rgba(79, 143, 114, 0.35);
  padding: 6px 0 6px 10px;
  color: var(--green-dark);
  line-height: 1.6;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  border-radius: 999px;
  padding: 5px 8px;
  background: var(--surface-soft);
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
}

.empty-state {
  padding: 26px 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(calc(100% - 24px), 366px);
  transform: translateX(-50%);
  border: 1px solid rgba(220, 229, 223, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 38px rgba(31, 55, 45, 0.16);
  overflow: hidden;
}

.nav-button {
  min-height: 58px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.nav-button.active {
  background: linear-gradient(180deg, rgba(241, 248, 244, 0.95), rgba(232, 244, 236, 0.95));
  color: var(--green-dark);
}

.hidden {
  display: none !important;
}

@media (min-width: 780px) {
  body {
    padding: 28px 0;
  }

  .app-shell {
    min-height: calc(100vh - 56px);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
  }

  .bottom-nav {
    bottom: 18px;
    border-right: 1px solid var(--line);
    border-left: 1px solid var(--line);
  }
}

@media (max-width: 370px) {
  .metric-grid,
  .segmented,
  .option-cards.three,
  .option-cards.two {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 520px) {
  .app-shell {
    margin: 0;
  }

  .bottom-nav {
    left: 12px;
    transform: none;
  }
}
