:root {
  --bg: #050815;
  --panel: rgba(9, 24, 48, 0.86);
  --panel-2: rgba(12, 37, 70, 0.76);
  --line: rgba(82, 177, 255, 0.34);
  --cyan: #35d7ff;
  --blue: #3a86ff;
  --green: #31e6a1;
  --yellow: #ffd166;
  --red: #ff6b7a;
  --purple: #9b8cff;
  --text: #e8f7ff;
  --muted: #8db3cf;
}

* {
  box-sizing: border-box;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(53, 215, 255, 0.72) rgba(6, 20, 45, 0.72);
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: rgba(6, 20, 45, 0.72);
}

*::-webkit-scrollbar-thumb {
  border: 1px solid rgba(49, 230, 161, 0.45);
  background: linear-gradient(180deg, var(--cyan), var(--green));
  box-shadow: 0 0 10px rgba(53, 215, 255, 0.42);
}

*::-webkit-scrollbar-corner {
  background: rgba(6, 20, 45, 0.72);
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(circle at 20% 18%, rgba(30, 126, 214, 0.2), transparent 28%),
    radial-gradient(circle at 75% 10%, rgba(49, 230, 161, 0.12), transparent 24%),
    linear-gradient(180deg, #02040b 0%, var(--bg) 100%);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(53, 215, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(53, 215, 255, 0.045) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
}

.screen-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  min-height: 100vh;
  padding: 18px 22px 24px;
}

.screen-header {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr minmax(180px, 260px);
  align-items: center;
  min-height: 78px;
  border-bottom: 1px solid rgba(53, 215, 255, 0.32);
}

.title-block {
  text-align: center;
}

.title-block h1 {
  margin: 0;
  color: #f7fdff;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0;
  text-shadow: 0 0 18px rgba(53, 215, 255, 0.72);
}

.title-block p,
.time-block span,
.action-block span {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.time-block,
.action-block {
  display: grid;
  gap: 6px;
}

.time-block strong {
  color: var(--cyan);
  font-size: 24px;
}

.action-block {
  justify-items: end;
}

.action-block a {
  color: var(--cyan);
  font-size: 13px;
  text-decoration: none;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.kpi-card,
.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(14, 42, 78, 0.88), rgba(5, 13, 31, 0.86)),
    var(--panel);
  box-shadow: inset 0 0 24px rgba(36, 125, 255, 0.12), 0 0 16px rgba(0, 120, 255, 0.1);
}

.kpi-card::before,
.panel::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(90deg, var(--cyan), transparent 20%) top left / 100% 1px no-repeat,
    linear-gradient(180deg, var(--cyan), transparent 28%) top left / 1px 100% no-repeat,
    linear-gradient(270deg, var(--green), transparent 20%) bottom right / 100% 1px no-repeat,
    linear-gradient(0deg, var(--green), transparent 28%) bottom right / 1px 100% no-repeat;
  opacity: 0.82;
  z-index: 0;
}

.kpi-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 96px;
  padding: 16px 18px;
}

.kpi-card > *,
.panel > * {
  position: relative;
  z-index: 1;
}

.kpi-card span {
  color: var(--muted);
  font-size: 14px;
}

.kpi-card strong {
  display: block;
  margin-top: 8px;
  color: #fff;
  font-size: 32px;
  line-height: 1;
  text-shadow: 0 0 12px rgba(53, 215, 255, 0.66);
}

.kpi-card small {
  color: var(--green);
  font-size: 14px;
}

.kpi-card .down {
  color: var(--red);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 330px;
  min-height: 330px;
  padding: 18px;
}

.panel-trend,
.panel-structure,
.panel-new-org {
  grid-column: span 4;
}

.panel-structure {
  grid-column: span 4;
}

.panel-table {
  grid-column: span 4;
}

.panel-third {
  grid-column: span 4;
}

.panel-quarter {
  grid-column: span 4;
}

.dashboard-grid > .panel:not(.panel-trend):not(.panel-structure):not(.panel-new-org):not(.panel-third):not(.panel-quarter):not(.panel-table) {
  grid-column: span 6;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  margin-bottom: 10px;
}

.panel-head span {
  display: block;
  color: #f2fbff;
  font-size: 17px;
  font-weight: 700;
}

.panel-head strong {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 12px;
  flex: 1;
  max-width: 62%;
  color: var(--muted);
  font-size: 12px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  border: 1px solid rgba(82, 177, 255, 0.18);
  padding: 3px 8px;
  background: rgba(9, 24, 48, 0.38);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  white-space: nowrap;
}

