/* ============================================
   运营后台公共样式
   ============================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: #333;
  background: #f5f6fa;
}

a { text-decoration: none; color: inherit; }

/* ===== 布局 ===== */
.admin-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  background: #1f2d3d;
  color: #c0ccda;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.sidebar .brand {
  padding: 20px 20px 16px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar .brand small { display: block; font-size: 12px; font-weight: 400; color: #8492a6; margin-top: 4px; }
.sidebar nav { flex: 1; padding: 12px 0; }
.sidebar nav a {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: #c0ccda;
  transition: background 0.15s;
}
.sidebar nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.sidebar nav a.active { background: #3d7eff; color: #fff; }
.sidebar nav a .ico { margin-right: 10px; font-size: 15px; }
.sidebar .side-foot { padding: 14px 20px; border-top: 1px solid rgba(255,255,255,0.08); font-size: 12px; color: #8492a6; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px;
  background: #fff;
  border-bottom: 1px solid #e6e8eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}
.topbar .page-title { font-size: 16px; font-weight: 600; }
.topbar .admin-info { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #666; }
.topbar .admin-info form { display: inline; }

.content { padding: 24px; }

/* ===== 卡片 / 统计 ===== */
.card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  padding: 20px;
  margin-bottom: 20px;
}
.card h3 { font-size: 15px; font-weight: 600; margin-bottom: 16px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card {
  background: #fff;
  border-radius: 8px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.stat-card .num { font-size: 26px; font-weight: 700; color: #1f2d3d; }
.stat-card .label { font-size: 12px; color: #8492a6; margin-top: 4px; }

/* ===== 表格 ===== */
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #eef0f2; font-size: 13px; vertical-align: middle; }
th { background: #fafbfc; color: #666; font-weight: 600; white-space: nowrap; }
tr:hover td { background: #fafbfe; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 13px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: opacity 0.15s;
  background: #e8eaee;
  color: #333;
}
.btn:hover { opacity: 0.88; }
.btn-primary { background: #3d7eff; color: #fff; }
.btn-danger { background: #f56c6c; color: #fff; }
.btn-success { background: #67c23a; color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 4px; }
.btn-ghost { background: transparent; border-color: #d5d9de; }

/* ===== 表单 ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: #666; margin-bottom: 6px; }
.form-group .hint { font-size: 12px; color: #99a2ad; margin-top: 4px; }
.input, .select, .textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d5d9de;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: #3d7eff; }
.textarea { min-height: 140px; line-height: 1.6; resize: vertical; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 200px; }
.form-inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ===== 提示消息 ===== */
.alert { padding: 10px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; }
.alert-success { background: #f0f9eb; color: #67c23a; border: 1px solid #e1f3d8; }
.alert-error { background: #fef0f0; color: #f56c6c; border: 1px solid #fde2e2; }
.alert .close { float: right; cursor: pointer; color: inherit; }

/* ===== 徽标 / 标签 ===== */
.tag { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px; }
.tag-gray { background: #f0f2f5; color: #666; }
.tag-green { background: #f0f9eb; color: #67c23a; }
.tag-blue { background: #ecf5ff; color: #3d7eff; }
.tag-gold { background: #fdf6ec; color: #e6a23c; }
.tag-red { background: #fef0f0; color: #f56c6c; }

/* ===== 分页 ===== */
.pagination { display: flex; gap: 6px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: 5px 12px;
  border-radius: 4px;
  border: 1px solid #d5d9de;
  font-size: 13px;
  color: #333;
  background: #fff;
}
.pagination .active { background: #3d7eff; color: #fff; border-color: #3d7eff; }

/* ===== 空态 ===== */
.empty { text-align: center; padding: 48px 0; color: #99a2ad; }

/* ===== 登录页 ===== */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1f2d3d, #3d7eff); }
.login-box { width: 360px; background: #fff; border-radius: 10px; padding: 36px 32px; box-shadow: 0 8px 30px rgba(0,0,0,0.15); }
.login-box h1 { font-size: 20px; margin-bottom: 6px; }
.login-box .sub { font-size: 13px; color: #8492a6; margin-bottom: 24px; }

/* 简单趋势条 */
.bars { display: flex; align-items: flex-end; gap: 12px; height: 140px; padding-top: 10px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bar .col { width: 100%; background: #3d7eff; border-radius: 4px 4px 0 0; min-height: 2px; opacity: 0.85; }
.bar .val { font-size: 12px; color: #666; }
.bar .day { font-size: 11px; color: #99a2ad; }
