/* ============================================================
 * 中鼎智能 · 项目管理系统 —— 设计系统 v2（深色玻璃拟态 · 霓虹辉光 · 未来感）
 * ============================================================ */
:root {
  --bg: #070b16;
  --panel: rgba(20, 27, 48, 0.55);        /* 玻璃卡：半透明 + backdrop-filter */
  --panel-solid: #111830;
  --ink: #e8edf9;
  --ink-2: #97a3c2;
  --ink-3: #616d8e;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.055);
  --brand: #6f8cff;                        /* 霓虹蓝紫 */
  --brand-2: #38e0ff;                      /* 霓虹青 */
  --brand-soft: rgba(111, 140, 255, 0.14);
  --glow: 0 0 0 1px rgba(111,140,255,.35), 0 0 22px rgba(111,140,255,.35);
  --nav: rgba(10, 14, 28, 0.55);
  --nav-hi: rgba(111, 140, 255, 0.14);
  --good: #35e0a1;
  --good-soft: rgba(53, 224, 161, 0.15);
  --warn: #ffc24d;
  --warn-soft: rgba(255, 194, 77, 0.15);
  --risk: #ff5f78;
  --risk-soft: rgba(255, 95, 120, 0.16);
  --radius: 16px;
  --shadow: 0 2px 8px rgba(0,0,0,.35), 0 12px 40px rgba(0,0,0,.35);
  --font: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: #070b16; }
body {
  font-family: var(--font); color: var(--ink); font-size: 14px; -webkit-font-smoothing: antialiased;
  /* CSS 渐变兜底（WebGL 不可用 / reduced-motion 时可见） */
  background:
    radial-gradient(80% 60% at 15% 0%, rgba(111,140,255,.18), transparent 60%),
    radial-gradient(70% 55% at 100% 20%, rgba(56,224,255,.12), transparent 55%),
    radial-gradient(90% 80% at 50% 110%, rgba(124,92,255,.15), transparent 60%),
    #070b16;
  background-attachment: fixed;
}
/* WebGL 背景画布：铺满、置底、不拦截交互 */
#bg-canvas { position: fixed; inset: 0; z-index: -1; pointer-events: none; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
::selection { background: rgba(111,140,255,.35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 224px 1fr; min-height: 100vh; }

/* ---------- Sidebar (控制舱) ---------- */
.side { background: var(--nav); backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%); color: #c4cde4; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line); }
.brand { padding: 20px 20px 16px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line-2); }
.brand .logo { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, #6f8cff, #38e0ff); display: grid; place-items: center; color: #071026; font-weight: 800; font-size: 16px; box-shadow: 0 0 18px rgba(111,140,255,.55); }
.brand .t { line-height: 1.2; }
.brand .t b { color: #fff; font-size: 15px; display: block; letter-spacing: .5px; }
.brand .t span { font-size: 11px; color: #6f7ba0; }
.nav { padding: 12px 12px; flex: 1; overflow-y: auto; }
.nav .grp { font-size: 11px; color: #5f6b8f; padding: 14px 12px 6px; letter-spacing: 1px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; font-size: 13.5px; color: #b3bdd8; margin-bottom: 2px; transition: .15s; }
.nav a .ic { width: 18px; text-align: center; opacity: .85; font-size: 15px; }
.nav a:hover { background: var(--nav-hi); color: #fff; }
.nav a.on { background: linear-gradient(90deg, rgba(111,140,255,.28), rgba(111,140,255,.04)); color: #fff; box-shadow: inset 2px 0 0 var(--brand), 0 0 16px rgba(111,140,255,.18); }
.side .foot { padding: 12px 16px; border-top: 1px solid var(--line-2); font-size: 11px; color: #5f6b8f; }

/* ---------- Topbar ---------- */
.main { display: flex; flex-direction: column; min-width: 0; }
.top { background: var(--nav); backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%); border-bottom: 1px solid var(--line); padding: 0 24px; height: 58px; display: flex; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 20; }
.top .crumb { font-size: 15px; font-weight: 650; }
.top .crumb small { color: var(--ink-3); font-weight: 400; margin-left: 8px; font-size: 12px; }
.top .sp { flex: 1; }
.role-switch { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.role-switch label { font-size: 11px; color: var(--ink-3); padding-left: 8px; }
.role-switch select { border: none; background: rgba(255,255,255,.05); border-radius: 7px; padding: 6px 10px; font-family: inherit; font-size: 13px; font-weight: 600; color: var(--brand); cursor: pointer; }
.role-switch select option { background: var(--panel-solid); color: var(--ink); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 13px; box-shadow: 0 0 14px rgba(111,140,255,.4); }

/* ---------- Content ---------- */
.view { padding: 24px; max-width: 1360px; }
.view-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 18px; }
.view-head h1 { font-size: 22px; font-weight: 750; letter-spacing: -.3px; }
.view-head p { color: var(--ink-2); font-size: 13px; }
.view-head .sp { flex: 1; }

/* ---------- KPI cards ---------- */
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 20px; }
.kpi { background: var(--panel); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%); border: 1px solid var(--line); border-radius: var(--radius); padding: 17px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.25), transparent); }
.kpi .lb { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.kpi .v { font-size: 40px; font-weight: 780; margin-top: 6px; letter-spacing: -1px; line-height: 1.05; }
.kpi .v small { font-size: 14px; color: var(--ink-3); font-weight: 500; margin-left: 3px; }
.kpi .sub { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }
.kpi.accent { background: linear-gradient(135deg, rgba(111,140,255,.9), rgba(56,224,255,.75)); border: 1px solid rgba(150,180,255,.4); color: #061024; box-shadow: 0 0 30px rgba(111,140,255,.4), var(--shadow); }
.kpi.accent .lb, .kpi.accent .sub { color: rgba(6,16,36,.72); }
.kpi.accent .v small { color: rgba(6,16,36,.6); }

/* ---------- Panel & Card ---------- */
.card { background: var(--panel); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
.card-h { padding: 15px 18px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 10px; }
.card-h h3 { font-size: 15px; font-weight: 650; }
.card-h .sp { flex: 1; }
.card-b { padding: 18px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }

/* ---------- Filters / toolbar ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar select, .toolbar input { border: 1px solid var(--line); background: rgba(255,255,255,.04); border-radius: 9px; padding: 8px 12px; font-family: inherit; font-size: 13px; color: var(--ink); }
.toolbar select option { background: var(--panel-solid); color: var(--ink); }
.toolbar .sp { flex: 1; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px; font-size: 13px; font-weight: 600; border: 1px solid var(--line); background: rgba(255,255,255,.05); color: var(--ink); transition: transform .18s cubic-bezier(.2,.8,.2,1), border-color .18s, box-shadow .18s, background .18s; }
.btn:hover { border-color: var(--brand); color: #fff; box-shadow: var(--glow); transform: translateY(-1px); }
.btn.primary { background: linear-gradient(135deg, #6f8cff, #4d6bff); color: #fff; border-color: transparent; box-shadow: 0 0 18px rgba(111,140,255,.45); }
.btn.primary:hover { box-shadow: 0 0 28px rgba(111,140,255,.7); transform: translateY(-1px); }
.btn select, .btn.sm select { background: transparent; color: inherit; border: none; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- Table ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; color: var(--ink-2); font-weight: 600; font-size: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.03); position: sticky; top: 0; white-space: nowrap; backdrop-filter: blur(6px); }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.tbl tbody tr { transition: background .14s; }
.tbl tbody tr:hover { background: rgba(111,140,255,.08); cursor: pointer; }
.tbl select { background: rgba(255,255,255,.05); color: var(--ink); border: 1px solid var(--line); border-radius: 7px; padding: 4px 8px; }
.tbl select option { background: var(--panel-solid); color: var(--ink); }
.tbl .proj-name { font-weight: 600; }
.tbl .proj-id { font-size: 11px; color: var(--ink-3); font-family: ui-monospace, monospace; }
.tbl-wrap { overflow-x: auto; }

/* ---------- Badges / chips ---------- */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.tag.good { background: var(--good-soft); color: var(--good); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.risk { background: var(--risk-soft); color: var(--risk); }
.tag.info { background: var(--brand-soft); color: var(--brand); }
.tag.mut  { background: rgba(255,255,255,.08); color: var(--ink-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.good { background: var(--good); } .dot.warn { background: var(--warn); } .dot.risk { background: var(--risk); }

/* ---------- Progress bar ---------- */
.pbar { height: 7px; background: rgba(255,255,255,.09); border-radius: 6px; overflow: hidden; min-width: 80px; }
.pbar > i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #6f8cff, #38e0ff); box-shadow: 0 0 10px rgba(111,140,255,.5); }
.pbar.good > i { background: linear-gradient(90deg,#35e0a1,#8ef5c8); box-shadow: 0 0 10px rgba(53,224,161,.5); } .pbar.warn > i { background: linear-gradient(90deg,#ffc24d,#ffd98a); box-shadow: 0 0 10px rgba(255,194,77,.4); } .pbar.risk > i { background: linear-gradient(90deg,#ff5f78,#ff9aa8); box-shadow: 0 0 10px rgba(255,95,120,.5); }

/* ---------- Masked (字段级权限) ---------- */
.masked { color: var(--ink-3); letter-spacing: 1px; user-select: none; }
.masked::after { content: ""; }
.lock { font-size: 11px; color: var(--ink-3); }

/* ---------- Gantt ---------- */
.gantt { display: flex; flex-direction: column; gap: 3px; }
.gantt-row { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 12px; padding: 5px 0; }
.gantt-row .ml-name { font-size: 13px; display: flex; align-items: center; gap: 7px; }
.gantt-track { position: relative; height: 30px; background: linear-gradient(90deg, var(--line-2) 1px, transparent 1px); background-size: 8.33% 100%; border-radius: 6px; }
.gbar { position: absolute; top: 4px; height: 10px; border-radius: 5px; }
.gbar.base { background: rgba(255,255,255,.28); top: 4px; }
.gbar.cur { background: var(--brand); top: 16px; box-shadow: 0 0 10px rgba(111,140,255,.6); }
.gbar.cur.delay { background: var(--risk); }
.gbar.cur.done { background: var(--good); }
.ml-legend { display: flex; gap: 16px; font-size: 12px; color: var(--ink-2); }
.ml-legend i { display: inline-block; width: 20px; height: 8px; border-radius: 4px; vertical-align: middle; margin-right: 5px; }

/* ---------- Donut /齐套率 ---------- */
.donut { width: 128px; height: 128px; border-radius: 50%; display: grid; place-items: center; position: relative; }
.donut::before { content: ""; position: absolute; inset: 16px; background: #0c1226; border-radius: 50%; }
.donut .val { position: relative; text-align: center; }
.donut .val b { font-size: 26px; font-weight: 750; } .donut .val span { font-size: 11px; color: var(--ink-3); display:block; }

/* ---------- Bars chart ---------- */
.barchart { display: flex; align-items: flex-end; gap: 18px; height: 200px; padding: 10px 6px 0; }
.barchart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.barchart .bar { width: 60%; max-width: 46px; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, #7c9bff, #4d6bff); box-shadow: 0 0 16px rgba(111,140,255,.4); transition: .3s; }
.barchart .bl { font-size: 12px; color: var(--ink-2); }
.barchart .bv { font-size: 12px; font-weight: 700; }

/* ---------- Timeline / weekly ---------- */
.timeline { position: relative; }
.wk { border: 1px solid var(--line); background: rgba(255,255,255,.03); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.wk.high { border-left: 3px solid var(--risk); } .wk.mid { border-left: 3px solid var(--warn); } .wk.low { border-left: 3px solid var(--good); }
.wk h4 { font-size: 14px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.wk .rline { font-size: 13px; color: var(--ink-2); margin: 3px 0; }
.wk .rline b { color: var(--ink); font-weight: 600; }

/* ---------- Modal ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(4,8,18,.66); backdrop-filter: blur(4px); display: none; place-items: center; z-index: 100; padding: 20px; }
.modal-mask.on { display: grid; }
.modal { background: rgba(17,24,48,.92); backdrop-filter: blur(24px) saturate(150%); -webkit-backdrop-filter: blur(24px) saturate(150%); border: 1px solid var(--line); border-radius: 16px; width: 100%; max-width: 520px; box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(111,140,255,.1); overflow: hidden; }
.modal-h { padding: 18px 20px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 10px; }
.modal-h h3 { font-size: 16px; } .modal-h .x { margin-left: auto; font-size: 20px; color: var(--ink-3); }
.modal-b { padding: 20px; }
.field { margin-bottom: 14px; } .field label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; font-weight: 600; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid var(--line); background: rgba(255,255,255,.05); color: var(--ink); border-radius: 10px; padding: 9px 12px; font-family: inherit; font-size: 13px; transition: border-color .15s, box-shadow .15s; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(111,140,255,.18); }
.field select option { background: var(--panel-solid); color: var(--ink); }
.field .req { color: var(--risk); }
.modal-f { padding: 14px 20px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 10px; }
.alert { background: var(--risk-soft); color: var(--risk); border-radius: 9px; padding: 10px 14px; font-size: 12.5px; margin-bottom: 14px; display: flex; gap: 8px; }

/* ---------- Phone (移动端飞书) ---------- */
.phone-wrap { display: flex; gap: 30px; align-items: flex-start; flex-wrap: wrap; }
.phone { width: 320px; background: #0b1220; border-radius: 34px; padding: 12px; box-shadow: 0 20px 50px rgba(16,26,51,.25); flex-shrink: 0; }
.phone .screen { background: var(--bg); border-radius: 24px; overflow: hidden; height: 640px; display: flex; flex-direction: column; }
.phone .sbar { background: #2b5aed; color: #fff; padding: 14px 16px 12px; }
.phone .sbar .app-t { font-size: 12px; opacity: .8; display: flex; align-items: center; gap: 6px; }
.phone .sbar h4 { font-size: 16px; margin-top: 4px; }
.phone .pbody { flex: 1; overflow-y: auto; padding: 12px; }
.mcard { background: #fff; border-radius: 12px; padding: 12px 13px; margin-bottom: 10px; border: 1px solid var(--line); }
.mcard .mh { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); margin-bottom: 6px; }
.mcard .mt { font-size: 13px; line-height: 1.5; }
.mcard .mp { margin-top: 8px; height: 74px; border-radius: 8px; background: linear-gradient(135deg,#e7ebf3,#d5dcea); display: grid; place-items: center; color: var(--ink-3); font-size: 11px; }
.phone .fab { margin: 8px; background: #2b5aed; color: #fff; text-align: center; padding: 12px; border-radius: 12px; font-weight: 600; font-size: 14px; }
.note-list { flex: 1; }
.note-list li { display: flex; gap: 10px; padding: 12px 4px; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.note-list .ni { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; background: var(--brand-soft); }

/* ---------- Login ---------- */
.login-mask { position: fixed; inset: 0; display: grid; place-items: center; z-index: 300; }
.login-card { background: rgba(17,24,48,.75); backdrop-filter: blur(28px) saturate(150%); -webkit-backdrop-filter: blur(28px) saturate(150%); border: 1px solid var(--line); border-radius: 20px; padding: 34px 32px; width: 384px; box-shadow: 0 40px 100px rgba(0,0,0,.6), 0 0 0 1px rgba(111,140,255,.12), 0 0 60px rgba(111,140,255,.15); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.login-brand .logo { width: 46px; height: 46px; border-radius: 12px; background: linear-gradient(135deg, #6f8cff, #38e0ff); display: grid; place-items: center; color: #061024; font-weight: 800; font-size: 22px; box-shadow: 0 0 26px rgba(111,140,255,.6); }
.login-brand b { font-size: 18px; display: block; } .login-brand span { font-size: 12px; color: var(--ink-3); }
.lg-err { color: var(--risk); font-size: 12.5px; min-height: 18px; margin-bottom: 6px; }
.lg-demo { margin-top: 22px; border-top: 1px solid var(--line-2); padding-top: 16px; }
.lg-demo-t { font-size: 11.5px; color: var(--ink-3); margin-bottom: 10px; }
.lg-demo a { display: block; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 12.5px; margin-bottom: 7px; color: var(--ink-2); cursor: pointer; transition: .15s; }
.lg-demo a:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.lg-demo a b { color: var(--ink); font-family: ui-monospace, monospace; margin-right: 8px; }

/* misc */
.muted { color: var(--ink-3); }
.mono { font-family: ui-monospace, monospace; }
.right { text-align: right; }
.center { text-align: center; }
.hint { font-size: 12px; color: var(--ink-3); background: var(--brand-soft); color: var(--brand); padding: 8px 12px; border-radius: 8px; display: inline-flex; gap: 6px; align-items: center; }
.split-note { font-size: 12px; color: var(--ink-2); background: rgba(111,140,255,.06); border: 1px solid var(--line); border-left: 2px solid var(--brand); border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; }
.lg-demo a b { color: var(--brand); }
