/* 金元宝 · 超市保质期预警 —— 偏老年人向：字大、按钮大、一屏一件事 */

:root {
  --ink: #1f2430;
  --ink-soft: #5b6472;
  --ink-faint: #98a0ad;
  --line: #e6e8ee;
  --paper: #f4f5f8;
  --card: #ffffff;

  --brand: #c0392b;
  --brand-soft: #fdecea;

  --shimen: #2f6fed;
  --shimen-soft: #eef3fe;
  --jixiang: #2f9e6b;
  --jixiang-soft: #eaf7f1;

  /* 四档颜色（预警专用，别处不用） */
  --band-light: #fff8c5;
  --band-yellow: #ffe066;
  --band-pink: #ffc9c9;
  --band-red: #ff8383;

  --shadow: 0 1px 2px rgba(24, 28, 38, 0.04), 0 8px 20px rgba(24, 28, 38, 0.05);
  --shadow-press: 0 1px 2px rgba(24, 28, 38, 0.06);
  --radius: 18px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.screen { display: none; min-height: 100vh; padding-bottom: 24px; }
.screen.active { display: block; }
.hidden { display: none !important; }

.pad { padding: 20px 18px 40px; }
.login-pad { padding-top: 48px; }

.big-title { font-size: 30px; line-height: 1.35; margin: 10px 0 18px; text-align: center; letter-spacing: 1px; }
.section-title { font-size: 20px; margin: 30px 0 12px; }
.center { text-align: center; }

.hint { color: var(--ink-soft); margin: 8px 0 16px; font-size: 17px; }
.hint.small { font-size: 15px; margin: 6px 0 10px; }
.error { color: #b3261e; font-size: 16px; min-height: 24px; margin: 4px 0 12px; }

/* ---------- 按钮 ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  margin: 0 0 14px;
  padding: 14px 18px;
  font-size: 20px;
  font-weight: 600;
  font-family: inherit;
  color: var(--ink);
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn:active { transform: translateY(1px) scale(0.995); box-shadow: var(--shadow-press); }
a.btn { text-decoration: none; }
.btn-xl { min-height: 68px; font-size: 23px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-store { min-height: 96px; font-size: 27px; }
.btn-menu { justify-content: flex-start; position: relative; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-soft); font-size: 17px; min-height: 48px; }
.btn-back { width: auto; margin: 0; padding: 8px 14px; min-height: 44px; font-size: 18px; border: none; box-shadow: none; background: transparent; }
.btn-chip { width: auto; min-height: 44px; margin: 0 8px 8px 0; padding: 8px 16px; font-size: 17px; border-radius: 22px; box-shadow: none; }
.btn-step { width: 64px; min-width: 64px; min-height: 56px; margin: 0; font-size: 26px; box-shadow: none; }
.ico { font-size: 22px; line-height: 1; }

.row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

.btn-store[data-store="shimen"] { background: var(--shimen-soft); border-color: var(--shimen); }
.btn-store[data-store="jixiang"] { background: var(--jixiang-soft); border-color: var(--jixiang); }

/* ---------- 今日概况横幅 ---------- */
.btn-today {
  display: block;
  min-height: 0;
  margin-bottom: 18px;
  padding: 16px 18px;
  font-size: 19px;
  font-weight: 700;
  text-align: left;
  line-height: 1.7;
  background: var(--card);
  border-left: 6px solid var(--brand);
}
body[data-store="shimen"] .btn-today { border-left-color: var(--shimen); background: var(--shimen-soft); }
body[data-store="jixiang"] .btn-today { border-left-color: var(--jixiang); background: var(--jixiang-soft); }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.topbar-title { font-size: 20px; font-weight: 700; }
body[data-store="shimen"] .topbar { box-shadow: inset 0 -3px 0 var(--shimen-soft); }
body[data-store="jixiang"] .topbar { box-shadow: inset 0 -3px 0 var(--jixiang-soft); }

/* ---------- 搜索框 ---------- */
.searchbar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  margin-bottom: 18px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.searchbar input { flex: 1; border: none; outline: none; font-size: 19px; font-family: inherit; background: transparent; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 18px; }
.field > label { display: block; font-size: 17px; font-weight: 600; margin-bottom: 8px; }
input, select, textarea {
  width: 100%;
  min-height: 56px;
  padding: 12px 14px;
  font-size: 19px;
  font-family: inherit;
  color: var(--ink);
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 14px;
  outline: none;
  transition: border-color 0.12s ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); }
textarea { line-height: 1.7; }
.stepper input { text-align: center; font-size: 22px; font-weight: 700; }

.check-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 14px;
  font-size: 17px;
  cursor: pointer;
}
.check-row input[type="checkbox"] {
  width: 26px; height: 26px; min-height: 0; margin: 0; flex: none;
  accent-color: var(--brand);
}