.legend-item:hover,
.legend-item.active {
  border-color: rgba(53, 215, 255, 0.62);
  background: rgba(53, 215, 255, 0.12);
  color: var(--text);
}

.legend-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  box-shadow: 0 0 10px currentColor;
}

.chart {
  height: 100%;
  min-height: 0;
}

.chart svg {
  width: 100%;
  height: 100%;
  display: block;
}

.axis-text {
  fill: rgba(210, 239, 255, 0.62);
  font-size: 11px;
}

.bar-value {
  fill: #f6fbff;
  font-size: 12px;
  font-weight: 700;
  paint-order: stroke;
  stroke: rgba(3, 10, 24, 0.86);
  stroke-width: 3px;
}

.donut-wrap {
  display: grid;
  grid-template-columns: minmax(116px, 138px) 1fr;
  gap: 16px;
  align-items: center;
  min-height: 0;
}

.donut {
  width: 138px;
  height: 138px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--cyan) 0deg, var(--blue) 120deg, var(--green) 230deg, var(--yellow) 310deg);
}

.donut::after {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: #08172e;
  content: "";
  box-shadow: inset 0 0 20px rgba(53, 215, 255, 0.22);
}

.composition-list {
  display: grid;
  width: 100%;
  gap: 10px;
}

.composition-item {
  display: grid;
  grid-template-columns: 80px 1fr 52px;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 30px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  text-align: left;
}

.composition-item:hover {
  color: var(--text);
}

.composition-bar,
.ranking-bar {
  height: 8px;
  overflow: hidden;
  background: rgba(72, 150, 220, 0.18);
}

.composition-bar span,
.ranking-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  box-shadow: 0 0 10px rgba(53, 215, 255, 0.62);
}

.ranking-list {
  display: grid;
  gap: 10px;
  min-height: 0;
  height: 100%;
  max-height: none;
  align-content: start;
  overflow-y: auto;
  padding-right: 4px;
}

.ranking-item {
  display: grid;
  grid-template-columns: minmax(94px, 1fr) 0.95fr 60px;
  gap: 10px;
  align-items: center;
  min-height: 30px;
  color: var(--muted);
  font-size: 13px;
}

.ranking-item span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ranking-item strong,
.composition-item strong {
  color: #fff;
  text-align: right;
}

.ranking-status {
  min-height: 28px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.daily-table {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
  height: 100%;
  max-height: none;
  overflow: hidden;
  font-size: 12px;
}

.daily-head,
.daily-row {
  display: grid;
  grid-template-columns: 92px repeat(10, 72px);
  gap: 8px;
  align-items: center;
  min-width: 820px;
  min-height: 30px;
  padding: 0 10px;
}

.add-org-ranks {
  min-height: 0;
  max-height: none;
  padding-right: 6px;
}

.daily-head {
  color: var(--cyan);
  border-bottom: 1px solid rgba(53, 215, 255, 0.24);
  background: rgba(53, 215, 255, 0.08);
}

.daily-body {
  display: grid;
  gap: 5px;
  padding-top: 8px;
  overflow: auto;
}

.daily-row {
  color: #cceaff;
  background: rgba(18, 80, 156, 0.2);
}

.daily-row span:not(:first-child),
.daily-head span:not(:first-child) {
  text-align: right;
}

.empty-state {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--muted);
  font-size: 13px;
}

.detail-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
}

.detail-modal.hidden {
  display: none;
}

.detail-mask {
  position: absolute;
  inset: 0;
  background: rgba(1, 8, 20, 0.72);
}

.detail-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: min(980px, 96vw);
  max-height: min(720px, 90vh);
  min-height: 560px;
  border: 1px solid rgba(53, 215, 255, 0.48);
  background: linear-gradient(145deg, rgba(10, 31, 62, 0.98), rgba(3, 12, 29, 0.98));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.48), inset 0 0 24px rgba(53, 215, 255, 0.12);
}

.detail-header,
.detail-tools,
.detail-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
}

.detail-header {
  border-bottom: 1px solid rgba(53, 215, 255, 0.24);
}

.detail-header span,
.detail-footer {
  color: var(--muted);
  font-size: 13px;
}

.detail-header strong {
  display: block;
  margin-top: 6px;
  color: #fff;
  font-size: 22px;
}

.detail-close,
.detail-tools button,
.detail-pages button {
  border: 1px solid rgba(53, 215, 255, 0.4);
  background: rgba(53, 215, 255, 0.1);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}

.detail-close {
  width: 34px;
  height: 34px;
  font-size: 22px;
  line-height: 1;
}

