/* ===== 管理后台样式 ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Microsoft YaHei", sans-serif;
  background: #f4f5f7; color: #222;
}
a { color: inherit; text-decoration: none; }

/* 登录 */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #111 0%, #333 100%);
}
.login-box {
  background: #fff; padding: 40px 36px; width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-box h2 { text-align: center; margin-bottom: 30px; font-size: 22px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: #666; margin-bottom: 6px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 10px 12px; border: 1px solid #ddd; font-size: 14px;
  font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: #d4a757; }
.btn {
  display: inline-block; padding: 10px 22px; font-size: 14px; cursor: pointer;
  border: 1px solid transparent; border-radius: 2px;
}
.btn-primary { background: #111; color: #fff; border-color: #111; width: 100%; }
.btn-primary:hover { background: #333; }
.btn-danger { background: #c62828; color: #fff; border-color: #c62828; }
.btn-danger:hover { background: #a31515; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-link { background: none; color: #1976d2; border: none; padding: 4px 8px; font-size: 13px; cursor: pointer; }
.btn-link.danger { color: #c62828; }

/* 后台布局 */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 220px; background: #1a1a1a; color: #ccc; flex-shrink: 0;
  padding: 20px 0;
}
.admin-sidebar .brand {
  color: #fff; font-size: 18px; font-weight: 700; padding: 0 20px 20px;
  border-bottom: 1px solid #333; margin-bottom: 20px;
}
.admin-sidebar a {
  display: block; padding: 12px 20px; font-size: 14px; color: #bbb;
  border-left: 3px solid transparent;
}
.admin-sidebar a:hover { background: #222; color: #fff; }
.admin-sidebar a.active {
  background: #222; color: #fff; border-left-color: #d4a757;
}
.admin-main { flex: 1; display: flex; flex-direction: column; }
.admin-top {
  background: #fff; padding: 14px 24px;
  display: flex; justify-content: space-between; align-items: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.admin-top .admin-user { font-size: 14px; color: #555; }
.admin-content { padding: 24px; flex: 1; }
.admin-content h1 { font-size: 22px; margin-bottom: 20px; }

/* 卡片容器 */
.card { background: #fff; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }

/* 统计卡 */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; padding: 24px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.stat-card .num { font-size: 32px; font-weight: 700; color: #111; }
.stat-card .label { font-size: 13px; color: #888; margin-top: 4px; }

/* 表格 */
table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 12px 10px; text-align: left; border-bottom: 1px solid #eee; font-size: 14px; }
table th { background: #fafafa; font-weight: 600; color: #555; font-size: 13px; }
table tr:hover td { background: #fafafa; }
.thumb-img { width: 50px; height: 40px; object-fit: cover; background: #eee; }
.ellipsis-cell {
  max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 模态框 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 999;
  display: none; align-items: center; justify-content: center;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff; padding: 24px; width: 640px; max-width: 92vw; max-height: 90vh; overflow: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.modal h3 { margin-bottom: 20px; font-size: 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* 空状态 */
.empty { text-align: center; padding: 60px 20px; color: #aaa; }

/* 文本域 */
textarea { min-height: 100px; resize: vertical; }

/* Toobar */
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.toolbar .flex1 { flex: 1; }

/* Toast */
.toast {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
  background: #111; color: #fff; padding: 10px 20px; border-radius: 2px;
  font-size: 14px; z-index: 9999; opacity: 0; transition: opacity .3s; pointer-events: none;
}
.toast.show { opacity: 1; }
.toast.success { background: #2e7d32; }
.toast.error { background: #c62828; }
