:root {
  --bg-0: #ffffff;
  --bg-1: #f5f7fb;
  --bg-2: #edf1f8;
  --content-width: min(1180px, calc(100vw - 24px));
  --panel: rgba(255, 255, 255, 0.88);
  --panel-strong: rgba(255, 255, 255, 0.96);
  --panel-soft: rgba(255, 255, 255, 0.04);
  --text: #1f2a44;
  --muted: rgba(70, 84, 110, 0.8);
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --accent-3: #34d399;
  --line: rgba(255, 255, 255, 0.1);
  --shadow: 0 18px 50px rgba(31, 42, 68, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-size: 14px;
  font-family: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  background:
    radial-gradient(circle at 20% 12%, rgba(139, 92, 246, 0.06), transparent 30%),
    radial-gradient(circle at 80% 10%, rgba(34, 211, 238, 0.06), transparent 26%),
    radial-gradient(circle at 50% 100%, rgba(52, 211, 153, 0.04), transparent 28%),
    linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 48%, var(--bg-2) 100%);
}

body {
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(31, 42, 68, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 42, 68, 0.04) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
  opacity: 0.45;
}

[hidden] {
  display: none !important;
}

.glass {
  background: var(--panel);
  border: 1px solid rgba(31, 42, 68, 0.1);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.brand-logo {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.logo-frame {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(139, 92, 246, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.logo-frame-login {
  width: min(100%, 420px);
  padding: 16px 18px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, rgba(245, 247, 255, 0.98), rgba(255, 255, 255, 0.98));
  border: 1px solid rgba(31, 42, 68, 0.06);
}

.logo-frame-hero {
  width: min(100%, 380px);
  padding: 16px 18px;
}

.brand-logo-login {
  max-width: 100%;
  max-height: 112px;
}

.brand-logo-hero {
  max-width: 100%;
  max-height: 84px;
}

.eyebrow {
  margin: 0 0 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 12px;
  color: rgba(70, 84, 110, 0.72);
}

.app-shell,
.page-shell {
  position: relative;
  width: 100%;
  padding: 14px 0 28px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas:
    "logo . actions"
    "copy copy copy";
  gap: 10px 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 24px;
  color: var(--text);
  width: var(--content-width);
  margin: 0 auto;
}

.topbar-logo {
  display: flex;
  align-items: center;
  grid-area: logo;
}

.topbar-copy {
  grid-area: copy;
  min-width: 0;
  max-width: 760px;
  justify-self: center;
  text-align: center;
}

.topbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-self: end;
  min-width: 0;
  grid-area: actions;
}

.topbar-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar-userline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: end;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(31, 42, 68, 0.05);
  border: 1px solid rgba(31, 42, 68, 0.08);
  font-size: 11px;
  color: var(--muted);
}

.topbar-user-value {
  font-size: 12px;
  color: var(--text);
}

.brand-stack {
  display: grid;
  gap: 16px;
}

.brand-copy h1,
.topbar-copy h1,
.login-card h1 {
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-weight: 700;
  line-height: 1.05;
}

.brand-copy h1 {
  font-size: clamp(28px, 4vw, 44px);
}

.topbar-copy h1 {
  font-size: clamp(24px, 3vw, 34px);
}

.hero-copy {
  max-width: 780px;
  margin: 8px auto 0;
  line-height: 1.6;
  font-size: 13px;
  color: var(--muted);
}

.meta-card {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(31, 42, 68, 0.08);
}

.meta-card-inline {
  min-width: 0;
}

.meta-card span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.meta-card strong {
  display: block;
  margin-top: 6px;
  font-size: 16px;
}

.user-card strong {
  font-size: 16px;
}

.meta-action {
  height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.meta-action-small {
  height: 32px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 12px;
}

.meta-action.ghost {
  background: rgba(31, 42, 68, 0.06);
  border: 1px solid rgba(31, 42, 68, 0.08);
  color: var(--text);
}

.status-banner {
  width: var(--content-width);
  margin: 12px auto 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.18);
  color: var(--text);
  box-shadow: var(--shadow);
}

.section-block {
  width: var(--content-width);
  margin: 12px auto 0;
}

.section-block.glass {
  padding: 16px 16px 18px;
  border-radius: 22px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.section-head-tight {
  margin-bottom: 10px;
}

.section-head h2 {
  margin: 2px 0 0;
  font-size: clamp(18px, 1.8vw, 24px);
}

.section-head span {
  color: var(--muted);
  font-size: 13px;
}

.section-kicker {
  margin: 0;
  color: var(--accent);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 800;
}

.overview-toolbar {
  display: grid;
  gap: 10px;
  margin: 8px 0 14px;
  padding: 12px 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(31, 42, 68, 0.08);
}

.overview-toolbar-head {
  margin-bottom: 0;
}

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.filters-compact {
  gap: 10px;
}

.filter-group {
  display: grid;
  gap: 8px;
}

.filter-group label,
.login-form span,
.password-form span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.filter-group select,
.filter-group input,
.login-form input,
.password-form input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(31, 42, 68, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  font-size: 13px;
  outline: none;
}

.filter-group select::placeholder,
.filter-group input::placeholder,
.login-form input::placeholder,
.password-form input::placeholder {
  color: rgba(70, 84, 110, 0.42);
}

.filter-group select:focus,
.filter-group input:focus,
.login-form input:focus,
.password-form input:focus {
  border-color: rgba(34, 211, 238, 0.5);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12);
}

.reset-btn,
.login-btn,
.ghost-btn {
  height: 38px;
  padding: 0 14px;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
}

.reset-btn-small {
  height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.reset-btn,
.login-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}

.ghost-btn {
  background: rgba(31, 42, 68, 0.06);
  color: var(--text);
  border: 1px solid rgba(31, 42, 68, 0.08);
}

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

.kpi {
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 253, 0.98));
  border: 1px solid rgba(31, 42, 68, 0.08);
  box-shadow: var(--shadow);
}

