/* ============================================================
   热量账本 —— 反主流版本
   规则:不居中、不等宽、无渐变蓝紫、无圆润药丸、无 emoji
   ============================================================ */

/* ---------- 令牌 ---------- */
:root {
  /* 纸墨 */
  --paper:      #f4ecd9;
  --paper-hi:   #fbf5e6;
  --paper-lo:   #e8dcc0;
  --ink:        #262119;
  --ink-soft:   #6d6351;
  --line:       #262119;

  /* 印泥与墨绿 */
  --rust:       #b23a1e;
  --rust-deep:  #8a2a12;
  --moss:       #5a6b3d;
  --mustard:    #c9992e;
  --clay:       #a3543a;

  --ok:   #3f5a32;
  --bad:  #9c2412;

  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong",
           "SimSun", Georgia, "Times New Roman", serif;
  --sans:  "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
           "Noto Sans CJK SC", system-ui, sans-serif;
  --mono:  "Cascadia Mono", "JetBrains Mono", "SFMono-Regular", Consolas,
           "Liberation Mono", monospace;

  /* 弹一点的缓动,拒绝 ease-in-out */
  --pop: cubic-bezier(0.16, 1.3, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* 纸张底 + 噪点,拒绝纯平色 */
body {
  font-family: var(--sans);
  color: var(--ink);
  line-height: 1.75;
  background:
    radial-gradient(1100px 700px at 88% -8%, rgba(201, 153, 46, 0.16), transparent 62%),
    radial-gradient(900px 640px at -6% 34%, rgba(90, 107, 61, 0.10), transparent 58%),
    linear-gradient(178deg, #f7f0df 0%, #f1e6cd 58%, #eadcc0 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

::selection { background: var(--mustard); color: var(--ink); }

/* ---------- 通用 ---------- */
.shell {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 56px) 72px;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ic {
  width: 1.1em;
  height: 1.1em;
  vertical-align: -0.18em;
  flex: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.hidden { display: none !important; }

button { font-family: inherit; color: inherit; }
input, select { font-family: inherit; color: inherit; }
input::placeholder { color: #9a8f76; }

:focus-visible {
  outline: 3px solid var(--rust);
  outline-offset: 2px;
}

/* ---------- 按钮:平、硬、方 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  border: 2px solid var(--ink);
  background: var(--paper-hi);
  color: var(--ink);
  padding: 0.62em 1.1em;
  font-size: 1rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.14s var(--pop), box-shadow 0.14s var(--pop),
              background-color 0.14s var(--pop);
}

.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 6px 6px 0 var(--ink);
}

.btn:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--ink);
}

.btn--rust {
  background: var(--rust);
  color: var(--paper-hi);
}

.btn--rust:hover { background: var(--rust-deep); }

.btn--ink {
  background: var(--ink);
  color: var(--paper-hi);
}

.btn--small {
  padding: 0.45em 0.9em;
  font-size: 0.92rem;
  box-shadow: 3px 3px 0 var(--ink);
}

.text-btn {
  border: none;
  background: none;
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.15s var(--pop);
}

.text-btn:hover { color: var(--rust); }

/* ---------- 页眉:大字报 ---------- */
.masthead {
  padding: clamp(28px, 5vw, 60px) 0 clamp(22px, 4vw, 44px);
  border-bottom: 3px double var(--ink);
  position: relative;
}

.brand {
  font-family: var(--serif);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  margin-bottom: clamp(18px, 3vw, 30px);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6em;
}

.brand i {
  font-family: var(--mono);
  font-size: 0.68em;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  font-style: normal;
  transform: rotate(-0.6deg);
}

.mast-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(18px, 4vw, 60px);
  align-items: start;
}

.title {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: 0.01em;
  margin-bottom: 0.6em;
  max-width: 15em;
}

.title em {
  font-style: normal;
  color: var(--rust);
}

.lede {
  max-width: 42em;
  font-size: clamp(1rem, 1.6vw, 1.14rem);
  color: var(--ink-soft);
}

.lede b { color: var(--ink); }

/* 右侧骑缝印 */
.mast-side {
  justify-self: end;
  align-self: start;
  margin-top: 2.4rem;
  padding-right: 1.2rem;
}

.stamp {
  font-family: var(--serif);
  font-weight: 700;
  text-align: right;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--rust);
  border: 3px double var(--rust);
  padding: 0.55em 0.9em;
  transform: rotate(2.4deg);
  opacity: 0.9;
}

.stamp b {
  font-family: var(--mono);
  font-size: 1.35em;
  letter-spacing: 0.02em;
}

/* ---------- 区块骨架:非对称 ---------- */
.zone {
  margin-top: clamp(44px, 8vw, 84px);
}

.zone-label {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: clamp(20px, 3vw, 34px);
}

.zone-index {
  font-family: var(--mono);
  font-size: 0.85rem;
  border: 2px solid var(--ink);
  padding: 0.14em 0.5em;
  transform: rotate(-3deg);
  box-shadow: 2px 2px 0 var(--ink);
}

.zone-label h2 {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3.6vw, 2.4rem);
  font-weight: 900;
}

.zone-label::after {
  content: "";
  flex: 1;
  min-width: 40px;
  height: 2px;
  background: var(--ink);
  transform: translateY(4px);
  margin-right: -6px;
}

.zone-body {
  display: grid;
  gap: clamp(22px, 4vw, 52px);
}

/* 01 查账:左 7 / 右 5,右栏下沉打破对齐 */
.cols-search {
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: start;
}

.col-rail {
  margin-top: 7.5rem;   /* 故意下沉,拒绝水平对齐 */
}

/* ---------- 搜索 ---------- */
.search-form {
  display: flex;
  align-items: flex-end;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.search-line {
  position: relative;
  flex: 1 1 320px;
}

.search-line .ic {
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-52%);
  width: 1.3em;
  height: 1.3em;
  color: var(--rust);
}

#searchInput {
  width: 100%;
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
  font-weight: 700;
  background: transparent;
  border: none;
  border-bottom: 3px solid var(--ink);
  padding: 0.28em 0 0.28em 1.9em;
  border-radius: 0;
}

#searchInput:focus {
  outline: none;
  border-bottom-color: var(--rust);
}

.hint {
  margin: 0.7rem 0 1.4rem 0.2rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
  min-height: 1.5em;
  font-style: italic;
}

/* ---------- 账本行 ---------- */
.ledger {
  counter-reset: none;
  border-top: 2px solid var(--ink);
}

.ledger-row {
  display: grid;
  grid-template-columns: 3.2ch minmax(0, 1fr) auto auto;
  align-items: baseline;
  gap: 0.4rem 1rem;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-bottom: 1px dashed rgba(38, 33, 25, 0.35);
  padding: 0.62rem 0.3rem 0.62rem 0;
  cursor: pointer;
  transition: background-color 0.16s var(--pop), padding-left 0.16s var(--pop);
  animation: rise 0.4s var(--pop) both;
}

.ledger-row:hover {
  background: rgba(251, 245, 230, 0.85);
  padding-left: 0.7rem;
}

.row-no {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.row-main {
  display: flex;
  align-items: baseline;
  gap: 0.55em;
  min-width: 0;
  flex-wrap: wrap;
}

.row-name {
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 700;
}

.row-tag,
.row-custom {
  font-size: 0.7rem;
  font-family: var(--mono);
  letter-spacing: 0.03em;
  border: 1px solid var(--ink);
  padding: 0 0.45em;
  color: var(--ink-soft);
  white-space: nowrap;
}

.row-custom {
  border-style: dashed;
  color: var(--rust);
}

.row-kcal {
  text-align: right;
  white-space: nowrap;
}

.row-kcal b {
  font-family: var(--mono);
  font-size: 1.45rem;
  font-weight: 700;
}

.row-kcal i {
  font-style: normal;
  font-size: 0.72rem;
  color: var(--ink-soft);
  margin-left: 0.3em;
}

.row-go {
  color: var(--rust);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.16s var(--pop), transform 0.16s var(--pop);
}

.ledger-row:hover .row-go,
.ledger-row:focus-visible .row-go {
  opacity: 1;
  transform: translateX(0);
}

.ledger-empty {
  border-top: 2px solid var(--ink);
  border-bottom: 1px dashed rgba(38, 33, 25, 0.35);
  padding: 1.6rem 0.3rem 1.8rem;
  font-family: var(--serif);
  font-size: 1.15rem;
}

.ledger-empty b { color: var(--rust); }

.ledger-empty a {
  color: var(--rust);
  font-weight: 700;
  text-underline-offset: 3px;
}

/* ---------- 结账小票 ---------- */
.ticket {
  margin-top: 1.8rem;
  background: var(--paper-hi);
  border: 2px dashed var(--rust);
  border-top: 4px solid var(--rust);
  padding: 1.1rem 1.2rem 1.2rem;
  rotate: -0.35deg;
  max-width: 34rem;
  animation: rise 0.4s var(--pop) both;
}

.ticket-q {
  font-family: var(--serif);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.ticket-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.ticket-food {
  font-family: var(--serif);
  font-size: 1.15rem;
  margin-right: 0.4rem;
}

#gramInput {
  width: 7.5em;
  font-family: var(--mono);
  font-size: 1.05rem;
  border: 2px solid var(--ink);
  background: var(--paper);
  padding: 0.32em 0.5em;
}

#gramInput:focus {
  outline: 2px solid var(--rust);
  outline-offset: 1px;
}

.ticket-unit {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.calc-result {
  margin-top: 0.8rem;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 900;
}

.calc-result .kcal-num {
  font-family: var(--mono);
  color: var(--rust);
  font-size: 1.7rem;
}

.calc-result .calc-note {
  display: block;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--ink-soft);
  margin-top: 0.2rem;
}

/* ---------- 右栏:速查 ---------- */
.rail-block {
  border: 2px solid var(--ink);
  background: rgba(251, 245, 230, 0.6);
  padding: 1.2rem 1.2rem 0.9rem;
  position: relative;
}

.rail-block::before {
  content: "";
  position: absolute;
  top: -10px;
  right: -10px;
  width: 22px;
  height: 22px;
  border-top: 2px solid var(--ink);
  border-right: 2px solid var(--ink);
}

.rail-title {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 900;
}

.rail-sub {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 0.15rem 0 1rem;
}

.quick-list {
  display: flex;
  flex-direction: column;
}

.quick-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-bottom: 1px dashed rgba(38, 33, 25, 0.4);
  padding: 0.5rem 0.1rem;
  cursor: pointer;
  transition: background-color 0.15s var(--pop), padding-left 0.15s var(--pop);
}

