:root {
  --bg: #fff7f5;
  --surface: #ffffff;
  --surface-soft: #fff0ed;
  --ink: #2f2630;
  --muted: #7c6d75;
  --line: #efd9d3;
  --peach: #f6a993;
  --rose: #ec7f92;
  --mint: #a6d8cb;
  --sage: #6b9f92;
  --cream: #fff5d7;
  --blue: #d6e8f8;
  --shadow: 0 18px 50px rgba(129, 82, 75, 0.14);
  --radius: 22px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100%;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 0%, rgba(246, 169, 147, 0.22), transparent 32rem),
    linear-gradient(180deg, #fff7f5 0%, #fffaf2 52%, #f6fbf8 100%);
}

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

.app-shell {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 14px) 16px calc(env(safe-area-inset-bottom) + 92px);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: center;
  padding: 10px 0 12px;
  background: linear-gradient(180deg, rgba(255, 247, 245, 0.98), rgba(255, 247, 245, 0.88));
  backdrop-filter: blur(18px);
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(20px, 5vw, 30px);
  line-height: 1.08;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 22px rgba(129, 82, 75, 0.1);
}

.icon-button.is-hidden {
  opacity: 0;
  pointer-events: none;
}

svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.hero {
  display: grid;
  gap: 14px;
  margin: 4px 0 22px;
}

.hero-copy {
  padding: 22px;
  border: 1px solid rgba(239, 217, 211, 0.9);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 240, 237, 0.88)),
    linear-gradient(90deg, rgba(166, 216, 203, 0.24), rgba(246, 169, 147, 0.16));
  box-shadow: var(--shadow);
}

.hero-copy h2 {
  margin: 12px 0 0;
  font-size: clamp(25px, 8vw, 42px);
  line-height: 1.04;
  letter-spacing: 0;
}

.hero-copy p,
.section-heading p,
.detail-summary p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 7px 11px;
  border-radius: 999px;
  color: #78514d;
  background: var(--cream);
  font-size: 12px;
  font-weight: 800;
}

.progress-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 14px;
  align-items: center;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 28px rgba(129, 82, 75, 0.08);
}

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

.progress-card strong {
  font-size: 26px;
}

.meter {
  grid-column: 1 / -1;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #f1e1dc;
}

.meter i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--peach), var(--sage));
  transition: width 240ms ease;
}

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

.section-heading h2,
.detail-summary h2 {
  margin-bottom: 2px;
  font-size: 20px;
}

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

.sheet-button {
  position: relative;
  min-height: 128px;
  padding: 15px;
  border: 1px solid rgba(239, 217, 211, 0.9);
  border-radius: var(--radius);
  text-align: left;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 14px 36px rgba(129, 82, 75, 0.09);
}

.sheet-button:nth-child(3n + 2) {
  background: #f7fbf8;
}

.sheet-button:nth-child(4n) {
  background: #fffaf0;
}

.sheet-button .sheet-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 15px;
  color: #80504d;
  background: var(--surface-soft);
}

.sheet-button strong {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
  line-height: 1.22;
}

.sheet-button small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.sheet-button .badge {
  position: absolute;
  right: 12px;
  top: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #476a61;
  background: #e5f4ef;
  font-size: 11px;
  font-weight: 800;
}

.detail-view {
  animation: rise 220ms ease;
}

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

