:root {
  --bg0: #050b18;
  --bg1: #0a1628;
  --panel: rgba(12, 28, 52, .72);
  --line: rgba(94, 234, 212, .18);
  --text: #e8f1ff;
  --muted: #8aa0c0;
  --teal: #5eead4;
  --blue: #38bdf8;
  --violet: #a78bfa;
  --amber: #fbbf24;
  --rose: #fb7185;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
.screen-body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg0);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}
.screen-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(56,189,248,.22), transparent 55%),
    radial-gradient(ellipse 70% 45% at 90% 10%, rgba(94,234,212,.16), transparent 50%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(167,139,250,.12), transparent 55%),
    linear-gradient(180deg, var(--bg1), var(--bg0));
}
.screen-bg::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(94,234,212,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94,234,212,.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  animation: gridPulse 8s ease-in-out infinite;
}
@keyframes gridPulse {
  0%, 100% { opacity: .45; }
  50% { opacity: .8; }
}

.screen-top, .kpi-row, .screen-grid {
  position: relative; z-index: 1;
}
.screen-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px 8px;
}
.screen-brand { display: flex; gap: 14px; align-items: center; }
.screen-logo {
  width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center; font-weight: 800; font-size: 18px;
  background: linear-gradient(135deg, #0ea5e9, #14b8a6);
  box-shadow: 0 0 24px rgba(56,189,248,.45);
  animation: logoGlow 3s ease-in-out infinite;
}
@keyframes logoGlow {
  0%, 100% { box-shadow: 0 0 18px rgba(56,189,248,.35); }
  50% { box-shadow: 0 0 32px rgba(94,234,212,.55); }
}
.screen-brand h1 {
  margin: 0; font-size: 26px; letter-spacing: .08em;
  background: linear-gradient(90deg, #fff, #5eead4 60%, #38bdf8);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.screen-brand p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.screen-clock { text-align: right; }
.screen-clock #clock { font-variant-numeric: tabular-nums; color: var(--teal); font-size: 15px; }
.screen-back {
  display: inline-block; margin-top: 6px; font-size: 12px;
  color: var(--muted); border: 1px solid var(--line); padding: 4px 10px; border-radius: 999px;
  text-decoration: none;
}
.screen-back:hover { color: #fff; border-color: var(--teal); }

.role-tabs {
  position: relative; z-index: 1;
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 0 28px 10px;
}
.role-tabs a {
  padding: 6px 14px; border-radius: 999px; font-size: 12px; font-weight: 700;
  color: var(--muted); border: 1px solid var(--line); background: rgba(255,255,255,.03);
  text-decoration: none;
}
.role-tabs a:hover, .role-tabs a.on {
  color: #041016; background: var(--teal); border-color: var(--teal);
}
.screen-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }

.kpi-row {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px;
  padding: 8px 28px 16px;
}
.kpi, a.kpi-link {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  backdrop-filter: blur(10px);
  position: relative; overflow: hidden;
  animation: fadeUp .7s ease both;
  text-decoration: none; color: inherit; display: block;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
a.kpi-link:hover {
  border-color: rgba(94,234,212,.55);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(56,189,248,.18);
}
.kpi:nth-child(2) { animation-delay: .05s; }
.kpi:nth-child(3) { animation-delay: .1s; }
.kpi:nth-child(4) { animation-delay: .15s; }
.kpi:nth-child(5) { animation-delay: .2s; }
.kpi:nth-child(6) { animation-delay: .25s; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.kpi::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
}
.glow-teal::before { background: var(--teal); }
.glow-blue::before { background: var(--blue); }
.glow-cyan::before { background: #22d3ee; }
.glow-amber::before { background: var(--amber); }
.glow-violet::before { background: var(--violet); }
.glow-rose::before { background: var(--rose); }
.kpi span { display: block; color: var(--muted); font-size: 12px; }
.kpi strong {
  display: block; margin-top: 6px; font-size: 24px; font-weight: 800;
  letter-spacing: .02em;
}
.kpi em { display: block; margin-top: 4px; font-style: normal; font-size: 11px; color: #6b7f9e; }

.screen-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 0 28px 28px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 18px;
  backdrop-filter: blur(12px);
  min-height: 220px;
  animation: fadeUp .8s ease both;
}
.panel.span-2 { grid-column: span 2; }
.panel-hd {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.panel-hd h2 {
  margin: 0; font-size: 15px; font-weight: 700;
  color: #c7d7f0; letter-spacing: .04em;
}
.legend { display: flex; gap: 12px; align-items: center; font-size: 11px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; }
.lg-in { background: var(--teal); }
.lg-out { background: var(--rose); }
.lg-sign { background: var(--violet); }

.bars { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; height: 200px; padding-top: 10px; }
.bar-col { flex: 1; text-align: center; text-decoration: none; color: inherit; }
.bar-col:hover .bar { filter: brightness(1.15); }
.src-row { text-decoration: none; color: inherit; }
.src-row:hover .src-track i { filter: brightness(1.2); }
.funnel-step { text-decoration: none; color: inherit; }
.funnel-step:hover { border-color: var(--teal); }
.panel-more { color: var(--teal); font-size: 12px; text-decoration: none; }
.panel-hint { margin: -6px 0 12px; color: var(--muted); font-size: 12px; }
.drill-list { display: flex; flex-direction: column; gap: 8px; }
.drill-row {
  display: grid; grid-template-columns: 72px 1fr auto; gap: 10px; align-items: center;
  padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.06);
  text-decoration: none; color: inherit; font-size: 13px;
}
.drill-row:hover { border-color: rgba(94,234,212,.4); background: rgba(94,234,212,.06); }
.drill-tag {
  font-size: 11px; color: var(--teal); border: 1px solid rgba(94,234,212,.35);
  border-radius: 999px; padding: 2px 8px; text-align: center;
}
.drill-row em { color: var(--muted); font-style: normal; font-size: 11px; text-align: right; }
.todo-link {
  display: flex; gap: 10px; align-items: flex-start; text-decoration: none; color: inherit; width: 100%;
}
.todo-link:hover strong { color: var(--teal); }
.bar-stack { display: flex; align-items: flex-end; justify-content: center; gap: 4px; height: 170px; }
.bar {
  width: 10px; border-radius: 6px 6px 2px 2px;
  transition: height .6s ease;
}
.bar.income { background: linear-gradient(180deg, #99f6e4, #14b8a6); box-shadow: 0 0 12px rgba(94,234,212,.35); }
.bar.expense { background: linear-gradient(180deg, #fda4af, #e11d48); }
.bar.sign { background: linear-gradient(180deg, #c4b5fd, #7c3aed); }
.bar-col span { display: block; margin-top: 8px; font-size: 11px; color: var(--muted); }

.pipeline {
  display: flex; align-items: center; justify-content: space-between;
  gap: 4px; margin-top: 8px;
}
.pipe-node { text-align: center; flex: 1; text-decoration: none; color: inherit; }
.pipe-node:hover .pipe-num { border-color: var(--teal); box-shadow: 0 0 20px rgba(94,234,212,.45); }
.pipe-num {
  width: 52px; height: 52px; margin: 0 auto;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800; font-size: 16px;
  border: 2px solid rgba(94,234,212,.45);
  background: radial-gradient(circle at 30% 30%, rgba(56,189,248,.35), rgba(5,11,24,.8));
  box-shadow: 0 0 16px rgba(56,189,248,.25);
}
.pipe-name { margin-top: 8px; font-size: 13px; font-weight: 700; }
.pipe-hint { font-size: 11px; color: var(--muted); }
.pipe-arrow { color: var(--teal); font-size: 22px; opacity: .55; }
.mini-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line);
}
.mini-stats div { text-align: center; }
.mini-stats b { display: block; font-size: 18px; color: var(--teal); }
.mini-stats span { font-size: 11px; color: var(--muted); }

.src-list { display: flex; flex-direction: column; gap: 12px; }
.src-row { display: grid; grid-template-columns: 72px 1fr 64px; gap: 8px; align-items: center; font-size: 12px; }
.src-track { height: 8px; background: rgba(255,255,255,.06); border-radius: 999px; overflow: hidden; }
.src-track i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8, #5eead4);
  box-shadow: 0 0 8px rgba(94,234,212,.4);
}
.src-row em { text-align: right; color: var(--muted); font-style: normal; }

.ring-wrap { display: flex; align-items: center; gap: 16px; }
.ring { width: 140px; height: 140px; }
.ring-n { fill: #fff; font-size: 18px; font-weight: 800; }
.ring-l { fill: var(--muted); font-size: 10px; }
.ring-legend { list-style: none; margin: 0; padding: 0; flex: 1; }
.ring-legend li {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; margin-bottom: 8px; color: var(--muted);
}
.ring-legend i { width: 8px; height: 8px; border-radius: 50%; }
.ring-legend b { margin-left: auto; color: #fff; }

.funnel { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 10px; }
.funnel-step {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; border-radius: 10px;
  background: linear-gradient(90deg, rgba(56,189,248,.25), rgba(94,234,212,.12));
  border: 1px solid rgba(94,234,212,.25);
  font-size: 13px;
}
.funnel-step b { color: var(--teal); font-size: 16px; }

.cust-bars { display: flex; flex-direction: column; gap: 12px; }
.cust-row { display: grid; grid-template-columns: 120px 1fr 180px; gap: 10px; align-items: center; font-size: 12px; }
.cust-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cust-track { height: 10px; background: rgba(255,255,255,.06); border-radius: 999px; overflow: hidden; }
.cust-track i {
  display: block; height: 100%;
  background: linear-gradient(90deg, #818cf8, #38bdf8 50%, #5eead4);
  border-radius: 999px;
}
.cust-row em { text-align: right; color: var(--muted); font-style: normal; font-size: 11px; }

.todo-list { list-style: none; margin: 0; padding: 0; max-height: 240px; overflow: auto; }
.todo-list li {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.05);
}
.todo-list strong { display: block; font-size: 13px; }
.todo-list small { color: var(--muted); font-size: 11px; }
.tag {
  flex-shrink: 0; font-size: 10px; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--teal);
}
.tag-续费 { color: var(--amber); border-color: rgba(251,191,36,.4); }
.tag-申报 { color: var(--rose); border-color: rgba(251,113,133,.4); }
.tag-外勤 { color: var(--blue); border-color: rgba(56,189,248,.4); }
.empty { color: var(--muted); font-size: 13px; padding: 20px 0; text-align: center; }

@media (max-width: 1200px) {
  .kpi-row { grid-template-columns: repeat(3, 1fr); }
  .screen-grid { grid-template-columns: 1fr 1fr; }
  .panel.span-2 { grid-column: span 2; }
}
@media (max-width: 720px) {
  .kpi-row, .screen-grid { grid-template-columns: 1fr; padding-left: 14px; padding-right: 14px; }
  .panel.span-2 { grid-column: auto; }
  .cust-row { grid-template-columns: 1fr; }
  .screen-brand h1 { font-size: 18px; }
}

.preview-banner {
  position: relative; z-index: 2;
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  margin: 12px 28px 0; padding: 12px 16px;
  border: 1px solid rgba(251,191,36,.35);
  background: linear-gradient(90deg, rgba(251,191,36,.14), rgba(56,189,248,.08));
  border-radius: 12px; color: var(--text);
}
.preview-banner strong { color: var(--amber); margin-right: 8px; }
.preview-banner span { color: var(--muted); font-size: 13px; }
.preview-banner-actions { display: flex; gap: 8px; }
.preview-banner-actions a {
  font-size: 12px; color: var(--muted); border: 1px solid var(--line);
  padding: 6px 12px; border-radius: 999px; text-decoration: none;
}
.preview-banner-actions a.primary {
  color: #041018; background: linear-gradient(135deg, #5eead4, #38bdf8); border: none; font-weight: 600;
}
button.kpi {
  font: inherit; text-align: left; cursor: pointer; border: none; width: 100%;
  appearance: none; -webkit-appearance: none;
}
.preview-modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(2, 8, 20, .72);
  display: grid; place-items: center; padding: 20px;
}
.preview-modal[hidden] { display: none !important; }
.preview-modal-card {
  width: min(440px, 100%);
  background: #0c1c34; border: 1px solid var(--line); border-radius: 16px;
  padding: 22px 22px 18px; position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}
.preview-modal-card h3 { margin: 0 0 8px; font-size: 18px; }
.preview-modal-card p { margin: 0 0 16px; color: var(--muted); line-height: 1.6; font-size: 14px; }
.preview-modal-close {
  position: absolute; top: 10px; right: 12px; border: none; background: transparent;
  color: var(--muted); font-size: 22px; cursor: pointer;
}
.preview-modal-actions .screen-back.primary {
  color: #041018; background: linear-gradient(135deg, #5eead4, #38bdf8); border: none;
}
