[hidden] { display: none !important; }
:root {
  /* 溫暖活潑：奶油底、珊瑚橘主色、陽光黃與薄荷綠點綴、暖棕色文字 */
  --bg: #fff8f0;
  --surface: #ffffff;
  --surface-2: #fffaf4;
  --tint: #fff1e4;
  --tint-2: #ffe6d1;
  --ink: #3b2a20;
  --ink-2: #6b5446;
  --muted: #8c7363;
  --line: #f1dfd0;
  --line-strong: #dcc3b0;
  --brand: #f0643c;
  --brand-dark: #d24a23;
  --brand-soft: #ffc6ae;
  --info-bg: #fff0e8;
  --sun: #ffb937;
  --sun-dark: #e8960f;
  --mint: #2fb39a;
  --mint-bg: #e2f6f0;
  --deep: #5a2f1e;
  --bubble: #ffe4d6;
  --urgent: #e0433a;
  --urgent-bg: #fde9e6;
  --urgent-soft: #fff6f4;
  --urgent-line: #f6bdb6;
  --warn: #b0600a;
  --warn-bg: #fff3d6;
  --ok: #2a9a68;
  --ok-bg: #e3f6ec;
  --ok-line: #a9e0c4;
  --focus: #ffb937;
  --radius: 16px;
  --radius-s: 10px;
  --shadow: 0 2px 4px rgba(120, 60, 20, .04), 0 8px 24px rgba(120, 60, 20, .07);
  --shadow-hover: 0 4px 8px rgba(120, 60, 20, .06), 0 14px 32px rgba(120, 60, 20, .12);
}
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font: 16px/1.6 "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", sans-serif;
}
h1, h2, h3 { line-height: 1.3; margin: 0 0 .6em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.25rem; }
a { color: var(--brand); }

