/* Foodli 廟 — prototype */
:root {
  --ink: #14201a;
  --muted: #5a6b62;
  --paper: #e7efe9;
  --paper-2: #d5e3da;
  --panel: rgba(255, 252, 248, 0.92);
  --line: rgba(20, 32, 26, 0.12);
  --temple: #1f4d3a;
  --temple-deep: #123328;
  --gold: #c4a35a;
  --gold-soft: #e6d3a3;
  --danger: #9b3b2e;
  --ok: #2f6f4e;
  --foodli: #8b5a2b;
  --foodli-deep: #5c3a18;
  --shadow: 0 18px 50px rgba(18, 51, 40, 0.14);
  --radius: 18px;
  --font-ui: "Manrope", "Noto Sans TC", sans-serif;
  --font-display: "Noto Serif TC", "Songti TC", serif;
  --touch: 48px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(196, 163, 90, 0.28), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(31, 77, 58, 0.22), transparent 50%),
    linear-gradient(165deg, #f3f7f4 0%, var(--paper) 45%, var(--paper-2) 100%);
  min-height: 100%;
}

button, input, select { font: inherit; }
button {
  min-height: var(--touch);
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
button:active { transform: scale(0.98); }
a { color: inherit; }

.app-shell { min-height: 100%; display: flex; flex-direction: column; }

.demo-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 10px 16px;
  background: #14201a;
  color: #f3efe6;
  font-size: 13px;
  font-weight: 600;
}
.demo-banner a {
  color: #e6d3a3;
  text-decoration: none;
}
.demo-banner a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  backdrop-filter: blur(10px);
  background: rgba(255, 252, 248, 0.72);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand-block { display: flex; flex-direction: column; gap: 2px; }
.brand-kicker {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--foodli);
  font-weight: 700;
}
.brand-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.brand-sub { font-size: 12px; color: var(--muted); }

.main { width: min(1120px, 100%); margin: 0 auto; padding: 20px 16px 48px; flex: 1; }

.hero-hub {
  display: grid;
  gap: 22px;
  padding: 28px 8px 8px;
  animation: rise .5s ease both;
}
.hero-hub h1 {
  font-family: var(--font-display);
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1.15;
  margin: 0;
}
.hero-hub p { margin: 0; color: var(--muted); font-size: 16px; max-width: 36em; }

.role-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 8px;
}
@media (max-width: 820px) {
  .role-grid { grid-template-columns: 1fr; }
}

.role-card {
  text-align: left;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: grid;
  gap: 10px;
  min-height: 160px;
}
.role-card:hover { transform: translateY(-2px); }
.role-card .tag {
  display: inline-flex;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(31, 77, 58, 0.1);
  color: var(--temple);
  font-size: 12px;
  font-weight: 700;
}
.role-card h2 { margin: 0; font-size: 22px; font-family: var(--font-display); }
.role-card p { margin: 0; color: var(--muted); font-size: 14px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  animation: rise .45s ease both;
}
.panel + .panel { margin-top: 14px; }

.section-title {
  font-family: var(--font-display);
  font-size: 24px;
  margin: 0 0 6px;
}
.section-desc { margin: 0 0 16px; color: var(--muted); font-size: 14px; }

.btn-primary {
  background: linear-gradient(180deg, #2a634c, var(--temple-deep));
  color: #fff;
  font-weight: 700;
  padding: 0 18px;
  box-shadow: 0 10px 24px rgba(18, 51, 40, 0.28);
}
.btn-secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line) !important;
  padding: 0 16px;
  font-weight: 600;
}
.btn-gold {
  background: linear-gradient(180deg, #d8b86a, #b08a3d);
  color: #1a1408;
  font-weight: 800;
  padding: 0 18px;
}
.btn-ghost {
  background: transparent;
  color: var(--muted);
  min-height: 40px;
  padding: 0 10px;
}
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 13px; font-weight: 700; color: var(--muted); }
.field input, .field select, .field textarea {
  min-height: var(--touch);
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 0 14px;
  background: #fff;
}
.field textarea { padding: 12px 14px; min-height: 90px; resize: vertical; }

.serve-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: linear-gradient(90deg, rgba(31,77,58,.12), rgba(196,163,90,.18));
  border: 1px solid var(--line);
  margin-bottom: 14px;
}
.serve-bar strong { font-size: 18px; }
.serve-bar span { color: var(--muted); font-size: 13px; }

