/* 南京社区助餐平台 - 大字简易版，专为老人设计 */

:root {
  --red: #c0392b;
  --red-dark: #a93226;
  --green: #27803c;
  --ink: #1a1a1a;
  --gray: #666;
  --line: #e5e5e5;
  --bg: #f5f3ef;
  --card: #ffffff;
  --shadow: 0 2px 10px rgba(0,0,0,.08);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Heiti SC", sans-serif;
  font-size: 20px;
  line-height: 1.5;
  padding-bottom: 96px;
}

.app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
}

/* 顶部 */
.topbar {
  background: var(--red);
  color: #fff;
  padding: 20px 20px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-icon { font-size: 44px; line-height: 1; }
.brand-text h1 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: 1px; }
.brand-text p { margin: 2px 0 0; font-size: 18px; opacity: .9; }
.cart-mini {
  background: rgba(255,255,255,.2);
  border: 2px solid rgba(255,255,255,.5);
  color: #fff;
  font-size: 30px;
  width: 62px; height: 62px;
  border-radius: 14px;
  position: relative;
  cursor: pointer;
}
.cart-mini-badge {
  position: absolute; top: -8px; right: -8px;
  background: #ffd23f; color: #7a1c10;
  font-size: 18px; font-weight: 800;
  min-width: 30px; height: 30px; padding: 0 6px;
  border-radius: 15px;
  display: flex; align-items: center; justify-content: center;
}

/* 当前社区条 */
.community-bar {
  width: 100%;
  background: #27803c;
  color: #fff;
  border: none;
  padding: 14px 18px;
  display: flex; align-items: center; gap: 10px;
  font-size: 21px; text-align: left; cursor: pointer;
}
.cb-icon { font-size: 24px; }
.cb-text { flex: 1; }
.cb-text strong { font-size: 23px; }
.cb-change { font-size: 18px; opacity: .9; background: rgba(255,255,255,.18); padding: 6px 12px; border-radius: 10px; }

