:root {
  --bg: #f4f8fc;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --sidebar: #0f2745;
  --sidebar-soft: #173a64;
  --primary: #1677ff;
  --primary-soft: #e8f2ff;
  --accent: #33b4f4;
  --success: #31a86e;
  --warning: #f6a623;
  --danger: #e85757;
  --text: #1f2f45;
  --muted: #6b7c93;
  --line: #dbe5ef;
  --shadow: 0 14px 32px rgba(19, 56, 99, 0.08);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(51, 180, 244, 0.08), transparent 26%),
    linear-gradient(180deg, #f7fbff 0%, #f4f8fc 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.admin-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-soft) 100%);
  color: rgba(255, 255, 255, 0.92);
  padding: 24px 18px;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.admin-brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #2c8fff, #50c4ff);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(26, 115, 232, 0.28);
}

.admin-brand strong {
  display: block;
  font-size: 16px;
}

.admin-brand span {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  margin-top: 4px;
}

.nav-section {
  margin-top: 18px;
}

.nav-section-label {
  padding: 0 12px 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.78);
  transition: 0.2s ease;
}

.nav-list a:hover,
.nav-list a.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 12px;
  text-align: center;
}

.sidebar-foot {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 22px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-foot strong {
  display: block;
  margin-bottom: 8px;
}

.admin-main {
  min-width: 0;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 28px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(219, 229, 239, 0.9);
}

.topbar-left,
.topbar-right,
.topbar-actions,
.filter-row,
.chips,
.page-actions,
.status-row,
.toolbar,
.stat-grid,
.panel-grid,
.two-col,
.kpi-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-field {
  min-width: 320px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 4px 18px rgba(20, 115, 230, 0.04);
}

.search-field input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
}

.top-chip {
  padding: 10px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.top-chip.primary {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: rgba(22, 119, 255, 0.12);
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1677ff, #55c1ff);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.page {
  padding: 28px;
}

.page-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.page-header h1 {
  margin: 10px 0 8px;
  font-size: 30px;
}

.page-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.crumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  font-weight: 600;
}

.btn-primary {
  background: linear-gradient(135deg, #0f62d9, #1f86ff);
  color: #fff;
  box-shadow: 0 10px 24px rgba(22, 119, 255, 0.18);
}

.btn-secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}

.card,
.panel,
.table-card,
.side-card,
.timeline-card,
.chart-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
}

.stat-card {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.stat-card strong {
  display: block;
  margin-bottom: 12px;
  color: var(--primary);
  font-size: 28px;
}

.stat-card span {
  display: block;
  font-weight: 700;
  margin-bottom: 10px;
}

.stat-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 13px;
}

.panel-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 18px;
  margin-top: 18px;
}

.panel,
.table-card,
.side-card,
.timeline-card,
.chart-card {
  padding: 22px;
}

.panel h3,
.table-card h3,
.side-card h3,
.timeline-card h3,
.chart-card h3 {
  margin: 0 0 14px;
  font-size: 20px;
}

.panel p,
.table-card p,
.side-card p,
.timeline-card p,
.chart-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.chart-placeholder {
  margin-top: 18px;
  height: 240px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(22, 119, 255, 0.12), rgba(51, 180, 244, 0.04)),
    linear-gradient(90deg, rgba(22, 119, 255, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(22, 119, 255, 0.06) 1px, transparent 1px);
  background-size: auto, 72px 100%, 100% 48px;
  position: relative;
  overflow: hidden;
}

.chart-line {
  position: absolute;
  inset: 0;
}

.chart-line svg {
  width: 100%;
  height: 100%;
}

.legend {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}

.legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.split-main {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 18px;
  margin-top: 18px;
}

.table-card {
  overflow: hidden;
}

.toolbar {
  justify-content: space-between;
  margin-bottom: 16px;
}

.filter-row {
  margin: 14px 0 18px;
}

.filter {
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  min-width: 160px;
}

.chips .chip {
  padding: 9px 12px;
  border-radius: 999px;
  background: #f3f7fb;
  color: var(--muted);
  font-size: 13px;
}

.chips .chip.active {
  background: var(--primary-soft);
  color: var(--primary);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 14px;
}

th {
  color: var(--primary);
  background: #f7fbff;
  font-weight: 700;
}