.kpi .label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.kpi .value {
  margin-top: 8px;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1;
}

.kpi .sub {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.panel {
  padding: 14px;
  border-radius: 20px;
}

.modal-panel {
  margin-top: 14px;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.panel-head h2 {
  margin: 0;
  font-size: 16px;
}

.panel-head h3 {
  margin: 0;
  font-size: 15px;
}

.panel-head span {
  font-size: 11px;
  color: var(--muted);
}

.detail-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chart {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: center;
}

.bar-label {
  font-size: 12px;
  color: var(--text);
  font-weight: 600;
}

.bar-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: rgba(31, 42, 68, 0.08);
  overflow: hidden;
}

.bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
}

.bar-count {
  text-align: right;
  font-weight: 700;
}

.table-wrap {
  overflow: auto;
  border: 1px solid rgba(31, 42, 68, 0.08);
  border-radius: 18px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(31, 42, 68, 0.08);
  white-space: nowrap;
  text-align: left;
  font-size: 12px;
}

.data-table th {
  position: sticky;
  top: 0;
  background: #f4f6fb;
  z-index: 1;
  color: var(--muted);
}

.data-table th:first-child,
.data-table td:first-child {
  width: 64px;
  text-align: center;
}

.data-table tbody tr:hover {
  background: rgba(139, 92, 246, 0.06);
}

.detail-hint {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.16);
  color: var(--muted);
}

.detail-filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr)) auto;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(244, 246, 251, 0.92);
  border: 1px solid rgba(31, 42, 68, 0.08);
}

.password-form {
  display: grid;
  gap: 14px;
  max-width: 360px;
}

.import-form {
  max-width: 420px;
}

.import-form input[type="file"] {
  padding-top: 8px;
  height: auto;
}

.template-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px dashed rgba(31, 42, 68, 0.18);
  background: rgba(31, 42, 68, 0.03);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.template-link:hover {
  border-color: rgba(34, 211, 238, 0.55);
  background: rgba(34, 211, 238, 0.08);
}

.import-hint {
  line-height: 1.6;
}

.password-form label,
.login-form label {
  display: grid;
  gap: 8px;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

.login-card {
  width: min(520px, 100%);
  padding: 24px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 247, 251, 0.98));
  color: var(--text);
  border: 1px solid rgba(31, 42, 68, 0.08);
}

.login-card h1 {
  color: var(--text);
  margin-top: 10px;
  font-size: clamp(26px, 3.2vw, 36px);
  word-break: keep-all;
}

.login-copy {
  color: var(--muted);
  line-height: 1.65;
  margin: 10px 0 16px;
  font-size: 13px;
}

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

.login-error {
  min-height: 18px;
  margin: 0;
  color: #c2410c;
  font-size: 13px;
}

.detail-quick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: -2px 0 12px;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(244, 246, 251, 0.92);
  border: 1px solid rgba(31, 42, 68, 0.08);
}

.detail-quick-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}

.detail-quick-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-chip {
  height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(31, 42, 68, 0.1);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.detail-chip.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
}

.detail-chip-ghost {
  background: rgba(31, 42, 68, 0.04);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.36);
  backdrop-filter: blur(8px);
}

.modal-card {
  width: min(460px, 100%);
  margin: 0;
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.modal-panel {
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
}

.muted {
  color: var(--muted);
}

@media (max-width: 1100px) {
  .filters,
  .detail-filters,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    grid-template-columns: 1fr;
    grid-template-areas:
      "logo"
      "copy"
      "actions";
    gap: 12px;
  }

  .topbar-copy {
    justify-self: start;
    text-align: left;
  }

  .topbar-actions {
    justify-self: start;
    justify-content: flex-start;
  }

  .topbar-actions,
  .topbar-userline,
  .topbar-buttons {
    justify-self: start;
    justify-items: start;
    justify-content: flex-start;
  }

  .reset-btn {
    width: 100%;
  }

  .kpi {
    padding: 14px;
    border-radius: 16px;
  }

  .kpi .value {
    font-size: clamp(22px, 5vw, 30px);
  }
}

@media (max-width: 700px) {
  .page-shell {
    width: min(100vw - 16px, 1480px);
    padding-top: 10px;
  }

  .topbar,
  .section-block.glass,
  .panel {
    padding: 14px 12px 12px;
  }

  .filters,
  .detail-filters,
  .panel,
  .kpi,
  .login-card {
    padding: 12px;
  }

  .kpis {
    gap: 8px;
  }

  .kpi {
    padding: 10px 10px 12px;
    border-radius: 14px;
  }

  .kpi .label {
    font-size: 10px;
  }

  .kpi .value {
    font-size: clamp(18px, 8vw, 24px);
    margin-top: 6px;
  }

  .kpi .sub {
    margin-top: 4px;
    font-size: 10px;
  }

  .bar-row {
    grid-template-columns: 90px minmax(0, 1fr) 44px;
  }

  .topbar-buttons {
    width: 100%;
  }

  .topbar-buttons .meta-action-small {
    flex: 1 1 auto;
    min-width: 0;
  }
}
