/* 馬蔥餅 POS 設計語言「紙墨紅・職人」— 全端共用 tokens
   基因：編輯感（wired：紙白黑字、hairline、零裝飾）轉譯到觸控平板；有機暖紙底
   色彩角色只有四個：紙（底）/ 墨（字）/ 馬蔥紅（唯一強調）/ 翠蔥綠（完成、金流正向）*/
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+TC:wght@600;900&family=Noto+Sans+TC:wght@400;500;700&family=Cormorant+Garamond:ital,wght@1,500&display=swap');

:root {
  --paper: #F7F2E9;        /* 紙米白：頁底 */
  --paper-2: #EFE7D8;      /* 紙深一階：面板底 */
  --paper-3: #E4DAC6;      /* 紙深二階：按下態 */
  --ink: #1C1C1C;          /* 墨黑 */
  --ink-2: #4A4540;        /* 次要文字 */
  --ink-3: #8C8478;        /* 弱化文字 / placeholder */
  --hair: #D9CDB6;         /* hairline */
  --red: #C8232C;          /* 馬蔥紅：唯一強調（取餐號框、主 CTA、警示） */
  --red-2: #A61B23;        /* 按下 */
  --red-wash: #F6DEDC;     /* 紅淡底 */
  --green: #3E7A4E;        /* 翠蔥綠：完成 / 正向 */
  --green-wash: #DCE9DD;
  --white: #FFFDF9;        /* 卡片浮起面（不是純白） */

  --serif: 'Noto Serif TC', 'Songti TC', serif;
  --sans: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;

  --r: 6px;                /* 全站單一圓角 */
  --shadow-sm: 0 1px 2px rgba(28, 28, 28, .08);
  --shadow-md: 0 6px 20px rgba(28, 28, 28, .14);

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --fast: 120ms; --normal: 220ms;
  --ease: cubic-bezier(.25, .46, .45, .94);

  --touch: 56px;           /* 觸控最小高度（44 + 高頻 +40% 規範 → 56） */
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.45;
  overflow-x: hidden; -webkit-font-smoothing: antialiased; user-select: none;
}
input, textarea, button, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--hair); background: var(--white); border-radius: var(--r); min-height: var(--touch); padding: 0 var(--s4); transition: background var(--fast) var(--ease), transform var(--fast) var(--ease), border-color var(--fast); }
button:hover { background: var(--paper-2); }
button:active { transform: scale(.97); background: var(--paper-3); }
button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
button.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); font-weight: 700; }
button.primary:hover { background: #2a2a2a; }
button.red { background: var(--red); color: #fff; border-color: var(--red); font-weight: 700; }
button.red:hover { background: var(--red-2); }
button.green { background: var(--green); color: #fff; border-color: var(--green); font-weight: 700; }
button.ghost { background: transparent; border-color: transparent; }
button.ghost:hover { background: var(--paper-2); }
button.sm { min-height: 40px; padding: 0 var(--s3); font-size: 14px; }

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.serif { font-family: var(--serif); }
.muted { color: var(--ink-3); }
.hair-t { border-top: 1px solid var(--hair); }
.hair-b { border-bottom: 1px solid var(--hair); }

/* 紙感：極淡的暈染，避免大面積平塗的「均值感」 */
body { background-image: radial-gradient(ellipse at 20% 0%, rgba(255, 253, 249, .9), transparent 55%), radial-gradient(ellipse at 100% 100%, rgba(200, 35, 44, .045), transparent 50%); background-attachment: fixed; }

/* LOGO（去白底透明 PNG） */
.logo { display: block; height: 40px; width: auto; }
.logo.lg { height: 120px; margin: 0 auto; }

/* FoodYang 匯瀚科技 落款（跨案一致：Cormorant italic） */
.sig { font-family: 'Cormorant Garamond', 'Noto Serif TC', serif; font-style: italic; font-size: 13px; color: var(--ink-3); letter-spacing: .04em; display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.sig b { font-weight: 500; color: var(--ink-2); }
.sig .zh { font-family: var(--sans); font-style: normal; font-size: 11px; letter-spacing: .08em; }
.sig::before { content: ""; width: 14px; height: 1px; background: var(--red); display: inline-block; align-self: center; }

/* 取餐號印章框：品牌記憶錨點 */
.stamp { display: inline-block; border: 3px solid var(--red); color: var(--ink); font-family: var(--serif); font-weight: 900; line-height: 1; padding: .1em .25em; border-radius: 4px; letter-spacing: .02em; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--paper); padding: var(--s3) var(--s5); border-radius: var(--r); box-shadow: var(--shadow-md); opacity: 0; transition: opacity var(--normal) var(--ease), transform var(--normal) var(--ease); z-index: 1000; pointer-events: none; max-width: 90vw; }
.toast.in { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--red); color: #fff; }
.toast.ok { background: var(--green); color: #fff; }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(28, 28, 28, .55); display: none; align-items: center; justify-content: center; z-index: 500; padding: var(--s4); }
.modal-bg.open { display: flex; }
.modal { background: var(--paper); border-radius: var(--r); box-shadow: var(--shadow-md); width: min(720px, 100%); max-height: 94vh; overflow: auto; border: 1px solid var(--hair); }
.modal header { display: flex; align-items: center; justify-content: space-between; padding: var(--s4) var(--s5); border-bottom: 1px solid var(--hair); }
.modal header h3 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 20px; }
.modal .body { padding: var(--s5); }
.modal footer { display: flex; gap: var(--s3); padding: var(--s4) var(--s5); border-top: 1px solid var(--hair); justify-content: flex-end; }

.reveal { opacity: 0; transform: translateY(12px); animation: fadeUp .4s var(--ease) forwards; }
@keyframes fadeUp { to { opacity: 1; transform: none; } }