.calc-box {
  margin: 6px 0 18px;
  padding: 14px 16px;
  background: var(--brand-soft);
  border-radius: 14px;
  font-size: 18px;
  line-height: 1.9;
}

/* ---------- 商品卡片 ---------- */
.card {
  position: relative;
  margin-bottom: 14px;
  padding: 16px 16px 12px;
  background: var(--card);
  border-radius: var(--radius);
  border: 2px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card.band-light  { background: var(--band-light);  border-color: var(--band-light); }
.card.band-yellow { background: var(--band-yellow); border-color: var(--band-yellow); }
.card.band-pink   { background: var(--band-pink);   border-color: var(--band-pink); }
.card.band-red    { background: var(--band-red);    border-color: var(--band-red); }

.card .thumb {
  float: left;
  width: 76px;
  height: 76px;
  margin: 0 12px 8px 0;
  object-fit: cover;
  border-radius: 12px;
  background: #eef0f4;
}

.card .name { font-size: 21px; font-weight: 700; margin-bottom: 6px; }
.card .meta { font-size: 17px; line-height: 1.9; }
.card .days { font-size: 26px; font-weight: 800; letter-spacing: 0.5px; }
.card .stamp { margin-top: 8px; font-size: 14px; color: var(--ink-faint); }
.card .actions { display: flex; gap: 10px; margin-top: 10px; clear: both; }
.card .actions .btn { margin: 0; min-height: 46px; font-size: 17px; }

.group-title {
  margin: 26px 0 12px;
  padding: 12px 16px;
  font-size: 19px;
  font-weight: 700;
  border-radius: 14px;
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: var(--shadow);
}
.group-title.band-light  { background: var(--band-light); }
.group-title.band-yellow { background: var(--band-yellow); }
.group-title.band-pink   { background: var(--band-pink); }
.group-title.band-red    { background: var(--band-red); }

.badge {
  margin-left: auto;
  min-width: 40px;
  padding: 3px 12px;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  color: #fff;
  background: #c62828;
  border-radius: 999px;
}
.badge.zero { background: #b6bcc7; }

.profit-cards { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 18px; }
.profit-card { padding: 18px; background: var(--card); border-radius: var(--radius); border: 2px solid var(--line); box-shadow: var(--shadow); }
.profit-card .k { font-size: 17px; color: var(--ink-soft); }
.profit-card .v { font-size: 30px; font-weight: 800; }

.empty-state {
  padding: 34px 20px;
  text-align: center;
  background: var(--card);
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  color: var(--ink-soft);
  font-size: 17px;
}
.empty-state .e-ico { display: block; font-size: 40px; margin-bottom: 10px; }

.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  padding: 14px 26px; font-size: 19px; font-weight: 600;
  color: #fff; background: #2f3542;
  border-radius: 999px; z-index: 50;
  box-shadow: 0 10px 30px rgba(20, 22, 28, 0.25);
}

video { width: 100%; border-radius: var(--radius); margin-bottom: 12px; background: #000; }
input[type="date"] { min-height: 56px; }

/* ---------- 商品照片 ---------- */
.photo-preview {
  display: block;
  width: 100%;
  max-height: 320px;
  margin-bottom: 12px;
  object-fit: contain;
  border-radius: 14px;
  background: #eef0f4;
}

.viewer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px;
  background: rgba(20, 22, 28, 0.92);
}
.viewer img { max-width: 100%; max-height: 72vh; border-radius: 14px; }
.viewer .btn { max-width: 320px; }

.brand-icon {
  display: block;
  width: 104px;
  height: 104px;
  margin: 8px auto 6px;
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.credit {
  margin: 0;
  padding: 8px 0 30px;
  text-align: center;
  font-size: 14px;
  color: var(--ink-faint);
  letter-spacing: 0.5px;
}

/* ---------- 账号管理 ---------- */
.acct-card {
  margin-bottom: 14px;
  padding: 16px;
  background: var(--card);
  border-radius: var(--radius);
  border: 2px solid var(--line);
  box-shadow: var(--shadow);
}
.acct-card .acct-title { font-size: 19px; font-weight: 700; margin-bottom: 10px; }
.acct-card .field { margin-bottom: 12px; }
.acct-card input { min-height: 50px; font-size: 18px; }
