/* 物資管理系統 視覺系統
   配色沿用庭芳各系統登入頁（中央、示範站、社群系統）同一套語彙：暖白底、墨綠灰字、庭芳洋紅。
   另補三組狀態色（待點收的橘與紅、完成的綠）與深色模式。元件一律從下面的 token 取色。 */
:root {
  --bg: #F7F7F3; --surface: #FFFFFF; --surface-2: #F1F2EE; --ink: #303735; --ink-2: #4A524F;
  --muted: #66706D; --ph: #9AA19E; --line: #E3E6E1; --line-2: #D5DAD4;
  --primary: #E4007F; --primary-dark: #B10063; --primary-soft: #FDEEF6; --on-primary: #FFFFFF;
  --ok: #1E6B3C; --ok-soft: #E6F3EA; --warn: #9A5B00; --warn-soft: #FFF3DD; --late: #B3261E; --late-soft: #FCEBE8;
  --focus: rgba(228,0,127,.22);
  --shadow-1: 0 1px 2px rgba(48,55,53,.05), 0 6px 20px rgba(48,55,53,.06);
  --shadow-2: 0 12px 40px rgba(48,55,53,.22);
  --r-lg: 18px; --r-md: 12px; --r-sm: 8px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --fs-xs: 12px; --fs-sm: 14px; --fs-md: 16px; --fs-lg: 18px; --fs-xl: 22px; --fs-2xl: 28px;
  --font: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SF Mono", "Menlo", "Consolas", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151817; --surface: #1D2120; --surface-2: #252a28; --ink: #ECEEEB; --ink-2: #CDD2CE;
    --muted: #9AA39F; --ph: #6F7874; --line: #2E3432; --line-2: #3A413E;
    --primary: #FF4DA6; --primary-dark: #FF7ABD; --primary-soft: #3A1C2B; --on-primary: #1B0A12;
    --ok: #6FD19A; --ok-soft: #173325; --warn: #F2B357; --warn-soft: #3A2C12; --late: #FF8A80; --late-soft: #3D1C1A;
    --focus: rgba(255,77,166,.3);
    --shadow-1: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25); --shadow-2: 0 12px 40px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #151817; --surface: #1D2120; --surface-2: #252a28; --ink: #ECEEEB; --ink-2: #CDD2CE;
  --muted: #9AA39F; --ph: #6F7874; --line: #2E3432; --line-2: #3A413E;
  --primary: #FF4DA6; --primary-dark: #FF7ABD; --primary-soft: #3A1C2B; --on-primary: #1B0A12;
  --ok: #6FD19A; --ok-soft: #173325; --warn: #F2B357; --warn-soft: #3A2C12; --late: #FF8A80; --late-soft: #3D1C1A;
  --focus: rgba(255,77,166,.3); color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* [hidden] 的預設權重最低，任何自己寫的 display 都蓋得過它，所以要 !important */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); font-size: var(--fs-md); line-height: 1.6; color: var(--ink); background: var(--bg);
       min-height: 100vh; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary-dark); }
.mono { font-family: var(--mono); letter-spacing: .01em; font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ── 頂欄與導覽 ── */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent);
       backdrop-filter: saturate(1.2) blur(10px); -webkit-backdrop-filter: saturate(1.2) blur(10px);
       border-bottom: 1px solid var(--line); }
.top-in { max-width: 1080px; margin: 0 auto; padding: var(--s2) var(--s4); display: flex; align-items: center; gap: var(--s3); }
.brand { display: flex; align-items: center; gap: var(--s2); font-weight: 800; font-size: var(--fs-lg); letter-spacing: .02em; white-space: nowrap; }
.brand img { width: 32px; height: 32px; border-radius: 50%; }
.tabs { display: flex; gap: 2px; margin-left: var(--s4); }
.tab { border: 0; background: transparent; padding: 8px 14px; border-radius: 999px; font-weight: 600; color: var(--muted); cursor: pointer; }
.tab[aria-current="page"] { background: var(--primary-soft); color: var(--primary-dark); }
.tab:hover { color: var(--ink); }
.me { margin-left: auto; position: relative; }
/* 電腦：名字＋管理＋臉或指紋綁定＋登出 一排文字連結(照 FB 回覆系統) */
.me-links { display: flex; align-items: center; gap: var(--s4); font-size: var(--fs-sm); white-space: nowrap; }
.me-links b { color: var(--ink); }
.me-links a, .me-links button { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; background: none; border: 0;
                                padding: 4px 0; font: inherit; cursor: pointer; }