.quick-row:hover {
  background: var(--paper-hi);
  padding-left: 0.45rem;
}

.q-name { font-weight: 600; flex: 1; }

.q-kcal {
  font-family: var(--mono);
  font-weight: 700;
}

.q-kcal i {
  font-style: normal;
  font-size: 0.66rem;
  color: var(--ink-soft);
  font-weight: 400;
}

.quick-row .ic { color: var(--rust); }

/* 附注卡片 */
.note-card {
  margin-top: 1.6rem;
  border: 1px solid var(--ink);
  background: var(--paper-lo);
  padding: 1rem 1.1rem 0.9rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  transform: rotate(0.6deg);
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}

.note-card b { color: var(--ink); }

.note-ic {
  margin-top: 0.25em;
  color: var(--rust);
  width: 1.2em;
  height: 1.2em;
}

.note-card--empty {
  transform: rotate(-0.4deg);
  margin-top: 0;
}

/* ---------- 02 排一天 ---------- */
.cols-plan {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: start;
  column-gap: clamp(20px, 3vw, 44px);
}

.plan-q label {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 700;
  display: block;
  margin-bottom: 0.4rem;
}

.plan-input-line {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

#targetInput {
  width: 8em;
  font-family: var(--mono);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  background: transparent;
  border: none;
  border-bottom: 4px solid var(--rust);
  padding: 0.1em 0.2em;
}