/* 社区三级选择 */
.step-flow { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.loc-step { font-size: 17px; font-weight: 700; color: #aaa; background: #f0f0f0; padding: 8px 14px; border-radius: 20px; }
.loc-step.active { color: #fff; background: var(--green); }
.loc-step.done { color: var(--green); background: #e8f6ec; }
.loc-arrow { color: #ccc; font-size: 16px; }
.loc-pane { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; max-height: 46vh; overflow-y: auto; align-content: start; padding: 2px; }
.loc-pane.comm-mode { grid-template-columns: 1fr; }
.loc-item {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 2px solid var(--line); border-radius: 14px;
  padding: 16px 14px; cursor: pointer; text-align: left; font-size: 21px; font-weight: 700; min-height: 64px;
}
.loc-item:active { background: #f0f8f2; }
.loc-item .li-icon { font-size: 26px; }
.loc-item .li-main { flex: 1; }
.loc-item .li-sub { display: block; font-size: 15px; color: var(--gray); font-weight: 400; margin-top: 2px; }
.loc-item .li-arrow { color: var(--green); font-size: 22px; }
.loc-search { margin-top: 14px; }
.loc-search input { width: 100%; height: 54px; border: 2px solid var(--line); border-radius: 12px; padding: 0 16px; font-size: 20px; }
.loc-search input:focus { outline: none; border-color: var(--green); }
.loc-back { margin-top: 16px; background: #f0f0f0; border: none; border-radius: 10px; padding: 12px 20px; font-size: 19px; color: var(--gray); cursor: pointer; }

/* 公告 */
.notice {
  margin: 14px 16px 0;
  background: #fff8e1;
  border: 2px solid #ffe0a3;
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 18px;
  color: #7a5b00;
  display: flex; gap: 10px; align-items: flex-start;
}
.notice-icon { font-size: 22px; }

/* 分类标签 */
.tabs {
  display: flex;
  gap: 10px;
  padding: 16px;
  overflow-x: auto;
  position: sticky;
  top: 84px;
  z-index: 15;
  background: var(--bg);
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 12px 20px;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  display: flex; align-items: center; gap: 8px;
}
.tab .tab-icon { font-size: 26px; }
.tab.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  box-shadow: var(--shadow);
}

/* 菜品区 */
.content { padding: 4px 16px 20px; }
.category-title {
  font-size: 20px;
  color: var(--gray);
  margin: 4px 4px 14px;
  font-weight: 600;
}
.dish-grid { display: flex; flex-direction: column; gap: 14px; }
.dish-card {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  gap: 16px;
  align-items: center;
  box-shadow: var(--shadow);
}
.dish-icon {
  font-size: 56px;
  width: 76px; height: 76px;
  flex: 0 0 76px;
  background: #faf6ef;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
}
.dish-main { flex: 1; min-width: 0; }
.dish-name { font-size: 26px; font-weight: 800; margin: 0 0 4px; }
.dish-desc { font-size: 18px; color: var(--gray); margin: 0 0 10px; }
.dish-bottom { display: flex; align-items: center; justify-content: space-between; }
.dish-price { color: var(--red); font-weight: 800; font-size: 26px; }
.dish-price small { font-size: 18px; }

.stepper { display: flex; align-items: center; gap: 12px; }
.step-btn {
  width: 48px; height: 48px;
  border-radius: 12px;
  border: 2px solid var(--green);
  background: #fff;
  color: var(--green);
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.step-btn.minus { border-color: var(--gray); color: var(--gray); }
.step-btn.add { background: var(--green); color: #fff; }
.qty { font-size: 26px; font-weight: 800; min-width: 34px; text-align: center; }

/* 底部购物车条 */
.cart-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  max-width: 560px;
  margin: 0 auto;
  background: #fff;
  border-top: 2px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  box-shadow: 0 -2px 14px rgba(0,0,0,.1);
  z-index: 25;
}
.cart-info {
  flex: 1;
  display: flex; align-items: center; gap: 10px;
  background: none; border: none; cursor: pointer;
  padding: 0; text-align: left;
}
.cart-bag { font-size: 36px; }
.cart-sum { display: flex; flex-direction: column; }
.cart-sum strong { font-size: 24px; color: var(--ink); }
.cart-sum small { font-size: 15px; color: var(--gray); }
.cart-total { display: flex; flex-direction: column; align-items: flex-end; }
.cart-total span { font-size: 15px; color: var(--gray); }
.cart-total strong { font-size: 28px; color: var(--red); }
.checkout-btn {
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 0 24px;
  height: 60px;
  font-size: 24px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.checkout-btn:active { background: var(--red-dark); }
.checkout-btn.big { width: 100%; height: 66px; font-size: 26px; }

/* 弹层 */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
}
.overlay[hidden] { display: none; }
.sheet {
  background: #fff;
  width: 100%;
  max-width: 560px;
  border-radius: 22px 22px 0 0;
  padding: 22px 20px 26px;
  max-height: 88vh;
  overflow-y: auto;
}
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.sheet-head h2 { margin: 0; font-size: 28px; }
.close-btn {
  background: #f0f0f0; border: none; border-radius: 10px;
  padding: 10px 16px; font-size: 19px; color: var(--gray); cursor: pointer;
}

/* 购物车清单 */
.cart-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.cart-row {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.cart-row .r-emoji { font-size: 40px; }
.cart-row .r-name { flex: 1; font-size: 23px; font-weight: 700; }
.cart-row .r-name small { display: block; font-size: 17px; color: var(--gray); font-weight: 400; }
.cart-row .r-qty { font-size: 22px; color: var(--gray); }
.cart-row .r-money { font-size: 22px; font-weight: 800; color: var(--red); min-width: 70px; text-align: right; }
.sheet-foot { border-top: 2px solid var(--line); padding-top: 16px; }
.foot-total { font-size: 24px; margin-bottom: 14px; text-align: right; }
.foot-total strong { font-size: 32px; color: var(--red); }

/* 结账 */
.order-summary {
  background: #faf6ef; border-radius: 14px; padding: 14px 16px;
  font-size: 19px; margin-bottom: 18px; line-height: 1.7;
}
.order-summary strong { color: var(--red); font-size: 24px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.field input {
  width: 100%; height: 58px;
  border: 2px solid var(--line); border-radius: 12px;
  padding: 0 16px; font-size: 22px;
  background: #fff;
}
.field input:focus { outline: none; border-color: var(--green); }

.pay-title { font-size: 23px; font-weight: 800; margin: 22px 0 12px; }
.pay-methods { display: flex; flex-direction: column; gap: 12px; }
.pay-method {
  display: flex; align-items: center; gap: 16px;
  background: #fff; border: 2px solid var(--line); border-radius: 14px;
  padding: 16px; cursor: pointer; text-align: left;
}
.pay-method.selected { border-color: var(--green); background: #f0f8f2; border-width: 3px; }
.pay-emoji { font-size: 40px; }
.pay-label { font-size: 24px; font-weight: 800; flex: 1; }
.pay-sub { font-size: 17px; color: var(--gray); }

.qr-area { text-align: center; margin-top: 18px; }
.qr-box {
  width: 240px; height: 240px; margin: 0 auto;
  border: 2px dashed #bbb; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  position: relative; background: #fff; overflow: hidden;
}
.qr-box img { max-width: 100%; max-height: 100%; display: none; }
.qr-box img.has-img { display: block; }
.qr-placeholder span { font-size: 48px; }
.qr-placeholder p { font-size: 20px; font-weight: 700; margin: 6px 0 2px; }
.qr-placeholder small { font-size: 15px; color: var(--gray); }
.qr-tip { font-size: 19px; color: var(--red); font-weight: 700; margin-top: 12px; }

.pos-area {
  margin-top: 18px; background: #eef4ff; border: 2px solid #c9dcff;
  border-radius: 14px; padding: 20px; text-align: center;
}
.pos-area[hidden] { display: none; }
.pos-icon { font-size: 48px; }
.pos-area p { font-size: 20px; margin: 10px 0 0; color: #234; }

.submit-btn {
  width: 100%; height: 66px; margin-top: 22px;
  background: var(--green); color: #fff;
  border: none; border-radius: 14px;
  font-size: 26px; font-weight: 800; cursor: pointer;
}
.submit-btn:disabled { background: #bbb; cursor: not-allowed; }
.submit-btn:not(:disabled):active { background: #1e6b30; }

/* 成功页 */
.success-sheet { text-align: center; padding: 36px 24px 30px; }
.success-icon { font-size: 76px; }
.success-sheet h2 { font-size: 34px; margin: 10px 0; }
.success-msg { font-size: 22px; color: var(--gray); margin: 8px 0 24px; }
.order-no-box {
  background: #fff8e1; border: 2px solid #ffe0a3; border-radius: 16px;
  padding: 16px; margin-bottom: 16px;
}
.order-no-box span { display: block; font-size: 19px; color: #7a5b00; }
.order-no-box strong { display: block; font-size: 46px; color: var(--red); letter-spacing: 3px; }
.success-pay { font-size: 19px; color: var(--green); font-weight: 700; min-height: 24px; }