.me-links a:hover, .me-links button:hover { color: var(--primary-dark); }
.me-links a[aria-current="page"] { color: var(--primary-dark); font-weight: 700; }
.me-links [hidden] { display: none; }
@media (min-width: 720px) { .me-btn, .menu { display: none !important; } }
.me-btn { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 6px 12px 6px 10px;
          display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: var(--fs-sm); color: var(--ink-2); }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line);
        border-radius: var(--r-md); box-shadow: var(--shadow-2); min-width: 190px; padding: 6px; }
.menu button, .menu a { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px 12px;
        border-radius: var(--r-sm); cursor: pointer; color: var(--ink); text-decoration: none; font-size: var(--fs-sm); }
.menu button:hover, .menu a:hover { background: var(--surface-2); }
.menu .roles { padding: 8px 12px 10px; font-size: var(--fs-xs); color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 4px; }

/* 手機：導覽改到底部，拇指按得到 */
.bottom-nav { display: none; }
@media (max-width: 719px) {
  .tabs { display: none; }
  .me-links { display: none; }
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface);
                border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); gap: 4px; }
  .bottom-nav .tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px;
                     border-radius: var(--r-md); font-size: 16px; }
  .bottom-nav .tab svg { width: 26px; height: 26px; }
  main { padding-bottom: calc(96px + env(safe-area-inset-bottom)) !important; }
  .me-btn { padding: 6px 14px; }
  .brand span { font-size: var(--fs-md); }
}

main { max-width: 1080px; margin: 0 auto; padding: var(--s5) var(--s4) var(--s6); }
.page-title { font-size: var(--fs-xl); font-weight: 800; margin-bottom: var(--s4); letter-spacing: .01em; }
.section-title { font-size: var(--fs-sm); font-weight: 700; color: var(--muted); letter-spacing: .08em; margin: var(--s5) 0 var(--s3);
                 display: flex; align-items: center; gap: var(--s2); }
.section-title .count { background: var(--surface-2); color: var(--ink-2); border-radius: 999px; padding: 0 8px; font-size: var(--fs-xs); letter-spacing: 0; }

/* ── 卡片、按鈕、輸入 ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: var(--s4); }
.card + .card { margin-top: var(--s3); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; font-weight: 700;
       background: var(--primary); color: var(--on-primary); padding: 11px 20px; border-radius: 999px; transition: background .15s, transform .06s;
       box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 28%, transparent); white-space: nowrap; }
.btn:hover { background: var(--primary-dark); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: default; box-shadow: none; transform: none; }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line-2); box-shadow: none; }
.btn.ghost:hover { border-color: var(--primary); color: var(--primary-dark); background: var(--primary-soft); }
.btn.danger { background: var(--surface); color: var(--late); border: 1.5px solid color-mix(in srgb, var(--late) 40%, var(--line)); box-shadow: none; }
.btn.small { padding: 6px 14px; font-size: var(--fs-sm); }
.btn.block { width: 100%; }
.btn svg { width: 20px; height: 20px; flex: none; }
.actions { display: flex; gap: var(--s2); margin-top: var(--s4); }
.actions .btn { flex: 1; }
.field { display: block; }
.field > span { display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=search], input[type=number], input[type=date], input[type=tel], select, textarea {
  width: 100%; background: var(--surface); border: 1.5px solid var(--line-2); border-radius: var(--r-md); padding: 10px 12px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus); }
input::placeholder { color: var(--ph); }

/* ── 首頁兩顆大動作鈕 ── */
.hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.big-action { border: 0; cursor: pointer; border-radius: var(--r-lg); padding: var(--s5) var(--s4); text-align: center; display: flex;
              flex-direction: column; align-items: center; justify-content: center; gap: var(--s3); min-height: 150px; transition: transform .08s, box-shadow .15s; box-shadow: var(--shadow-1); }
.big-action:active { transform: scale(.98); }
.big-action .ico { width: 68px; height: 68px; border-radius: 20px; display: grid; place-items: center; }
.big-action .ico svg { width: 38px; height: 38px; }
.big-action b { font-size: var(--fs-lg); display: block; }
.big-action.primary { background: var(--primary); color: var(--on-primary); }
.big-action.primary .ico { background: color-mix(in srgb, var(--on-primary) 18%, transparent); }
.big-action.secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.big-action.secondary .ico { background: var(--primary-soft); color: var(--primary-dark); }
.code-input { display: flex; gap: var(--s2); margin-top: var(--s3); }
.code-input input { flex: 1; }

