:root { --navy: #0A192F; --navy2: #172A45; --cyan: #00B4D8; --cyan-bg: #E0F2F7; --ink: #0A192F; --muted: #475569; --line: #E2E8F0; --bg: #F1F5F9; --ok: #166534; --ok-bg: #DCFCE7; --warn: #92400E; --warn-bg: #FEF3C7; --err: #B91C1C; --err-bg: #FEE2E2; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; font-size: 15px; line-height: 1.5; -webkit-text-size-adjust: 100%; }
a { color: #0077A0; }
button { font: inherit; }
.top { background: var(--navy); color: #fff; padding: 14px 18px; display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 10; }
.top .brand { font-weight: 700; letter-spacing: .5px; }
.top .sub { font-size: 12px; color: #7DD3E8; }
.top .sp { flex: 1; }
.top .who { font-size: 13px; color: #CBD5E1; text-align: right; }
.top button.link { background: none; border: 1px solid #475569; color: #fff; border-radius: 8px; min-height: 36px; padding: 0 12px; cursor: pointer; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 16px; }
.narrow { max-width: 560px; margin: 0 auto; padding: 16px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.card h2 { margin: 0 0 10px; font-size: 17px; }
.card.dark { background: var(--navy); color: #fff; border-color: var(--navy); }
.card.dark .muted { color: #CBD5E1; }
.card.hl { border: 2px solid var(--cyan); }
h1 { font-size: 21px; margin: 0 0 14px; }
.muted { color: var(--muted); font-size: 13px; }
.small { font-size: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 10px; border: 0; background: var(--navy); color: #fff; font-weight: 600; cursor: pointer; text-decoration: none; gap: 6px; }
.btn.block { display: flex; width: 100%; }
.btn.cyan { background: var(--cyan); color: var(--navy); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid #CBD5E1; }
.btn.danger { background: #fff; color: var(--err); border: 1px solid #FCA5A5; }
.btn:disabled { background: #94A3B8; color: #fff; cursor: not-allowed; border: 0; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 8px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
label.f { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
input.i, select.i, textarea.i { width: 100%; border: 1px solid #CBD5E1; border-radius: 8px; min-height: 44px; padding: 8px 12px; font: inherit; font-size: 16px; background: #fff; color: var(--ink); }
textarea.i { min-height: 120px; line-height: 1.6; }
.chk { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; line-height: 1.5; }
.chk input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--cyan); flex-shrink: 0; }
.seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.seg button { min-height: 44px; border-radius: 8px; border: 2px solid var(--line); background: #fff; cursor: pointer; color: var(--ink); }
.seg button.on { border-color: var(--cyan); background: var(--cyan-bg); }
.chip { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 20px; background: var(--cyan-bg); color: #075E73; white-space: nowrap; }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.gray { background: #F1F5F9; color: var(--muted); }
.list-item { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; cursor: pointer; color: var(--ink); }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--cyan-bg); color: var(--navy); display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.avatar.lg { width: 52px; height: 52px; font-size: 19px; color: #fff; background: #0077A0; }
.steps .s { display: flex; gap: 12px; padding-bottom: 12px; }
.steps .dot { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; background: var(--line); color: var(--muted); }
.steps .s.done .dot { background: var(--cyan); color: #fff; }
.steps .s.now .dot { background: var(--navy); color: #fff; }
.steps .s.now .t { font-weight: 700; }
.steps .s.todo .t { color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.kpis .card { margin: 0; }
.kpis b { display: block; font-size: 26px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tblwrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); background: #F8FAFC; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid #F1F5F9; vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.side { display: flex; flex-wrap: wrap; gap: 16px; }
.side nav { flex: 1 1 190px; max-width: 220px; }
.side main { flex: 999 1 560px; min-width: 0; }
.side nav button { display: block; width: 100%; text-align: left; min-height: 44px; border: 0; background: transparent; border-radius: 8px; padding: 0 14px; cursor: pointer; color: #334155; margin-bottom: 2px; }
.side nav button.on { background: var(--navy); color: #fff; font-weight: 700; }
@media (max-width: 700px) { .side nav { max-width: none; display: flex; overflow-x: auto; gap: 4px; } .side nav button { white-space: nowrap; width: auto; } }
.slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.slots button { min-height: 44px; border-radius: 8px; border: 2px solid var(--line); background: #fff; cursor: pointer; color: var(--ink); }
.slots button.on { border-color: var(--cyan); background: var(--cyan-bg); }
.slots button:disabled { background: #F1F5F9; color: #94A3B8; cursor: not-allowed; }
.week { display: grid; grid-template-columns: 64px repeat(7, minmax(78px, 1fr)); gap: 6px; min-width: 640px; }
.week .h { text-align: center; font-size: 13px; color: #334155; }
.week .t { font-size: 13px; color: var(--muted); display: flex; align-items: center; }
.week button { min-height: 40px; border: 0; border-radius: 6px; cursor: pointer; font-size: 12px; background: var(--line); color: var(--ink); }
.week button.open { background: var(--cyan); }
.week button.other { background: #CBD5E1; color: var(--muted); }
.week button.booked { background: var(--navy); color: #fff; cursor: default; }
.kv { display: flex; gap: 14px; padding: 8px 0; border-bottom: 1px solid #F1F5F9; font-size: 14px; flex-wrap: wrap; }
.kv .k { width: 220px; color: var(--muted); flex-shrink: 0; }
.kv .v { flex: 1; min-width: 180px; white-space: pre-wrap; }
.sec-h { font-weight: 700; margin: 14px 0 4px; color: var(--navy2); font-size: 14px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 10px; z-index: 999; font-size: 14px; max-width: 90vw; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.toast.err { background: var(--err); }
.box-code { font-family: ui-monospace, Menlo, monospace; font-size: 22px; letter-spacing: 3px; font-weight: 700; background: var(--cyan-bg); border-radius: 8px; padding: 10px 14px; display: inline-block; }
.linkbox { word-break: break-all; background: #F8FAFC; border: 1px dashed #94A3B8; border-radius: 8px; padding: 10px; font-size: 13px; }
.qr-ph { width: 180px; height: 180px; margin: 10px auto; border: 2px dashed #94A3B8; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; text-align: center; padding: 10px; }
.qr-img { width: 200px; height: 200px; object-fit: contain; display: block; margin: 10px auto; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.err-text { color: var(--err); font-size: 13px; margin-top: 8px; }
.ok-text { color: var(--ok); font-size: 13px; margin-top: 8px; }
.hide { display: none !important; }

/* 共用弹窗 */
.dlg-mask { position: fixed; inset: 0; background: rgba(10,25,47,.55); z-index: 5000; display: flex; align-items: center; justify-content: center; padding: 18px; }
.dlg { background: #fff; border-radius: 16px; padding: 22px; width: 100%; max-width: 440px; max-height: 90vh; overflow: auto; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.dlg h3 { margin: 0 0 12px; font-size: 19px; color: #0A192F; }
.dlg-ok { width: 46px; height: 46px; border-radius: 50%; background: #DCFCE7; color: #16A34A; font-size: 26px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.cred { background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 12px; padding: 4px 14px; margin-bottom: 10px; }
.cred > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed #E2E8F0; font-size: 14px; }
.cred > div:last-child { border-bottom: 0; }
.cred span { color: #64748B; flex: 0 0 auto; }
.cred b { word-break: break-all; text-align: right; }
.cred b.pw { font-size: 20px; letter-spacing: 2px; color: #0A192F; font-family: ui-monospace, Menlo, monospace; }
/* 唯一 ID 输入 */
.uidbox .seg { display: inline-flex; border: 1px solid #CBD5E1; border-radius: 10px; overflow: hidden; margin-bottom: 10px; }
.uidbox .seg button { min-width: 72px; min-height: 42px; border: 0; background: #fff; font-size: 16px; cursor: pointer; }
.uidbox .seg button + button { border-left: 1px solid #CBD5E1; }
.uidbox .seg button.on { background: #0A192F; color: #fff; }
.uidrow { display: flex; align-items: center; gap: 6px; }
.uidrow .pre { font-family: ui-monospace, Menlo, monospace; font-weight: 700; color: #0A192F; font-size: 16px; white-space: nowrap; }
.uidrow .pre i { font-style: normal; color: #00A3C4; }
.uidrow .bd { flex: 1.6; min-width: 0; font-size: 16px; }
.uidrow .l4 { flex: 1; min-width: 0; font-size: 16px; text-transform: uppercase; }
.uidbox .sfx { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.uidprev { margin-top: 8px; min-height: 20px; }
.uidprev b { font-family: ui-monospace, Menlo, monospace; font-size: 15px; color: #0A192F; }
.uidbox .link { margin-top: 6px; padding: 0; background: none; border: 0; color: #0077B6; cursor: pointer; font-size: 13px; }
.qrbox { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.qrbox canvas { width: 132px; height: 132px; border: 1px solid #E2E8F0; border-radius: 8px; }

/* 干预方案编辑器 */
.plan-dim { border: 1px solid var(--line, #E2E8F0); border-radius: 12px; padding: 12px; margin: 10px 0; background: #fff; }
.plan-dim.locked { background: #F8FAFC; opacity: .75; }
.plan-head, .plan-row { display: grid; grid-template-columns: 1.4fr 1.6fr .8fr 1.6fr 36px; gap: 6px; align-items: center; margin-top: 6px; }
.plan-head span:last-child { grid-column: span 2; }
.plan-row .i { min-width: 0; }
.plan-tbl td, .plan-tbl th { font-size: 14px; }
@media (max-width: 720px) {
  .plan-head { display: none; }
  .plan-row { grid-template-columns: 1fr 1fr; border-bottom: 1px dashed #E2E8F0; padding-bottom: 8px; }
}

.plan-item { border: 1px solid #E2E8F0; border-radius: 10px; padding: 10px 12px; margin: 6px 0; background: #fff; }
.plan-item .pi-dose { font-size: 14px; margin-top: 4px; color: #0A192F; }
.plan-dim.locked .plan-head { display: none; }

.dlg.wide { max-width: 640px; }
.notice-txt { white-space: pre-wrap; word-break: break-all; background: #F8FAFC; border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: 14px; line-height: 1.6; }
.sign-sec { font-weight: 600; color: #0A192F; margin: 16px 0 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.dlg > .sign-sec:first-of-type { border-top: 0; padding-top: 0; margin-top: 4px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg label { padding: 8px 14px; cursor: pointer; font-size: 14px; }
.seg input { display: none; }
.seg label.on { background: #0A192F; color: #fff; }
.chip.bad { background: #FEE2E2; color: #B91C1C; }
.more-list { display: flex; flex-direction: column; gap: 10px; }
.more-it { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.more-it > div { flex: 1; }
.modebar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 8px max(16px, calc((100% - 1180px) / 2)); background: #11253F; }
.modebar button, .modebar a { border: 1px solid rgba(255,255,255,.25); background: transparent; color: #CFE3EE; border-radius: 20px; padding: 6px 14px; font-size: 13px; cursor: pointer; text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
.modebar button.on { background: #fff; color: #0A192F; border-color: #fff; font-weight: 600; }
.modebar a { margin-left: auto; }
/* 客户端：底部标签 */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 800; display: flex; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar button { flex: 1; border: 0; background: none; padding: 8px 0 10px; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; min-height: 54px; }
.tabbar .ti { font-size: 18px; line-height: 1; }
.tabbar button.on { color: var(--navy, #0A192F); font-weight: 700; }
.tabbar button.on .ti { color: var(--cyan); }
body.has-tabs { padding-bottom: 76px; }
.pbar { display: flex; gap: 4px; margin-top: 10px; }
.pbar i { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.pbar i.d { background: var(--cyan); }
.pbar i.n { background: #0A192F; }
.mbar { display: flex; gap: 12px; align-items: center; padding: 12px 16px; }
.team-r { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.team-r:last-of-type { border-bottom: 0; }
.gsearch { position: relative; width: min(420px, 40vw); margin-right: 14px; }
.gsearch .i { background: rgba(255,255,255,.95); min-height: 38px; font-size: 14px; }
.gres { position: absolute; top: 44px; left: 0; right: 0; z-index: 3000; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(10,25,47,.2); max-height: 70vh; overflow: auto; color: var(--ink); }
.gres .gsec { font-size: 12px; color: var(--muted); padding: 8px 12px 4px; background: #F8FAFC; }
.gres button { display: block; width: 100%; text-align: left; border: 0; background: #fff; padding: 9px 12px; font-size: 14px; cursor: pointer; border-bottom: 1px solid #F1F5F9; }
.gres button:hover { background: #F0F9FB; }
.flash { box-shadow: 0 0 0 3px var(--cyan) !important; }
@media (max-width: 760px) { .gsearch { width: 100%; order: 5; margin: 8px 0 0; } }
