:root {
  --bg: #f5f5f3; --panel: #ffffff; --panel2: #fafaf9; --line: #e7e7e3; --line2: #f0f0ed;
  --ink: #18181b; --ink2: #52525b; --muted: #8b8b94; --hover: #f4f4f1;
  --primary: #18181b; --on-primary: #ffffff;
  --blue: #2a78d6; --blue-soft: rgba(42,120,214,.10);
  --ok: #1f8a4c; --ok-bg: #e8f5ed; --warn: #a86a0c; --warn-bg: #fcf2df; --err: #c4372f; --err-bg: #fcebea;
  --shadow: 0 1px 2px rgba(16,16,20,.04), 0 1px 1px rgba(16,16,20,.02);
  --shadow-lg: 0 24px 48px -12px rgba(16,16,20,.18), 0 2px 6px rgba(16,16,20,.06);
  --r: 12px; --r-sm: 8px;
  --ease: cubic-bezier(.2,.8,.2,1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0e0e10; --panel: #161618; --panel2: #1b1b1e; --line: #27272b; --line2: #202024;
  --ink: #ececef; --ink2: #a6a6ae; --muted: #6f6f78; --hover: #1f1f23;
  --primary: #f2f2f4; --on-primary: #111113;
  --blue: #3987e5; --blue-soft: rgba(57,135,229,.16);
  --ok: #4cc27f; --ok-bg: rgba(76,194,127,.12); --warn: #e0a447; --warn-bg: rgba(224,164,71,.13); --err: #f0706a; --err-bg: rgba(240,112,106,.13);
  --shadow: 0 0 0 1px rgba(255,255,255,.02);
  --shadow-lg: 0 24px 60px -10px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.05);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
.num, td.n, .tnum { font-variant-numeric: tabular-nums; }
::selection { background: var(--blue-soft); }

/* ---------- 布局 ---------- */
.shell { display: grid; grid-template-columns: 224px 1fr; min-height: 100vh; }
.side { position: sticky; top: var(--imp, 0px); height: calc(100vh - var(--imp, 0px)); padding: 18px 12px; border-right: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.logo { width: 30px; height: 30px; border-radius: 9px; background: #141414; overflow: hidden; flex: none; box-shadow: 0 0 0 1px rgba(0,0,0,.06); }
.logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand b { font-size: 15px; letter-spacing: .2px; }
.brand small { display: block; color: var(--muted); font-size: 11.5px; margin-top: -2px; }
.nav-g { color: var(--muted); font-size: 11.5px; padding: 14px 12px 6px; letter-spacing: .5px; }
.nav a { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px; border-radius: var(--r-sm); color: var(--ink2); transition: background .15s, color .15s; position: relative; }
.nav a svg { width: 17px; height: 17px; opacity: .8; flex: none; }
.nav a:hover { background: var(--hover); color: var(--ink); }
.nav a.on { background: var(--hover); color: var(--ink); font-weight: 600; }
.nav a.on::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--ink); }
.nav .badge { margin-left: auto; }
.side-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line2); display: flex; align-items: center; gap: 10px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--hover); display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; color: var(--ink2); }
.side-foot .who { min-width: 0; flex: 1; line-height: 1.25; }
.side-foot .who b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot .who small { color: var(--muted); font-size: 11.5px; }

