:root {
  --bg: #f1f2f5;
  --surface: #ffffff;
  --surface-2: #eef2f6;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --text: #202124;
  --muted: #6b7280;
  --primary: #e02e24;
  --primary-strong: #c81e1a;
  --success: #52c41a;
  --warning: #b45309;
  --danger: #e02e24;
  --purple: #6d28d9;
  --shadow: 0 8px 28px rgba(30, 35, 45, 0.08);
  --radius: 4px;
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    "Noto Sans CJK SC",
    Arial,
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  transition: grid-template-columns 0.2s ease;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: grid;
  align-items: center;
}

.brand-mark {
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-logo {
  background: transparent;
  color: transparent;
  object-fit: cover;
  padding: 0;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  line-height: 1.3;
}

.sidebar-toggle {
  display: grid;
  align-items: center;
  text-align: left;
}

.nav-item {
  width: 100%;
  display: grid;
  align-items: center;
  border: 0;
  text-align: left;
}

.nav-icon {
  display: grid;
  place-items: center;
}

.icon-svg,
.inline-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  display: block;
}

.workspace {
  min-width: 0;
}

.topbar {
  height: 78px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.subpage-layout .topbar {
  height: 58px;
  padding: 0 18px;
}

.breadcrumb {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
  display: none;
}

.subpage-layout .breadcrumb {
  display: block;
  color: #4b5563;
  font-size: 14px;
  font-weight: 600;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: 24px;
  margin-bottom: 0;
}

.subpage-layout h1 {
  display: none;
}

h2 {
  font-size: 18px;
  margin-bottom: 0;
}

h3 {
  font-size: 16px;
  margin-bottom: 12px;
}

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

.bell-button,
.topbar-icon-button {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: #606266;
  display: grid;
  place-items: center;
  border-radius: 4px;
}

.bell-button:hover,
.topbar-icon-button:hover {
  background: #f5f5f5;
  color: var(--primary);
}

.topbar-icon-button {
  cursor: pointer;
}

.topbar-icon-button svg {
  width: 18px;
  height: 18px;
}

.logout-button:hover {
  background: #fff5f4;
  color: var(--primary);
}

.role-switcher {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
}

.role-switcher select {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.user-chip {
  min-width: 170px;
  max-width: 220px;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: center;
  overflow: hidden;
}

.avatar-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  overflow: hidden;
  flex: 0 0 auto;
}

.avatar-dot img,
.table-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-dot.has-image,
.table-avatar.has-image {
  background: #fff5f4;
}

.table-user-cell {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.table-avatar {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex: 0 0 auto;
}

.user-chip strong,
.user-chip span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip strong {
  font-size: 14px;
}

.user-chip span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.page-content {
  padding: 28px 28px 56px;
}

.subpage-layout .page-content {
  padding: 14px 16px 56px;
}

.toolbar,
.filter-grid,
.section-header,
.split-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toolbar {
  margin-bottom: 16px;
  flex-wrap: wrap;
}

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

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 22px;
  margin-bottom: 22px;
}

.metric-card {
  min-height: 136px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 24px 28px;
}

.metric-card span {
  color: var(--muted);
  font-size: 18px;
}

.metric-card strong {
  display: block;
  margin-top: 18px;
  font-size: 40px;
  line-height: 1;
}

.metric-card small {
  display: none;
  margin-top: 8px;
  color: var(--muted);
}

.metric-card.metric-muted strong {
  color: #8c8c8c;
}

.metric-card.metric-success strong {
  color: #52c41a;
}

.metric-card.metric-network strong {
  color: #1677ff;
}

.metric-card.metric-danger strong {
  color: var(--primary);
}

.metric-card.metric-warning strong,
.metric-card.metric-review strong {
  color: #fa8c16;
}

.metric-card.metric-review {
  background: #fffbe6;
  border-color: #ffc53d;
}
