@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;600&display=swap");

:root {
  color-scheme: light;
  --bg: #0f172a;
  --bg-panel: #101c3a;
  --bg-elevated: #162447;
  --border: rgba(148, 163, 184, 0.18);
  --accent: #6ee7b7;
  --accent-muted: rgba(110, 231, 183, 0.15);
  --accent-strong: #0ea5e9;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --shadow: 0 24px 48px -32px rgba(15, 23, 42, 0.65);
  --card-radius: 20px;
  --divider: rgba(148, 163, 184, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: radial-gradient(circle at top left, rgba(14, 165, 233, 0.35), transparent 55%),
    radial-gradient(circle at 80% 10%, rgba(110, 231, 183, 0.25), transparent 50%),
    var(--bg);
  min-height: 100vh;
  color: var(--text);
}

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  padding: 2.4rem 2rem;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.sidebar__brand a {
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.04em;
}

.sidebar__subtitle {
  margin: 0.3rem 0 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.sidebar__link .icon {
  font-size: 1.1rem;
}

.sidebar__link:hover {
  background: rgba(110, 231, 183, 0.12);
  color: var(--text);
  transform: translateX(4px);
}

.sidebar__link.is-active {
  background: rgba(110, 231, 183, 0.18);
  color: var(--accent);
  border: 1px solid rgba(110, 231, 183, 0.25);
  box-shadow: 0 8px 22px -16px rgba(110, 231, 183, 0.65);
}

.sidebar__footer {
  margin-top: auto;
  padding-top: 2rem;
  border-top: 1px solid var(--divider);
}

.sidebar__logout {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}

.sidebar__logout:hover {
  color: var(--accent);
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 2rem 3rem;
}

.main__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.main__header h1 {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.main__desc {
  margin: 0.45rem 0 0;
  color: var(--text-muted);
  max-width: 720px;
  line-height: 1.6;
}

.main__actions {
  display: inline-flex;
  gap: 0.6rem;
}

.main__body {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.footer {
  margin-top: auto;
  padding-top: 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer__meta {
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.06em;
}

.grid {
  display: grid;
  gap: 1.4rem;
}

.grid.cols-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.grid.cols-4 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card {
  background: var(--bg-elevated);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card--accent {
  background: linear-gradient(150deg, rgba(110, 231, 183, 0.18), rgba(14, 165, 233, 0.12));
  border: 1px solid rgba(110, 231, 183, 0.35);
}

.card__title {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.card__metric {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--accent);
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(110, 231, 183, 0.4);
  background: rgba(110, 231, 183, 0.12);
  font-size: 0.8rem;
  color: var(--accent);
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.timeline__item {
  padding-left: 1.4rem;
  border-left: 1px solid rgba(148, 163, 184, 0.25);
  position: relative;
}

.timeline__item::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 0.35rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(110, 231, 183, 0.2);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.table th,
.table td {
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  text-align: left;
}

.table th {
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.78rem;
}

.table tbody tr:hover {
  background: rgba(110, 231, 183, 0.12);
}

.metric-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.65rem;
  margin-right: 0.5rem;
  margin-bottom: 0.3rem;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.16);
  color: #38bdf8;
  font-size: 0.8rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 1rem;
}

.filters .upload-form__input {
  width: auto;
  min-width: 140px;
}

.code-block {
  font-family: "JetBrains Mono", monospace;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.1rem 1.3rem;
  font-size: 0.82rem;
  line-height: 1.6;
  color: #cbd5f5;
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.upload-form__input {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  padding: 0.75rem;
  color: var(--text);
}

.upload-form__input::file-selector-button {
  padding: 0.5rem 0.9rem;
  border: none;
  border-radius: 10px;
  background: rgba(110, 231, 183, 0.18);
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}

.ack-btn {
  background: rgba(110, 231, 183, 0.15);
  border: 1px solid rgba(110, 231, 183, 0.4);
  border-radius: 10px;
  color: var(--accent);
  padding: 0.2rem 0.6rem;
  cursor: pointer;
  font-size: 0.78rem;
}

.ack-btn:hover {
  background: rgba(110, 231, 183, 0.3);
}

.alert-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-top: 0.5rem;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(110, 231, 183, 0.45);
  background: rgba(110, 231, 183, 0.16);
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.button:hover {
  background: rgba(110, 231, 183, 0.28);
}

.flash-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.flash {
  padding: 0.9rem 1.1rem;
  border-radius: 14px;
  border: 1px solid rgba(110, 231, 183, 0.35);
  background: rgba(110, 231, 183, 0.18);
  color: var(--accent);
  font-weight: 600;
}

.flash.danger {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.18);
  color: #fca5a5;
}

.flash.warning {
  border-color: rgba(250, 204, 21, 0.35);
  background: rgba(251, 191, 36, 0.18);
  color: #facc15;
}

.hint {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.kpi {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: rgba(15, 23, 42, 0.55);
  border-radius: 16px;
  border: 1px solid rgba(110, 231, 183, 0.16);
  padding: 1.2rem 1.4rem;
}

.kpi__label {
  text-transform: uppercase;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
}

.kpi__value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
}

.kpi__meta {
  font-size: 0.82rem;
  color: rgba(148, 163, 184, 0.75);
}

.section-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-title::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.list-guidance {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  color: var(--text-muted);
}

.list-guidance strong {
  color: var(--text);
}

.tag-cloud {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.tag-cloud span {
  padding: 0.35rem 0.75rem;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.24);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.chart-container {
  height: 340px;
  background: rgba(15, 23, 42, 0.55);
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  padding: 1.2rem;
}

.table-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  border: 1px dashed rgba(148, 163, 184, 0.3);
  border-radius: 16px;
}

@media (max-width: 980px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    border-right: none;
    border-bottom: 1px solid var(--divider);
    padding: 1.5rem;
    gap: 1.2rem;
  }

  .sidebar__nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .sidebar__footer {
    display: none;
  }

  .main {
    padding: 1.5rem;
  }

  .main__header {
    flex-direction: column;
  }
}
