:root {
  --side: #001529;
  --side-hover: #000c17;
  --primary: #1890ff;
  --primary-hover: #40a9ff;
  --success: #52c41a;
  --info: #13c2c2;
  --danger: #ff4d4f;
  --bg: #f0f2f5;
  --card: #ffffff;
  --text: #1f1f1f;
  --muted: #8c8c8c;
  --border: #f0f0f0;
  --line: #e8e8e8;
  --radius: 6px;
  --side-w: 220px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

/* —— 登录 —— */
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #001529 0%, #003a8c 55%, #1890ff 100%);
}
.login-card {
  width: 400px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border-radius: 8px;
  padding: 40px 36px 32px;
  box-shadow: 0 12px 40px rgba(0,0,0,.18);
}
.login-brand {
  font-size: 26px;
  font-weight: 700;
  text-align: center;
  letter-spacing: .12em;
}
.login-sub {
  text-align: center;
  color: var(--muted);
  margin: 8px 0 28px;
}
.btn-block { width: 100%; margin-top: 8px; }

/* —— 布局 —— */
.admin-body { min-height: 100vh; }
.side {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--side-w);
  background: var(--side);
  color: rgba(255,255,255,.75);
  z-index: 40;
  display: flex;
  flex-direction: column;
  transition: width .2s;
  overflow: hidden;
}
.brand {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-mark {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--primary);
  display: grid; place-items: center;
  font-weight: 700;
  flex-shrink: 0;
}
.brand-text { font-size: 15px; font-weight: 600; line-height: 1.2; white-space: nowrap; }
.brand-text small { display: block; font-size: 11px; font-weight: 400; opacity: .55; }

.menu { padding: 12px 8px; overflow-y: auto; flex: 1; }
.menu-group {
  padding: 12px 12px 6px;
  font-size: 12px;
  color: rgba(255,255,255,.35);
  letter-spacing: .08em;
}
.menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,.75);
  padding: 10px 12px;
  border-radius: 4px;
  margin-bottom: 2px;
  white-space: nowrap;
}
.menu a:hover { color: #fff; background: rgba(255,255,255,.08); }
.menu a.on { color: #fff; background: var(--primary); }
.menu .ico {
  width: 22px; height: 22px;
  border-radius: 4px;
  background: rgba(255,255,255,.08);
  display: grid; place-items: center;
  font-size: 12px;
  font-style: normal;
  flex-shrink: 0;
}

.shell {
  margin-left: var(--side-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left .2s;
}
.side-fold { --side-w: 64px; }
.side-fold .brand-text,
.side-fold .menu-group,
.side-fold .menu a span { display: none; }
.side-fold .menu a { justify-content: center; padding: 12px 0; }
.side-fold .brand { justify-content: center; padding: 0; }

.topbar {
  height: 50px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 30;
}
.crumb { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--primary); }
.crumb .sep { opacity: .45; }
.crumb strong { color: var(--text); font-weight: 600; }
.fold {
  border: 0;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  color: var(--text);
}
.top-right { display: flex; align-items: center; gap: 16px; }
.who { color: var(--text); }
.link-out { color: var(--muted); }
.link-out:hover { color: var(--danger); }

.tabs {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
  display: flex;
  gap: 4px;
}
.tab {
  display: inline-block;
  padding: 10px 14px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab.on { color: var(--primary); border-bottom-color: var(--primary); }

.main { padding: 16px; flex: 1; }

/* —— 面板 / 卡片 —— */
.panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
  margin-bottom: 16px;
  overflow: hidden;
}
.panel-hd {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.panel-bd { padding: 16px; }
.lead { color: var(--text); line-height: 1.7; margin: 0; }
.muted { color: var(--muted); line-height: 1.7; margin: 0; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 1200px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .side { transform: translateX(-100%); }
  .shell { margin-left: 0; }
  body:not(.side-fold) .side { transform: none; }
}
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 18px 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.stat-n { font-size: 28px; font-weight: 700; color: var(--primary); line-height: 1.1; }
.stat-l { margin-top: 6px; color: var(--muted); font-size: 13px; }

/* —— 按钮 —— */
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { color: var(--primary); border-color: var(--primary); }
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-info {
  background: #e6fffb;
  border-color: #87e8de;
  color: #13c2c2;
}
.btn-info:hover { background: #13c2c2; border-color: #13c2c2; color: #fff; }

/* —— 筛选 / 表单 —— */
.filter {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-end;
}
.filter label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 200px;
}
.filter label span,
.form-label {
  color: var(--muted);
  font-size: 13px;
}
.filter input,
.form input,
.form textarea,
.login-card input {
  height: 32px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  padding: 4px 11px;
  font: inherit;
  background: #fff;
  width: 100%;
}
.form textarea { height: auto; padding: 8px 11px; }
.filter input:focus,
.form input:focus,
.form textarea:focus,
.login-card input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(24,144,255,.15);
}
.filter-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.form-item { display: block; margin-bottom: 16px; }
.form-item .form-label { display: block; margin-bottom: 6px; }
.form-actions { display: flex; gap: 8px; margin-top: 8px; }

/* —— 表格 —— */
.table-wrap { padding-top: 0; overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th,
.data-table td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}
.data-table th {
  background: #fafafa;
  color: rgba(0,0,0,.85);
  font-weight: 600;
  white-space: nowrap;
}
.data-table tbody tr:hover { background: #fafafa; }
.col-ops { width: 140px; }
.ops a { margin-right: 10px; }
.ops a.danger { color: var(--danger); }
.empty { text-align: center; color: var(--muted); padding: 32px 12px !important; }
.thumb {
  width: 36px; height: 36px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: #fafafa;
  display: block;
}
.pager { margin-top: 16px; color: var(--muted); }
.pager a, .pager span { margin-right: 8px; }

/* —— 提示 —— */
.alert {
  padding: 10px 14px;
  border-radius: 4px;
  margin-bottom: 16px;
}
.alert.ok {
  background: #f6ffed;
  border: 1px solid #b7eb8f;
  color: #389e0d;
}
.alert.err {
  background: #fff2f0;
  border: 1px solid #ffccc7;
  color: var(--danger);
}
