:root {
  --bg: #F2F6F1;
  --paper: #FFFFFF;
  --ink: #17342A;
  --ink-soft: #4B6459;
  --line: #DCE6DD;
  --primary: #1F5C4A;
  --primary-deep: #123C30;
  --gold: #C79A3E;
  --rust: #BD5B34;
  --ok: #3C8562;
  --warn: #C79A3E;
  --low: #BD5B34;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "IBM Plex Sans", -apple-system, sans-serif;
}

.disp {
  font-family: "Fraunces", "Songti SC", serif;
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

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

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  flex-shrink: 0;
}

.title {
  font-size: 22px;
  font-weight: 600;
  color: var(--primary-deep);
  line-height: 1.2;
}

.subtitle {
  font-size: 12.5px;
  color: var(--ink-soft);
}

.btn {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12.5px;
  color: var(--ink-soft);
  cursor: pointer;
}
.btn:hover { background: #fff; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 13px;
  cursor: pointer;
}
.btn-primary:hover { background: var(--primary-deep); }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}

.tab-btn {
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  white-space: nowrap;
}

.tab-btn.active {
  color: var(--primary-deep);
  border-bottom-color: var(--primary);
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 16px;
}

.card-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--primary-deep);
  margin-bottom: 4px;
}

.card-hint {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-bottom: 18px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 560px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
}

.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
  display: block;
}

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

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13.5px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
textarea { min-height: 70px; resize: vertical; }

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}
.chip {
  font-size: 12.5px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
}
.chip:hover { border-color: var(--primary); }

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.log-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 10px;
  margin-bottom: 8px;
  font-size: 13.5px;
}
.log-item .muted { color: var(--ink-soft); }
.icon-btn {
  background: transparent;
  border: none;
  color: var(--rust);
  cursor: pointer;
  font-size: 14px;
}

.stat-strip {
  background: var(--primary-deep);
  border-radius: 16px;
  padding: 20px;
  color: #fff;
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.stat-label { font-size: 12px; opacity: .75; }
.stat-value { font-size: 24px; font-weight: 600; font-family: "Fraunces", serif; }
.stat-value small { font-size: 12px; font-weight: 400; opacity: .75; }

.nutrient-row { margin-bottom: 14px; }
.nutrient-top {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 4px;
}
.nutrient-name { display: flex; align-items: center; gap: 6px; }
.nutrient-value { color: var(--ink-soft); font-size: 12px; }
.pct-badge { font-weight: 700; margin-left: 6px; }

.bar-track {
  background: var(--line);
  border-radius: 999px;
  height: 8px;
  width: 100%;
  overflow: hidden;
}
.bar-fill { height: 100%; border-radius: 999px; transition: width .3s ease; }

.suggestion {
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 10px;
  margin-bottom: 10px;
}
.suggestion-title { font-size: 13px; font-weight: 700; color: var(--rust); }
.suggestion-body { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }

.empty { font-size: 12.5px; color: var(--ink-soft); }

.footer-note {
  font-size: 11px;
  color: var(--ink-soft);
  line-height: 1.7;
  margin-top: 20px;
}

.history-list { display: grid; gap: 8px; }
.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
}
.history-item:hover { outline: 1px solid var(--primary); }

svg text { font-family: "IBM Plex Sans", "PingFang SC", sans-serif; }

.goal-options {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 30px;
  padding: 8px 0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  width: auto;
  min-width: 120px;
  cursor: pointer;
  white-space: nowrap;
}

.checkbox-label input {
  margin: 0;
}