.detail-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 4px 0 14px;
  padding: 18px;
  border-radius: 25px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.mini-progress {
  flex: 0 0 74px;
  width: 74px;
  height: 74px;
  display: grid;
  place-content: center;
  text-align: center;
  border-radius: 50%;
  background: conic-gradient(var(--sage) var(--progress, 0%), #efe0dc 0);
  box-shadow: inset 0 0 0 8px #fff;
}

.mini-progress strong {
  font-size: 18px;
}

.mini-progress span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.toolbar {
  position: sticky;
  top: 78px;
  z-index: 7;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 10px;
  padding: 10px 0;
  background: linear-gradient(180deg, rgba(255, 247, 245, 0.96), rgba(255, 247, 245, 0.84));
  backdrop-filter: blur(18px);
}

.search-box {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
  padding: 0 12px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.search-box svg {
  width: 18px;
  color: var(--muted);
}

input,
select,
textarea {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

select {
  height: 48px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

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

.zone-card {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px 14px;
  align-items: center;
  min-height: 116px;
  padding: 17px;
  border: 1px solid rgba(239, 217, 211, 0.92);
  border-radius: 23px;
  text-align: left;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 14px 34px rgba(129, 82, 75, 0.09);
}

.zone-card:nth-child(2) {
  background: #f7fbf8;
}

.zone-card:nth-child(3) {
  background: #fffaf0;
}

.zone-icon {
  grid-row: span 3;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #80504d;
  background: var(--surface-soft);
}

.zone-card strong {
  display: block;
  font-size: 18px;
  line-height: 1.25;
}

.zone-card small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.zone-card em {
  display: inline-flex;
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  color: #476a61;
  background: #e5f4ef;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.check-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 26px;
  gap: 10px;
  align-items: center;
  min-height: 78px;
  padding: 12px 12px 12px 10px;
  border: 1px solid rgba(239, 217, 211, 0.92);
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 24px rgba(129, 82, 75, 0.08);
}

.check-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
}

.check-toggle input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.check-toggle span {
  width: 26px;
  height: 26px;
  border: 2px solid #d8beb7;
  border-radius: 9px;
  background: #fff;
  box-shadow: inset 0 0 0 3px #fff;
}

.check-toggle input:checked + span {
  border-color: var(--sage);
  background: var(--sage);
}

.check-toggle input:checked + span::after {
  content: "";
  display: block;
  width: 10px;
  height: 6px;
  margin: 6px auto 0;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
}

.check-title {
  min-width: 0;
  border: 0;
  padding: 6px 0;
  text-align: left;
  color: var(--ink);
  background: transparent;
}

.check-title strong {
  display: block;
  margin-bottom: 5px;
  overflow-wrap: anywhere;
  font-size: 16px;
  line-height: 1.28;
}

.check-title small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.chevron {
  width: 22px;
  height: 22px;
  color: #b59088;
}

.item-view {
  animation: rise 220ms ease;
}

.item-panel {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid rgba(239, 217, 211, 0.92);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.item-panel h2 {
  margin: 0;
  font-size: clamp(26px, 8vw, 42px);
  line-height: 1.08;
  letter-spacing: 0;
}

.item-status-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 17px;
  background: #fff8f5;
}

.item-status-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.item-detail-grid {
  display: grid;
  gap: 11px;
}

.item-field {
  padding: 14px;
  border-radius: 18px;
  background: #fbf4f1;
}

.item-field span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.item-field strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.5;
}

.item-input input {
  width: 100%;
  min-height: 46px;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-size: 16px;
  font-weight: 800;
}

.item-input input::placeholder {
  color: #b99a93;
  font-weight: 700;
}

.record-card {
  border: 1px solid rgba(239, 217, 211, 0.92);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 28px rgba(129, 82, 75, 0.08);
  overflow: hidden;
}

.record-main {
  padding: 15px;
}

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

.record-title h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.28;
}

.status-chip {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  color: #78514d;
  background: var(--cream);
  font-size: 12px;
  font-weight: 800;
}

.status-chip.done {
  color: #38695f;
  background: #dff2ec;
}

.status-chip.buy {
  color: #38695f;
  background: #dff2ec;
}

.status-chip.delay {
  color: #73505f;
  background: #f9dce4;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 13px;
}

.field {
  min-width: 0;
  padding: 10px;
  border-radius: 14px;
  background: #fbf4f1;
}

.field span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.field strong,
.field a {
  display: block;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  text-decoration: none;
}

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

.record-actions {
  display: grid;
  gap: 10px;
  padding: 13px 15px 15px;
  border-top: 1px solid #f0dfda;
  background: #fffaf8;
}

.action-row {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

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

.action-row input,
.action-row select,
.action-row textarea {
  min-height: 42px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.action-row textarea {
  resize: vertical;
}

.empty-state {
  padding: 28px;
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
}

.bottom-nav {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 12px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: min(calc(100% - 28px), 430px);
  padding: 8px;
  border: 1px solid rgba(239, 217, 211, 0.95);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 40px rgba(83, 52, 49, 0.16);
  backdrop-filter: blur(18px);
}

.bottom-nav button {
  display: grid;
  place-items: center;
  gap: 2px;
  min-height: 54px;
  border: 0;
  border-radius: 18px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}

.bottom-nav button.active {
  color: #74433e;
  background: var(--surface-soft);
}

.bottom-nav svg {
  width: 20px;
  height: 20px;
}

@media (min-width: 700px) {
  .app-shell {
    padding-left: 28px;
    padding-right: 28px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) 260px;
    align-items: stretch;
  }

  .progress-card {
    align-content: center;
  }

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

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

  .record-list:has(.check-card) {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 390px) {
  .sheet-grid,
  .field-grid {
    grid-template-columns: 1fr;
  }

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

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