/* 微信群机器人管理面板 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #f0f2f5; color: #333; font-size: 14px;
}

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1d3a8f 0%, #2f6bff 60%, #4f8dff 100%);
}
.login-box {
  width: 360px; background: #fff; border-radius: 12px; padding: 40px 36px;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.login-box h1 { font-size: 20px; text-align: center; margin-bottom: 6px; color: #1d3a8f; }
.login-box .sub { text-align: center; color: #8a93a6; font-size: 12px; margin-bottom: 26px; }
.login-box input {
  width: 100%; height: 42px; border: 1px solid #dcdfe6; border-radius: 8px;
  padding: 0 12px; margin-bottom: 14px; font-size: 14px; outline: none;
}
.login-box input:focus { border-color: #2f6bff; }
.login-box button {
  width: 100%; height: 42px; border: none; border-radius: 8px; cursor: pointer;
  background: #2f6bff; color: #fff; font-size: 15px;
}
.login-box button:hover { background: #2456d6; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 210px; background: #16233f; color: #b8c2d9; flex-shrink: 0;
  display: flex; flex-direction: column;
}
.sidebar .logo {
  padding: 20px 18px; font-size: 16px; font-weight: 600; color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar .logo small { display: block; font-size: 11px; color: #7f8db0; font-weight: 400; margin-top: 4px; }
.sidebar nav { flex: 1; padding: 10px 0; }
.sidebar nav a {
  display: block; padding: 11px 20px; color: #b8c2d9; text-decoration: none;
  border-left: 3px solid transparent; cursor: pointer;
}
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav a.active { background: rgba(47,107,255,.18); border-left-color: #2f6bff; color: #fff; }
.sidebar .user-box {
  padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px;
}
.sidebar .user-box .name { color: #fff; margin-bottom: 8px; }
.sidebar .user-box a { color: #8fa4ff; cursor: pointer; margin-right: 12px; text-decoration: none; }

.main { flex: 1; padding: 22px 26px; overflow-x: auto; }
.page-title { font-size: 18px; font-weight: 600; margin-bottom: 16px; }

/* ---------- 卡片/统计 ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.card {
  background: #fff; border-radius: 10px; padding: 18px 20px;
  box-shadow: 0 1px 4px rgba(20,30,60,.06);
}
.card .label { color: #8a93a6; font-size: 13px; margin-bottom: 8px; }
.card .value { font-size: 26px; font-weight: 700; color: #1d3a8f; }
.card .value.green { color: #18a058; }
.card .value.orange { color: #e6a23c; }

.panel {
  background: #fff; border-radius: 10px; padding: 18px 20px; margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(20,30,60,.06);
}
.panel h3 { font-size: 15px; margin-bottom: 12px; }

/* ---------- 工具条/表格 ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.toolbar input, .toolbar select {
  height: 34px; border: 1px solid #dcdfe6; border-radius: 6px; padding: 0 10px;
  font-size: 13px; outline: none; background: #fff;
}
.toolbar input:focus, .toolbar select:focus { border-color: #2f6bff; }
.btn {
  height: 34px; padding: 0 14px; border: none; border-radius: 6px; cursor: pointer;
  background: #2f6bff; color: #fff; font-size: 13px;
}
.btn:hover { background: #2456d6; }
.btn.plain { background: #fff; color: #333; border: 1px solid #dcdfe6; }
.btn.plain:hover { border-color: #2f6bff; color: #2f6bff; }
.btn.danger { background: #e64545; }
.btn.danger:hover { background: #c93636; }
.btn.small { height: 28px; padding: 0 10px; font-size: 12px; }

table.grid { width: 100%; border-collapse: collapse; background: #fff; }
table.grid th, table.grid td {
  padding: 10px 12px; border-bottom: 1px solid #eef0f4; text-align: left;
  font-size: 13px; white-space: nowrap;
}
table.grid th { background: #f7f8fa; color: #5a6478; font-weight: 600; }
table.grid tr:hover td { background: #fafbfd; }
table.grid td.wrap { white-space: normal; max-width: 420px; word-break: break-all; }

.tag { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; }
.tag.green { background: #e8f7ee; color: #18a058; }
.tag.gray { background: #f0f1f4; color: #8a93a6; }
.tag.red { background: #fdecec; color: #e64545; }
.tag.blue { background: #e9f0ff; color: #2f6bff; }
.tag.orange { background: #fdf3e3; color: #e6a23c; }

/* ---------- 分页 ---------- */
.pager { display: flex; gap: 8px; align-items: center; margin-top: 14px; justify-content: flex-end; }
.pager .info { color: #8a93a6; font-size: 12px; margin-right: 8px; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.modal {
  background: #fff; border-radius: 10px; width: 520px; max-width: 94vw;
  max-height: 88vh; overflow: auto; padding: 22px 24px;
}
.modal h3 { margin-bottom: 16px; font-size: 16px; }
.modal .field { margin-bottom: 12px; }
.modal .field label { display: block; margin-bottom: 5px; color: #5a6478; font-size: 13px; }
.modal .field input, .modal .field select, .modal .field textarea {
  width: 100%; border: 1px solid #dcdfe6; border-radius: 6px; padding: 8px 10px;
  font-size: 13px; outline: none; font-family: inherit;
}
.modal .field textarea { min-height: 90px; resize: vertical; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---------- 其他 ---------- */
.empty { padding: 40px 0; text-align: center; color: #a0a8b8; }
#toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-70px);
  background: #303133; color: #fff; padding: 10px 22px; border-radius: 6px;
  font-size: 13px; opacity: 0; transition: all .25s; z-index: 999; pointer-events: none;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.error { background: #e64545; }
.chart-bars { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 10px; }
.chart-bars .bar-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.chart-bars .bar {
  width: 70%; background: linear-gradient(180deg, #4f8dff, #2f6bff); border-radius: 4px 4px 0 0;
  min-height: 2px;
}
.chart-bars .bar-label { font-size: 11px; color: #8a93a6; }
.chart-bars .bar-value { font-size: 11px; color: #2f6bff; }