.detail-tools {
  justify-content: flex-start;
  border-bottom: 1px solid rgba(53, 215, 255, 0.16);
}

.detail-tools input {
  width: min(360px, 100%);
  height: 36px;
  border: 1px solid rgba(80, 184, 255, 0.38);
  outline: none;
  padding: 0 12px;
  background: rgba(3, 14, 38, 0.9);
  color: #fff;
  font-family: inherit;
}

.detail-tools button,
.detail-pages button {
  height: 36px;
  padding: 0 14px;
}

.detail-pages button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.detail-table {
  min-height: 0;
  overflow: auto;
  padding: 12px 18px;
}

.detail-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 84px repeat(4, 94px);
  gap: 10px;
  align-items: center;
  min-width: 720px;
  min-height: 36px;
  padding: 0 12px;
  color: #cceaff;
  font-size: 13px;
  background: rgba(18, 80, 156, 0.18);
}

.detail-row + .detail-row,
.detail-body .detail-row + .detail-row {
  margin-top: 6px;
}

.detail-head-row {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(53, 215, 255, 0.13);
}

.detail-sort {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
  height: 28px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--cyan);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
}

.detail-sort:first-child {
  justify-content: flex-start;
}

.detail-sort.active {
  color: #fff;
  text-shadow: 0 0 10px rgba(53, 215, 255, 0.66);
}

.detail-sort small {
  width: 12px;
  color: var(--green);
  font-size: 12px;
}

.detail-row span:first-child {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.detail-row span:not(:first-child) {
  text-align: right;
}

.detail-footer {
  border-top: 1px solid rgba(53, 215, 255, 0.18);
}

.detail-pages {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  overflow: hidden;
}

.login-shell {
  display: grid;
  place-items: center;
  width: 100vw;
  height: 100vh;
  padding: 24px;
}

.login-panel {
  position: relative;
  width: min(440px, 100%);
  padding: 34px;
  border: 1px solid rgba(52, 163, 255, 0.56);
  background: linear-gradient(145deg, rgba(7, 28, 77, 0.92), rgba(2, 11, 31, 0.84));
  box-shadow: inset 0 0 28px rgba(20, 111, 255, 0.2), 0 0 28px rgba(0, 120, 255, 0.22);
}

.login-panel::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(90deg, var(--cyan), transparent 32%) top left / 100% 1px no-repeat,
    linear-gradient(180deg, var(--cyan), transparent 40%) top left / 1px 100% no-repeat,
    linear-gradient(270deg, var(--cyan), transparent 32%) bottom right / 100% 1px no-repeat,
    linear-gradient(0deg, var(--cyan), transparent 40%) bottom right / 1px 100% no-repeat;
}

.login-brand span {
  color: var(--cyan);
  font-size: 13px;
}

.login-brand h1 {
  margin: 10px 0 28px;
  color: #fff;
  font-size: 24px;
  line-height: 1.35;
  text-shadow: 0 0 16px rgba(53, 215, 255, 0.58);
}

.login-form {
  display: grid;
  gap: 18px;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.login-form input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(80, 184, 255, 0.42);
  outline: none;
  background: rgba(3, 14, 38, 0.9);
  color: #fff;
  font-size: 16px;
}

.login-form input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 14px rgba(53, 215, 255, 0.24);
}

.login-error {
  min-height: 20px;
  margin: -4px 0 0;
  color: var(--red);
  font-size: 13px;
}

.login-form button {
  height: 46px;
  border: 0;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  color: #001226;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
}

.login-form button:disabled {
  cursor: wait;
  opacity: 0.72;
}

@media (max-width: 1440px) {
  .screen-shell {
    padding: 12px 14px;
  }

  .title-block h1 {
    font-size: 30px;
  }

  .dashboard-grid {
    gap: 10px;
  }
}

@media (max-width: 1180px) {
  .screen-header {
    grid-template-columns: 1fr;
    gap: 8px;
    padding-bottom: 12px;
    text-align: center;
  }

  .time-block,
  .action-block {
    justify-items: center;
  }

  .kpi-row,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .panel-trend,
  .panel-structure,
  .panel-new-org,
  .panel-third,
  .panel-quarter,
  .panel-table,
  .dashboard-grid > .panel:not(.panel-trend):not(.panel-structure):not(.panel-new-org):not(.panel-third):not(.panel-quarter):not(.panel-table) {
    grid-column: 1;
  }

  .donut-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .daily-table {
    overflow-x: auto;
  }

  .daily-head,
  .daily-row {
    min-width: 860px;
  }
}
