:root {
  --side: #1f2430;
  --side-2: #2a3140;
  --accent: #e11d2e;
  --accent-dark: #c01020;
  --bg: #f0f2f5;
  --card: #fff;
  --text: #303133;
  --muted: #909399;
  --line: #ebeef5;
  --green: #43a06b;
  --blue: #3a8ee6;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }

.layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background: var(--side);
  color: #cfd3dc;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 16px;
  background: var(--accent);
  color: #fff;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255,255,255,.2);
  display: grid;
  place-items: center;
  font-weight: 700;
}

.brand strong { display: block; font-size: 15px; }
.brand small { opacity: .85; font-size: 12px; }

.menu { padding: 12px 0 24px; }

.menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  color: #c8ced8;
  border-left: 3px solid transparent;
}

.menu-item:hover { background: rgba(255,255,255,.04); color: #fff; }
.menu-item.active {
  background: rgba(225, 29, 46, .15);
  color: #fff;
  border-left-color: var(--accent);
}

.menu-group-title {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: #8b93a7;
  padding: 14px 18px 8px;
  cursor: pointer;
  font-size: 12px;
  letter-spacing: 1px;
}

.menu-sub { display: none; }
.menu-group.open .menu-sub { display: block; }
.menu-sub .menu-item { padding-left: 34px; font-size: 13px; }

.ico {
  width: 18px;
  text-align: center;
  opacity: .9;
}

/* Main */
.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 56px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.crumb { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.crumb strong { color: var(--text); }
.sep { opacity: .5; }

.top-actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
}

.content { padding: 16px; flex: 1; }

.panel {
  background: var(--card);
  border-radius: 8px;
  padding: 16px 18px 18px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.panel-head h2 {
  font-size: 16px;
  font-weight: 600;
}

.filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filters input,
.filters select {
  height: 34px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  padding: 0 10px;
  background: #fff;
}

.filters input[type="text"] { width: 160px; }

.btn-primary {
  height: 34px;
  padding: 0 16px;
  border: none;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.btn-primary:hover { background: var(--accent-dark); }

.btn-ghost, .btn-page {
  height: 30px;
  min-width: 30px;
  padding: 0 10px;
  border: 1px solid #dcdfe6;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
}

.btn-page.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Stats */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.stat-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #fafbfd);
}

.stat-card p { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.stat-card h3 { font-size: 26px; line-height: 1.1; margin-bottom: 6px; }
.stat-card small { color: var(--muted); font-size: 12px; }
.stat-card em { font-style: normal; color: #606266; }
.stat-card em.up { color: #67c23a; }
.stat-card em.down { color: #f56c6c; }

.stat-ico {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  flex-shrink: 0;
}

.c1 { background: #e11d2e; }
.c2 { background: #3a8ee6; }
.c3 { background: #e6a23c; }
.c4 { background: #67c23a; }
.c5 { background: #909399; }
.c6 { background: #8e44ad; }
.c7 { background: #16a085; }
.c8 { background: #2980b9; }

/* Table */
.table-wrap { overflow: auto; position: relative; min-height: 220px; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  background: #fafafa;
  color: #606266;
  font-weight: 600;
}

.data-table tbody tr:hover { background: #fafcff; }

.thumb {
  width: 48px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: #f5f5f5;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
}

.tag-ok { background: #f0f9eb; color: #67c23a; }
.tag-wait { background: #fdf6ec; color: #e6a23c; }
.tag-reject { background: #fef0f0; color: #f56c6c; }
.tag-off { background: #f4f4f5; color: #909399; }

.link-btn {
  color: var(--blue);
  margin-right: 8px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.link-btn.danger { color: var(--accent); }

.empty {
  text-align: center;
  padding: 48px 0;
  color: var(--muted);
}

.empty-art { font-size: 42px; margin-bottom: 8px; }

.pager {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
}

.pager-btns { display: flex; gap: 6px; }

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.mini-stats div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.mini-stats span { display: block; color: var(--muted); margin-bottom: 8px; }
.mini-stats strong { font-size: 22px; }

.muted { color: var(--muted); line-height: 1.7; }

.admin-foot {
  text-align: center;
  color: #a0a4ad;
  font-size: 12px;
  padding: 8px 16px 18px;
}

.admin-foot a { color: #8b9298; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%) translateY(12px);
  background: rgba(30, 34, 40, .92);
  color: #fff;
  padding: 10px 18px;
  border-radius: 4px;
  opacity: 0;
  transition: .25s;
  z-index: 99;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: -230px;
    z-index: 20;
    transition: left .2s;
  }
  .sidebar.open { left: 0; }
  .stat-grid { grid-template-columns: 1fr; }
  .mini-stats { grid-template-columns: 1fr; }
}