/* ── 清單列 ── */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden; }
.row { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s3); align-items: center; padding: 14px var(--s4);
       border-top: 1px solid var(--line); cursor: pointer; text-decoration: none; color: inherit; background: none; width: 100%; text-align: left; border-left: 0; border-right: 0; border-bottom: 0; }
.row:first-child { border-top: 0; }
.row:hover { background: var(--surface-2); }
.row .stripe { width: 4px; align-self: stretch; border-radius: 4px; background: var(--line-2); }
.row .stripe.warn { background: var(--warn); } .row .stripe.late { background: var(--late); } .row .stripe.ok { background: var(--ok); }
.row .main { min-width: 0; }
.row .l1 { display: flex; align-items: baseline; gap: var(--s2); flex-wrap: wrap; }
.row .tf { font-family: var(--mono); font-weight: 700; font-size: var(--fs-md); }
.row .who { font-weight: 600; }
.row .l2 { display: block; color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .main { display: block; }
.row .side { text-align: right; font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; }
.row.voided .main { opacity: .55; } .row.voided .tf { text-decoration: line-through; }
.empty { padding: var(--s6) var(--s4); text-align: center; color: var(--muted); }
.empty svg { width: 40px; height: 40px; opacity: .45; margin-bottom: var(--s2); }

.chip { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 700; border-radius: 999px; padding: 2px 9px; line-height: 1.6; white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); } .chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.late { background: var(--late-soft); color: var(--late); } .chip.muted { background: var(--surface-2); color: var(--muted); }
.chip.primary { background: var(--primary-soft); color: var(--primary-dark); }

/* ── 結果卡／詳情的欄位 ── */
.kv { display: grid; gap: 2px; }
.kv .item { padding: 10px 0; border-top: 1px solid var(--line); }
.kv .item:first-child { border-top: 0; }
.kv .k { font-size: var(--fs-xs); font-weight: 700; color: var(--muted); letter-spacing: .06em; display: flex; align-items: center; gap: var(--s2); }
.kv .v { font-size: var(--fs-lg); font-weight: 600; word-break: break-all; min-height: 1.6em; }
.kv .v.mono { font-size: var(--fs-lg); }
.kv .v.none { color: var(--ph); font-weight: 400; font-size: var(--fs-md); }
.kv .v.big { font-size: var(--fs-xl); font-weight: 800; }
.kv input { font-size: var(--fs-md); margin-top: 4px; }
.kv .was { color: var(--muted); font-size: var(--fs-sm); } .kv .was s { color: var(--late); }
.kv .item.diff { background: var(--warn-soft); margin: 0 calc(-1 * var(--s3)); padding: 10px var(--s3); border-radius: var(--r-md); border-top-color: transparent; }
.confirm { margin-top: 8px; display: flex; align-items: center; gap: 10px; font-size: var(--fs-sm); }
.toggle { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line-2); background: var(--surface); border-radius: 999px;
          padding: 6px 12px; cursor: pointer; font-weight: 700; color: var(--muted); }
.toggle[aria-pressed="true"] { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.warnline { color: var(--warn); font-size: var(--fs-sm); }
details.more { margin-top: var(--s3); border-top: 1px solid var(--line); padding-top: var(--s2); }
details.more > summary { cursor: pointer; list-style: none; font-size: var(--fs-sm); font-weight: 700; color: var(--muted); padding: 6px 0; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "▸ "; color: var(--primary); } details.more[open] > summary::before { content: "▾ "; }
.nums { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.num { display: flex; justify-content: space-between; gap: var(--s2); background: var(--surface-2); border-radius: var(--r-sm); padding: 6px 10px; font-size: var(--fs-sm); }
.num .mono { font-weight: 600; word-break: break-all; }
.num small { color: var(--muted); white-space: nowrap; }

.banner { border-radius: var(--r-md); padding: 12px 14px; display: flex; gap: var(--s3); align-items: flex-start; margin-bottom: var(--s3); font-size: var(--fs-sm); }
.banner b { display: block; font-size: var(--fs-md); }
.banner.late { background: var(--late-soft); color: var(--late); } .banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.ok { background: var(--ok-soft); color: var(--ok); } .banner.info { background: var(--primary-soft); color: var(--primary-dark); }
.banner .btn { margin-left: auto; }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--s2); margin-top: var(--s2); }
.photos a { display: block; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 3/4; background: var(--surface-2); position: relative; }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos .cap { position: absolute; left: 6px; bottom: 6px; }
.preview { width: 100%; max-height: 260px; object-fit: contain; border-radius: var(--r-md); background: var(--surface-2); margin-bottom: var(--s3); }