#targetInput:focus { outline: none; }

.unit {
  font-size: 1rem;
  color: var(--ink-soft);
}

.preset-label {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin-bottom: 0.7rem;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.preset-chip {
  border: 2px solid var(--ink);
  background: transparent;
  padding: 0.42em 0.85em;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(38, 33, 25, 0.9);
  transition: transform 0.14s var(--pop), background-color 0.14s var(--pop),
              box-shadow 0.14s var(--pop), color 0.14s var(--pop);
}

.preset-chip:hover {
  transform: translate(-1px, -1px);
  background: var(--mustard);
  box-shadow: 4px 4px 0 var(--ink);
}

.preset-chip:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

.form-error {
  color: var(--bad);
  font-weight: 700;
  min-height: 1.4em;
  margin-top: 0.9rem;
  font-size: 0.95rem;
}

/* 菜单总账 */
.plan-output { margin-top: 1.6rem; }

.plan-sheet {
  border: 2px solid var(--ink);
  background: rgba(251, 245, 230, 0.55);
  padding: clamp(18px, 3vw, 30px);
  position: relative;
}

.plan-sheet::before {
  content: "今日菜单";
  position: absolute;
  top: -13px;
  left: 18px;
  background: var(--paper);
  padding: 0 0.5em;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  border: 1px solid var(--ink);
  transform: rotate(-1.5deg);
}

.plan-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1.4rem;
  margin-bottom: 1.2rem;
}

