/* 勞工通報頁：沿用「建築二處戰情看板」的色系與元件（手機版、使用手機內建字型） */
:root {
  --bg: #ECEEF0; --panel: #FFFFFF; --ink: #15233F; --muted: #5A6577; --blue: #1D5BB8; --blue2: #E3ECF8;
  --line: #D2D8DF; --signal: #F3C318; --red: #D23B2E; --green: #2E9A55; --orange: #EE7D1E;
  --led: #0E1116; --led2: #1A1F27; --warnbg: #FDF1E4;
  --sans: "PingFang TC", "Noto Sans TC", "Noto Sans CJK TC", "Microsoft JhengHei", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1724; --panel: #172236; --ink: #E6ECF4; --muted: #9AA7BA; --blue: #2F6FD6; --blue2: #1D2D48;
    --line: #2A3850; --warnbg: #3A2A1A; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1724; --panel: #172236; --ink: #E6ECF4; --muted: #9AA7BA; --blue: #2F6FD6; --blue2: #1D2D48;
  --line: #2A3850; --warnbg: #3A2A1A; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 var(--sans); padding-bottom: 120px; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }
h3, p { margin: 0; }

/* 頁首 */
.top { position: sticky; top: 0; z-index: 5; background: var(--panel); border-bottom: 1px solid var(--line); padding: 12px 16px 10px; }
.brand b { display: block; font-size: 24px; font-weight: 900; letter-spacing: .04em; line-height: 1.2; }
.brand span { display: block; font-size: 13px; color: var(--muted); letter-spacing: .14em; }
.tabs { display: flex; gap: 8px; margin-top: 10px; }
.tabs button { flex: 1; padding: 9px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); font-weight: 700; font-size: 16px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--blue); color: #fff; border-color: var(--blue); }

.wrap { max-width: 640px; margin: 0 auto; padding: 12px 12px 24px; }
.panel { background: var(--panel); border-radius: 10px; padding: 16px; margin-bottom: 12px; }
.panel h3 { font-size: 19px; font-weight: 900; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.panel h3::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--signal); flex: none; }
.panel h3:has(.no)::before { display: none; }
.no { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--led); color: var(--signal); font: 700 17px var(--mono); flex: none; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.right { text-align: right; }
.hint { color: var(--muted); font-size: 14px; margin-top: 8px; }
.grow { flex: 1; min-width: 0; }

.alert { border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; font-weight: 700; background: var(--warnbg); color: var(--red); border-left: 6px solid var(--red); }
.alert.ok { color: var(--green); border-left-color: var(--green); }
.note { background: var(--warnbg); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; font-size: 15px; }
.note p + p { margin-top: 4px; }

/* 按鈕 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 10px 16px; border-radius: 10px; border: 1px solid transparent; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-line { background: var(--panel); border-color: var(--line); }
.btn-small { min-height: 38px; padding: 6px 12px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-big { min-height: 56px; font-size: 19px; }
.btn-col { display: grid; gap: 10px; margin-top: 16px; }
.file-btn { color: #fff; }

.input { display: block; width: 100%; margin-top: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-size: 17px; }
textarea.input { resize: vertical; min-height: 84px; }
.field { display: block; font-size: 15px; color: var(--muted); margin-bottom: 10px; }

/* 工地選單 */
.site-list { display: grid; gap: 8px; margin-top: 10px; }
.site-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); text-align: left; cursor: pointer; }
.site-item:active, .site-item:hover { border-color: var(--blue); background: var(--blue2); }
.thumb { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; flex: none; background: var(--led2); }
.thumb-ph { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 8px; flex: none; background: var(--led); color: var(--signal); font: 700 20px var(--mono); }
.site-item .nm { font-weight: 700; font-size: 17px; line-height: 1.35; }
.site-item .cd { font-size: 13px; color: var(--muted); }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--signal); color: #15233F; margin-left: 6px; vertical-align: 2px; }
.site-picked .banner { display: block; width: 100%; aspect-ratio: 2 / 1; object-fit: cover; border-radius: 8px; margin-bottom: 10px; }
.picked-row { display: flex; align-items: center; gap: 12px; }
.picked-name { font-weight: 900; font-size: 19px; line-height: 1.3; }

/* 類別、項目、位置 */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice { padding: 12px 10px; min-height: 56px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-weight: 700; cursor: pointer; text-align: center; line-height: 1.35; }
.choice small { display: block; font-weight: 500; font-size: 13px; color: var(--muted); }
.choice[aria-pressed="true"] { background: var(--blue); color: #fff; border-color: var(--blue); }
.choice[aria-pressed="true"] small { color: #DCE6F7; }
.list { display: grid; gap: 8px; }
.list .choice { text-align: left; display: flex; gap: 10px; align-items: flex-start; }
.star { color: var(--orange); font-weight: 900; }
.choice[aria-pressed="true"] .star { color: var(--signal); }
.reward { margin-left: auto; flex: none; font: 700 14px var(--mono); padding: 2px 8px; border-radius: 6px; background: var(--led); color: var(--signal); }
.grid-floor { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.grid-floor .choice { min-height: 46px; padding: 8px 4px; font-family: var(--mono); }

/* 照片 */
.photos { display: grid; gap: 10px; margin-top: 12px; }
.photo { display: grid; grid-template-columns: 84px 1fr; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.photo img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; background: var(--led2); }
.bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin: 6px 0; }
.bar i { display: block; height: 100%; width: 0; background: var(--blue); transition: width .2s; }
.st { font-size: 15px; font-weight: 700; }
.st.ok { color: var(--green); } .st.err { color: var(--red); }
.warn { color: var(--orange); font-size: 13px; font-weight: 700; }
.row-btns { display: flex; gap: 8px; margin-top: 4px; }

/* 下方送出列 */
.bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--panel); border-top: 1px solid var(--line); padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); }
.bottom > * { max-width: 640px; margin-left: auto; margin-right: auto; }
.need { font-size: 14px; color: var(--muted); margin-bottom: 6px; text-align: center; }

/* 送出完成、查詢（黑底黃字面板） */
.done { text-align: center; }
.led-msg { background: var(--led); color: var(--signal); font: 900 30px var(--sans); border-radius: 10px; padding: 18px; margin-bottom: 14px; }
.done p + p { margin-top: 6px; }
.led { background: var(--led); border-radius: 12px; padding: 10px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.cell { background: var(--led2); border-radius: 8px; padding: 10px; }
.cell .v { font: 700 26px/1.1 var(--mono); color: var(--signal); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell .l { font-size: 12px; color: #9AA7BA; margin-top: 4px; }
.q-list { display: grid; gap: 10px; margin-bottom: 12px; }
.q-item { background: var(--panel); border-radius: 10px; padding: 12px 14px; border-left: 6px solid var(--blue); }
.q-item.ok { border-left-color: var(--green); } .q-item.bad { border-left-color: var(--red); }
.q-item .t { font-size: 13px; color: var(--muted); }
.q-item .s { font-weight: 900; margin: 2px 0; }
.q-item.ok .s { color: var(--green); } .q-item.bad .s { color: var(--red); } .q-item .s.wait { color: var(--blue); }
.q-item .d { font-size: 15px; }
.q-item .r { font-size: 14px; margin-top: 4px; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.ts { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); z-index: 10; }