.task-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 720px) {
  .task-grid { grid-template-columns: repeat(2, 1fr); }
}
.task-tile {
  min-height: 110px;
  padding: 16px;
  border-radius: 16px;
  text-align: left;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-weight: 700;
  font-size: 18px;
  box-shadow: 0 12px 28px rgba(0,0,0,.12);
}
.task-tile small { font-size: 12px; font-weight: 600; opacity: .85; }
.task-tile.oil { background: linear-gradient(145deg, #3d6b54, #1f4d3a); }
.task-tile.fahui { background: linear-gradient(145deg, #c4a35a, #8a6a2e); color: #1a1408; }
.task-tile.lamp { background: linear-gradient(145deg, #4a7d6a, #244f3d); }
.task-tile.loan { background: linear-gradient(145deg, #6b5a3d, #3f3422); }
.task-tile.project { background: linear-gradient(145deg, #5a6f7d, #2f3f4a); }
.task-tile.item { background: linear-gradient(145deg, #7a5a4a, #4a3228); }

.search-results { display: grid; gap: 8px; }
.person-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.person-row:hover { border-color: var(--temple); }
.person-row .meta { color: var(--muted); font-size: 13px; }

.cart {
  margin-top: 14px;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
}
.cart-line {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 15px;
}
.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 22px;
  font-weight: 800;
  margin-top: 8px;
  font-family: var(--font-display);
}

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 600;
}
.chip.active {
  background: var(--temple);
  color: #fff;
  border-color: var(--temple);
}

.preview-sheet {
  background: #fffef8;
  border: 1px solid var(--gold-soft);
  border-radius: 12px;
  padding: 22px;
  font-family: var(--font-display);
  box-shadow: inset 0 0 0 1px rgba(196,163,90,.25);
}
.preview-sheet h3 {
  text-align: center;
  margin: 0 0 12px;
  font-size: 26px;
  letter-spacing: 0.2em;
}
.preview-sheet .line { margin: 8px 0; font-size: 16px; }
.preview-sheet .seal {
  margin-top: 18px;
  text-align: right;
  color: var(--temple);
  font-weight: 700;
}

.qr-stage {
  display: grid;
  place-items: center;
  gap: 14px;
  padding: 28px 12px;
  background:
    radial-gradient(circle at 50% 30%, rgba(196,163,90,.25), transparent 55%),
    linear-gradient(180deg, #123328, #0c1f18);
  color: #f7f1e4;
  border-radius: var(--radius);
  min-height: 420px;
}
.qr-box {
  width: min(240px, 70vw);
  aspect-ratio: 1;
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  display: grid;
  place-items: center;
}
.qr-pseudo {
  width: 100%;
  height: 100%;
  background:
    linear-gradient(#14201a 0 0) 0 0 / 20% 20%,
    linear-gradient(#14201a 0 0) 100% 0 / 20% 20%,
    linear-gradient(#14201a 0 0) 0 100% / 20% 20%,
    linear-gradient(#14201a 0 0) 100% 100% / 20% 20%,
    repeating-conic-gradient(#14201a 0% 25%, #fff 0% 50%) 50% / 16% 16%;
  background-repeat: no-repeat;
  border-radius: 8px;
}
.qr-stage .cardno {
  font-size: 28px;
  letter-spacing: 0.18em;
  font-weight: 800;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table th, .table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}
.table th { color: var(--muted); font-size: 12px; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.stat {
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  border: 1px solid var(--line);
}
.stat b { display: block; font-size: 22px; margin-top: 4px; }
.stat span { color: var(--muted); font-size: 12px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: .25s ease;
  z-index: 50;
  font-weight: 600;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.footer-note {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 8px 16px 24px;
}

.hidden { display: none !important; }

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

.believer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.believer-actions button {
  min-height: 100px;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}
.ba-qr { background: linear-gradient(145deg, #9b3b2e, #6e2a20); }
.ba-family { background: linear-gradient(145deg, #1f4d3a, #123328); }
.ba-profile { background: linear-gradient(145deg, #5c3a18, #3d2610); }
.ba-out { background: #6b7280; }

.amount-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.amount-pad button {
  background: #fff;
  border: 1px solid var(--line) !important;
  font-size: 20px;
  font-weight: 700;
}
.amount-display {
  font-family: var(--font-display);
  font-size: 40px;
  text-align: center;
  margin: 8px 0 14px;
  letter-spacing: 0.04em;
}