/* 頂部列 */
.topbar { display: flex; align-items: center; gap: 1.5rem; padding: .7rem 1.5rem; background: var(--brand); color: #fff; }
.topbar .brand { font-size: 1.2rem; font-weight: 700; color: #fff; text-decoration: none; letter-spacing: .03em; }
.topbar nav { display: flex; gap: 1.1rem; flex: 1; }
.topbar nav a { color: var(--bubble); text-decoration: none; padding: .2rem 0; border-bottom: 3px solid transparent; }
.topbar nav a.active, .topbar nav a:hover { color: #fff; border-color: #fff; }
.topbar .who { color: var(--bubble); font-size: .95rem; }
.topbar .btn.ghost { color: #fff; border-color: var(--brand-soft); }
.topbar .btn.ghost:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,.12); }

main { max-width: 980px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }

/* 按鈕 */
.btn {
  display: inline-block; cursor: pointer; font: inherit; text-decoration: none;
  background: var(--brand); color: #fff; border: 1px solid var(--brand); border-radius: 6px;
  padding: .5rem 1.1rem; font-weight: 600;
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); font-weight: 500; }
.btn.ghost:hover { background: var(--tint); border-color: var(--brand); color: var(--brand); }
.btn.danger { background: var(--urgent); border-color: var(--urgent); color: #fff; }
.btn.danger:hover { background: #9f1f1f; border-color: #9f1f1f; }
.btn.small { padding: .2rem .7rem; font-size: .88rem; }
.btn { white-space: nowrap; }
.btn.big { padding: .75rem 1.8rem; font-size: 1.1rem; }
.btn.ok { background: var(--ok); border-color: var(--ok); }
.btn.ok:hover { background: #115731; border-color: #115731; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .card:focus-visible {
  outline: 3px solid var(--sun); outline-offset: 2px;
}

/* 表格 */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .65rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .9rem; background: var(--surface-2); }
tr.off td { opacity: .5; }
.tag { display: inline-block; padding: 0 .55rem; border-radius: 4px; font-size: .85rem; font-weight: 600; }
.tag.admin { background: var(--info-bg); color: var(--brand-dark); }
.tag.player { background: var(--ok-bg); color: var(--ok); }
.tag.stopped { background: var(--urgent-bg); color: var(--urgent); }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.actions form { margin: 0; }

/* 表單 */
label { display: block; margin-bottom: 1rem; }
label span { display: block; color: var(--muted); font-size: .9rem; margin-bottom: .25rem; }
input[type=text], input[type=password], input[type=datetime-local], input[type=time], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--line-strong); border-radius: 6px; padding: .55rem .7rem;
}
input[type=datetime-local] { width: auto; }
textarea { min-height: 8rem; resize: vertical; }
.hint { color: var(--muted); font-size: .85rem; margin-top: .25rem; }
.error { background: var(--urgent-bg); border-left: 5px solid var(--urgent); color: #7a1414; padding: .6rem .9rem; margin-bottom: 1rem; border-radius: 4px; }
.notice { background: var(--ok-bg); border-left: 5px solid var(--ok); color: #0f4a29; padding: .6rem .9rem; margin-bottom: 1.25rem; border-radius: 4px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .4rem .8rem; margin: .5rem 0 1rem; }
.checks label { margin: 0; display: flex; align-items: center; gap: .5rem; }
.checks input { width: 1.1rem; height: 1.1rem; accent-color: var(--brand); }

/* 登入 */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-card { width: min(400px, 100%); border-top: 6px solid var(--brand); }
.login-card h1 { color: var(--brand); font-size: 1.6rem; }

/* 標籤（狀態） */
.st { display: inline-block; padding: .05rem .6rem; border-radius: 4px; font-size: .85rem; font-weight: 700; white-space: nowrap; background: var(--tint); color: var(--ink-2); }
.st.unread, .st.read { background: var(--warn-bg); color: var(--warn); }
.st.accepted { background: var(--info-bg); color: var(--brand-dark); }
.st.done { background: var(--ok-bg); color: var(--ok); }
.st.urgent { background: var(--urgent); color: #fff; }
.st.overdue { background: #7a1414; color: #fff; }
.st.late { background: var(--warn-bg); color: var(--warn); }
.st.plain { background: var(--tint); color: var(--ink-2); font-weight: 500; }

/* 頁首摘要 */
.summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem;
  border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.5rem;
  background: var(--info-bg); border: 1px solid var(--brand-soft); font-size: 1.1rem;
}
.summary.alert { background: var(--urgent-bg); border-color: var(--urgent-line); }
.summary.calm { background: var(--ok-bg); border-color: var(--ok-line); }

/* 任務卡片 */
.board { display: grid; gap: .9rem; }
.card {
  display: block; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-left: 8px solid var(--brand);
  border-radius: var(--radius); padding: 1rem 1.25rem;
}
.card:hover { border-color: var(--brand); box-shadow: 0 2px 8px rgba(10,60,100,.12); }
.card h3 { margin: 0 0 .4rem; font-size: 1.15rem; color: var(--ink); }
.card .meta { color: var(--muted); font-size: .92rem; display: flex; gap: .4rem .9rem; flex-wrap: wrap; align-items: center; }
.card.with-due { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.card.urgent { border-left-color: var(--urgent); background: var(--urgent-soft); }
.card.lv-soon { border-left-color: var(--sun-dark); }
.card.lv-over { border-left-color: #7a1414; background: var(--urgent-bg); border-color: var(--urgent-line); }
.card.done { opacity: .75; border-left-color: var(--ok); }

.due { text-align: right; min-width: 8.5rem; }
.due b { display: block; font-size: 1.3rem; line-height: 1.2; color: var(--brand-dark); }
.due small { color: var(--muted); }
.due.soon b { color: var(--warn); }
.due.over b { color: #7a1414; }
.due.none b { color: var(--muted); font-size: 1rem; font-weight: 500; }

.body-text { white-space: pre-wrap; word-break: break-word; }
.section { margin-top: 1.75rem; }
.reply { border-left: 3px solid var(--brand-soft); padding: .3rem 0 .3rem .9rem; margin-bottom: .9rem; }
.reply small { color: var(--muted); display: block; }
.empty { color: var(--muted); }
.progress { display: flex; gap: .4rem; flex-wrap: wrap; }
.stack { display: grid; gap: 1rem; }

@media (max-width: 640px) {
  .two { grid-template-columns: 1fr; }
  .card.with-due { flex-direction: column; align-items: flex-start; }
  .due { text-align: left; }
  .topbar { flex-wrap: wrap; gap: .6rem 1rem; }
}

/* =====================================================================
   整合版新增：頂部列、首頁磚塊、後台側欄、統計卡、表格與表單
   ===================================================================== */
.topbar { position: sticky; top: 0; z-index: 20; }
.topbar nav { overflow-x: auto; scrollbar-width: none; }
.topbar nav a { white-space: nowrap; }
.topbar .who { color: #fff; text-decoration: none; display: flex; flex-direction: column; line-height: 1.15; text-align: right; }
.topbar .who small { color: var(--brand-soft); font-size: .75rem; }
.topbar .who:hover { text-decoration: underline; }
main.wide { max-width: 1280px; }
.muted { color: var(--muted); }
.warn-text { color: var(--warn); }
.mono { font-family: "JetBrains Mono", Consolas, Menlo, monospace; letter-spacing: .02em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
code { background: var(--tint); padding: 0 .3rem; border-radius: 3px; font-size: .9em; }
input[type=date], input[type=number], input[type=search] {
  font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: 6px; padding: .5rem .7rem;
}
input[type=search] { width: 100%; }
.row.tight { margin-bottom: .6rem; }
.row.tight h2 { margin: 0; }

/* 首頁磚塊 */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.tile {
  display: flex; flex-direction: column; gap: .35rem; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-top: 6px solid var(--brand);
  border-radius: var(--radius); padding: 1.2rem 1.3rem 1.1rem; min-height: 10.5rem;
}
.tile:hover { border-color: var(--brand); box-shadow: 0 4px 14px rgba(10,60,100,.12); }
.tile.alert { border-top-color: var(--urgent); }
.tile.dark { background: var(--deep); border-color: var(--deep); border-top-color: var(--sun); color: #fff7ef; }
.tile.dark .tile-k, .tile.dark .tile-meta { color: var(--brand-soft); }
.tile-k { font-weight: 700; color: var(--muted); font-size: .95rem; }
.tile-v { font-size: 1.9rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.tile-v small { font-size: .95rem; font-weight: 500; color: var(--muted); }
.tile-v.small { font-size: 1.25rem; }
.tile-meta { color: var(--muted); font-size: .9rem; display: flex; flex-wrap: wrap; gap: .3rem .5rem; align-items: center; }
.tile-go { margin-top: auto; color: var(--brand); font-weight: 700; }

/* 後台版面：左側選單 */
.admin-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - 56px); background: linear-gradient(to right, #fff 219px, var(--line) 219px, var(--line) 220px, transparent 220px); }
.side { background: #fff; border-right: 1px solid var(--line); padding: 1.1rem .7rem 2rem; position: sticky; top: 56px; align-self: start; height: calc(100vh - 56px); overflow-y: auto; }
.side-title { font-weight: 800; color: var(--brand-dark); padding: 0 .6rem .6rem; font-size: 1.05rem; }
.side-group { font-size: .75rem; letter-spacing: .08em; color: var(--muted); padding: .9rem .6rem .25rem; font-weight: 700; }
.side a { display: block; padding: .42rem .6rem; border-radius: 6px; color: var(--ink); text-decoration: none; }
.side a:hover { background: var(--tint); }
.side a.active { background: var(--info-bg); color: var(--brand-dark); font-weight: 700; box-shadow: inset 3px 0 0 var(--brand); }
.admin-main { padding: 1.6rem 2rem 4rem; max-width: 1240px; width: 100%; }

/* 統計卡 */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .9rem; margin-bottom: 1.25rem; }
.kpis.compact { margin: 1rem 0; }
.kpi { display: flex; flex-direction: column; gap: .15rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1.1rem; text-decoration: none; color: inherit; }
a.kpi:hover { border-color: var(--brand); }
.kpi span { color: var(--muted); font-size: .88rem; }
.kpi b { font-size: 1.6rem; line-height: 1.25; font-variant-numeric: tabular-nums; }
.kpi b.small { font-size: 1.15rem; }
.kpi b small { font-size: .85rem; color: var(--muted); font-weight: 500; }
.kpi small { color: var(--muted); font-size: .82rem; }
.kpi.warn { border-left: 5px solid var(--sun-dark); }
.kpi.bad { border-left: 5px solid var(--urgent); background: var(--urgent-soft); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.grid-2 > .panel { padding: 1.1rem 1.25rem; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: .45rem 0; border-bottom: 1px solid var(--tint); }
.list li:last-child { border-bottom: 0; }
.list small { display: block; color: var(--muted); }

/* 長條圖 */
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: .5rem; height: 190px; align-items: end; padding-top: 1.2rem; }
.bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: .2rem; }
.bar i { display: block; width: 70%; max-width: 46px; min-height: 2px; background: var(--brand); border-radius: 4px 4px 0 0; }
.bar:hover i { background: var(--brand-dark); }
.bar-v { font-size: .72rem; color: var(--muted); white-space: nowrap; }
.bar-k { font-size: .8rem; color: var(--muted); }

/* 篩選列 */
.filters { display: flex; flex-wrap: wrap; gap: .6rem .8rem; align-items: flex-end; }
.filters label { margin: 0; }
.filters label span { font-size: .8rem; }
.filters select, .filters input { width: auto; padding: .42rem .6rem; }
.filters .grow { flex: 1 1 220px; }
.filters .grow input { width: 100%; }
.check-inline { display: flex !important; align-items: center; gap: .4rem; padding-bottom: .5rem; white-space: nowrap; }
.check-inline input { width: 1.05rem; height: 1.05rem; accent-color: var(--brand); }
.event-bar { display: flex; gap: .8rem; align-items: flex-end; margin-bottom: 1rem; padding: 1rem 1.25rem; }
.event-bar label { flex: 1; margin: 0; }

table.dense th, table.dense td { padding: .5rem .6rem; }
table.dense tfoot td { border-bottom: 0; padding-top: .3rem; padding-bottom: .3rem; }
.pager { display: flex; gap: 1rem; align-items: center; justify-content: center; margin-top: 1rem; color: var(--muted); }

/* 價目表的行內編輯 */
.inline-form { display: flex; flex-wrap: wrap; gap: .6rem .8rem; align-items: flex-end; margin-bottom: 1rem; }
.inline-form label { margin: 0; flex: 1 1 150px; }
.inline-form label:nth-child(3) { flex: 2 1 220px; }
.row-form { display: grid; grid-template-columns: 1.3fr 2fr 1fr .9fr auto; gap: .5rem; padding: .35rem .6rem; align-items: center; }
.row-form input[type=text], .row-form input[type=number] { width: 100%; padding: .35rem .5rem; }
.row-form .check-inline { padding: 0; }

fieldset.perm { border: 1px solid var(--line); border-radius: 6px; padding: .6rem 1rem .8rem; margin: 0 0 1rem; }
fieldset.perm legend { color: var(--muted); font-size: .9rem; padding: 0 .3rem; }
label.check { display: flex; align-items: center; gap: .55rem; margin: .35rem 0; }
label.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--brand); }

dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.2rem; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }
details.help { margin: .5rem 0 1rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: .6rem .9rem; }
details.help summary { cursor: pointer; font-weight: 600; color: var(--brand); }
details.help dl { margin-top: .7rem; font-size: .9rem; }
textarea.code { font-family: "JetBrains Mono", Consolas, Menlo, monospace; font-size: .86rem; line-height: 1.5; min-height: 26rem; white-space: pre; tab-size: 2; }

/* 選單上的未讀數字 */
.nav-badge { display: inline-block; min-width: 1.25rem; margin-left: .3rem; padding: 0 .35rem; border-radius: 999px;
  background: var(--sun); color: var(--ink); font-size: .75rem; font-weight: 800; line-height: 1.25rem; text-align: center; vertical-align: 1px; }

/* 監看頁：嵌入原儀表板 */
body.fill { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
body.fill .embed { flex: 1; width: 100%; border: 0; display: block; background: var(--surface-2); }
.strip { padding: .55rem 1.5rem; font-weight: 600; }
.strip.alert { background: var(--urgent); color: #fff; }

@media (max-width: 980px) {
  .admin-layout { grid-template-columns: minmax(0, 1fr); background: none; }
  .side { position: static; height: auto; display: flex; flex-wrap: nowrap; overflow-x: auto; gap: .2rem; padding: .6rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .side a { white-space: nowrap; flex: none; }
  table.dense td, table.dense th { white-space: nowrap; }
  .side-title, .side-group { display: none; }
  .admin-main { padding: 1.2rem 1rem 3rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .row-form { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .topbar { padding: .6rem 1rem; }
  .topbar nav { order: 3; flex: 1 1 100%; }
  .topbar .brand { font-size: 1.05rem; flex: 1; }
  main { padding: 1.25rem 1rem 3rem; }
  .bars { height: 150px; }
  .bar-v { display: none; }
  table.dense th:nth-child(2), table.dense td:nth-child(2) { display: table-cell; }
}
@media print {
  .topbar, .side, .actions, form .btn { display: none !important; }
  .admin-layout { display: block; }
  body { background: #fff; }
}

.kpis.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .kpis.six { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .kpis.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi b { font-size: 1.3rem; } }

/* 後台頁內的快速跳轉 */
.tabs-inline { display: flex; flex-wrap: wrap; gap: .4rem; margin: -.3rem 0 1rem; }
.tabs-inline a { text-decoration: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: .15rem .8rem; font-size: .9rem; }
.tabs-inline a:hover { border-color: var(--brand); }
table.settle td { vertical-align: middle; }
table.dense input[type=text], table.dense input[type=number] { padding: .3rem .45rem; }
/* 首頁公告欄 */
.bulletins { display: grid; gap: .7rem; margin-bottom: 1.4rem; }
.bulletin { background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--sun-dark); border-radius: var(--radius); padding: .8rem 1.1rem; }
.bulletin.pinned { border-left-color: var(--urgent); }
.bulletin h3 { margin: 0 0 .2rem; font-size: 1.05rem; }
.bulletin small { color: var(--muted); }
.bulletin .body-text { margin-top: .35rem; }

/* ---------------- 部門群組 ---------------- */
.tabs-inline a.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.tabs-inline a small { opacity: .7; margin-left: .15rem; }
tr.group-row th { background: var(--tint); text-align: left; font-size: .9rem; padding: .35rem .7rem; color: var(--brand-dark); border-bottom: 1px solid var(--line); }
.bulk-bar { position: sticky; bottom: .8rem; display: none; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .8rem; padding: .7rem 1rem; box-shadow: 0 6px 22px rgba(0,0,0,.12); border-top: 4px solid var(--brand); }
.bulk-bar.on { display: flex; }
.bulk-bar select { width: auto; min-width: 9rem; }
.dept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 1rem; }
.dept-card { display: flex; flex-direction: column; gap: .6rem; }
.dept-card h2 { margin: 0; font-size: 1.15rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.dept-card .people { display: flex; flex-wrap: wrap; gap: .3rem; min-height: 1.6rem; }
.person { background: var(--tint); border-radius: 999px; padding: .05rem .65rem; font-size: .88rem; }
.person.admin { background: var(--info-bg); }
.dept-card .tools { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: auto; padding-top: .4rem; border-top: 1px dashed var(--line); }
.dept-card .tools form { margin: 0; }
.rename { display: none; gap: .4rem; }
.rename.on { display: flex; }
.rename input { padding: .3rem .5rem; }
.pick-group { border: 1px solid var(--line); border-radius: 8px; padding: .5rem .8rem .2rem; margin-bottom: .7rem; }
.pick-group legend { font-weight: 700; padding: 0 .3rem; font-size: .92rem; }
.pick-group legend button { margin-left: .4rem; }
.pick-group .checks { margin: .2rem 0 .5rem; }
.dept-quick { display: flex; flex-wrap: wrap; gap: .4rem; margin: .2rem 0 .8rem; align-items: center; }

/* 帳號列表 */
.users-panel { overflow-x: auto; padding-top: .4rem; }
.users-table td { vertical-align: middle; padding-top: .65rem; padding-bottom: .65rem; }
.users-table th { white-space: nowrap; }
.users-table .c-pick { width: 2rem; }
.users-table .c-pick input { width: 1.05rem; height: 1.05rem; }
.users-table .c-who { white-space: nowrap; }
.users-table .c-who b { display: block; font-size: 1.02rem; }
.users-table .c-who small, .users-table .c-state small { display: block; color: var(--muted); font-size: .8rem; margin-top: .1rem; }
.users-table .c-role { white-space: nowrap; width: 1%; }
.users-table .c-perm { min-width: 13rem; line-height: 1.9; }
.users-table .c-state { white-space: nowrap; width: 1%; }
.users-table .c-act { width: 1%; }
.users-table .c-act .actions { flex-wrap: nowrap; justify-content: flex-end; }
.users-table .tag { white-space: nowrap; }
.dot { display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; margin-right: .35rem; vertical-align: middle; }
.dot.ok { background: var(--ok); }
.ok-text { color: var(--ok); font-weight: 700; }
@media (max-width: 760px) {
  .users-table thead { display: none; }
  .users-table, .users-table tbody { display: block; }
  .users-table tr { display: grid; grid-template-columns: auto 1fr auto; gap: .35rem .7rem; align-items: center;
                    padding: .75rem .2rem; border-bottom: 1px solid var(--line); }
  .users-table tr.group-row { display: block; padding: 0; }
  .users-table tr.group-row th { display: block; }
  .users-table td { display: block; padding: 0; border: 0; width: auto !important; min-width: 0 !important; }
  .users-table .c-pick { grid-row: 1; grid-column: 1; }
  .users-table .c-who { grid-row: 1; grid-column: 2; white-space: normal; }
  .users-table .c-role { grid-row: 1; grid-column: 3; }
  .users-table .c-perm, .users-table .c-state, .users-table .c-act { grid-column: 1 / -1; }
  .users-table tr:not(:has(.c-pick)) .c-who { grid-column: 1 / 3; }
  .users-table .c-state { white-space: normal; }
  .users-table .c-state small { display: inline; margin-left: .5rem; }
  .users-table .c-act .actions { justify-content: flex-start; }
  .users-table tr td.empty { grid-column: 1 / -1; }
}

/* ---------------- 帳號申請 ---------------- */
.login-alt { text-align: center; margin: 1rem 0 0; color: var(--muted); font-size: .92rem; }
.signup-card { width: min(520px, 100%); }
.signup-card .two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .8rem; }
@media (max-width: 520px) { .signup-card .two { grid-template-columns: 1fr; } }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.done-box { text-align: center; padding: .5rem 0 1rem; }
.done-box .big { font-size: 2.6rem; line-height: 1; color: var(--ok); }
.signups-table td { vertical-align: middle; }
.signups-table .who b { display: block; }
.signups-table .who small { color: var(--muted); }
.signups-table select { padding: .3rem .4rem; width: auto; min-width: 7rem; }
.signups-table .actions { flex-wrap: nowrap; justify-content: flex-end; }
.share-url { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.share-url code { background: var(--tint); padding: .35rem .6rem; border-radius: 6px; font-size: .95rem; user-select: all; }
.danger-zone { border-top: 5px solid var(--urgent); }

/* =====================================================================
   溫暖活潑主題（2026/10）：圓角、柔和陰影、膠囊按鈕、漸層頂部列
   放在最後，覆蓋前面的舊樣式。
   ===================================================================== */
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  background-image: radial-gradient(circle at 8% -10%, #ffe2cc 0, transparent 38%),
                    radial-gradient(circle at 105% 0%, #fff0c9 0, transparent 30%);
  background-attachment: fixed;
  font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", "Heiti TC", sans-serif;
  letter-spacing: .01em;
}
h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: .02em; }
h2 { font-weight: 800; }
h1, h2, h3 { color: var(--ink); }
a { color: var(--brand-dark); }
::selection { background: var(--sun); color: var(--ink); }

/* 頂部列：暖色漸層 + 膠囊選單 */
.topbar {
  background: linear-gradient(100deg, #f0643c 0%, #f5813f 55%, #f9a23d 100%);
  box-shadow: 0 4px 18px rgba(210, 74, 35, .25);
  padding: .55rem 1.4rem; gap: 1.2rem;
}
.topbar .brand { display: flex; align-items: center; gap: .55rem; font-size: 1.15rem; font-weight: 800; }
.logo-mark {
  display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 12px; flex: none;
  background: #fff; color: var(--brand); font-weight: 900; font-size: 1.1rem;
  box-shadow: 0 3px 0 rgba(120, 40, 10, .18); transform: rotate(-6deg);
}
.topbar nav { gap: .3rem; align-items: center; }
.topbar nav a {
  color: #fff; opacity: .92; border: 0; padding: .38rem .85rem; border-radius: 999px; font-weight: 600;
  transition: background .15s, opacity .15s;
}
.topbar nav a:hover { background: rgba(255, 255, 255, .18); opacity: 1; }
.topbar nav a.active { background: #fff; color: var(--brand-dark); opacity: 1; box-shadow: 0 2px 0 rgba(120, 40, 10, .15); }
.topbar .who { color: #fff; }
.topbar .who small { color: #ffe6d6; }
.topbar .btn.ghost { color: #fff; border-color: rgba(255, 255, 255, .7); background: transparent; }
.topbar .btn.ghost:hover { background: rgba(255, 255, 255, .2); border-color: #fff; color: #fff; }
.nav-badge { background: var(--sun); color: var(--deep); box-shadow: 0 0 0 2px #fff; }
.topbar nav a.active .nav-badge { box-shadow: none; }

/* 面板、卡片：圓角 + 柔和陰影 */
.panel { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card, .tile, .kpi { border-radius: var(--radius); box-shadow: var(--shadow); border-color: var(--line); transition: box-shadow .18s, transform .18s; }
.card:hover, .tile:hover, a.kpi:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); border-color: var(--brand-soft); }
.card { border-left-width: 6px; }
.tile { border-top: 0; position: relative; overflow: hidden; padding-top: 1.4rem; }
.tile::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: linear-gradient(90deg, var(--brand), var(--sun)); }
.tile.alert::before { background: linear-gradient(90deg, var(--urgent), #ff8a65); }
.tile.dark { background: linear-gradient(135deg, #5a2f1e, #7a3f22); border-color: transparent; color: #fff7ef; }
.tile.dark::before { background: linear-gradient(90deg, var(--sun), #ffe08a); }
.tile.dark .tile-k, .tile.dark .tile-meta { color: #ffd9c2; }
.tile-go { color: var(--brand); }
.kpi { border: 1px solid var(--line); }
.kpi b { color: var(--ink); }
.kpi.bad { border-left: 0; background: linear-gradient(135deg, #fff6f4, #fff); box-shadow: inset 4px 0 0 var(--urgent), var(--shadow); }
.kpi.warn { border-left: 0; box-shadow: inset 4px 0 0 var(--sun-dark), var(--shadow); }
.summary { border-radius: var(--radius); border-color: var(--brand-soft); box-shadow: var(--shadow); }

/* 按鈕：膠囊形、按下去有回饋 */
.btn {
  border-radius: 999px; padding: .5rem 1.25rem; font-weight: 700;
  box-shadow: 0 3px 0 var(--brand-dark); transition: transform .08s, box-shadow .08s, background .15s;
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--brand-dark); }
.btn.ghost { box-shadow: none; background: #fff; border-color: var(--line-strong); color: var(--ink-2); font-weight: 600; }
.btn.ghost:hover { background: var(--tint); border-color: var(--brand); color: var(--brand-dark); }
.btn.danger { box-shadow: 0 3px 0 #a92c24; }
.btn.danger:hover { background: #c4352c; border-color: #c4352c; }
.btn.ok { background: var(--mint); border-color: var(--mint); box-shadow: 0 3px 0 #1f8a75; }
.btn.ok:hover { background: #229c85; border-color: #229c85; }
.btn.small { padding: .22rem .8rem; font-size: .86rem; box-shadow: 0 2px 0 var(--brand-dark); }
.btn.ghost.small, .btn.small.ghost { box-shadow: none; }
.btn.big { padding: .8rem 2rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .card:focus-visible, a:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px;
}

/* 表單 */
input[type=text], input[type=password], input[type=datetime-local], input[type=time], input[type=date],
input[type=number], input[type=search], input[type=email], input[type=month], select, textarea {
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-s); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(240, 100, 60, .14); outline: none; }
label span { color: var(--ink-2); font-weight: 600; font-size: .88rem; }
.checks input, label.check input, .check-inline input { accent-color: var(--brand); }
fieldset.perm { border-radius: var(--radius-s); border-color: var(--line); background: var(--surface-2); }
.error { border-radius: var(--radius-s); border-left-width: 6px; color: #8c1d16; }
.notice { border-radius: var(--radius-s); border-left-width: 6px; color: #155a3b; }

/* 表格 */
th { background: var(--tint); color: var(--ink-2); font-weight: 700; }
thead tr:first-child th:first-child { border-top-left-radius: var(--radius-s); }
thead tr:first-child th:last-child { border-top-right-radius: var(--radius-s); }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: var(--surface-2); }
code { background: var(--tint); color: var(--ink-2); border-radius: 6px; }

/* 狀態標籤：圓膠囊 */
.st, .tag { border-radius: 999px; padding: .08rem .65rem; }
.st.accepted { background: #ffe8dc; color: var(--brand-dark); }
.tag.admin { background: #ffe8dc; color: var(--brand-dark); }
.st.done, .tag.player { background: var(--mint-bg); color: #1d7f6b; }

/* 後台側欄 */
.admin-layout { background: none; min-height: calc(100vh - var(--topbar-h, 56px)); }
@media (min-width: 981px) { .side { top: var(--topbar-h, 56px); height: calc(100vh - var(--topbar-h, 56px)); } }
.side { background: rgba(255, 255, 255, .78); backdrop-filter: blur(6px); border-right: 1px solid var(--line); }
.side-title { color: var(--brand-dark); }
.side-group { color: var(--muted); }
.side a { border-radius: 999px; padding: .42rem .85rem; color: var(--ink-2); font-weight: 500; }
.side a:hover { background: var(--tint); color: var(--brand-dark); }
.side a.active { background: linear-gradient(90deg, var(--brand), #f5813f); color: #fff; box-shadow: 0 3px 10px rgba(240, 100, 60, .3); font-weight: 700; }
.admin-main { padding-top: 1.8rem; }

/* 頁內分頁膠囊 */
.tabs-inline a { border-color: var(--line-strong); background: #fff; color: var(--ink-2); }
.tabs-inline a:hover { border-color: var(--brand); color: var(--brand-dark); }
.tabs-inline a.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* 登入／申請 */
.login-wrap { background: radial-gradient(circle at 20% 15%, #ffd7bd 0, transparent 40%), radial-gradient(circle at 85% 80%, #fff0b8 0, transparent 35%); }
.login-card { border-top: 0; border-radius: 22px; box-shadow: 0 20px 60px rgba(150, 70, 30, .18); position: relative; overflow: hidden; }
.login-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 8px; background: linear-gradient(90deg, var(--brand), var(--sun), var(--mint)); }
.login-card h1 { color: var(--brand-dark); }

/* 長條圖、其他 */
.bar i { background: linear-gradient(180deg, #f9a23d, var(--brand)); border-radius: 8px 8px 2px 2px; }
.reply { border-left-color: var(--brand-soft); }
details.help { border-radius: var(--radius-s); background: var(--surface-2); }
.strip.alert { background: linear-gradient(90deg, var(--urgent), #f0643c); }
.bulk-bar { border-top-color: var(--brand); border-radius: var(--radius); }

/* =====================================================================
   響應式（手機、平板）
   ===================================================================== */
img, video { max-width: 100%; height: auto; }
.panel, .card, .tile, .kpi { min-width: 0; }
@media (max-width: 980px) {
  .side { background: rgba(255, 255, 255, .92); gap: .35rem; position: static; scrollbar-width: none; }
  .side::-webkit-scrollbar { display: none; }
  .admin-main { padding: 1.1rem 1rem 3rem; }
}
@media (max-width: 760px) {
  h1 { font-size: 1.45rem; }
  h2 { font-size: 1.12rem; }
  .panel { padding: 1.1rem 1rem; border-radius: 14px; }
  .row { gap: .6rem; }
  .row > .actions { width: 100%; }
  .tiles { grid-template-columns: 1fr; }
  .tile { min-height: 0; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .kpi { padding: .75rem .85rem; }
  .kpi b { font-size: 1.3rem; }
  .inline-form label, .filters label { flex: 1 1 100%; }
  .inline-form .btn, .filters .btn { flex: 1 1 auto; }
  .three, .two, .grid-2 { grid-template-columns: 1fr !important; }
  /* 寬表格：在面板裡左右滑動，不撐破版面 */
  .panel > table, .panel > form > table, main > table, .admin-main table:not(.users-table) {
    display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%;
  }
  .admin-main table:not(.users-table) td, .admin-main table:not(.users-table) th { white-space: nowrap; }
  .admin-main table td.wrap, .admin-main table td.wrap-s { white-space: normal; }
  .btn { padding: .5rem 1.05rem; }
  .actions { gap: .4rem; }
  input, select, textarea { font-size: 16px; }   /* iPhone 點輸入框不會自動放大 */
}
@media (max-width: 640px) {
  .topbar { padding: .5rem .8rem; gap: .5rem .7rem; }
  .topbar .brand { font-size: 1rem; }
  .logo-mark { width: 1.85rem; height: 1.85rem; font-size: .95rem; border-radius: 10px; }
  .topbar nav { margin: 0 -.8rem; padding: .1rem .8rem .25rem; mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .topbar nav a { padding: .32rem .75rem; font-size: .95rem; }
  .topbar .who small { display: none; }
  main { padding: 1rem .8rem 3rem; }
}
@media (max-width: 380px) {
  .kpis { grid-template-columns: 1fr; }
}

/* =====================================================================
   柔和護眼版（2026/10/28）：降低彩度、拿掉大面積亮橘與光暈，保留暖色調
   ===================================================================== */
:root {
  --bg: #f8f5f0;
  --surface-2: #fbf9f6;
  --tint: #f4eee7;
  --tint-2: #ece3d9;
  --ink: #3d3530;
  --ink-2: #5f544c;
  --muted: #8a7d72;
  --line: #e8e0d6;
  --line-strong: #d3c7ba;
  --brand: #c4704f;          /* 陶土色：比亮橘柔和 */
  --brand-dark: #a85a3c;
  --brand-soft: #ead2c4;
  --info-bg: #f6ebe4;
  --sun: #e2b45a;
  --sun-dark: #c99a3e;
  --mint: #5f9e8a;
  --mint-bg: #e6f1ec;
  --deep: #4e3b31;
  --bubble: #f3e4da;
  --urgent: #c4483f;
  --urgent-bg: #f8e9e6;
  --warn: #9a6a1f;
  --warn-bg: #f7eedb;
  --ok: #3f8a66;
  --ok-bg: #e5f1ea;
  --focus: #d9a35a;
  --shadow: 0 1px 2px rgba(60, 40, 25, .04), 0 4px 14px rgba(60, 40, 25, .05);
  --shadow-hover: 0 2px 4px rgba(60, 40, 25, .05), 0 8px 22px rgba(60, 40, 25, .09);
}
body { background: var(--bg); background-image: none; }

/* 頂部列：米白底、暖棕字，目前頁面用淡陶土色 */
.topbar { background: #fffdfa; color: var(--ink); box-shadow: 0 1px 0 var(--line), 0 2px 10px rgba(60, 40, 25, .04); }
.topbar .brand { color: var(--ink); }
.logo-mark { background: var(--brand); color: #fff; box-shadow: none; transform: none; border-radius: 10px; }
.topbar nav a { color: var(--ink-2); opacity: 1; font-weight: 500; }
.topbar nav a:hover { background: var(--tint); color: var(--ink); }
.topbar nav a.active { background: var(--info-bg); color: var(--brand-dark); box-shadow: none; font-weight: 700; }
.topbar .who { color: var(--ink-2); }
.topbar .who small { color: var(--muted); }
.topbar .btn.ghost { color: var(--ink-2); border-color: var(--line-strong); }
.topbar .btn.ghost:hover { background: var(--tint); color: var(--ink); border-color: var(--line-strong); }
.nav-badge { background: var(--brand); color: #fff; box-shadow: none; }

/* 按鈕：柔和實心、陰影變淡 */
.btn { box-shadow: 0 1px 0 rgba(0, 0, 0, .08); }
.btn:active { box-shadow: none; }
.btn.small { box-shadow: none; }
.btn.danger { box-shadow: none; }
.btn.ok { box-shadow: none; }

/* 卡片、首頁區塊：拿掉漸層彩條，改細細一條陶土色 */
.tile::before { height: 4px; background: var(--brand-soft); }
.tile.alert::before { background: #e7b3ad; }
.tile.dark { background: #4e3b31; }
.tile.dark::before { background: var(--sun); opacity: .7; }
.card:hover, .tile:hover, a.kpi:hover { transform: none; }
.kpi.bad { background: #fff; box-shadow: inset 3px 0 0 var(--urgent), var(--shadow); }
.kpi.warn { box-shadow: inset 3px 0 0 var(--sun-dark), var(--shadow); }

/* 後台側欄：選中改淡色底 */
.side { background: #fffdfa; backdrop-filter: none; }
.side a.active { background: var(--info-bg); color: var(--brand-dark); box-shadow: inset 3px 0 0 var(--brand); border-radius: 10px; }
.side a { border-radius: 10px; }

/* 表格、輸入框 */
th { background: var(--tint); }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px rgba(196, 112, 79, .15); }
.tabs-inline a.on { background: var(--info-bg); border-color: var(--brand-soft); color: var(--brand-dark); }

/* 登入頁：淡底、彩條改單色 */
.login-wrap { background: var(--bg); }
.login-card::before { height: 5px; background: var(--brand); }
.bar i { background: var(--brand-soft); }
.bar:hover i { background: var(--brand); }
.strip.alert { background: var(--urgent); }

/* 上方選單的次選單（新竹物流 ▾） */
.nav-drop { display: inline-flex; }
.nav-drop-btn {
  font: inherit; cursor: pointer; border: 0; background: none; white-space: nowrap;
  color: var(--ink-2); padding: .38rem .85rem; border-radius: 999px; font-weight: 500; display: inline-flex; align-items: center; gap: .25rem;
}
.nav-drop-btn:hover, .nav-drop-btn[aria-expanded="true"] { background: var(--tint); color: var(--ink); }
.nav-drop.active .nav-drop-btn { background: var(--info-bg); color: var(--brand-dark); font-weight: 700; }
.nav-drop .caret { font-size: .7em; opacity: .7; transition: transform .15s; }
.nav-drop-btn[aria-expanded="true"] .caret { transform: rotate(180deg); }
.nav-sub {
  position: fixed; z-index: 60; min-width: 11rem; padding: .35rem;
  background: #fffdfa; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(60, 40, 25, .14);
}
.nav-sub a {
  display: block; padding: .5rem .8rem; border-radius: 8px; color: var(--ink-2) !important; text-decoration: none;
  white-space: nowrap; background: none !important; box-shadow: none !important; font-weight: 500;
}
.nav-sub a:hover { background: var(--tint) !important; color: var(--ink) !important; }
.nav-sub a.on { color: var(--brand-dark) !important; font-weight: 700; background: var(--info-bg) !important; }

/* 新竹物流頁面上方的分頁 */
main.freight-main { padding-top: 1.2rem; }
.sub-tabs { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; margin-bottom: 1.2rem;
  padding: .35rem; background: #fffdfa; border: 1px solid var(--line); border-radius: 999px; width: fit-content; max-width: 100%; }
.sub-tabs-title { font-weight: 800; color: var(--brand-dark); padding: 0 .7rem 0 .6rem; }
.sub-tabs a { text-decoration: none; color: var(--ink-2); padding: .32rem .95rem; border-radius: 999px; white-space: nowrap; }
.sub-tabs a:hover { background: var(--tint); color: var(--ink); }
.sub-tabs a.on { background: var(--info-bg); color: var(--brand-dark); font-weight: 700; box-shadow: inset 0 0 0 1px var(--brand-soft); }
@media (max-width: 640px) {
  .nav-drop-btn { padding: .32rem .75rem; font-size: .95rem; }
  .sub-tabs { width: 100%; border-radius: 14px; }
  .sub-tabs-title { display: none; }
  .sub-tabs a { flex: 1; text-align: center; }
}

/* 隱形帳號設定 */
fieldset.hidden-acct { border: 1px dashed var(--line); border-radius: 10px; padding: .6rem .9rem .8rem; margin: 0 0 1rem; }
fieldset.hidden-acct small { display: block; margin-top: .3rem; line-height: 1.5; }
.tag.ghost-tag { background: #ece8e2; color: #6b6259; }

/* 訂單通知對象 */
.kind-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .7rem; margin: .4rem 0 1rem; }
.kind-card { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 10px; padding: .6rem .8rem; display: grid; gap: .2rem; }
.kind-card small { color: var(--muted); }
.kind-card form { margin-top: .3rem; }
.kind-card.k-ship { border-left-color: #6f8f6a; }
.kind-card.k-alert { border-left-color: #c9894a; }
.notify-panel { padding: 0; overflow-x: auto; }
.notify-table { width: 100%; border-collapse: collapse; }
.notify-table th, .notify-table td { padding: .5rem .7rem; border-bottom: 1px solid var(--tint); text-align: left; }
.notify-table .c-k { text-align: center; white-space: nowrap; }
.notify-table .c-k input { width: 1.15rem; height: 1.15rem; }
.notify-table .c-cli { white-space: nowrap; font-size: .88rem; }
.notify-table .c-cli small { display: block; }
.notify-table thead th { vertical-align: middle; border-bottom: 2px solid var(--line); }
.notify-table .group-row th { background: var(--tint); font-size: .85rem; color: var(--muted); padding-top: .3rem; padding-bottom: .3rem; }
.notify-table .lab-short { display: none; }
.notify-save { padding: .8rem; justify-content: flex-end; }
.sub-h { font-size: 1.1rem; margin: 1.4rem 0 .6rem; }
.notice-log { list-style: none; margin: 0; padding: 0; }
.notice-log li { padding: .55rem 0; border-bottom: 1px solid var(--tint); }
.notice-log li:last-child { border-bottom: 0; }
.notice-log small { margin-left: .4rem; }
.notice-log pre { white-space: pre-wrap; font: inherit; font-size: .85rem; background: var(--tint); padding: .5rem .7rem; border-radius: 8px; margin: .4rem 0 0; max-height: 16rem; overflow: auto; }
.tag.k-order { background: #f4e3da; color: #a85a3c; }
.tag.k-ship { background: #e3ece1; color: #4f6b4a; }
.tag.k-alert { background: #f6e7d6; color: #9a5a22; }
@media (max-width: 640px) {
  .notify-table th, .notify-table td { padding: .45rem .4rem; }
  .notify-table .lab-full { display: none; }
  .notify-table .lab-short { display: inline; }
  .notify-table .c-cli small { display: none; }
}
.notify-table { display: table !important; }

.line-switch { display: flex; gap: .8rem; align-items: center; justify-content: space-between; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: .6rem .9rem; margin: 0 0 .9rem; }
.line-switch small { display: block; color: var(--muted); margin-top: .15rem; }
.line-switch.on { border-color: #b9d3b4; }

/* 公告頁 */
.more-link { justify-self: end; font-size: .9rem; color: var(--brand); text-decoration: none; padding: .2rem .2rem 0; }
.more-link:hover { text-decoration: underline; }
.search-inline { display: flex; gap: .4rem; align-items: center; margin: 0; }
.search-inline input { width: 14rem; max-width: 50vw; }
.pager { display: flex; gap: .8rem; align-items: center; justify-content: center; margin-top: 1rem; }

/* =====================================================================
   版面風格（參考品牌官網）：白色頂列、紙張質感底色、置中的中英雙語標題、
   素雅的灰階配色與深色頁尾。放在最後，覆蓋前面的配色。
   ===================================================================== */
:root {
  --bg: #f3f3f1;
  --surface: #ffffff;
  --surface-2: #fafaf8;
  --tint: #f0efec;
  --tint-2: #e7e5e0;
  --ink: #333333;
  --ink-2: #555555;
  --muted: #8a8a86;
  --line: #e3e2de;
  --line-strong: #cbc9c3;
  --brand: #3a3a3a;
  --brand-dark: #1f1f1f;
  --brand-soft: #d6d4ce;
  --accent: #a23b2f;          /* 印章紅：只用在選中狀態、置頂等少數地方 */
  --info-bg: #f2f1ed;
  --sun: #b08d57;
  --sun-dark: #8d6d3c;
  --mint: #5d7f6c;
  --mint-bg: #e8efea;
  --deep: #2b2b2b;
  --bubble: #ecebe7;
  --focus: #b08d57;
  --radius: 4px;
  --radius-s: 3px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04);
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, .08);
  --paper-tex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body { background: var(--bg) var(--paper-tex); color: var(--ink); font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif; letter-spacing: .02em; }
body:not(.fill):not(.pos-body) { display: flex; flex-direction: column; min-height: 100vh; }
body > main, body > .admin-layout, body > .login-wrap { flex: 1 0 auto; width: 100%; }

/* ---- 頂列 ---- */
.topbar { background: #fff; color: var(--ink); box-shadow: 0 1px 0 var(--line); padding: .55rem clamp(1rem, 3vw, 2.2rem); gap: 1.4rem; min-height: 64px; align-items: center; }
.topbar .brand { display: flex; flex-direction: column; justify-content: center; line-height: 1.05; text-decoration: none; color: #222; flex: none; }
.topbar .brand .brand-zh { font-size: 1.32rem; font-weight: 700; letter-spacing: .14em; }
.topbar .brand .brand-en { font-size: .58rem; letter-spacing: .38em; color: #777; margin-top: .25rem; padding-left: .1em; }
.topbar .brand-logo { height: 42px; width: auto; display: block; }
.topbar .logo-mark { display: none; }
.topbar nav { flex: 1; justify-content: flex-end; gap: .2rem; }
.topbar nav a, .topbar .nav-drop-btn { color: #4a4a4a; font-size: .95rem; letter-spacing: .1em; padding: .45rem .75rem; border-bottom: 0; border-radius: 0; position: relative; background: none; }
.topbar nav a::after, .topbar .nav-drop-btn::after { content: ""; position: absolute; left: .75rem; right: .75rem; bottom: .1rem; height: 1px; background: var(--accent); transform: scaleX(0); transition: transform .2s; }
.topbar nav a:hover, .topbar .nav-drop-btn:hover { color: #111; background: none; }
.topbar nav a:hover::after, .topbar nav a.active::after, .topbar .nav-drop.active .nav-drop-btn::after { transform: scaleX(1); }
.topbar nav a.active, .topbar .nav-drop.active .nav-drop-btn { color: #111; background: none; font-weight: 500; }
.topbar .user-box { display: flex; align-items: center; gap: .8rem; flex: none; padding-left: 1rem; border-left: 1px solid var(--line); }
.topbar .who { color: #444; }
.topbar .who small { color: var(--muted); }
.topbar .btn.ghost { color: #444; border-color: var(--line-strong); background: transparent; }
.topbar .btn.ghost:hover { color: #111; border-color: #888; background: transparent; }
.topbar .nav-badge { background: var(--accent); }
.nav-toggle { display: none; margin-left: auto; height: 38px; border: 1px solid var(--line-strong); border-radius: 999px; background: none; cursor: pointer; padding: 0 .85rem 0 .7rem; align-items: center; gap: .45rem; color: inherit; font: inherit; }
.nav-toggle .bars { display: flex; flex: none; flex-direction: column; justify-content: center; gap: 4px; width: 18px; height: 14px; margin: 0; padding: 0; font-size: 0; line-height: 0; position: static; }
.nav-toggle .bars span { width: 18px; }
.nav-toggle-t { font-size: .9rem; font-weight: 600; letter-spacing: .12em; }
.nav-toggle span { display: block; height: 2px; background: #333; border-radius: 1px; transition: transform .2s, opacity .2s; }
.topbar.open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.topbar.open .nav-toggle span:nth-child(2) { opacity: 0; }
.topbar.open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.nav-sub { border-radius: 2px; border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.nav-sub a.on, .nav-sub a:hover { background: var(--tint); color: #111; }

/* ---- 頁面標題：置中、字距加寬，下方英文小標 ---- */
h1.bi { text-align: center; font-weight: 500; letter-spacing: .28em; font-size: clamp(1.45rem, 2.4vw, 1.85rem); margin: .4rem 0 1.4rem; padding-left: .28em; display: block; }
h1.bi .h-en { display: block; font-size: .5em; letter-spacing: .14em; color: var(--muted); font-weight: 400; margin-top: .45rem; font-family: "Helvetica Neue", Arial, sans-serif; }
.row:has(> h1.bi) { flex-direction: column; align-items: center; justify-content: center; gap: .2rem; }
.row:has(> h1.bi) > h1.bi { margin-bottom: .6rem; }
.row:has(> h1.bi) .actions { justify-content: center; }
h1.bi + .hint, h1.bi + p.hint, .row:has(> h1.bi) + .hint, .row:has(> h1.bi) + p.hint { text-align: center; max-width: 46rem; margin-left: auto !important; margin-right: auto !important; }
h2 { letter-spacing: .08em; font-weight: 600; }

/* ---- 卡片、按鈕：素雅、方正 ---- */
.panel, .tile, .card, .bulletin { border-radius: var(--radius); box-shadow: var(--shadow); border-color: var(--line); }
.btn { border-radius: 2px; background: #333; border-color: #333; color: #fff; letter-spacing: .1em; font-weight: 500; }
.btn:hover { background: #111; border-color: #111; }
.btn.ghost { background: transparent; color: #333; border-color: var(--line-strong); }
.btn.ghost:hover { background: #fff; color: #111; border-color: #777; }
.btn.danger { background: #a23b2f; border-color: #a23b2f; }
.btn.danger:hover { background: #82291f; border-color: #82291f; }
.btn.ok { background: #4d6e5b; border-color: #4d6e5b; }
a { color: #6b4b2a; }
.st.urgent, .tag.urgent { background: var(--accent); color: #fff; }
input, select, textarea { border-radius: 2px; }

/* ---- 後台側欄 ---- */
.admin-layout { background: none; }
.side { background: #fff; border-right: 1px solid var(--line); }
.side-title { color: #222; letter-spacing: .2em; font-weight: 600; }
.side-group { letter-spacing: .14em; }
.side a { border-radius: 2px; }
.side a.active { background: var(--tint); color: #111; box-shadow: inset 2px 0 0 var(--accent); }

/* ---- 頁尾 ---- */
.site-footer { flex: none; background: #262626; color: #bdbdbd; margin-top: 3rem; }
.site-footer-in { max-width: 1120px; margin: 0 auto; padding: 1.8rem clamp(1rem, 4vw, 2.5rem); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: .8rem 2rem; font-size: .88rem; letter-spacing: .06em; }
.site-footer b { color: #eee; font-weight: 500; letter-spacing: .12em; }
.site-footer p { margin: .35rem 0 0; }
.site-footer small { color: #888; letter-spacing: .1em; }
.site-footer small.copyright { text-align: right; line-height: 1.7; }
@media (max-width: 760px) { .site-footer small.copyright { text-align: left; } }
body.fill .site-footer, body.pos-body .site-footer, body.home-body .site-footer { margin-top: 0; }
body.fill .site-footer, body.pos-body .site-footer { display: none; }

/* ---- 首頁 ---- */
main.home-main { max-width: none; padding: 0; }
.home-hero { position: relative; min-height: clamp(260px, 42vw, 520px); display: grid; place-items: center; text-align: center; color: #fff; overflow: hidden; background: #3b3b38; }
.home-hero.has-img { background-size: cover; background-position: center; }
.home-hero.no-img { background: radial-gradient(120% 90% at 30% 20%, #6d6a62 0%, #45433e 45%, #2e2d2a 100%); }
.home-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.08), rgba(0,0,0,.38)); }
.home-hero .hero-text { position: relative; z-index: 1; padding: 2rem 1.2rem; }
.home-hero h2 { font-size: clamp(1.5rem, 3.6vw, 2.6rem); font-weight: 500; letter-spacing: .3em; margin: 0; padding-left: .3em; text-shadow: 0 2px 12px rgba(0,0,0,.35); }
.home-hero p { margin: .9rem 0 0; letter-spacing: .3em; font-size: clamp(.85rem, 1.4vw, 1rem); opacity: .9; }
.home-hero .seal { position: absolute; right: clamp(1rem, 4vw, 3rem); bottom: clamp(1rem, 3vw, 2rem); z-index: 1; writing-mode: vertical-rl; font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 700; letter-spacing: .25em; color: #fff; opacity: .92; }
.home-hero .seal i { display: inline-block; font-style: normal; font-size: .38em; background: var(--accent); color: #fff; padding: .35em .2em; margin-top: .4em; letter-spacing: .1em; }
.home-sec { padding: clamp(2.6rem, 6vw, 4.5rem) clamp(1rem, 4vw, 2rem); }
.home-wrap { max-width: 1080px; margin: 0 auto; }
.sec-title { text-align: center; margin: 0 0 2.2rem; }
.sec-title h2 { font-size: clamp(1.4rem, 2.4vw, 1.8rem); font-weight: 500; letter-spacing: .3em; padding-left: .3em; margin: 0; }
.sec-title span { display: block; margin-top: .45rem; color: var(--muted); font-size: .9rem; letter-spacing: .14em; font-family: "Helvetica Neue", Arial, sans-serif; }
.greet { text-align: center; color: var(--ink-2); margin: -1.2rem 0 2rem; letter-spacing: .1em; }
.intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.intro.no-img { grid-template-columns: minmax(0, 1fr); max-width: 44rem; margin: 0 auto; }
.intro img { width: 100%; display: block; border-radius: 2px; }
.intro .body-text { line-height: 2.1; letter-spacing: .12em; color: var(--ink-2); white-space: pre-line; font-size: .95rem; }
.band { position: relative; min-height: clamp(200px, 26vw, 320px); display: grid; place-items: center; text-align: center; color: #fff; background: #4a4943; background-size: cover; background-position: center; }
.band.no-img { background: #403f3a var(--paper-tex); }
.band::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.28); }
.band > div { position: relative; z-index: 1; padding: 1.5rem; }
.band h2 { font-weight: 600; letter-spacing: .28em; font-size: clamp(1.05rem, 2vw, 1.3rem); margin: 0; text-shadow: 0 1px 8px rgba(0,0,0,.4); }
.band p { margin: 1rem 0 0; letter-spacing: .22em; font-weight: 600; text-shadow: 0 1px 8px rgba(0,0,0,.4); }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.2rem; }
.quick .tile { background: #fff; border: 1px solid var(--line); border-top: 1px solid var(--line); border-radius: 2px; padding: 1.4rem 1.4rem 1.2rem; }
.quick .tile:hover { border-color: #bdbab3; box-shadow: var(--shadow-hover); }
.quick .tile.dark { background: #2f2f2f; border-color: #2f2f2f; color: #eee; }
.quick .tile.alert { box-shadow: inset 0 2px 0 var(--accent); }
.quick .tile-k { letter-spacing: .16em; }
.quick .tile-go { color: #6b4b2a; letter-spacing: .1em; }
.news-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 2.4vw, 1.8rem); }
.news-card { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); min-width: 0; }
.news-card .ph { aspect-ratio: 4 / 3; background: #e9e7e2 var(--paper-tex); overflow: hidden; display: grid; place-items: center; }
.news-card .ph img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.news-card:hover .ph img { transform: scale(1.04); }
.news-card .ph-text { font-size: 2.6rem; letter-spacing: .1em; color: #b9b5ac; font-weight: 700; }
.news-card h3 { font-size: 1rem; font-weight: 500; letter-spacing: .12em; line-height: 1.7; margin: .9rem 0 .5rem; }
.news-card h3 .st { margin-right: .3rem; }
.news-card .date { color: var(--muted); font-size: .82rem; letter-spacing: .1em; display: flex; align-items: center; gap: .35rem; }
.news-card .date::before { content: ""; width: 12px; height: 12px; border: 1.5px solid currentColor; border-top-width: 3px; border-radius: 2px; flex: none; }
.news-card p { color: var(--ink-2); font-size: .9rem; line-height: 1.85; letter-spacing: .08em; margin: .5rem 0 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sec-more { text-align: center; margin-top: 2.2rem; }
.sec-more a { display: inline-block; padding: .55rem 2rem; border: 1px solid #999; color: #333; text-decoration: none; letter-spacing: .2em; font-size: .9rem; }
.sec-more a:hover { background: #333; color: #fff; border-color: #333; }
.news-detail { max-width: 46rem; margin: 0 auto; }
.news-detail .meta { text-align: center; color: var(--muted); letter-spacing: .1em; font-size: .88rem; margin: -.6rem 0 1.6rem; }
.news-detail img { width: 100%; display: block; margin-bottom: 1.6rem; }
.news-detail .body-text { line-height: 2.1; letter-spacing: .1em; white-space: pre-line; }
.news-thumb { display: block; max-width: 240px; margin-top: .6rem; border-radius: 2px; }

/* ---- 網站版面設定頁 ---- */
.site-form { display: grid; gap: 1.2rem; max-width: 900px; }
.site-form h2 { font-size: 1.05rem; margin: 0 0 .8rem; }
.site-form .grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.site-img { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 1rem; align-items: start; margin-top: .4rem; }
.site-img img, .site-img-empty { width: 200px; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--line); background: var(--tint); }
.site-img-empty { display: grid; place-items: center; color: var(--muted); font-size: .85rem; }

/* ---- 登入頁 ---- */
.login-wrap { background: none; }
.login-card { border-radius: 2px; border-top: 0; box-shadow: 0 10px 40px rgba(0,0,0,.06); }
.login-card h1.bi { letter-spacing: .18em; font-size: 1.4rem; }

/* ---- 手機與平板 ---- */
@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; gap: 0; min-height: 58px; }
  .nav-toggle { display: flex; }
  .topbar .user-box { display: none; }
  /* 手機：選單一直顯示在標誌下面，一排可以左右滑；右上角「選單」打開完整清單（含登出） */
  .topbar nav { display: flex; flex-basis: 100%; order: 3; justify-content: flex-start; overflow-x: auto; overflow-y: hidden; gap: .15rem; margin: .1rem 0 0; padding: .25rem 0 .5rem;
    border-top: 1px solid var(--tint); scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
    -webkit-mask-image: none; mask-image: none; }
  .topbar nav::-webkit-scrollbar { display: none; }
  .topbar nav > a, .topbar nav .nav-drop-btn { flex: none; white-space: nowrap; font-size: .95rem; letter-spacing: .06em; padding: .45rem .7rem; }
  .topbar nav > a.active, .topbar nav .nav-drop.active .nav-drop-btn { color: var(--accent); font-weight: 600; }
  .topbar.open nav { border-top: 1px solid var(--line); }
  .topbar.open nav { display: flex; flex-direction: column; align-items: stretch; flex-basis: 100%; overflow: visible; padding: .4rem 0 .2rem; border-top: 1px solid var(--line); margin-top: .5rem; }
  .topbar.open nav a, .topbar.open .nav-drop-btn { padding: .75rem .4rem; border-bottom: 1px solid var(--tint); text-align: left; width: 100%; }
  .topbar.open nav a::after, .topbar.open .nav-drop-btn::after { display: none; }
  .topbar.open nav a.active { color: var(--accent); }
  .topbar.open .user-box { display: flex; flex-basis: 100%; justify-content: space-between; border-left: 0; padding: .7rem .4rem .4rem; }
  .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .intro { grid-template-columns: minmax(0, 1fr); }
  .site-form .grid2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .news-grid { grid-template-columns: minmax(0, 1fr); }
  .site-img { grid-template-columns: minmax(0, 1fr); }
  .site-footer-in { flex-direction: column; align-items: flex-start; }
  h1.bi { letter-spacing: .16em; padding-left: .16em; }
}
/* 首頁修正：深色背景上的標題用白字；印章字不被裁切；卡片頂邊統一 */
.home-hero h2, .home-hero p, .band h2, .band p { color: #fff; }
.home-hero .seal { bottom: clamp(1.4rem, 3vw, 2.4rem); line-height: 1.15; display: flex; flex-direction: column; align-items: center; writing-mode: horizontal-tb; gap: .1em; font-size: clamp(1.4rem, 2.6vw, 2.1rem); }
.home-hero .seal b { display: block; font-weight: 700; }
.home-hero .seal i { font-size: .42em; padding: .3em .25em; writing-mode: vertical-rl; margin-top: .35em; }
.quick .tile, .quick .tile.alert, .quick .tile.dark { border-top-width: 1px; border-top-style: solid; }
.quick .tile { border-top-color: var(--line); }
.quick .tile.dark { border-top-color: #2f2f2f; }
.tile::before { display: none; }
.home-hero .seal { gap: 0; }
.home-hero .seal b { line-height: 1.12; }
.home-hero .seal .stamp { width: .55em; height: .55em; background: var(--accent); margin-top: .35em; display: block; }
@media (max-width: 900px) {
  .topbar.open nav { order: 3; }
  .topbar.open .user-box { order: 4; border-top: 1px solid var(--line); margin-top: .2rem; }
}
@media (max-width: 560px) { .home-hero .seal { display: none; } }
.news-detail h1 { text-align: center; font-weight: 500; letter-spacing: .14em; line-height: 1.6; margin: .6rem 0 1rem; }
.home-hero.has-img::after { background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.25)); } .home-hero { min-height: clamp(200px, 30vw, 420px); }

/* =====================================================================
   點餐中心（後台點餐：分頁、場次卡片、場次工作頁）
   ===================================================================== */
.mc-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: .2rem 0 1rem; }
.mc-head h1.mc-title, .mc-head h1.mc-title.bi { text-align: left; letter-spacing: .12em; padding-left: 0; margin: 0; font-size: clamp(1.35rem, 2.2vw, 1.7rem); }
.mc-head h1.bi .h-en { margin-top: .25rem; }
.mc-head .actions { flex-wrap: wrap; }
.crumb { margin: 0 0 .4rem; font-size: .88rem; color: var(--muted); }
.crumb a { color: var(--ink-2); }
.crumb span { margin: 0 .3rem; opacity: .6; }
.mc-tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--line-strong); margin: 0 0 1.2rem; overflow-x: auto; scrollbar-width: none; }
.mc-tabs::-webkit-scrollbar { display: none; }
.mc-tabs a { position: relative; padding: .65rem 1rem; text-decoration: none; color: var(--ink-2); white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1px; font-weight: 500; }
.mc-tabs a:hover { color: var(--brand-dark); }
.mc-tabs a.on { color: var(--ink); border-bottom-color: var(--brand); font-weight: 700; }
.mc-tabs a i { font-style: normal; display: inline-block; min-width: 1.3rem; padding: 0 .35rem; margin-left: .35rem; border-radius: 999px; background: var(--sun-dark, #c98a1b); color: #fff; font-size: .75rem; line-height: 1.3rem; text-align: center; }
.mc-tabs a i.warn { background: var(--urgent); }
.mc-tabs a.mc-out { margin-left: auto; color: var(--muted); font-weight: 400; }

/* 場次卡片 */
.rcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1rem; }
.rcard { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: box-shadow .18s, transform .18s; }
.rcard:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.rcard.is-open { box-shadow: inset 0 4px 0 var(--brand), var(--shadow); }
.rcard-main { display: block; padding: 1rem 1.1rem .8rem; color: inherit; text-decoration: none; flex: 1; }
.rcard-h { display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem; }
.rcard-h h3 { margin: 0; font-size: 1.12rem; line-height: 1.35; }
.rcard-meta { margin: .3rem 0 .7rem; color: var(--muted); font-size: .85rem; }
.rcard-nums { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--tint); border-radius: 10px; padding: .55rem .2rem; text-align: center; }
.rcard-nums b { display: block; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.rcard-nums span { font-size: .78rem; color: var(--muted); }
.rcard-sum { list-style: none; margin: .7rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.rcard-sum li { font-size: .82rem; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .05rem .6rem; }
.rcard-act { display: flex; gap: .5rem; align-items: center; padding: .7rem 1.1rem; border-top: 1px solid var(--line); background: rgba(0,0,0,.015); flex-wrap: wrap; }
.rcard-act > .btn:first-child { flex: 1; text-align: center; }

/* 進度條 */
.stage { list-style: none; display: flex; margin: .8rem 0 0; padding: 0; counter-reset: st; }
.stage li { flex: 1; position: relative; text-align: center; font-size: .76rem; color: var(--muted); padding-top: 1.3rem; }
.stage li::before { counter-increment: st; content: counter(st); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 1.1rem; height: 1.1rem; line-height: 1.1rem; border-radius: 50%; background: var(--line-strong); color: #fff; font-size: .68rem; z-index: 1; }
.stage li + li::after { content: ""; position: absolute; top: .52rem; right: 50%; width: 100%; height: 2px; background: var(--line-strong); }
.stage li.ok { color: var(--ink-2); }
.stage li.ok::before { content: "✓"; background: #1d7f6b; }
.stage li.ok::after, .stage li.now::after { background: #1d7f6b; }
.stage li.now { color: var(--brand-dark); font-weight: 700; }
.stage li.now::before { background: var(--brand); box-shadow: 0 0 0 3px rgba(178,112,48,.18); }
.stage li b { color: var(--urgent); }
.mc-head + .stage, .stage:not(.rcard .stage) { max-width: 560px; margin-bottom: .4rem; }

/* 場次工作頁 */
.settle-box { box-shadow: inset 4px 0 0 var(--sun-dark, #c98a1b), var(--shadow); }
.settle-box.is-ready { box-shadow: inset 4px 0 0 #1d7f6b, var(--shadow); }
.settle-box .row { align-items: center; }
.btn.big { padding: .75rem 1.5rem; font-size: 1.02rem; }
.order-sum { list-style: none; margin: 0 0 .8rem; padding: 0; }
.order-sum li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .55rem 0; border-bottom: 1px dashed var(--line); }
.order-sum li:last-child { border-bottom: 0; }
.order-sum small { display: block; color: var(--muted); font-size: .8rem; margin-top: .1rem; }
.order-sum li > span { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.thumbs { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: .6rem; }
.thumbs figure { margin: 0; text-align: center; }
.thumbs img { width: 92px; height: 92px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; margin-bottom: .3rem; }
h3.sub { font-size: .95rem; margin: 1.1rem 0 .5rem; color: var(--ink-2); }
table.orders td { vertical-align: top; }
table.orders .actions { flex-wrap: nowrap; }

/* 通用：表單格線、黏底儲存列、按鈕堆疊 */
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem 1rem; align-items: end; }
.form-grid > label { margin: 0; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-all { grid-column: 1 / -1; display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.form-grid .check-inline { align-self: center; }
.grid-2 .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sticky-save { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem 0 .2rem; margin-top: .6rem; background: linear-gradient(transparent, var(--surface) 30%); flex-wrap: wrap; }
.stack-btns { display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; }
.panel.attention { box-shadow: inset 4px 0 0 var(--urgent), var(--shadow); }
.store-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.store-chips button { border: 1px solid var(--line-strong); background: #fff; border-radius: 999px; padding: .15rem .8rem; font-size: .85rem; cursor: pointer; color: var(--ink-2); }
.store-chips button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.panel input[type=url], .panel input[type=text], .panel input[type=number], .panel input[type=datetime-local], .panel select { max-width: 100%; }
.panel form > label input[type=url] { width: 100%; }

/* 錢包頁分頁 */
.ptabs-pane[hidden] { display: none !important; }

@media (max-width: 900px) {
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .form-grid, .grid-2 .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .mc-head { align-items: flex-start; }
  .mc-tabs a { padding: .6rem .7rem; }
  .rcards { grid-template-columns: 1fr; }
  table.orders .actions { flex-wrap: wrap; }
}
@media print {
  .mc-tabs, .settle-box, .rcard-act, .mc-head .actions, .crumb { display: none !important; }
}
table.dense .btn.small { white-space: nowrap; }
.table-scroll { overflow-x: auto; }
@media (max-width: 640px) {
  table.orders thead { display: none; }
  table.orders, table.orders tbody, table.orders tr, table.orders td { display: block; width: 100%; }
  table.orders tr { position: relative; padding: .8rem 0; border-bottom: 1px solid var(--line); }
  table.orders td { border: 0 !important; padding: .15rem 0 !important; text-align: left !important; }
  table.orders td.num .actions { justify-content: flex-start !important; }
  table.orders td:nth-child(4) { position: absolute; top: .8rem; right: 0; width: auto; text-align: right !important; }
  table.orders td:last-child:not(:first-child) .actions, table.orders td form { display: inline-flex; }
}

/* 表格：標題列固定、內容在框內捲動（新竹物流託運單等長清單） */
.table-scroll-y { max-height: max(360px, calc(100vh - 260px)); overflow: auto; border: 1px solid var(--line); border-radius: 10px; overscroll-behavior: contain; }
.table-scroll-y > table { margin: 0; }
table.sticky-head thead th { position: sticky; top: 0; z-index: 2; background: linear-gradient(var(--tint), var(--tint)), #fff; box-shadow: inset 0 -1px 0 var(--line-strong); }
@media (max-width: 760px) { .table-scroll-y { max-height: 70vh; } }
/* 頭貼（上方選單） */
.topbar .who .who-t { display: flex; flex-direction: column; }
.topbar .who.has-av { flex-direction: row; align-items: center; gap: .5rem; }
.topbar .who-av { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 2px rgba(255,255,255,.6); }

.push-ask{position:fixed;left:12px;right:12px;bottom:calc(14px + env(safe-area-inset-bottom));z-index:9999;display:flex;gap:.6rem;align-items:center;flex-wrap:wrap;padding:.75rem .9rem;border-radius:14px;background:#1f3a5f;color:#fff;box-shadow:0 6px 24px rgba(0,0,0,.25);font-size:.92rem}
.push-ask span{flex:1 1 220px}.push-ask .linkbtn{color:#dfe8f3}
