* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #e8ebe2;
  color: #213b30;
  font:
    15px/1.6 "Microsoft YaHei",
    "PingFang SC",
    sans-serif;
}
main {
  max-width: 510px;
  margin: auto;
  background: #faf9f3;
  min-height: 100dvh;
  box-shadow: 0 0 80px #273b3010;
  padding: 0 22px 94px;
}
header,
.row,
.line,
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
header {
  padding: 20px 0 14px;
  border-bottom: 1px solid #d7dccf;
}
header b {
  font-size: 21px;
  letter-spacing: 2px;
}
.mark {
  display: inline-grid;
  place-items: center;
  background: #243e32;
  color: #ecfaad;
  width: 31px;
  height: 31px;
  border-radius: 10px 2px 10px 2px;
  margin-right: 8px;
  font-size: 19px;
}
small,
.muted {
  color: #5b7063;
  font-size: 12px;
}
h1 {
  font:
    700 33px/1.25 "Songti SC",
    SimSun,
    serif;
  letter-spacing: 1px;
  margin: 20px 0 6px;
}
h2 {
  font-size: 18px;
  margin: 22px 0 12px;
}
p {
  margin: 6px 0 14px;
}
.hero {
  background: #244736;
  color: #fcfff0;
  padding: 22px;
  border-radius: 22px;
  margin: 15px 0;
}
.hero small {
  color: #d7e2d2;
}
.big {
  font:
    500 52px/1.15 Georgia,
    serif;
  letter-spacing: -2px;
}
.unit {
  font-size: 13px;
  margin-left: 5px;
}
.track {
  height: 7px;
  background: #4e6958;
  border-radius: 5px;
  margin: 13px 0;
}
.track i {
  display: block;
  height: 100%;
  background: #dcec9c;
  border-radius: 5px;
}
.hero .numbers {
  display: flex;
  gap: 26px;
}
.numbers b {
  display: block;
  font-size: 18px;
}
.card {
  background: white;
  border: 1px solid #dde1d5;
  border-radius: 17px;
  padding: 16px;
  margin: 12px 0;
}
.line {
  align-items: center;
  border-bottom: 1px solid #ebede4;
  padding: 11px 0;
}
.line:last-child {
  border: 0;
}
.line strong {
  display: block;
}
.line .value {
  white-space: nowrap;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button {
  background: #edf0e6;
  border: 0;
  border-radius: 11px;
  padding: 9px 12px;
  cursor: pointer;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #af752a;
}
button:hover {
  filter: brightness(0.96);
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
.primary {
  background: #284c39;
  color: white;
  font-weight: 700;
}
.action {
  background: #dfeca6;
  color: #203928;
  font-weight: 700;
}
.full {
  width: 100%;
  margin-top: 12px;
}
.pair,
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.pair button {
  padding: 13px;
}
.mini {
  font-size: 12px;
  padding: 7px 10px;
}
.badge {
  background: #eaf0da;
  color: #47603a;
  border-radius: 20px;
  padding: 4px 9px;
  font-size: 11px;
}
.date {
  font:
    15px Georgia,
    serif;
  letter-spacing: 0.5px;
}
.section {
  margin: 20px 0 8px;
}
.section h2 {
  margin: 0;
}
input,
select,
textarea {
  display: block;
  width: 100%;
  min-width: 0;
  border: 1px solid #cfd9c9;
  border-radius: 9px;
  background: #fff;
  padding: 9px;
  margin-top: 4px;
}
label {
  display: block;
  font-size: 13px;
}
label + label {
  margin-top: 9px;
}
.fields label {
  margin: 0;
}
textarea {
  resize: vertical;
  min-height: 78px;
}
nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 510px);
  background: #faf9f3f8;
  border-top: 1px solid #d9dece;
  padding: 7px 12px max(8px, env(safe-area-inset-bottom));
  z-index: 2;
}
nav button {
  flex: 1;
  font-size: 12px;
  padding: 5px;
  background: transparent;
  color: #607065;
}
nav b {
  display: block;
  font-size: 19px;
  line-height: 1.3;
}
nav .sel,
.tabs .sel,
.grid .sel {
  background: #e0ebbf;
  color: #274432;
}
.tabs {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.tabs button {
  font-size: 13px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  gap: 3px;
}
.grid button {
  height: 40px;
  background: transparent;
  padding: 0;
  position: relative;
}
.grid button.has:after {
  content: "";
  display: block;
  width: 4px;
  height: 4px;
  background: #688739;
  border-radius: 50%;
  margin: 0 auto;
}
.grid button.sel {
  background: #dce9b8;
}
.grid small {
  padding: 6px 0;
}
.bargrid {
  display: flex;
  align-items: end;
  height: 82px;
  gap: 3px;
  border-bottom: 1px solid #ccd7c6;
}
.bargrid span {
  flex: 1;
  background: #839b66;
  border-radius: 3px 3px 0 0;
}
.hint {
  background: #f5ecd9;
  padding: 9px;
  border-radius: 8px;
  font-size: 13px;
}
.portion {
  width: 82px;
}
output {
  display: block;
}
dialog {
  width: min(360px, 90vw);
  border: 1px solid #ced9c8;
  border-radius: 17px;
  background: #fafaf5;
  color: inherit;
}
dialog::backdrop {
  background: #14291d55;
}
.icon {
  background: #eaf0dc;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 18px;
}
.left {
  display: flex;
  align-items: center;
  gap: 10px;
}
#toast {
  position: fixed;
  bottom: 82px;
  left: 50%;
  transform: translateX(-50%);
  background: #233e30;
  color: white;
  padding: 7px 15px;
  border-radius: 20px;
  z-index: 3;
  pointer-events: none;
}
#toast:empty {
  display: none;
}
.record-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}
.remove {
  background: #f7ede9;
  color: #874333;
}
.card details {
  font-size: 13px;
}
.card summary {
  cursor: pointer;
}
a {
  color: #35603c;
}
body {
  background: #e9ecf1;
  color: #1d1d1f;
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
main {
  background: #f5f5f7;
  max-width: 540px;
  padding: 0 clamp(15px, 4vw, 26px) 100px;
  box-shadow: 0 12px 90px #17213c12;
}
header {
  border-color: #dddfe5;
  padding: 17px 0;
}
header b {
  font-size: 20px;
  letter-spacing: 0.04em;
}
.mark {
  background: #1d1d1f;
  color: #fff;
  border-radius: 10px;
}
.big,
.date,
h1 {
  font-family: inherit;
}
h1 {
  font-size: clamp(30px, 7vw, 39px);
  font-weight: 730;
  letter-spacing: -0.04em;
  margin-top: 24px;
}
h2 {
  letter-spacing: -0.035em;
  font-weight: 680;
}
.big {
  font-weight: 620;
  letter-spacing: -0.065em;
  font-variant-numeric: tabular-nums;
}
small,
.muted,
.unit {
  color: #626774;
}
.hero .unit,
.hero small {
  color: #d7e5f8;
}
.hero {
  background: linear-gradient(120deg, #172337, #203a5b);
  border-radius: 22px;
}
.hero .track {
  background: #435570;
}
.track i {
  background: #9dcfff;
}
.card,
.weight-panel {
  background: white;
  border: 1px solid #e5e6eb;
  box-shadow: 0 2px 6px #22263404;
  border-radius: 21px;
}
.card {
  padding: 18px;
}
.line {
  border-color: #ecedf1;
}
.icon {
  background: #eef3fb;
  color: #3574a8;
}
button {
  background: #e9ecf1;
  color: #27292e;
}
.primary,
.action {
  background: #006edb;
  color: white;
}
.tabs .sel,
.range .sel,
.filters .sel {
  background: #202124;
  color: #fff;
}
.badge {
  background: #eaf1fb;
  color: #335887;
}
input,
textarea,
select {
  border-color: #d9dce3;
  border-radius: 11px;
  color: #1d1d1f;
}
a {
  color: #0065c8;
}
nav {
  max-width: 540px;
  width: min(100%, 540px);
  background: #fcfcfdea;
  backdrop-filter: blur(18px);
  border-color: #dddfe4;
}
nav .sel {
  color: #0067c9;
  background: #eaf2fb;
}
nav button {
  color: #626770;
}
dialog {
  background: #fff;
  color: #17171a;
  border: 0;
  box-shadow: 0 24px 90px #0c142d38;
  border-radius: 22px;
  padding: 24px;
}
dialog h2 {
  margin-top: 3px;
}
dialog::backdrop {
  background: #10152259;
  backdrop-filter: blur(4px);
}
#toast {
  background: #22252e;
}
.hint {
  background: #fff2df;
}
.weight-panel {
  margin: 14px 0;
  padding: 17px 19px 14px;
}
.weight-panel h2,
.chart h2 {
  font-size: 18px;
  margin: 0;
}
.weigh-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 12px 0 2px;
}
.weigh {
  padding: 0 10px 0 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
}
.weigh + .weigh {
  border-left: 1px solid #e3e5eb;
  padding-left: 18px;
}
.weigh b {
  display: block;
  font-size: 31px;
  font-weight: 620;
  letter-spacing: -0.06em;
  line-height: 1.35;
}
.weigh em {
  font-size: 13px;
  letter-spacing: 0;
  font-style: normal;
  font-weight: 450;
  color: #737884;
}
.weigh span {
  display: inline-block;
  font-size: 12px;
  color: #0066c9;
}
.finish,
.jump {
  border-top: 1px solid #e9ebef;
  padding: 11px 0 2px;
  margin-top: 10px;
}
.finish button {
  white-space: nowrap;
}
.calendar .grid {
  gap: 4px;
  margin-top: 11px;
}
.calendar .grid button {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0;
  border-radius: 10px;
  height: 45px;
  border: 2px solid transparent;
}
.grid b {
  font-size: 14px;
  line-height: 18px;
  font-weight: 560;
}
.grid span {
  font-size: 12px;
  line-height: 14px;
  height: 14px;
}
.grid button.miss {
  background: #ffe3e2;
}
.grid button.hit {
  background: #daf3e2;
}
.grid button.over {
  background: linear-gradient(120deg, #ffe4a9, #ffd8e7, #d4e5ff);
}
.calendar .grid button.sel {
  border-color: #006edb;
  color: #101c2e;
}
.legend,
.axis {
  font-size: 12px;
  color: #626774;
}
.legend {
  padding-top: 10px;
}
.jump label {
  display: flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
  color: #5a5e69;
}
.jump input {
  width: auto;
  padding: 5px;
  font-size: 13px;
}
.numbers-inline,
.serving-fields {
  display: flex;
  gap: 16px;
  align-items: baseline;
  margin: 12px 0;
}
.numbers-inline span {
  font-size: 13px;
}
.numbers-inline b {
  font-size: 22px;
  letter-spacing: -0.05em;
}
.range,
.filters {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.range button,
.filters button {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 18px;
}
.chart svg {
  display: block;
  width: 100%;
  overflow: visible;
  margin: 8px 0 2px;
}
.chart svg text {
  fill: #616574;
  font-family: inherit;
  font-size: 10px;
}
.chart-empty {
  text-align: center;
  padding: 24px 0;
  color: #737784;
}
.serving {
  border-bottom: 1px solid #e6e8ed;
  padding: 12px 0;
}
.serving-fields {
  gap: 8px;
  align-items: end;
  margin: 8px 0;
}
.serving-fields label {
  max-width: 85px;
  margin: 0;
}
.serving-fields b {
  margin-left: auto;
  font-size: 14px;
}
.catalog-action {
  text-align: right;
  min-width: 88px;
}
.catalog-action b {
  display: block;
  font-size: 13px;
  margin-bottom: 3px;
}
.catalog .mini {
  color: #0069ce;
  background: #ebf3fc;
}
.remove {
  color: #a63730;
  background: #fff0ef;
}
.card details summary {
  color: #536071;
}
.close-hint {
  display: block;
  margin-top: 8px;
}

/* System type and numeric hierarchy */
:root {
  --ui-type:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Noto Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
}
body {
  font-family: var(--ui-type);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: 0.005em;
  text-rendering: optimizeLegibility;
}
h1,
h2,
header b,
.big,
.weigh b {
  font-family: var(--ui-type);
}
h1 {
  font-size: clamp(31px, 7.5vw, 38px);
  font-weight: 680;
  letter-spacing: -0.035em;
  line-height: 1.23;
}
h2,
.chart h2,
.weight-panel h2 {
  font-weight: 650;
  letter-spacing: -0.018em;
}
button,
input,
select,
textarea {
  font-family: inherit;
}
button {
  font-weight: 520;
}
.primary,
.action {
  font-weight: 620;
}
small,
.muted {
  line-height: 1.55;
  letter-spacing: 0.012em;
}
.big,
.weigh b,
.numbers b,
.numbers-inline b,
.chart,
.grid,
.date,
input[type="number"] {
  font-variant-numeric: tabular-nums;
}
.big {
  letter-spacing: -0.045em;
}
.unit,
.weigh em {
  letter-spacing: 0;
  font-weight: 450;
}
header b {
  font-weight: 690;
  letter-spacing: 0.025em;
}
.chart .tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  margin: 12px 0 4px;
  background: #f1f2f5;
  border-radius: 12px;
}
.chart .tabs button {
  background: transparent;
  color: #555e6b;
  padding: 6px 14px;
  border-radius: 9px;
}
.chart .tabs .sel {
  background: white;
  color: #1d2633;
  box-shadow: 0 1px 4px #19233524;
  font-weight: 650;
}
.chart .range {
  margin: 8px 0 12px;
}
.chart .range button {
  background: #f4f5f7;
  color: #535d69;
  font-size: 12px;
}
.chart .range .sel {
  background: #25354a;
  color: white;
}
.plot-area {
  position: relative;
}
.trend-track {
  touch-action: pan-y;
  cursor: crosshair;
  border-radius: 9px;
}
.trend-track:focus-visible {
  outline: 2px solid #0071e3;
  outline-offset: 2px;
}
.chart .trend-track svg {
  margin: 0;
  overflow: visible;
  user-select: none;
}
.chart svg text {
  fill: #647180;
  font-size: 9px;
  font-weight: 500;
}
.chart .legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 8px;
}
.chart .legend span,
.pop-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chart .legend i,
.pop-row i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}
.chart .legend,
.chart .axis small {
  font-size: 12px;
  color: #566373;
}
.reveal-rect {
  transform-origin: left center;
  animation: reveal-trend 0.42s cubic-bezier(0.23, 0.65, 0.25, 1) both;
}
@keyframes reveal-trend {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}
.trend-cursor {
  pointer-events: none;
}
.guide {
  stroke: #768494;
  stroke-width: 0.9;
  stroke-dasharray: 2.5 3;
}
.trend-pop {
  position: absolute;
  top: 3px;
  width: max-content;
  max-width: calc(100% - 4px);
  pointer-events: none;
  z-index: 1;
  padding: 10px 13px;
  border: 1px solid #dce1e8;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 4px 15px #26354a1f;
  opacity: 0;
  transform: translateY(3px);
  transition:
    opacity 0.13s,
    transform 0.13s;
}
.trend-pop.visible {
  opacity: 1;
  transform: none;
}
.pop-date {
  font-size: 12px;
  color: #4c5c70;
  font-weight: 550;
  padding-bottom: 4px;
}
.pop-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  line-height: 1.7;
  font-size: 12px;
  color: #384451;
}
.pop-row b {
  font-size: 13px;
  font-weight: 620;
  color: #111f30;
}
@media (prefers-reduced-motion: reduce) {
  .reveal-rect {
    animation: none;
  }
  .trend-pop {
    transition: none;
  }
}

