:root {
  --bg: #0a0e1a;
  --bg-elevated: #0f1419;
  --surface: #141922;
  --surface-hover: #1a1f2e;
  --text: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --accent: #8b5cf6;
  --border: rgba(148, 163, 184, 0.1);
  --border-hover: rgba(148, 163, 184, 0.2);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px 0 rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px 0 rgba(0, 0, 0, 0.5);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.login {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 92vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-lg);
}

.login-title {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 20px;
  color: var(--text);
}

.login-subtitle {
  color: var(--text-muted);
  margin: 0 0 20px 0;
  font-size: 14px;
  line-height: 1.6;
  font-weight: 400;
}

.login-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

input[type="password"] {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 12px 14px;
  outline: none;
  font-size: 15px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

input[type="password"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  background: var(--surface-hover);
}

button {
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 600;
  color: white;
  background: var(--primary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

button:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.hint {
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
  font-weight: 400;
}

.err {
  margin-top: 10px;
  color: #fecaca;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  padding: 10px 12px;
  border-radius: 12px;
  display: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 20, 25, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.signature {
  font-style: italic;
  font-weight: 500;
  background: linear-gradient(120deg, #f472b6, #c084fc, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 4s linear infinite;
}

@keyframes shimmer {
  0% {
    filter: drop-shadow(0 0 2px rgba(244, 114, 182, 0.4));
  }
  50% {
    filter: drop-shadow(0 0 6px rgba(96, 165, 250, 0.6));
  }
  100% {
    filter: drop-shadow(0 0 2px rgba(244, 114, 182, 0.4));
  }
}

.header-compliance {
  flex: 1;
  text-align: center;
  color: #fcd34d;
  font-size: 13px;
  letter-spacing: 0.03em;
}

.brand small {
  color: var(--muted);
  font-weight: 600;
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  color: var(--text);
  transform: translateY(-1px);
}

.btn.primary {
  border: none;
  background: var(--primary);
  color: white;
}

.btn.primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.compliance-notice {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 18px;
  color: #fcd34d;
  background: rgba(124, 58, 237, 0.1);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.tab {
  flex: 1;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  font-weight: 500;
  font-size: 14px;
  color: var(--text-muted);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  background: transparent;
}

.tab:hover {
  color: var(--text-secondary);
  background: rgba(148, 163, 184, 0.05);
}

.tab.active {
  color: var(--text);
  background: var(--primary);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.panel-head {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.panel-title {
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--text);
}

.panel-sub {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
  line-height: 1.5;
  font-weight: 400;
}

.panel-body {
  padding: 24px;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.file-item:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.file-icon {
  font-size: 24px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.1);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-weight: 500;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.file-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.file-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.file-download-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--primary);
  color: white;
  cursor: pointer;
  font-weight: 500;
  font-size: 13px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.file-download-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.crumb {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.crumb a {
  color: var(--text-secondary);
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.crumb a:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
  color: var(--text);
  transform: translateY(-1px);
}

table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-elevated);
}

thead th {
  text-align: left;
  padding: 14px 16px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 13px;
  color: var(--text-secondary);
}

tbody tr {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

tbody tr:hover {
  background: var(--surface-hover);
}

.fn {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  color: var(--text);
  font-weight: 500;
  transition: color 0.2s ease;
}

.fn:hover {
  color: var(--primary);
}

.tag {
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 500;
}

.muted {
  color: var(--text-muted);
  font-size: 14px;
}

.right {
  display: flex;
  gap: 10px;
  align-items: center;
}

.notice {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  margin-bottom: 16px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.metric-icon {
  font-size: 28px;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.1);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.metric-content {
  flex: 1;
  min-width: 0;
}

.metric-label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.metric-value {
  font-size: 26px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  word-break: break-all;
  letter-spacing: -0.02em;
}

.metric-trend {
  font-size: 11px;
  color: #4ade80;
  margin-top: 4px;
  font-weight: 600;
}

.charts-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.chart-container {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  overflow: hidden;
}

.chart-container.full-width {
  grid-column: 1 / -1;
}

.chart-header {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.chart-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.chart-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.chart-body {
  position: relative;
  min-height: 240px;
}

.top-files-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.top-file-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.top-file-item:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.top-file-rank {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
  color: white;
}

.top-file-info {
  flex: 1;
  min-width: 0;
}

.top-file-name {
  font-weight: 500;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-file-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 500;
}

.top-file-stats {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-shrink: 0;
}

.top-file-stat {
  text-align: right;
}

.top-file-stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.top-file-stat-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

@media (max-width: 640px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .actions {
    width: 100%;
    justify-content: flex-start;
  }
  .panel-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  .charts-row {
    grid-template-columns: 1fr;
  }
  .metric-value {
    font-size: 24px;
  }
  .top-file-stats {
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
  }
}
