:root {
  --sidebar-width: 248px;
  --ink: #16202a;
  --muted: #6b7785;
  --line: #e6eaf0;
  --brand: #e47911;
  --brand-dark: #c96500;
  --surface: #f5f7fa;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
}

a { text-decoration: none; }

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

.sidebar {
  width: var(--sidebar-width);
  background: #101820;
  color: #d7dee6;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  padding: 18px 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  margin-bottom: 14px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f59e0b, #e47911);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 20px;
  flex: 0 0 auto;
}

.brand-name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .2px;
  color: #fff;
}

.brand-sub {
  font-size: 11px;
  color: #8c9aa8;
}

.sidebar .nav-link {
  color: #aeb9c5;
  border-radius: 8px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  margin-bottom: 2px;
}

.sidebar .nav-link i { font-size: 16px; }

.sidebar .nav-link:hover {
  background: rgba(255, 255, 255, .06);
  color: #fff;
}

.sidebar .nav-link.active {
  background: rgba(228, 121, 17, .18);
  color: #ffb45c;
}

.sidebar-foot {
  margin-top: auto;
  padding: 12px 8px 0;
  border-top: 1px solid rgba(255, 255, 255, .08);
  line-height: 1.6;
}

.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
}

.topbar {
  height: 64px;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-title {
  font-size: 17px;
  font-weight: 650;
}

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

.content {
  padding: 22px 24px 40px;
  max-width: 1500px;
}

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(16, 24, 32, .03);
  overflow: hidden;
}

.panel-head {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  font-size: 14px;
}

.panel-head i { color: var(--brand); margin-right: 4px; }

.panel-body { padding: 16px; }

.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 100%;
}

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 22px;
  flex: 0 0 auto;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.info-label {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 2px;
}

.info-value {
  font-size: 13px;
  word-break: break-all;
}

.table > :not(caption) > * > * {
  padding: .65rem .75rem;
  vertical-align: middle;
}

.table thead th {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  background: #fafbfc;
  white-space: nowrap;
}

.table tbody tr:hover { background: #fbfcfd; }

.btn-primary {
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand-dark);
  --bs-btn-hover-border-color: var(--brand-dark);
}

.btn-outline-primary {
  --bs-btn-color: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand);
  --bs-btn-hover-border-color: var(--brand);
}

.result-box {
  background: #0f1720;
  color: #d6e2ee;
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
  max-height: 300px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.font-monospace { font-family: "SFMono-Regular", Menlo, Consolas, monospace; }

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 15% 20%, rgba(228, 121, 17, .18), transparent 35%),
    radial-gradient(circle at 85% 80%, rgba(20, 80, 140, .16), transparent 40%),
    #0e1620;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.login-brand h1 {
  font-size: 20px;
  margin: 0;
  font-weight: 700;
}

.login-brand p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.login-tip {
  margin-top: 16px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 900px) {
  .sidebar {
    position: static;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 10px 12px;
  }
  .brand { border: 0; margin: 0; padding: 0 10px 0 0; }
  .sidebar .nav { flex-direction: row !important; gap: 4px; }
  .sidebar .nav-link { padding: 7px 10px; font-size: 12px; }
  .sidebar-foot { display: none; }
  .main { margin-left: 0; }
  .app-shell { flex-direction: column; }
  .content { padding: 16px 12px 32px; }
}