body {
  background: #eef0f4;
  color: #1d2230;
}
header b {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.mark {
  margin: 0;
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #006edb;
  background: linear-gradient(#006edb 50%, #badfff 50%);
  border-radius: 50%;
  vertical-align: middle;
}
header small {
  color: #5f6c7c;
}
main {
  min-height: 100svh;
}
header {
  padding: 17px 2px;
}
nav {
  padding-bottom: max(7px, env(safe-area-inset-bottom));
}
nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  line-height: 1.4;
}
nav svg {
  width: 20px;
  height: 20px;
}
.plan-foot {
  display: block;
  margin: 13px 2px;
}
.data-tools {
  margin-top: 24px;
}
.data-tools summary {
  font-weight: 620;
}
.data-tools p {
  font-size: 14px;
  color: #586477;
}
#pf .card h2 {
  margin: 0 0 13px;
}
input,
textarea,
select {
  font-size: 16px;
}
#pf .fields {
  align-items: end;
}
.hint {
  font-size: 14px;
}
.start h2 {
  font-size: 27px;
  color: white;
  margin: 14px 0 4px;
}
.start p {
  color: #d7e5f8;
  max-width: 28em;
}
.start button {
  margin-top: 8px;
}
.record-actions .remove {
  color: #993f36;
}
.full {
  min-height: 42px;
}
button:focus-visible,
summary:focus-visible {
  outline: 2px solid #006edb;
  outline-offset: 3px;
}
#toast:not(:empty) {
  z-index: 20;
}
.weight-panel h2 {
  margin: 0;
}
nav button.sel {
  color: #0065cc;
}
dialog {
  max-height: 85dvh;
  overflow: auto;
}
.line > .left {
  min-width: 0;
}
.line .left small,
.catalog .line > div {
  overflow-wrap: anywhere;
}
.record-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}
@media (max-width: 380px) {
  main {
    padding-left: 13px;
    padding-right: 13px;
  }
  .card {
    padding: 14px;
  }
  .record-actions button {
    padding-left: 8px;
    padding-right: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