/* ── 點收品項 ── */
.items { display: flex; flex-direction: column; gap: var(--s2); }
.item-row { display: grid; grid-template-columns: 1fr 76px 72px 104px 36px; gap: 6px; align-items: center; }
.item-row .x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 20px; border-radius: 50%; width: 36px; height: 36px; }
.item-row .x:hover { background: var(--late-soft); color: var(--late); }
@media (max-width: 560px) {
  /* 手機：品名一整列、數量與單位並排、類別一整列 */
  .item-row { grid-template-columns: 1fr 1fr 36px; grid-template-areas: "n n x" "q u u" "c c c"; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
  .item-row:last-child { border-bottom: 0; padding-bottom: 0; }
  .item-row .n { grid-area: n; } .item-row .q { grid-area: q; } .item-row .u { grid-area: u; }
  .item-row .c { grid-area: c; } .item-row .x { grid-area: x; }
}

.item-head { display: grid; grid-template-columns: 1fr 76px 72px 104px 36px; gap: 6px; font-size: var(--fs-xs); color: var(--muted); font-weight: 700; }
@media (max-width: 560px) { .item-head { display: none; } }
.sugg { position: relative; }
.sugg-list { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line);
             border-radius: var(--r-md); box-shadow: var(--shadow-2); overflow: hidden; }
.sugg-list button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 12px; cursor: pointer; }
.sugg-list button:hover, .sugg-list button.on { background: var(--primary-soft); }
.photo-slot { width: 100%; background: none; border: 2px dashed var(--line-2); border-radius: var(--r-lg); padding: var(--s4); text-align: center; cursor: pointer; color: var(--muted);
              display: flex; flex-direction: column; align-items: center; gap: 6px; }
.photo-slot:hover { border-color: var(--primary); color: var(--primary-dark); }
.photo-slot.done { border-style: solid; border-color: var(--ok); color: var(--ok); background: var(--ok-soft); }
.photo-slot svg { width: 30px; height: 30px; }

/* ── 掃描器 ── */
.scanner { position: fixed; inset: 0; z-index: 60; background: #000; display: flex; flex-direction: column; }
.scanner video { flex: 1; width: 100%; object-fit: cover; }
.scanner .frame { position: absolute; left: 10%; right: 10%; top: 32%; height: 22%; border: 3px solid rgba(255,255,255,.9); border-radius: 18px;
                  box-shadow: 0 0 0 9999px rgba(0,0,0,.45); }
.scanner .frame::after { content: ""; position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; background: var(--primary); box-shadow: 0 0 12px var(--primary);
                         animation: scanline 1.6s ease-in-out infinite; }
@keyframes scanline { 0%,100% { transform: translateY(-40px); } 50% { transform: translateY(40px); } }
@media (prefers-reduced-motion: reduce) { .scanner .frame::after { animation: none; } }
.scanner .bar { position: absolute; left: 0; right: 0; bottom: 0; padding: var(--s4) var(--s4) calc(var(--s4) + env(safe-area-inset-bottom));
                display: flex; flex-direction: column; gap: var(--s3); background: linear-gradient(transparent, rgba(0,0,0,.75)); color: #fff; }
.scanner .hint { text-align: center; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.scanner .row2 { display: flex; gap: var(--s2); }
.scanner .row2 input { flex: 1; background: rgba(255,255,255,.95); color: #111; border: 0; }

/* ── 查詢頁 ── */
.searchbar { display: grid; grid-template-columns: 1fr auto; gap: var(--s2); }
.filters { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s3); align-items: end; }
.filters .field { flex: 1 1 140px; }
.filters .field > span { font-size: var(--fs-xs); }
.searchbar input { font-size: var(--fs-lg); padding: 12px 16px; }

/* 桌機：詳情兩欄 */
.detail-grid { display: grid; gap: var(--s3); }
@media (min-width: 900px) { .detail-grid { grid-template-columns: 1.1fr .9fr; align-items: start; } }
.reply { background: var(--surface-2); border-radius: var(--r-md); padding: var(--s3); font-size: var(--fs-md); line-height: 1.8; white-space: pre-wrap; }
.head-line { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s3); }
.head-line .tfno { font-family: var(--mono); font-size: var(--fs-2xl); font-weight: 800; letter-spacing: .01em; }
.back { border: 0; background: none; color: var(--muted); cursor: pointer; font-weight: 600; padding: 6px 0; margin-bottom: var(--s2); display: inline-flex; gap: 4px; align-items: center; }
.back:hover { color: var(--ink); }

/* ── 管理頁 ── */
.mtable { width: 100%; border-collapse: collapse; }
.mtable th, .mtable td { padding: 10px 8px; border-top: 1px solid var(--line); text-align: left; font-size: var(--fs-sm); }
.mtable th { color: var(--muted); font-size: var(--fs-xs); letter-spacing: .06em; border-top: 0; }
.mtable td.c, .mtable th.c { text-align: center; }
.mtable input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--primary); }
.table-wrap { overflow-x: auto; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; gap: 2px; margin-bottom: var(--s4); }
.seg button { border: 0; background: none; padding: 7px 16px; border-radius: 999px; cursor: pointer; font-weight: 700; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

/* ── 彈窗與 toast ── */
.modal-bg { position: fixed; inset: 0; z-index: 70; background: rgba(21,24,23,.5); display: flex; align-items: center; justify-content: center; padding: var(--s4); }
.modal { background: var(--surface); border-radius: var(--r-lg); padding: var(--s5); width: 100%; max-width: 420px; box-shadow: var(--shadow-2); max-height: 86vh; overflow: auto; }
.modal h3 { font-size: var(--fs-lg); margin-bottom: var(--s3); }
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 80; background: var(--ink); color: var(--bg);
         padding: 12px 18px; border-radius: 14px; box-shadow: var(--shadow-2); font-weight: 600; max-width: calc(100vw - 32px); text-align: center; }