.plan-total-label {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 900;
}

.plan-total-num {
  font-family: var(--mono);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--rust);
}

.plan-diff { font-size: 0.92rem; color: var(--ink-soft); }
.plan-match-ok { color: var(--ok); font-weight: 700; }
.plan-match-warn { color: var(--rust); font-weight: 700; }

.plan-note {
  font-size: 0.8rem;
  color: var(--ink-soft);
  border-top: 1px dashed rgba(38, 33, 25, 0.4);
  padding-top: 0.6rem;
  margin-bottom: 1.2rem;
}

/* 每餐卡片:前后错位,不排等宽队列 */
.meals {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.meal {
  max-width: min(100%, 46rem);
  border: 1px solid var(--ink);
  border-top: 6px solid var(--ink);
  background: var(--paper-hi);
  padding: 1rem 1.1rem 0.9rem;
  animation: rise 0.45s var(--pop) both;
}

.meal:nth-child(even) {
  margin-left: auto;
  max-width: min(100%, 39rem);
  rotate: 0.35deg;
}

.meal:nth-child(odd) {
  rotate: -0.3deg;
}

/* 每餐各自的印泥色 */
.meal--b { border-top-color: var(--mustard); }
.meal--l { border-top-color: var(--rust); }
.meal--d { border-top-color: var(--moss); }
.meal--s { border-top-color: var(--clay); }

.meal-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.meal-name {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 900;
  display: flex;
  align-items: baseline;
  gap: 0.55em;
}

.meal-share {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
}

.meal-sub {
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 700;
  white-space: nowrap;
}

.meal-sub i {
  font-style: normal;
  font-size: 0.7rem;
  color: var(--ink-soft);
}

.meal-items {
  list-style: none;
}

.meal-items li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: baseline;
  gap: 0.5rem 1rem;
  border-bottom: 1px dotted rgba(38, 33, 25, 0.45);
  padding: 0.42rem 0;
  font-size: 0.98rem;
}

.meal-items li:last-child { border-bottom: none; }

.mi-name { font-weight: 600; }
.mi-grams { font-family: var(--mono); font-size: 0.85rem; color: var(--ink-soft); white-space: nowrap; }
.mi-kcal { font-family: var(--mono); font-weight: 700; white-space: nowrap; }

.plan-actions {
  margin-top: 1.3rem;
  display: flex;
  justify-content: flex-end;
}

.regen-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  border: 2px dashed var(--ink);
  background: transparent;
  padding: 0.5em 1.1em;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-style 0.15s var(--pop), background-color 0.15s var(--pop);
}

