:root {
  --pri: #0f5c7a; --pri-d: #0a4660; --pri-l: #e6f1f5; --acc: #c9771a;
  --bg: #f3f5f7; --card: #fff; --line: #dfe5ea; --line-l: #edf1f4;
  --tx: #1c2a36; --tx2: #556573; --tx3: #8795a1;
  --red: #c0392b; --red-l: #fbeceb; --amber: #b7791f; --amber-l: #fdf3df; --green: #1e8a5a; --green-l: #e4f5ec; --blue: #2468b3; --blue-l: #e8f0fa; --purple: #6b4fa3; --purple-l: #f0ebf8;
  --r: 10px; --sh: 0 1px 2px rgba(16, 40, 60, .06), 0 2px 8px rgba(16, 40, 60, .05);
  --side: 256px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--tx); font: 15px/1.6 "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, -apple-system, "Segoe UI", sans-serif; }
h1, h2, h3, h4 { margin: 0; line-height: 1.35; }
h1 { font-size: 21px; } h2 { font-size: 17px; } h3 { font-size: 15px; } h4 { font-size: 14px; }
a { color: var(--pri); text-decoration: none; } a:hover { text-decoration: underline; }
p { margin: 0 0 8px; }
.boot { padding: 80px 20px; text-align: center; color: var(--tx3); }
.muted { color: var(--tx2); } .small { font-size: 13px; } .tiny { font-size: 12px; } .nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; } .right { text-align: right; } .center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .grow { flex: 1; min-width: 0; } .between { justify-content: space-between; }
.mt { margin-top: 14px; } .mb { margin-bottom: 14px; } .hide { display: none !important; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ── 版面 ── */
.shell { min-height: 100dvh; }
.side { position: fixed; inset: 0 auto 0 0; width: var(--side); background: #0d3f55; color: #cfe1ea; display: flex; flex-direction: column; z-index: 20; }
.side .logo { display: block; padding: 20px 18px 16px; border-bottom: 1px solid rgba(255, 255, 255, .1); color: inherit; --mark-check: #0d3f55; }
.side .logo:hover { text-decoration: none; }
.brand .co { display: flex; align-items: center; gap: 9px; font-size: 21px; font-weight: 700; letter-spacing: 3px; line-height: 1.2; }
.brand .mark { width: 30px; height: 30px; flex: none; }
.brand .sys { font-size: 13.5px; font-weight: 600; margin-top: 12px; padding-top: 11px; line-height: 1.4; letter-spacing: 0; overflow-wrap: anywhere; border-top: 1px solid rgba(127, 208, 230, .28); }
.brand .sys em { font-style: normal; font-weight: 800; letter-spacing: .5px; margin: 0 1px; }
.brand .std { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.brand .std span { font-size: 10.5px; line-height: 1.6; padding: 0 6px; border-radius: 4px; white-space: nowrap; letter-spacing: .2px; }
.side .brand .co { color: #fff; } .side .brand .mark { color: #7fd0e6; }
.side .brand .sys { color: #fff; } .side .brand .sys em { color: #7fd0e6; }
.side .brand .std span { background: rgba(255, 255, 255, .1); color: #b9d3de; }
.side nav { padding: 10px 8px; flex: 1; overflow-y: auto; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: #cfe1ea; margin-bottom: 2px; font-size: 14.5px; }
.side nav a:hover { background: rgba(255, 255, 255, .08); text-decoration: none; }
.side nav a.on { background: #fff; color: var(--pri-d); font-weight: 600; }
.side nav a .cnt { margin-left: auto; background: var(--acc); color: #fff; border-radius: 10px; font-size: 11.5px; padding: 0 7px; font-weight: 600; }
.side .me { padding: 12px 14px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 13px; }
.side .me b { color: #fff; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .me .row { margin-top: 8px; gap: 6px; }
.side .me button { background: rgba(255, 255, 255, .1); color: #fff; border: 0; border-radius: 6px; padding: 5px 10px; font-size: 12.5px; cursor: pointer; }
.side .me button:hover { background: rgba(255, 255, 255, .2); }
svg.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.main { margin-left: var(--side); padding: 22px 26px 30px; max-width: 1500px; }
.topbar, .tabbar { display: none; }
.foot { margin: 32px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--tx3); line-height: 1.8; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head .sub { color: var(--tx2); font-size: 13.5px; margin-top: 2px; }

/* ── 元件 ── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); padding: 16px 18px; margin-bottom: 16px; }
.card > h2, .card > .card-h { margin-bottom: 12px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid > .card { margin-bottom: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; box-shadow: var(--sh); }
.kpi .l { font-size: 12.5px; color: var(--tx2); } .kpi .v { font-size: 24px; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; } .kpi .s { font-size: 12px; color: var(--tx3); }
.kpi.red .v { color: var(--red); } .kpi.amber .v { color: var(--amber); } .kpi.green .v { color: var(--green); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--tx); border-radius: 8px; padding: 7px 14px; font: inherit; font-size: 14px; cursor: pointer; min-height: 36px; white-space: nowrap; }
.btn:hover { background: #f6f8fa; text-decoration: none; }
.btn.pri { background: var(--pri); border-color: var(--pri); color: #fff; } .btn.pri:hover { background: var(--pri-d); }
.btn.danger { color: var(--red); border-color: #e8c4c0; } .btn.danger:hover { background: var(--red-l); }
.btn.ok { background: var(--green); border-color: var(--green); color: #fff; }
.btn.sm { padding: 3px 10px; min-height: 30px; font-size: 13px; }
.btn.link { border: 0; background: none; color: var(--pri); padding: 2px 4px; min-height: 0; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--pri); outline-offset: 2px; }

.badge { display: inline-block; padding: 1px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; line-height: 1.7; white-space: nowrap; background: var(--line-l); color: var(--tx2); }
.badge.red { background: var(--red-l); color: var(--red); } .badge.amber { background: var(--amber-l); color: var(--amber); }
.badge.green { background: var(--green-l); color: var(--green); } .badge.blue { background: var(--blue-l); color: var(--blue); }
.badge.purple { background: var(--purple-l); color: var(--purple); } .badge.pri { background: var(--pri-l); color: var(--pri-d); }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: #c5ced6; vertical-align: -1px; }
.dot.red { background: var(--red); } .dot.amber { background: #e0a030; } .dot.green { background: var(--green); }

.bar { position: relative; height: 8px; background: var(--line-l); border-radius: 5px; min-width: 70px; }
.bar > i { position: absolute; inset: 0 auto 0 0; border-radius: 5px; background: var(--pri); }
.bar > i.red { background: var(--red); } .bar > i.amber { background: #e0a030; } .bar > i.green { background: var(--green); }
.bar > u { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--tx); opacity: .55; }
.hbar { display: grid; grid-template-columns: minmax(84px, 34%) 1fr auto; gap: 8px; align-items: center; margin: 7px 0; font-size: 13.5px; }
.hbar .bar { height: 12px; }

.notice { border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-size: 14px; border: 1px solid; }
.notice.info { background: var(--blue-l); border-color: #c5d9f0; color: #1c4f8a; }
.notice.warn { background: var(--amber-l); border-color: #f0dcae; color: #7a5210; }
.notice.err { background: var(--red-l); border-color: #efc6c2; color: #8f2a20; }
.notice.ok { background: var(--green-l); border-color: #bfe3cf; color: #156343; }
.notice ul { margin: 6px 0 0; padding-left: 20px; }
.empty { text-align: center; color: var(--tx3); padding: 26px 10px; font-size: 14px; }

/* 表格（手機轉為卡片） */
.tbl-wrap { overflow-x: auto; margin: 0 -4px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12.5px; color: var(--tx2); font-weight: 600; padding: 8px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; background: #fafbfc; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line-l); vertical-align: top; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: #f7fafb; }
.tbl td.act { white-space: nowrap; text-align: right; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 9px 14px; color: var(--tx2); white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1px; font-size: 14.5px; }
.tabs a:hover { color: var(--tx); text-decoration: none; }
.tabs a.on { color: var(--pri-d); border-bottom-color: var(--pri); font-weight: 600; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.pills a { padding: 5px 13px; border-radius: 20px; background: #fff; border: 1px solid var(--line); color: var(--tx2); font-size: 13.5px; white-space: nowrap; }
.pills a:hover { text-decoration: none; background: #f6f8fa; }
.pills a.on { background: var(--pri); border-color: var(--pri); color: #fff; }

/* 表單 */
label.f { display: block; margin-bottom: 12px; font-size: 13.5px; color: var(--tx2); }
label.f > span { display: block; margin-bottom: 4px; font-weight: 600; } label.f em { color: var(--red); font-style: normal; }
label.f small { display: block; color: var(--tx3); margin-top: 3px; font-size: 12px; }
input, select, textarea { font: inherit; color: var(--tx); }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=search], select, textarea { width: 100%; border: 1px solid #cbd5dd; border-radius: 8px; padding: 8px 10px; background: #fff; min-height: 38px; font-size: 16px; }
textarea { min-height: 76px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--pri); outline: 2px solid var(--pri-l); }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; } .fgrid .full { grid-column: 1 / -1; }
label.chk { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 12px; font-size: 14px; cursor: pointer; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--pri); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar select, .toolbar input { width: auto; min-width: 120px; font-size: 14px; min-height: 36px; padding: 5px 10px; }
.toolbar input[type=search] { flex: 1; min-width: 150px; max-width: 320px; }

/* Modal / Toast */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 30, 42, .5); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 14px; z-index: 100; overflow-y: auto; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 560px; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); }
.modal.wide { max-width: 820px; }
.modal > header { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.modal > header button { border: 0; background: none; font-size: 24px; line-height: 1; cursor: pointer; color: var(--tx3); padding: 0 4px; }
.modal > .body { padding: 16px 18px; }
.modal > footer { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
#toast-root { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { background: #1c2a36; color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 14px; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
.toast.err { background: var(--red); } .toast.ok { background: var(--green); }

/* 登入 */
.login { min-height: 100dvh; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; padding: 28px 18px; color: #e6f1ff;
  background: radial-gradient(900px 560px at 12% 10%, rgba(34, 211, 238, .2), transparent 62%), radial-gradient(900px 620px at 88% 92%, rgba(129, 140, 248, .26), transparent 62%), linear-gradient(150deg, #061523 0%, #0a2a40 55%, #0d3a55 100%); }
.lg-bg { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .85; }
.lg-glow { position: absolute; width: 520px; height: 520px; right: 8%; top: 50%; margin-top: -260px; border-radius: 50%; background: radial-gradient(circle, rgba(56, 189, 220, .28), rgba(129, 140, 248, .16) 45%, transparent 70%); filter: blur(10px); animation: lgbreathe 7s ease-in-out infinite; pointer-events: none; }
@keyframes lgbreathe { 50% { transform: scale(1.12); opacity: .75; } }
.lg-wrap { position: relative; width: 100%; max-width: 1080px; display: grid; grid-template-columns: 1.08fr .92fr; gap: 56px; align-items: center; }
.lg-hero { animation: lgin .8s cubic-bezier(.2, .7, .2, 1) both; }
.lg-side { animation: lgin .8s .12s cubic-bezier(.2, .7, .2, 1) both; display: flex; flex-direction: column; align-items: center; }
@keyframes lgin { from { opacity: 0; transform: translateY(22px); } }
.lg-tag { display: inline-flex; align-items: center; gap: 9px; padding: 5px 15px 5px 10px; border-radius: 30px; border: 1px solid rgba(125, 211, 235, .3); background: rgba(56, 189, 220, .08); font-size: 13.5px; letter-spacing: 2px; color: #c5ecf7; margin-bottom: 22px; }
.lg-tag i { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0 rgba(52, 211, 153, .7); animation: lgping 2s infinite; }
@keyframes lgping { 70% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }
.lg-hero h1 { margin: 0; font-size: clamp(32px, 4.4vw, 52px); line-height: 1.22; font-weight: 800; letter-spacing: 1px; color: #fff; }
.lg-hero h1 span { background: linear-gradient(100deg, #38d6f0 0%, #818cf8 55%, #e879f9 100%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: lgshine 7s linear infinite; }
@keyframes lgshine { to { background-position: -200% 0; } }
.lg-hero p { margin: 20px 0 26px; color: #b3c7da; font-size: 16.5px; line-height: 1.8; max-width: 520px; }
.lg-hero ul { list-style: none; margin: 0 0 26px; padding: 0; display: grid; gap: 12px; max-width: 520px; }
.lg-hero li { display: grid; gap: 1px; padding: 11px 16px; border-radius: 12px; border: 1px solid rgba(125, 211, 235, .16); background: rgba(255, 255, 255, .04); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border-left: 3px solid #38bddc; }
.lg-hero li b { font-size: 15.5px; color: #fff; } .lg-hero li span { font-size: 13.5px; color: #9fb6ca; }
.lg-std { display: flex; flex-wrap: wrap; gap: 7px; } .lg-std span { font-size: 12px; padding: 3px 11px; border-radius: 20px; border: 1px solid rgba(125, 211, 235, .28); color: #c5ecf7; letter-spacing: .3px; }
.login .box { position: relative; color: var(--tx); background: #fff; border-radius: 18px; width: 100%; max-width: 430px; padding: 30px 28px 22px; box-shadow: 0 0 0 1px rgba(125, 211, 235, .25), 0 0 70px rgba(56, 189, 220, .22), 0 30px 80px rgba(0, 0, 0, .5); }
.login .box::before { content: ""; position: absolute; left: 18px; right: 18px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: linear-gradient(90deg, #38d6f0, #818cf8, #e879f9); }
.login .brand { text-align: center; margin-bottom: 20px; --mark-check: #fff; }
.login .brand .co { justify-content: center; color: var(--pri-d); font-size: 24px; } .login .brand .mark { color: var(--pri); width: 34px; height: 34px; }
.login .brand .sys { color: var(--tx); font-size: 16px; border-top-color: var(--line); display: inline-block; padding: 11px 6px 0; } .login .brand .sys em { color: var(--pri); }
.login .brand .std { justify-content: center; } .login .brand .std span { background: var(--pri-l); color: var(--pri-d); font-size: 11px; }
.login .seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--line-l); border-radius: 8px; padding: 3px; margin-bottom: 16px; }
.login .seg button { border: 0; background: none; padding: 7px; border-radius: 6px; font: inherit; cursor: pointer; color: var(--tx2); }
.login .seg button.on { background: #fff; color: var(--pri-d); font-weight: 600; box-shadow: var(--sh); }
.login .btn { width: 100%; min-height: 44px; font-size: 15px; }
.login .btn.pri { background: linear-gradient(100deg, #0f5c7a, #2468b3); border-color: transparent; box-shadow: 0 8px 22px rgba(36, 104, 179, .28); transition: transform .15s, box-shadow .15s; } .login .btn.pri:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(36, 104, 179, .38); }
.login input.code { text-align: center; font-size: 26px; letter-spacing: 10px; font-weight: 700; }
.login .foot2 { color: #a9c0d2; font-size: 12px; text-align: center; margin-top: 18px; line-height: 1.9; } .login .foot2 a { color: #fff; text-decoration: underline; }

/* 專案 */
.stepper { display: flex; margin: 4px 0 2px; }
.stepper > div { flex: 1; text-align: center; position: relative; font-size: 12.5px; color: var(--tx3); padding-top: 30px; min-width: 0; }
.stepper > div::before { content: attr(data-n); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 24px; height: 24px; line-height: 24px; border-radius: 50%; background: #d5dde3; color: #fff; font-weight: 700; font-size: 12px; z-index: 1; }
.stepper > div::after { content: ""; position: absolute; top: 11px; left: -50%; width: 100%; height: 3px; background: #d5dde3; }
.stepper > div:first-child::after { display: none; }
.stepper > div.done::before, .stepper > div.done::after, .stepper > div.cur::after { background: var(--green); }
.stepper > div.cur::before { background: var(--pri); box-shadow: 0 0 0 4px var(--pri-l); }
.stepper > div.cur { color: var(--pri-d); font-weight: 700; } .stepper > div.done { color: var(--green); }
.dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 18px; }
.dl div > span { display: block; font-size: 12px; color: var(--tx3); } .dl div > b { font-weight: 500; overflow-wrap: anywhere; }
.flow { display: flex; flex-wrap: wrap; gap: 6px; align-items: stretch; }
.flow > div { flex: 1 1 130px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; background: #fafbfc; position: relative; }
.flow > div b { display: block; font-size: 13.5px; } .flow > div.done { border-color: #bfe3cf; background: var(--green-l); } .flow > div.todo { border-color: #f0dcae; background: var(--amber-l); } .flow > div.na { opacity: .6; }
.ck { display: flex; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line-l); align-items: flex-start; }
.ck:last-child { border-bottom: 0; }
.ck .t { flex: 1; min-width: 0; } .ck .t.off { color: var(--tx3); text-decoration: line-through; }
.ck .st { width: 22px; height: 22px; border-radius: 6px; border: 2px solid #b9c5ce; flex: none; margin-top: 1px; background: #fff; cursor: pointer; padding: 0; font-size: 13px; line-height: 1; color: #fff; }
.ck .st.done { background: var(--green); border-color: var(--green); } .ck .st.na { background: #aab5be; border-color: #aab5be; } .ck .st:disabled { cursor: default; }
details.ph { background: #fff; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 12px; box-shadow: var(--sh); }
details.ph > summary { padding: 12px 16px; cursor: pointer; display: flex; align-items: center; gap: 10px; list-style: none; font-weight: 600; flex-wrap: wrap; }
details.ph > summary::-webkit-details-marker { display: none; }
details.ph > summary .bar { flex: 1; max-width: 220px; }
details.ph > div { padding: 0 16px 12px; }
details.ph.cur { border-color: var(--pri); }

.board { display: grid; grid-template-columns: repeat(5, minmax(210px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.board .col { background: #e9eef2; border-radius: 10px; padding: 8px; min-height: 120px; }
.board .col h4 { padding: 2px 6px 8px; color: var(--tx2); display: flex; justify-content: space-between; }
.tcard { background: #fff; border-radius: 8px; padding: 9px 11px; margin-bottom: 8px; box-shadow: var(--sh); cursor: pointer; font-size: 13.5px; border-left: 4px solid #c5ced6; }
.tcard:hover { box-shadow: 0 3px 10px rgba(0, 0, 0, .12); } .tcard.p3 { border-left-color: #e0a030; } .tcard.p4 { border-left-color: var(--red); }
.tcard b { display: block; font-weight: 600; margin-bottom: 4px; overflow-wrap: anywhere; }
.gantt { overflow-x: auto; }
.gantt .g-row { display: grid; grid-template-columns: 200px minmax(520px, 1fr); align-items: center; border-bottom: 1px solid var(--line-l); min-height: 34px; font-size: 13px; }
.gantt .g-row > div:first-child { padding: 4px 8px 4px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.gantt .track { position: relative; height: 22px; background: repeating-linear-gradient(90deg, transparent 0, transparent calc(8.333% - 1px), var(--line-l) calc(8.333% - 1px), var(--line-l) 8.333%); }
.gantt .track i { position: absolute; top: 4px; height: 14px; border-radius: 4px; background: #9fc3d3; min-width: 4px; overflow: hidden; }
.gantt .track i b { display: block; height: 100%; background: var(--pri); }
.gantt .track i.late { background: #efb4ad; } .gantt .track i.late b { background: var(--red); }
.gantt .track u { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--acc); }
.gantt .g-head { font-size: 11.5px; color: var(--tx3); }

.matrix { display: grid; grid-template-columns: 26px repeat(4, 1fr); gap: 4px; max-width: 360px; font-size: 12.5px; }
.matrix .c { aspect-ratio: 1.5; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 6px; font-weight: 700; color: #fff; line-height: 1.2; }
.matrix .c small { font-weight: 400; opacity: .85; font-size: 10.5px; }
.matrix .c.l1 { background: #6fb58f; } .matrix .c.l2 { background: #d9b23a; } .matrix .c.l3 { background: #dd8433; } .matrix .c.l4 { background: #c0392b; }
.matrix .c.z { opacity: .45; } .matrix .ax { display: flex; align-items: center; justify-content: center; color: var(--tx3); font-size: 11.5px; }
.lv1 { background: #e4f5ec; color: #1e8a5a; } .lv2 { background: #fdf3df; color: #8a6a10; } .lv3 { background: #fde8d7; color: #b45a12; } .lv4 { background: var(--red-l); color: var(--red); }
.dim { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.dim h4 { margin-bottom: 6px; } .dim .opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.dim .opts label { border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; font-size: 12.5px; cursor: pointer; display: block; line-height: 1.45; background: #fff; }
.dim .opts label b { display: block; font-size: 13px; }
.dim .opts input { position: absolute; opacity: 0; width: 0; height: 0; }
.dim .opts label:has(input:checked) { border-color: var(--pri); background: var(--pri-l); box-shadow: inset 0 0 0 1px var(--pri); }
.dim .opts label:has(input:focus-visible) { outline: 2px solid var(--pri); }
.cmt { border-left: 3px solid var(--line); padding: 2px 0 2px 10px; margin-bottom: 10px; font-size: 14px; }
input[type=range] { width: 100%; accent-color: var(--pri); }

.cobar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.cobar select { width: auto; min-width: 180px; max-width: 100%; min-height: 34px; padding: 4px 10px; font-size: 14.5px; font-weight: 600; }
.cobar b { font-size: 15px; }
.acct-bar { font-size: 13.5px; padding: 8px 14px; }
/* 設定維護：可增刪排序之清單、Logo */
.trow { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line-l); }
.trow:last-child { border-bottom: 0; }
.trow input[type=text] { min-height: 36px; font-size: 15px; }
.logo-prev { width: 72px; height: 72px; border-radius: 10px; background: #0d3f55; display: grid; place-items: center; padding: 8px; flex: none; }
.logo-prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-prev .muted { color: #9fbfcc; }
img.logo-img { object-fit: contain; border-radius: 5px; }
input[type=file] { font-size: 14px; max-width: 100%; }

/* ── 手機版 ── */
@media (max-width: 900px) {
  .side { display: none; }
  .main { margin-left: 0; padding: 14px 12px calc(84px + env(safe-area-inset-bottom)); }
  .topbar { display: flex; position: sticky; top: 0; z-index: 30; background: var(--pri-d); color: #fff; padding: 10px 14px; align-items: center; justify-content: space-between; gap: 10px; }
  .topbar b { font-size: 16px; display: flex; align-items: center; gap: 7px; letter-spacing: 1.5px; min-width: 0; white-space: nowrap; --mark-check: var(--pri-d); }
  .topbar b .mark { width: 22px; height: 22px; color: #7fd0e6; flex: none; }
  .topbar b small { font-weight: 400; font-size: 11.5px; opacity: .8; letter-spacing: 0; overflow: hidden; text-overflow: ellipsis; }
  .topbar button { background: rgba(255, 255, 255, .15); border: 0; color: #fff; border-radius: 6px; padding: 5px 10px; font-size: 13px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 6px; font-size: 11px; color: var(--tx3); position: relative; }
  .tabbar a.on { color: var(--pri); font-weight: 600; } .tabbar a:hover { text-decoration: none; }
  .tabbar a .cnt { position: absolute; top: 4px; left: 54%; background: var(--red); color: #fff; border-radius: 9px; font-size: 10px; padding: 0 5px; line-height: 16px; }
  .tabbar svg.ic { width: 22px; height: 22px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  h1 { font-size: 18px; }
  .card { padding: 14px; }
  .kpis { grid-template-columns: repeat(2, 1fr); gap: 10px; } .kpi .v { font-size: 21px; }
  .dim .opts { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  table.tbl.rsp thead { display: none; }
  table.tbl.rsp, table.tbl.rsp tbody, table.tbl.rsp tr, table.tbl.rsp td { display: block; width: 100%; }
  table.tbl.rsp tr { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; padding: 8px 12px; background: #fff; }
  table.tbl.rsp td { border: 0; padding: 4px 0; display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; text-align: right; }
  table.tbl.rsp td::before { content: attr(data-l); color: var(--tx3); font-size: 12.5px; flex: none; text-align: left; padding-top: 1px; }
  table.tbl.rsp td.main { display: block; text-align: left; font-weight: 600; font-size: 15px; padding-bottom: 6px; } table.tbl.rsp td.main::before { display: none; }
  table.tbl.rsp td.act { justify-content: flex-end; flex-wrap: wrap; padding-top: 8px; } table.tbl.rsp td.act::before { display: none; }
  table.tbl.rsp td:empty { display: none; }
  table.tbl.rsp td.small:not(.nowrap) { display: block; text-align: left; }
  table.tbl.rsp td.small:not(.nowrap)::before { display: block; margin-bottom: 2px; }
  table.tbl.rsp td .bar { min-width: 110px; margin-top: 8px; }
  .fgrid { grid-template-columns: 1fr; }
  .trow { grid-template-columns: 1fr auto; } .trow input[type=text] { grid-column: 1 / -1; }
  .modal-bg { padding: 0; align-items: flex-end; }
  .modal, .modal.wide { border-radius: 14px 14px 0 0; max-height: 94dvh; display: flex; flex-direction: column; max-width: none; }
  .modal > .body { overflow-y: auto; }
  .modal > footer .btn { flex: 1; }
  .stepper > div { font-size: 11.5px; }
  .board { grid-template-columns: repeat(5, 78vw); }
  .page-head .btn { flex: 1; }
}
@media print {
  .side, .topbar, .tabbar, .btn, .toolbar { display: none !important; }
  .main { margin: 0; padding: 0; } .card { box-shadow: none; break-inside: avoid; }
}

/* 語言切換 */
.langsel { width: auto; min-height: 30px; padding: 2px 8px; font-size: 13px; border-radius: 6px; }
.side .me .langsel { margin-top: 8px; width: 100%; background: rgba(255, 255, 255, .1); color: #fff; border: 1px solid rgba(255, 255, 255, .18); }
.side .me .langsel option { color: #1f2d3a; }
.topbar .langsel { max-width: 104px; background: rgba(255, 255, 255, .14); color: #fff; border: 0; }
.topbar .langsel option { color: #1f2d3a; }
.langrow { margin-bottom: 10px; }
.langrow .langsel { background: rgba(255, 255, 255, .12); color: #fff; border: 1px solid rgba(255, 255, 255, .3); }
.langrow .langsel option { color: #1f2d3a; }
@media (min-width: 761px) { .tbl td.main { min-width: 200px; } }
@media (max-width: 900px) {
  .login { padding: 22px 14px; align-items: flex-start; }
  .lg-wrap { grid-template-columns: 1fr; gap: 22px; max-width: 460px; margin: 0 auto; }
  .lg-hero { text-align: center; } .lg-hero h1 { font-size: 29px; } .lg-hero p { font-size: 14.5px; margin: 12px auto 0; } .lg-hero ul, .lg-std { display: none; } .lg-tag { margin-bottom: 14px; }
  .lg-glow { right: -180px; }
}
@media (prefers-reduced-motion: reduce) { .lg-glow, .lg-hero, .lg-side, .lg-tag i, .lg-hero h1 span { animation: none; } }