.main { min-width: 0; }
.top { position: sticky; top: var(--imp, 0px); z-index: 20; display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 28px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.top.scrolled { border-bottom-color: var(--line); }
.top h1 { font-size: 17px; margin: 0; font-weight: 650; letter-spacing: .2px; }
.top .sp { flex: 1; }
.view { padding: 8px 28px 48px; max-width: 1480px; }
.view.enter { animation: viewIn .32s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- 基础组件 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--panel); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .08s, opacity .15s; font-weight: 500; }
.btn:hover { background: var(--hover); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }
.btn.pri { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.pri:hover { opacity: .88; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.danger { color: var(--err); }
.btn.danger.solid { background: var(--err); border-color: var(--err); color: #fff; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
.btn.icon { width: 34px; padding: 0; }
.btn.sm.icon { width: 28px; }
.btn.loading { pointer-events: none; opacity: .7; }
.btn.loading::after { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.inp, .sel, textarea.inp { height: 34px; padding: 0 11px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--panel); outline: none; transition: border-color .15s, box-shadow .15s; min-width: 0; }
textarea.inp { height: auto; padding: 8px 11px; resize: vertical; line-height: 1.55; }
.inp:focus, .sel:focus { border-color: var(--ink2); box-shadow: 0 0 0 3px var(--blue-soft); }
.inp::placeholder { color: var(--muted); }
.sel { padding-right: 28px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238b8b94' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.search { position: relative; }
.search svg { position: absolute; left: 10px; top: 50%; translate: 0 -50%; width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.search .inp { padding-left: 32px; width: 240px; }

.badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--err); color: #fff; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 500; background: var(--hover); color: var(--ink2); white-space: nowrap; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.tag.plain::before { display: none; }
.tag.pending { background: var(--warn-bg); color: var(--warn); }
.tag.settled, .tag.active { background: var(--ok-bg); color: var(--ok); }
.tag.rejected, .tag.disabled { background: var(--err-bg); color: var(--err); }
.tag.k-project { background: var(--blue-soft); color: var(--blue); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 16px 18px 0; }
.card-h h3 { font-size: 14px; margin: 0; font-weight: 600; }
.card-h .sub { color: var(--muted); font-size: 12.5px; }
.card-h .sp { flex: 1; }
.card-b { padding: 14px 18px 18px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 14px; }
.toolbar .sp { flex: 1; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; background: var(--hover); border: 1px solid var(--line2); }
.seg button { height: 28px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--ink2); cursor: pointer; transition: background .18s, color .18s, box-shadow .18s; white-space: nowrap; font-size: 13px; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); font-weight: 600; }
.seg button .c { margin-left: 5px; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.daterange { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); height: 34px; padding: 0 4px; }
.daterange input { border: 0; background: transparent; outline: none; height: 30px; padding: 0 6px; width: 122px; font-variant-numeric: tabular-nums; }
.daterange span { color: var(--muted); }

/* ---------- 表格 ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tbl th { position: sticky; top: 0; text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--panel); white-space: nowrap; }
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable:hover { color: var(--ink); }
.tbl th .arr { opacity: .35; margin-left: 3px; }
.tbl th.sorted { color: var(--ink); } .tbl th.sorted .arr { opacity: 1; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line2); white-space: nowrap; vertical-align: middle; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: var(--panel2); }
.tbl tbody tr.sel { background: var(--blue-soft); }
.tbl tr.click { cursor: pointer; }
.tbl td.n, .tbl th.n { text-align: right; }
.tbl td.muted { color: var(--muted); }
.tbl td.wrap { white-space: normal; min-width: 180px; max-width: 420px; color: var(--ink2); }
.tbl tfoot td { font-weight: 600; border-bottom: 0; border-top: 1px solid var(--line); background: var(--panel2); }
.tbl .ck { width: 36px; padding-right: 0; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.ck input { width: 15px; height: 15px; accent-color: var(--ink); cursor: pointer; vertical-align: middle; }
.empty { padding: 56px 0; text-align: center; color: var(--muted); }
.empty svg { width: 36px; height: 36px; opacity: .45; display: block; margin: 0 auto 10px; }
.pager { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line2); color: var(--muted); font-size: 13px; }
.pager .sp { flex: 1; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; color: var(--muted); }
.ink2 { color: var(--ink2); } .muted { color: var(--muted); }
.pos { color: var(--ok); } .neg { color: var(--err); }

.batchbar { position: fixed; left: 50%; bottom: 24px; z-index: 40; display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; border-radius: 14px; background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-lg); translate: -50% 0; animation: rise .28s var(--ease) both; }
.batchbar .btn { background: transparent; border-color: color-mix(in srgb, var(--on-primary) 22%, transparent); color: var(--on-primary); }
.batchbar .btn:hover { background: color-mix(in srgb, var(--on-primary) 12%, transparent); }
.batchbar b { margin-right: 6px; font-weight: 600; font-variant-numeric: tabular-nums; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- 概览 ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 12px; }
.kpi { padding: 16px 18px; }
.kpi .l { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.kpi .v { font-size: 26px; font-weight: 650; letter-spacing: -.3px; margin: 6px 0 4px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi .v small { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.kpi .d { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.kpi .d .up { color: var(--ok); } .kpi .d .down { color: var(--err); }
.kpi.hero { position: relative; overflow: hidden; background: linear-gradient(160deg, color-mix(in srgb, var(--blue) 7%, var(--panel)) 0%, var(--panel) 62%); border-color: color-mix(in srgb, var(--blue) 22%, var(--line)); }
.kpi.hero::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 3px; border-radius: 0 3px 3px 0; background: var(--blue); }
.kpi.hero::after { content: ""; position: absolute; width: 220px; height: 220px; right: -90px; top: -110px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--blue) 16%, transparent), transparent); animation: glow 9s ease-in-out infinite alternate; pointer-events: none; }
.kpi.hero .l { color: var(--blue); font-weight: 550; }
.kpi.hero .v { color: var(--ink); }
@keyframes glow { to { transform: translate(-26px, 18px) scale(1.12); opacity: .7; } }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 12px; margin-bottom: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.chart { position: relative; height: 260px; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .grid line { stroke: var(--line2); }
.chart .axis text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .area { fill: url(#cc-grad); }
.chart .line { fill: none; stroke: var(--blue); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .line.draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 1s var(--ease) .05s forwards; }
.chart .area.draw { opacity: 0; animation: fade .6s ease .45s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
.chart .xh { stroke: var(--muted); stroke-dasharray: 3 3; opacity: 0; }
.chart .dot { fill: var(--blue); stroke: var(--panel); stroke-width: 2; opacity: 0; }
.chart.hover .xh, .chart.hover .dot { opacity: 1; }
.tip { position: absolute; pointer-events: none; z-index: 5; padding: 8px 10px; border-radius: 9px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-lg); font-size: 12px; min-width: 120px; opacity: 0; transition: opacity .12s; white-space: nowrap; }
.chart.hover .tip { opacity: 1; }
.tip .t { color: var(--muted); margin-bottom: 4px; }
.tip .r { display: flex; justify-content: space-between; gap: 14px; font-variant-numeric: tabular-nums; }
.tip .r b { font-weight: 600; }
.tip .sw { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--blue); margin-right: 6px; }
.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbar { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 10px; font-size: 13px; position: relative; }
.hbar .nm { color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .tr { height: 10px; border-radius: 0 4px 4px 0; background: var(--line2); overflow: hidden; }
.hbar .fl { height: 100%; background: var(--blue); border-radius: 0 4px 4px 0; transform-origin: left; animation: grow .8s var(--ease) both; }
.hbar .vl { font-variant-numeric: tabular-nums; color: var(--ink); min-width: 70px; text-align: right; }
.hbar .vl small { color: var(--muted); margin-left: 6px; }
@keyframes grow { from { transform: scaleX(0); } }
.rank-list { display: flex; flex-direction: column; }
.rank-row { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line2); }
.rank-row:last-child { border-bottom: 0; }
.rank-row .no { font-weight: 650; color: var(--muted); font-variant-numeric: tabular-nums; text-align: center; }
.rank-row:nth-child(-n+3) .no { color: var(--ink); }
.rank-row .nm { font-weight: 500; }
.rank-row .nm small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.rank-row .vl { font-variant-numeric: tabular-nums; font-weight: 600; }
.feed { display: flex; flex-direction: column; }
.feed-i { display: grid; grid-template-columns: 8px 1fr; gap: 12px; padding: 8px 0; }
.feed-i i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); margin-top: 7px; }
.feed-i p { margin: 0; font-size: 13px; color: var(--ink2); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feed-i small { color: var(--muted); font-size: 11.5px; }
.todo { display: flex; gap: 12px; margin-bottom: 12px; }
.todo a { flex: 1; display: flex; align-items: center; gap: 14px; padding: 14px 18px; transition: transform .2s var(--ease), box-shadow .2s; }
.todo a:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.todo .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--warn-bg); color: var(--warn); }
.todo .ic svg { width: 18px; height: 18px; }
.todo b { font-size: 20px; font-variant-numeric: tabular-nums; margin-right: 4px; }
.todo .go { margin-left: auto; color: var(--muted); }

/* ---------- 弹窗 ---------- */
.ov { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: rgba(10,10,12,.32); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade .2s ease both; opacity: 0; }
.ov.closing { animation: fadeOut .18s ease both; }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
.modal { width: min(560px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column; background: var(--panel); border-radius: 16px; box-shadow: var(--shadow-lg); animation: pop .26s var(--ease) both; }
.ov.closing .modal { animation: popOut .18s ease both; }
.modal.wide { width: min(760px, 100%); }
.modal.narrow { width: min(420px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes popOut { to { opacity: 0; transform: translateY(4px) scale(.99); } }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 18px 20px 6px; }
.modal-h h3 { margin: 0; font-size: 16px; font-weight: 650; flex: 1; }
.modal-b { padding: 12px 20px 8px; overflow-y: auto; }
.modal-f { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 20px 18px; }
.modal-f .sp { flex: 1; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 14px; }
.form .f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form .f.full { grid-column: 1 / -1; }
.form label.lb { font-size: 12.5px; color: var(--ink2); font-weight: 500; }
.form label.lb em { color: var(--err); font-style: normal; margin-left: 2px; }
.form .hint { font-size: 12px; color: var(--muted); }
.form .inp, .form .sel { width: 100%; }
.preview { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); border-radius: 10px; background: var(--panel2); border: 1px solid var(--line2); }
.preview > div { padding: 12px 14px; }
.preview > div + div { border-left: 1px solid var(--line2); }
.preview small { display: block; color: var(--muted); font-size: 12px; }
.preview b { font-size: 18px; font-variant-numeric: tabular-nums; font-weight: 650; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch i { width: 34px; height: 20px; border-radius: 10px; background: var(--line); position: relative; transition: background .2s; flex: none; }
.switch i::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .22s var(--ease); }
.switch input:checked + i { background: var(--ink); }
:root[data-theme="dark"] .switch input:checked + i { background: var(--blue); }
.switch input:checked + i::after { transform: translateX(14px); }
.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.radio-cards label { position: relative; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); cursor: pointer; transition: border-color .15s, background .15s; }
.radio-cards label:hover { background: var(--hover); }
.radio-cards input { position: absolute; opacity: 0; }
.radio-cards label:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.radio-cards b { display: block; font-size: 13px; }
.radio-cards small { color: var(--muted); font-size: 12px; }

/* ---------- 申请卡 ---------- */
.apply-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.apply { padding: 18px; display: flex; flex-direction: column; gap: 12px; animation: viewIn .3s var(--ease) both; }
.apply .hd { display: flex; align-items: center; gap: 12px; }
.apply .avatar { width: 40px; height: 40px; font-size: 15px; }
.apply .hd b { font-size: 15px; display: block; }
.apply .hd small { color: var(--muted); }
.apply dl { margin: 0; display: grid; grid-template-columns: 56px 1fr; gap: 6px 10px; font-size: 13px; }
.apply dt { color: var(--muted); }
.apply dd { margin: 0; color: var(--ink2); word-break: break-all; }
.apply .ft { display: flex; gap: 8px; margin-top: auto; }
.apply .ft .btn { flex: 1; }
.apply.leaving { animation: leave .3s var(--ease) forwards; }
@keyframes leave { to { opacity: 0; transform: scale(.97); } }

/* ---------- 设置 ---------- */
.settings { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 12px; align-items: start; }
.set-sec { padding: 20px 22px; }
.set-sec + .set-sec { border-top: 1px solid var(--line2); }
.set-sec h4 { margin: 0 0 4px; font-size: 14px; }
.set-sec > p { margin: 0 0 14px; color: var(--muted); font-size: 12.5px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; }
.set-row + .set-row { border-top: 1px dashed var(--line2); }
.set-row .t b { display: block; font-weight: 500; }
.set-row .t small { color: var(--muted); font-size: 12px; }
.share { padding: 20px; text-align: center; position: sticky; top: 76px; }
.share .qr { width: 188px; height: 188px; margin: 6px auto 14px; border-radius: 14px; padding: 12px; background: #fff; border: 1px solid var(--line); }
.share .qr img { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.share .url { display: flex; gap: 6px; margin-top: 8px; }
.share .url .inp { flex: 1; font-size: 13px; }
.share h4 { margin: 0; font-size: 15px; }
.share p { color: var(--muted); font-size: 12.5px; margin: 4px 0 0; }
.share .warn { margin-top: 12px; text-align: left; padding: 10px 12px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); font-size: 12.5px; line-height: 1.55; }

/* ---------- 登录 ---------- */

/* ---------- 提示 ---------- */
.cc-toasts { position: fixed; top: 18px; left: 50%; translate: -50% 0; z-index: 300; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.cc-toast { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px; background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-lg); font-size: 13.5px; opacity: 0; transform: translateY(-8px) scale(.98); transition: opacity .22s, transform .3s var(--ease); max-width: 520px; }
.cc-toast.in { opacity: 1; transform: none; }
.cc-toast.out { opacity: 0; transform: translateY(-6px); }
.cc-toast i { width: 16px; height: 16px; border-radius: 50%; background: var(--ok); flex: none; position: relative; }
.cc-toast i::after { content: ""; position: absolute; left: 5px; top: 3px; width: 4px; height: 7px; border: solid #fff; border-width: 0 1.6px 1.6px 0; rotate: 45deg; }
.cc-toast.err i { background: var(--err); }
.cc-toast.err i::after { left: 7.2px; top: 3.5px; width: 0; height: 6px; border-width: 0 1.6px 0 0; rotate: 0deg; box-shadow: 0 8px 0 -0.2px #fff; }

.skel { border-radius: 6px; background: linear-gradient(90deg, var(--line2), var(--hover), var(--line2)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 1100px) {
  .grid2, .settings { grid-template-columns: 1fr; }
  .grid3 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 60; width: 240px; transform: translateX(-100%); transition: transform .28s var(--ease); }
  .side.open { transform: none; box-shadow: var(--shadow-lg); }
  .top, .view { padding-left: 16px; padding-right: 16px; }
    .form { grid-template-columns: 1fr; }
  .search .inp { width: 100%; }
}
@media (min-width: 761px) { .menu-btn { display: none !important; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
.kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1360px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tbl .act { position: sticky; right: 0; z-index: 1; background: var(--panel); box-shadow: inset 1px 0 0 var(--line2); }
.tbl th.act { z-index: 2; }
.tbl tbody tr:hover .act { background: var(--panel2); }
.tbl tbody tr.sel .act { background: linear-gradient(var(--blue-soft), var(--blue-soft)), var(--panel); }
.tbl td.wrap.clip { min-width: 120px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- 头像 / 状态 ---------- */
.av { --s: 30px; width: var(--s); height: var(--s); border-radius: 50%; flex: none; display: inline-grid; place-items: center; overflow: hidden; background: var(--blue-soft); color: var(--blue); font-weight: 600; font-size: calc(var(--s) * .42); box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 6%, transparent); }
.av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av.s { --s: 28px; } .av.m { --s: 34px; } .av.l { --s: 44px; }
.apply .av { --s: 40px; }
.wsd { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.wsd::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); opacity: .6; }
.wsd.ws-online { color: var(--ok); } .wsd.ws-online::before { background: var(--ok); opacity: 1; box-shadow: 0 0 0 3px var(--ok-bg); }
.wsd.ws-busy { color: var(--warn); } .wsd.ws-busy::before { background: var(--warn); opacity: 1; }

/* ---------- 点单派单 ---------- */
.kpis.req-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rk { animation: viewIn .34s var(--ease) both; }
.rk .l i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.rk-open .l i { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }
.rk-assigned .l i { background: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.rk-accepted .l i { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.tag.rq-open { background: var(--warn-bg); color: var(--warn); }
.tag.rq-assigned { background: var(--blue-soft); color: var(--blue); }
.tag.rq-accepted, .tag.rq-done { background: var(--ok-bg); color: var(--ok); }
.tag.rq-done::before { opacity: .45; }
.tag.rq-cancelled { background: var(--hover); color: var(--muted); }
.who-c { display: flex; align-items: center; gap: 8px; }
.who-c.want span { color: var(--ink2); }
.note-c { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.req-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 12px 14px; margin-bottom: 12px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line2); }
.req-sum b { font-size: 15px; } .req-sum span { color: var(--ink2); } .req-sum small { flex-basis: 100%; color: var(--muted); }
.cpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; max-height: 320px; overflow-y: auto; padding: 2px; }
.cpk { position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; transition: border-color .15s, background .15s, box-shadow .2s; }
.cpk:hover { border-color: color-mix(in srgb, var(--blue) 35%, var(--line)); }
.cpk.on { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 12%, transparent); }
.cpk input { position: absolute; opacity: 0; pointer-events: none; }
.cpk .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.cpk .nm em { font-style: normal; font-size: 11px; color: var(--blue); margin-left: 6px; font-weight: 500; }
.side-foot .av { --s: 30px; }
body.leaving #app { opacity: 0; transform: translateY(4px); transition: opacity .2s ease, transform .2s ease; }
.subt { font-size: 12px; color: var(--muted); margin-top: 1px; white-space: nowrap; }
.side-foot { flex-wrap: wrap; row-gap: 10px; }
.side-foot .who small { white-space: nowrap; }
.side-foot .acts { display: flex; width: 100%; gap: 4px; }
.side-foot .acts .btn { flex: 1; }

/* ---------- 切换视角 ---------- */
.views-intro { display: flex; flex-direction: column; gap: 4px; padding: 14px 18px; margin-bottom: 14px; border-radius: var(--r); background: linear-gradient(120deg, var(--blue-soft), transparent 70%); border: 1px solid color-mix(in srgb, var(--blue) 18%, var(--line)); }
.views-intro b { font-size: 14.5px; } .views-intro span { color: var(--ink2); font-size: 13px; }
.views { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.vr { padding: 18px; display: flex; flex-direction: column; gap: 12px; animation: viewIn .34s var(--ease) both; }
.vr-h { display: flex; align-items: flex-start; gap: 10px; }
.vr-h > div { flex: 1; min-width: 0; } .vr-h b { font-size: 15.5px; display: block; } .vr-h small { color: var(--muted); font-size: 12.5px; }
.vr-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.vr-tabs span { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line2); color: var(--ink2); }
.vr-list { display: flex; flex-direction: column; gap: 2px; max-height: 236px; overflow-y: auto; margin: 0 -8px; }
.vr-u { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; border-radius: 10px; background: none; text-align: left; cursor: pointer; transition: background .15s; }
.vr-u:hover { background: var(--hover); }
.vr-u .nm { flex: 1; min-width: 0; line-height: 1.3; } .vr-u .nm b { display: block; font-weight: 600; font-size: 13.5px; }
.vr-u .nm small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.vr-u .go { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--blue); font-weight: 550; opacity: 0; transform: translateX(-4px); transition: opacity .18s, transform .18s var(--ease); }
.vr-u .go svg { width: 15px; height: 15px; }
.vr-u:hover .go, .vr-u:focus-visible .go { opacity: 1; transform: none; }
.vr-empty { color: var(--muted); font-size: 13px; padding: 8px; } .vr-empty a { color: var(--blue); }
.modal-f .btn svg { width: 15px; height: 15px; }

/* ---------- 成员页面（member.js） ---------- */
.av.xl { --s: 64px; }
.mlist { display: flex; flex-direction: column; margin: -6px 0; }
.mrow { display: flex; align-items: center; gap: 12px; padding: 10px 0; color: inherit; }
.mrow + .mrow { border-top: 1px solid var(--line2); }
.mrow.click { cursor: pointer; } .mrow.click:hover .bd b, a.mrow:hover .bd b { color: var(--blue); }
.mrow .bd { flex: 1; min-width: 0; }
.mrow .bd b { font-weight: 600; font-size: 13.5px; transition: color .15s; }
.mrow .bd small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrow .vl { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 64px; text-align: right; }
.mrow .ops { display: flex; gap: 6px; flex: none; }
.mrow .ops:empty { display: none; }
.who-c.want span { color: var(--ink2); }
.qa-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.qa { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); text-align: left; cursor: pointer; transition: border-color .15s, transform .2s var(--ease), box-shadow .2s; }
.qa:hover { border-color: var(--ink2); transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.qa .ic, .qa-ic { width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); }
.qa .ic svg, .qa-ic svg { width: 18px; height: 18px; }
.qa b { display: block; font-size: 13.5px; font-weight: 600; } .qa small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.rsteps { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.rsteps span { display: inline-flex; align-items: center; gap: 4px; }
.rsteps span + span::before { content: ""; width: 10px; height: 1px; background: var(--line); margin-right: 2px; }
.rsteps i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.rsteps .on { color: var(--ink); } .rsteps .on i { background: var(--blue); }
.play-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.pc { width: 100%; display: flex; flex-direction: column; gap: 10px; padding: 16px; text-align: left; cursor: pointer; color: inherit; font: inherit; animation: rise .32s var(--ease) both; transition: transform .2s var(--ease), box-shadow .2s, border-color .15s; }
.pc:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.pc .hd { display: flex; align-items: center; gap: 12px; }
.pc .nm { flex: 1; min-width: 0; } .pc .nm b { display: block; font-size: 15px; font-weight: 600; } .pc .nm small { font-size: 12px; }
.pc .tags, .pc-tags { display: flex; flex-wrap: wrap; gap: 6px; min-height: 22px; }
.pc .tags span, .pc-tags span { padding: 2px 8px; border-radius: 999px; font-size: 12px; background: var(--panel2); border: 1px solid var(--line2); color: var(--ink2); }
.pc p { margin: 0; flex: 1; color: var(--ink2); font-size: 13px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 41px; }
.pc .ft { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--line2); color: var(--muted); font-size: 12.5px; }
.pc .ft .go svg { width: 14px; height: 14px; }
.cm-hd { display: flex; align-items: center; gap: 16px; }
.cm-hd b { font-size: 18px; font-weight: 650; }
.cm-sub { display: flex; gap: 10px; align-items: center; margin: 4px 0 8px; color: var(--muted); font-size: 12.5px; }
.cm-intro { margin: 16px 0; color: var(--ink2); line-height: 1.7; white-space: pre-wrap; }
.cm-hist { margin-top: 16px; } .cm-hist .lb { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.pf-hd { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pf-hd .sp { flex: 1; }
.pf-who b { display: block; font-size: 16px; font-weight: 650; } .pf-who small { color: var(--muted); font-size: 12.5px; }
.pf-side { position: sticky; top: 76px; }
.pf-side .pc { cursor: default; } .pf-side .pc:hover { transform: none; box-shadow: var(--shadow); }
.qk { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; min-height: 420px; }
.qk > div:first-child { display: flex; flex-direction: column; gap: 8px; }
.qk-tpl { display: flex; gap: 6px; align-items: center; } .qk-tpl .sp { flex: 1; }
.qk textarea.inp { flex: 1; height: auto; min-height: 300px; padding: 10px 12px; resize: none; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; line-height: 1.7; }
.qk-hint { font-size: 12px; color: var(--muted); line-height: 1.7; }
.qk-hint code { padding: 0 4px; border-radius: 4px; background: var(--panel2); border: 1px solid var(--line2); font-size: 11.5px; }
.qk-list { display: flex; flex-direction: column; gap: 8px; max-height: 480px; overflow-y: auto; padding: 2px; }
.qk-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--panel2); }
.qk-item.bad { border-color: color-mix(in srgb, var(--err) 45%, transparent); background: var(--err-bg); }
.qk-item .h { display: flex; align-items: center; gap: 8px; } .qk-item .h b:last-child { margin-left: auto; }
.qk-item dl { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 4px 10px; margin: 8px 0 0; font-size: 12.5px; }
.qk-item dt { color: var(--muted); } .qk-item dd { margin: 0; } .qk-item dd.wide { grid-column: 2 / -1; }
.qk-item .e { margin-top: 8px; color: var(--err); font-size: 12.5px; }
.qk-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); font-size: 13px; }
.qk-empty svg { width: 28px; height: 28px; opacity: .5; }
.modal.xwide { width: min(980px, 100%); }
@media (max-width: 860px) { .qk { grid-template-columns: 1fr; } .qa-grid { grid-template-columns: 1fr; } .pf-side { position: static; } }
.daterange input[type=month] { width: 136px; }