.regen-btn:hover {
  border-style: solid;
  background: var(--paper-hi);
}

/* ---------- 03 自己记账 ---------- */
.cols-custom {
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: start;
  column-gap: clamp(24px, 4vw, 60px);
}

.col-ledger {
  margin-top: 2.8rem;  /* 左右错开 */
}

#customForm {
  background: rgba(251, 245, 230, 0.6);
  border: 2px solid var(--ink);
  padding: 1.3rem 1.3rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.field label {
  display: block;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  margin-bottom: 0.35rem;
}

.field input,
.field select {
  width: 100%;
  font-size: 1.05rem;
  background: var(--paper);
  border: 2px solid var(--ink);
  padding: 0.5em 0.6em;
}

.field input:focus,
.field select:focus { outline: 3px solid var(--mustard); outline-offset: 0; }

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

.field-inline {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.field-inline input { flex: 1; }

#customForm .btn {
  align-self: flex-start;
  margin-top: 0.3rem;
}

.form-msg {
  margin-top: 0.9rem;
  font-size: 0.92rem;
  font-weight: 700;
  min-height: 1.4em;
}

.form-msg.is-ok { color: var(--ok); }
.form-msg.is-error { color: var(--bad); }

/* 我记下的 */
.custom-wrap {
  border: 2px solid var(--ink);
  border-top: 6px solid var(--ink);
  background: var(--paper-hi);
  padding: 1.1rem 1.1rem 0.8rem;
}

.custom-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.custom-head .rail-title { font-size: 1.15rem; }

.custom-list {
  list-style: none;
  max-height: 320px;
  overflow-y: auto;
  border-top: 1px dashed rgba(38, 33, 25, 0.5);
}

.custom-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.2rem;
  border-bottom: 1px dashed rgba(38, 33, 25, 0.35);
  cursor: pointer;
  transition: background-color 0.15s var(--pop);
}

.custom-row:hover { background: rgba(201, 153, 46, 0.14); }

.ci-name { font-family: var(--serif); font-weight: 700; font-size: 1.05rem; }

.ci-cat {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ink-soft);
  border: 1px solid rgba(38, 33, 25, 0.5);
  padding: 0 0.4em;
}

.ci-kcal {
  font-family: var(--mono);
  font-weight: 700;
  white-space: nowrap;
}

.ci-del {
  border: 1px solid transparent;
  background: none;
  padding: 0.25em 0.4em;
  cursor: pointer;
  color: var(--ink-soft);
  display: inline-flex;
  transition: color 0.15s var(--pop), border-color 0.15s var(--pop);
}

.ci-del:hover { color: var(--bad); border-color: var(--bad); }

.custom-tip {
  margin-top: 0.7rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
  font-style: italic;
}

/* ---------- 页脚 ---------- */
.colophon {
  margin-top: clamp(48px, 8vw, 90px);
  border-top: 3px double var(--ink);
  padding-top: 1.4rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

/* ---------- 动画(用独立 translate,避免盖掉元素自带的旋转) ---------- */
@keyframes rise {
  from {
    opacity: 0;
    translate: 0 10px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

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

/* ---------- 响应式:单栏后错位消失 ---------- */
@media (max-width: 900px) {
  .mast-grid { grid-template-columns: 1fr; }
  .mast-side { justify-self: start; margin-top: 1rem; padding-right: 0; }
  .col-rail { margin-top: 0; }
  .cols-search,
  .cols-plan,
  .cols-custom { grid-template-columns: 1fr; }
  .col-ledger { margin-top: 0; }
  .meal:nth-child(even) { margin-left: 0; rotate: none; }
  .meal:nth-child(odd) { rotate: none; }
}

@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
  .plan-actions { justify-content: stretch; }
  .regen-btn { width: 100%; justify-content: center; }
  .row-kcal i { display: none; }
  .ledger-row {
    grid-template-columns: 3ch minmax(0, 1fr) auto;
  }
  .ledger-row .row-go { display: none; }
}
