:root {
  --primary: #1f6feb;
  --primary-hover: #1a5fd0;
  --primary-light: #e8f1ff;
  --primary-dark: #0b3a8c;
  --bg: #f4f7fc;
  --card: #ffffff;
  --border: #dde5f0;
  --text: #1c2b45;
  --text-sub: #6b7a93;
  --danger: #e5484d;
  --success: #12a150;
  --radius: 8px;
  --shadow: 0 2px 10px rgba(31, 111, 235, 0.08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 14px; color: var(--text); background: var(--bg);
}
a { color: var(--primary); text-decoration: none; }
.hidden { display: none !important; }

/* ---------- 按钮 / 表单 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  height: 34px; padding: 0 16px; border: 1px solid var(--border); border-radius: 6px;
  background: #fff; color: var(--text); cursor: pointer; font-size: 14px; transition: all .15s;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); color: var(--danger); background: #fff5f5; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.input, select.input, textarea.input {
  width: 100%; height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; color: var(--text); background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: 80px; padding: 8px 12px; resize: vertical; font-family: inherit; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.form-item { margin-bottom: 16px; }
.form-item label { display: block; margin-bottom: 6px; color: var(--text-sub); }

/* ---------- 登录页 ---------- */
.login-page {
  min-height: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #e8f1ff 0%, #f8fbff 50%, #dbe9ff 100%);
}
.login-card {
  width: 360px; padding: 40px 32px; background: #fff; border-radius: 12px;
  box-shadow: 0 10px 40px rgba(31, 111, 235, 0.15);
}
.login-logo {
  width: 48px; height: 48px; margin: 0 auto 16px; border-radius: 12px; background: var(--primary);
  color: #fff; font-size: 22px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.login-card h1 { font-size: 20px; text-align: center; margin-bottom: 6px; }
.login-card .sub { text-align: center; color: var(--text-sub); margin-bottom: 28px; }
.login-card .btn { width: 100%; height: 40px; }
.login-error { min-height: 20px; color: var(--danger); font-size: 13px; margin: -8px 0 12px; }

/* ---------- 布局 ---------- */
.layout { display: flex; height: 100%; }
.sidebar { width: 220px; flex-shrink: 0; background: var(--primary-dark); color: #cfe0ff; display: flex; flex-direction: column; }
.sidebar .brand { height: 56px; display: flex; align-items: center; padding: 0 20px; font-size: 17px; font-weight: 600; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .brand .dot { width: 26px; height: 26px; border-radius: 7px; background: var(--primary); margin-right: 10px; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.menu { list-style: none; padding: 12px 0; flex: 1; }
.menu li a { display: flex; align-items: center; height: 44px; padding: 0 20px; color: #cfe0ff; border-left: 3px solid transparent; transition: all .15s; }
.menu li a:hover { background: rgba(255,255,255,.06); color: #fff; }
.menu li a.active { background: var(--primary); color: #fff; border-left-color: #8fbcff; }
/* 菜单分组标题；空的就是一条分隔线 */
.menu li.menu-group { padding: 14px 20px 6px; font-size: 12px; color: rgba(207,224,255,.55); letter-spacing: .05em; border-top: 1px solid rgba(255,255,255,.08); margin-top: 6px; }
.menu li.menu-group:empty { padding: 0; margin: 6px 0 0; }
.menu li.menu-group + li a { padding-left: 32px; }
.menu li.menu-group:empty + li a { padding-left: 20px; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.header { height: 56px; flex-shrink: 0; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; }
.header .title { font-size: 16px; font-weight: 600; }
.content { flex: 1; overflow: auto; padding: 20px 24px; }

/* ---------- 卡片 / 表格 ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .input { width: 220px; }
.toolbar .spacer { flex: 1; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 16px; }
.stat { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; border-top: 3px solid var(--primary); }
.stat .label { color: var(--text-sub); margin-bottom: 8px; }
.stat .value { font-size: 24px; font-weight: 600; color: var(--primary-dark); }
table.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }
.table tbody tr:hover { background: #f7faff; }
.table .empty { text-align: center; color: var(--text-sub); padding: 40px 0; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.tag-on { background: #e6f7ee; color: var(--success); }
.tag-off { background: #f1f3f6; color: var(--text-sub); }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 16px; color: var(--text-sub); }

/* ---------- 弹窗 / 提示 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(12, 30, 66, .45); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { width: 460px; max-width: 92vw; background: #fff; border-radius: 10px; box-shadow: 0 16px 48px rgba(0,0,0,.18); }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 15px; }
.modal-body { padding: 20px; max-height: 75vh; overflow: auto; }
.modal-wide { width: 760px; }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.toast-wrap { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 10px 18px; border-radius: 6px; background: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.12); border-left: 4px solid var(--primary); animation: fadeIn .2s; }
.toast.error { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--success); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- 账户 / 刷量 ---------- */
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; }
.muted { color: var(--text-sub); }
.copyable { cursor: pointer; border-bottom: 1px dashed var(--border); }
.copyable:hover { color: var(--primary); border-bottom-color: var(--primary); }
.notice { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; line-height: 1.7; background: #fff7e6; border: 1px solid #ffd591; color: #874d00; }
.notice.info { background: var(--primary-light); border-color: #b6d4ff; color: var(--primary-dark); }
.tag-yes { background: #e6f7ee; color: var(--success); }
.tag-no { background: #fdecec; color: var(--danger); }
.tag-run { background: var(--primary-light); color: var(--primary); }
.tag-warn { background: #fff7e6; color: #d48806; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.hint { margin-top: 4px; font-size: 12px; color: var(--text-sub); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.seg button { height: 34px; padding: 0 22px; border: 0; background: #fff; cursor: pointer; font-size: 14px; color: var(--text); }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on-yes { background: var(--success); color: #fff; }
.seg button.on-no { background: var(--danger); color: #fff; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 4px 0 16px; }
.kv > div { background: #f7faff; border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; }
.kv .k { font-size: 12px; color: var(--text-sub); margin-bottom: 4px; }
.kv .v { font-weight: 600; }
.card h3 { font-size: 15px; margin-bottom: 14px; }
.table td.num, .table th.num { text-align: right; }
.err-text { color: var(--danger); font-size: 12px; word-break: break-all; }
.table .err-text { max-width: 280px; }
.secret { padding: 10px 12px; background: #fff5f5; border: 1px solid #ffc9c9; border-radius: 6px; word-break: break-all; }
.tag, .copyable, .table td.ops, .table td.num { white-space: nowrap; }
.table-scroll { overflow-x: auto; }
.table-scroll .table th { white-space: nowrap; }
