* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}
body {
  background: #f6f7f9;
  color: #2d3748;
  line-height: 1.5;
}
a {
  text-decoration: none;
  color: inherit;
}
img {
  max-width: 100%;
}

/* 布局 */
.app {
  display: flex;
  min-height: 100vh;
}
/* 侧边栏变窄！*/
.sidebar {
  width: 200px;
  background: #fff;
  border-right: 1px solid #e2e8f0;
  padding: 20px 0;
  position: fixed;
  height: 100vh;
}
.main {
  flex: 1;
  margin-left: 200px;
  padding: 24px 32px;
}

/* 侧边栏 */
.sidebar-head {
  font-size: 16px;
  font-weight: 600;
  padding: 0 16px 16px;
  margin-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
}
.sidebar-menu {
  list-style: none;
}
.sidebar-menu li {
  margin-bottom: 4px;
}
.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  color: #555;
  border-radius: 8px;
  margin: 0 8px;
  font-size: 14px;
}
.sidebar-menu a.active {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 500;
}
.sidebar-menu a:hover {
  background: #f4f5f7;
}

/* 头部 */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.page-title {
  font-size: 20px;
  font-weight: 600;
}
.header-user {
  font-size: 14px;
  color: #718096;
}

/* 卡片 */
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  overflow: hidden;
}
.card-body {
  padding: 20px;
}

/* 网格 */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 16px;
}
@media (max-width:1200px) { .grid { grid-template-columns: repeat(3,1fr) } }
@media (max-width:768px) { .grid { grid-template-columns: repeat(2,1fr) } }
@media (max-width:576px) { .grid { grid-template-columns: 1fr } }

/* 统计 */
.stat-card { padding: 20px; }
.stat-label { font-size:13px; color:#718096; margin-bottom:6px; }
.stat-value { font-size:24px; font-weight:600; color:#2d3748; }

/* 表单 */
.form-group { margin-bottom:14px; }
.form-group label {
  display: block;
  font-size:14px;
  font-weight:500;
  margin-bottom:6px;
}
.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size:14px;
}
.form-control:focus {
  outline: none;
  border-color: #3b82f6;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 8px;
  font-size:13px;
  font-weight:500;
  cursor: pointer;
  border: none;
}
.btn-primary { background:#3b82f6; color:#fff; }
.btn-primary:hover { background:#2563eb; }
.btn-default { background:#f3f4f6; color:#374151; }
.btn-default:hover { background:#e5e7eb; }
.btn-success { background:#10b981; color:#fff; }
.btn-success:hover { background:#059669; }
.btn-danger { background:#ef4444; color:#fff; }
.btn-danger:hover { background:#dc2626; }

/* 活码卡片 —— 二维码不裁切！*/
.code-card { }
.code-img {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1/1 !important;
  object-fit: contain !important;
  border-radius: 8px !important;
  margin: 10px 0 12px !important;
}
.code-title {
  font-size:15px;
  font-weight:600;
  margin-bottom:8px;
}
.code-info {
  font-size:13px;
  color:#6b7280;
  margin-bottom:4px;
}
.code-btns {
  display: flex;
  gap: 6px;
  margin-top:12px;
  flex-wrap: wrap;
}
.code-btns .btn {
  flex: 1;
  min-width: 65px;
  padding: 7px 8px;
  font-size:12px;
}

/* 表格 */
.table {
  width:100%;
  border-collapse: collapse;
  background:#fff;
  border-radius:10px;
  overflow:hidden;
}
.table th,.table td {
  padding:12px 14px;
  text-align:left;
  border-bottom:1px solid #f0f0f0;
  font-size:14px;
}
.table th {
  background:#f9fafb;
  font-weight:600;
}

/* 开关 */
.switch { position:relative; display:inline-block; width:40px; height:22px; }
.switch input { opacity:0; width:0; height:0; }
.slider {
  position:absolute; top:0; left:0; right:0; bottom:0;
  background:#ccc; border-radius:22px; transition:.2s;
}
.slider:before {
  position:absolute; content:"";
  height:16px; width:16px; left:3px; bottom:3px;
  background:white; border-radius:50%; transition:.2s;
}
input:checked + .slider { background:#3b82f6; }
input:checked + .slider:before { transform:translateX(18px); }

/* 只修复：子码卡片 垂直靠上，不居中，水平保持不变 */
.code-card .card-body {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;   /* 水平居中 ← 保留 */
  justify-content: flex-start !important; /* 垂直靠上 ← 核心修改 */
  text-align: center !important;    /* 文字水平居中 ← 保留 */
  padding-top: 20px !important;
}

.code-img {
  margin-top: 0 !important;       /* 二维码贴顶部 */
  margin-bottom: 12px !important;
}