.toast .tfno { font-family: var(--mono); font-size: var(--fs-xl); display: block; }
@media (min-width: 720px) { .toast { bottom: 32px; } }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; flex-direction: column; align-items: center; gap: var(--s3); padding: var(--s6) var(--s4); color: var(--muted); }

/* ── 登入頁（版面照示範站 demo.tinfun.org.tw，Jacky 指定的各系統登入範本）── */
.gate { max-width: 26rem; margin: 0 auto; padding: 1.5rem 1.25rem 2.5rem; text-align: center; }
.gate .logo { width: 88px; height: 88px; border-radius: 50%; display: block; margin: 0 auto .7rem; box-shadow: 0 6px 18px rgba(48,55,53,.16); }
.gate h1 { font-size: 1.45rem; margin-bottom: 1rem; }
.gate .card { --欄寬: 200px; max-width: 16rem; margin: 0 auto; padding: 1.5rem 1.4rem; text-align: left; }
.gate .field { width: var(--欄寬); margin: 0 auto 1.1rem; }
.gate #code { font-size: 28px; letter-spacing: 12px; text-align: center; padding: 10px 0 10px 12px; border-width: 2px; }
.gate .login-actions { display: flex; gap: .6rem; width: var(--欄寬); margin: 0 auto; }
.gate .login-actions .btn { flex: 1 1 0; padding: .85em 0; font-size: 1.05rem; }
.gate .login-actions .btn svg { width: 30px; height: 30px; }
.gate .forgot { width: var(--欄寬); margin: 1rem auto 0; text-align: right; font-size: .875rem; }
.gate .forgot a { color: var(--muted); text-underline-offset: 3px; }
.gate .notice { max-width: 22rem; margin: 1rem auto 0; }

/* 修改收件資料：其他號碼一組一列 */
.num-edit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 8px; margin-bottom: 8px; }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: 15px; }
@media (max-width: 520px) { .num-edit { grid-template-columns: minmax(0, 1fr) auto; } .num-edit input.mono { grid-column: 1; } .num-edit [data-del] { grid-row: 1 / span 2; grid-column: 2; } }

/* 手機查詢條件：放檔尾，才蓋得過上面 .filters 的 flex 寫法。
   兩欄跟著螢幕寬度平分(minmax(0,1fr) 讓欄可以縮到比內容窄)，日期欄取消 iPhone 的預設最小寬度 */
@media (max-width: 719px) {
  .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters .field { min-width: 0; }
  .filters .field.store:last-child { grid-column: 1 / -1; }
  .filters .btn { width: 100%; }
  input[type=date] { -webkit-appearance: none; appearance: none; min-width: 0; width: 100%; display: block; }
  input[type=date]::-webkit-date-and-time-value { text-align: left; }
}