tr:last-child td {
  border-bottom: 0;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status.success {
  background: rgba(49, 168, 110, 0.12);
  color: var(--success);
}

.status.success::before {
  background: var(--success);
}

.status.primary {
  background: rgba(22, 119, 255, 0.12);
  color: var(--primary);
}

.status.primary::before {
  background: var(--primary);
}

.status.warning {
  background: rgba(246, 166, 35, 0.14);
  color: var(--warning);
}

.status.warning::before {
  background: var(--warning);
}

.status.danger {
  background: rgba(232, 87, 87, 0.12);
  color: var(--danger);
}

.status.danger::before {
  background: var(--danger);
}

.mini-list {
  display: grid;
  gap: 14px;
}

.mini-item {
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.mini-item strong {
  display: block;
  margin-bottom: 8px;
}

.mini-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 13px;
}

.mini-meta {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.protocol-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 18px;
  margin-top: 18px;
}

.category-card {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.category-card h3 {
  margin: 0 0 14px;
  font-size: 18px;
}

.category-menu {
  display: grid;
  gap: 8px;
}

.category-menu a {
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--muted);
}

.category-menu a.active,
.category-menu a:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.summary-box {
  padding: 18px;
  border-radius: 18px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.summary-box strong {
  display: block;
  margin-bottom: 10px;
}

.summary-box p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.footer-note {
  margin-top: 24px;
  color: var(--muted);
  font-size: 13px;
}

.detail-shell {
  display: grid;
  gap: 18px;
}

.detail-hero {
  padding: 22px 24px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.detail-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.detail-hero h2 {
  margin: 14px 0 8px;
  font-size: 28px;
}

.detail-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.tab-bar,
.sub-tab-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tab-bar {
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.tab-item,
.sub-tab-item {
  padding: 12px 16px;
  border-radius: 14px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  font-weight: 600;
}

.tab-item.active,
.sub-tab-item.active {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: rgba(22, 119, 255, 0.14);
}

.sub-tab-bar {
  margin-top: 6px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 18px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.kv-card {
  padding: 18px;
  border-radius: 18px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.kv-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.kv-card strong {
  display: block;
  font-size: 18px;
}

.section-stack {
  display: grid;
  gap: 18px;
}

.helper-text {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.menu-toggle {
  display: none;
}

@media (max-width: 1280px) {
  .stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .panel-grid,
  .split-main,
  .protocol-layout,
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .admin-shell,
  .app-console-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar,
  .app-console-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 260px;
    transform: translateX(-100%);
    transition: 0.2s ease;
    z-index: 30;
  }

  .admin-sidebar.open,
  .app-console-sidebar.open {
    transform: translateX(0);
  }

  .sidebar-foot {
    position: static;
    margin-top: 18px;
  }

  .menu-toggle {
    display: inline-flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
  }

  .search-field {
    min-width: 0;
    width: 100%;
  }

  .admin-topbar,
  .page {
    padding: 18px;
  }
}



.app-console-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.app-console-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  background: linear-gradient(180deg, #102742 0%, #19385e 100%);
  color: rgba(255, 255, 255, 0.92);
}

.app-console-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.app-console-brand strong {
  display: block;
  font-size: 16px;
}

.app-console-brand span {
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
  margin-top: 4px;
}

.app-context-card {
  padding: 18px;
  margin-bottom: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.app-context-card .context-label {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

.app-context-card strong {
  display: block;
  font-size: 18px;
  margin-bottom: 10px;
}

.app-context-card p {
  margin: 6px 0 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
}

.app-menu-group {
  margin-top: 18px;
}

.app-menu-label {
  padding: 0 12px 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.app-menu-list {
  display: grid;
  gap: 8px;
}

.app-menu-list a {
  display: block;
  padding: 12px 14px;
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.78);
  transition: 0.2s ease;
}

.app-menu-list a:hover,
.app-menu-list a.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.app-console-foot {
  background: rgba(255, 255, 255, 0.08);
}

.app-switcher {
  min-width: 220px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

@media (max-width: 760px) {
  .page-header,
  .toolbar,
  .topbar-left,
  .topbar-right {
    flex-direction: column;
    align-items: start;
  }

  .stat-grid,
  .summary-grid,
  .info-grid {
    grid-template-columns: 1fr;
  }
}
